Merge ~raharper/curtin:feature/vmtest-add-centos-from-bionic into curtin:master

Proposed by Ryan Harper
Status: Merged
Approved by: Dan Watkins
Approved revision: 2720f6bcc62c9ee718061cde1f6a0de1dfd6f682
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~raharper/curtin:feature/vmtest-add-centos-from-bionic
Merge into: curtin:master
Diff against target: 252 lines (+160/-3)
4 files modified
examples/tests/centos6_basic.yaml (+101/-0)
tests/vmtests/releases.py (+14/-0)
tests/vmtests/test_basic.py (+29/-1)
tests/vmtests/test_simple.py (+16/-2)
Reviewer Review Type Date Requested Status
Dan Watkins (community) Approve
Server Team CI bot continuous-integration Approve
Review via email: mp+368358@code.launchpad.net

Commit message

vmtest: add Centos66/Centos70 FromBionic release and re-add tests

Newer MAAS will use Bionic to deploy Centos and curtin until now
did not test this path. Critically, Centos66 has issues with ext4
features that are enabled by default in Bionic and newer, namely
'64bit' and 'metadata_csum'. These features break centos66 grub
probing which results in failed deployment, LP: #1775424.

Add additional Centos66/70 tests to verify installing from Bionic
is successful. For Centos66, we test the known workaround which is
to use 'ext3' as the root filesystem, and we introduce a test-case
which recreates the failure (test_simple.py:Centos66BionicTestSimple)
but leave it disabled by default.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Dan Watkins (oddbloke) wrote :

One very minor inline comment, and you've also got "additiona" in your commit message. I'd be happy to merge as-is, but I'll leave it to you to Approve in case you do want to address those.

review: Approve
Revision history for this message
Ryan Harper (raharper) wrote :

Thanks.

2720f6b... by Ryan Harper

clarify btrfs-debug-tree comment

Revision history for this message
Dan Watkins (oddbloke) wrote :

Oh right, forgot I could edit the commit message on Launchpad MPs. >.< Thanks!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/examples/tests/centos6_basic.yaml b/examples/tests/centos6_basic.yaml
2new file mode 100644
3index 0000000..90fc584
4--- /dev/null
5+++ b/examples/tests/centos6_basic.yaml
6@@ -0,0 +1,101 @@
7+showtrace: true
8+storage:
9+ version: 1
10+ config:
11+ - id: sda
12+ type: disk
13+ ptable: msdos
14+ model: QEMU HARDDISK
15+ serial: disk-a
16+ name: main_disk_with_in/\&valid@#dname
17+ wipe: superblock
18+ grub_device: true
19+ - id: sda1
20+ type: partition
21+ number: 1
22+ size: 3GB
23+ device: sda
24+ flag: boot
25+ - id: sda2
26+ type: partition
27+ number: 2
28+ size: 1GB
29+ device: sda
30+ - id: sda3
31+ type: partition
32+ number: 3
33+ size: 1GB
34+ device: sda
35+ name: swap
36+ - id: sda1_root
37+ type: format
38+ fstype: ext3
39+ volume: sda1
40+ label: 'cloudimg-rootfs'
41+ - id: sda2_home
42+ type: format
43+ fstype: ext4
44+ volume: sda2
45+ - id: sda3_swap
46+ type: format
47+ fstype: swap
48+ volume: sda3
49+ - id: sda1_mount
50+ type: mount
51+ path: /
52+ device: sda1_root
53+ - id: sda2_mount
54+ type: mount
55+ path: /home
56+ device: sda2_home
57+ - id: sparedisk_id
58+ type: disk
59+ serial: disk-b
60+ name: sparedisk
61+ wipe: superblock
62+ - id: sparedisk_fat_fmt_id
63+ type: format
64+ fstype: fat32
65+ volume: sparedisk_id
66+ - id: btrfs_disk_id
67+ type: disk
68+ serial: disk-c
69+ name: btrfs_volume
70+ wipe: superblock
71+ - id: btrfs_disk_fmt_id
72+ type: format
73+ fstype: btrfs
74+ volume: btrfs_disk_id
75+ - id: btrfs_disk_mnt_id
76+ type: mount
77+ path: /btrfs
78+ options: 'defaults,noatime'
79+ device: btrfs_disk_fmt_id
80+ - id: pnum_disk
81+ type: disk
82+ serial: disk-d
83+ name: pnum_disk
84+ wipe: superblock
85+ ptable: gpt
86+ - id: pnum_disk_p1
87+ type: partition
88+ number: 1
89+ size: 1GB
90+ device: pnum_disk
91+ - id: pnum_disk_p2
92+ type: partition
93+ number: 2
94+ size: 8MB
95+ device: pnum_disk
96+ flag: prep
97+ wipe: zero
98+ name: prep
99+ - id: pnum_disk_p3
100+ type: partition
101+ number: 10
102+ size: 1GB
103+ device: pnum_disk
104+ - id: swap_mnt
105+ type: mount
106+ path: "none"
107+ device: sda3_swap
108diff --git a/tests/vmtests/releases.py b/tests/vmtests/releases.py
109index 1a92412..68deae1 100644
110--- a/tests/vmtests/releases.py
111+++ b/tests/vmtests/releases.py
112@@ -36,6 +36,13 @@ class _Centos70FromXenialBase(_CentosFromUbuntuBase):
113 target_release = "centos70"
114
115
116+class _Centos70FromBionicBase(_CentosFromUbuntuBase):
117+ # release for boot
118+ release = "bionic"
119+ # release for target
120+ target_release = "centos70"
121+
122+
123 class _UbuntuCore16FromXenialBase(_UbuntuCoreUbuntuBase):
124 # release for boot
125 release = "xenial"
126@@ -49,6 +56,11 @@ class _Centos66FromXenialBase(_CentosFromUbuntuBase):
127 target_release = "centos66"
128
129
130+class _Centos66FromBionicBase(_CentosFromUbuntuBase):
131+ release = "bionic"
132+ target_release = "centos66"
133+
134+
135 class _PreciseBase(_UbuntuBase):
136 release = "xenial"
137 target_release = "precise"
138@@ -149,6 +161,8 @@ class _Releases(object):
139 class _CentosReleases(object):
140 centos70_xenial = _Centos70FromXenialBase
141 centos66_xenial = _Centos66FromXenialBase
142+ centos70_bionic = _Centos70FromBionicBase
143+ centos66_bionic = _Centos66FromBionicBase
144
145
146 class _UbuntuCoreReleases(object):
147diff --git a/tests/vmtests/test_basic.py b/tests/vmtests/test_basic.py
148index 92971b3..d65a8c1 100644
149--- a/tests/vmtests/test_basic.py
150+++ b/tests/vmtests/test_basic.py
151@@ -37,6 +37,10 @@ class TestBasicAbs(VMBaseClass):
152 f="btrfs_uuid_diskc"
153 if command -v btrfs-debug-tree >/dev/null; then
154 btrfs-debug-tree -r $dev | awk '/^uuid/ {print $2}' | grep "-"
155+ # btrfs-debug-tree fails in centos66, use btrfs-show instead
156+ if [ "$?" != "0" ]; then
157+ btrfs-show $dev | awk '/uuid/ {print $4}'
158+ fi
159 else
160 btrfs inspect-internal dump-super $dev |
161 awk '/^dev_item.fsid/ {print $2}'
162@@ -46,7 +50,8 @@ class TestBasicAbs(VMBaseClass):
163 diskd=$(readlink -f /dev/disk/by-id/*-disk-d)
164 cmp --bytes=8388608 /dev/zero ${diskd}2; echo "$?" > cmp_prep.out
165 # extract partition info
166- udevadm info --export --query=property ${diskd}2 | cat >udev_info.out
167+ udevadm info --export --query=property --name=${diskd}2 |
168+ cat >udev_info.out
169
170 exit 0
171 """)]
172@@ -81,6 +86,9 @@ class TestBasicAbs(VMBaseClass):
173 return kname
174
175 def _test_ptable(self, blkid_output, expected):
176+ if self.target_release == "centos66":
177+ raise SkipTest("No PTTYPE blkid output on Centos66")
178+
179 if not blkid_output:
180 raise RuntimeError('_test_ptable requires blkid output file')
181
182@@ -138,6 +146,8 @@ class TestBasicAbs(VMBaseClass):
183 self.assertEqual(kname_uuid, btrfs_uuid)
184
185 def _test_partition_is_prep(self, info_file):
186+ if self.target_release == "centos66":
187+ raise SkipTest("Cannot detect PReP partitions in Centos66")
188 udev_info = self.load_collect_file(info_file).rstrip()
189 entry_type = ''
190 for line in udev_info.splitlines():
191@@ -234,6 +244,24 @@ class Centos70XenialTestBasic(centos_relbase.centos70_xenial,
192 __test__ = True
193
194
195+class Centos70BionicTestBasic(centos_relbase.centos70_bionic,
196+ CentosTestBasicAbs):
197+ __test__ = True
198+
199+
200+class Centos66XenialTestBasic(centos_relbase.centos66_xenial,
201+ CentosTestBasicAbs):
202+ __test__ = True
203+
204+
205+class Centos66BionicTestBasic(centos_relbase.centos66_bionic,
206+ CentosTestBasicAbs):
207+ # Centos66 cannot handle ext4 defaults in Bionic (64bit,meta_csum)
208+ # this conf defaults to ext3
209+ conf_file = "examples/tests/centos6_basic.yaml"
210+ __test__ = True
211+
212+
213 class XenialGAi386TestBasic(relbase.xenial_ga, TestBasicAbs):
214 __test__ = True
215 arch = 'i386'
216diff --git a/tests/vmtests/test_simple.py b/tests/vmtests/test_simple.py
217index bfac4e9..9c31b65 100644
218--- a/tests/vmtests/test_simple.py
219+++ b/tests/vmtests/test_simple.py
220@@ -1,6 +1,6 @@
221 # This file is part of curtin. See LICENSE file for copyright and license info.
222
223-from . import VMBaseClass
224+from . import VMBaseClass, SkipTest
225 from .releases import base_vm_classes as relbase
226 from .releases import centos_base_vm_classes as centos_relbase
227
228@@ -21,10 +21,24 @@ class TestSimple(VMBaseClass):
229 """)]
230
231
232-class Centos70TestSimple(centos_relbase.centos70_xenial, TestSimple):
233+class Centos70XenialTestSimple(centos_relbase.centos70_xenial, TestSimple):
234 __test__ = True
235
236
237+class Centos70BionicTestSimple(centos_relbase.centos70_bionic, TestSimple):
238+ __test__ = True
239+
240+
241+class Centos66XenialTestSimple(centos_relbase.centos66_xenial, TestSimple):
242+ __test__ = True
243+
244+
245+class Centos66BionicTestSimple(centos_relbase.centos66_bionic, TestSimple):
246+ __test__ = False
247+ # LP: #1775424
248+ raise SkipTest('Centos66 fails with Bionic Ephemeral ext4 features')
249+
250+
251 class XenialTestSimple(relbase.xenial, TestSimple):
252 __test__ = True
253

Subscribers

People subscribed via source and target branches