Merge ~smoser/curtin:fix/common-script-exits-non-zero into curtin:master

Proposed by Scott Moser
Status: Merged
Approved by: Ryan Harper
Approved revision: de195166c8d32e2f69d99bc9b06a920e2f2597e5
Merge reported by: Server Team CI bot
Merged at revision: not available
Proposed branch: ~smoser/curtin:fix/common-script-exits-non-zero
Merge into: curtin:master
Diff against target: 540 lines (+113/-30)
29 files modified
tests/vmtests/__init__.py (+8/-2)
tests/vmtests/test_apt_config_cmd.py (+2/-0)
tests/vmtests/test_apt_source.py (+2/-0)
tests/vmtests/test_basic.py (+4/-0)
tests/vmtests/test_bcache_basic.py (+2/-0)
tests/vmtests/test_fs_battery.py (+2/-0)
tests/vmtests/test_iscsi.py (+2/-0)
tests/vmtests/test_lvm.py (+2/-0)
tests/vmtests/test_lvm_iscsi.py (+9/-7)
tests/vmtests/test_lvm_raid.py (+12/-8)
tests/vmtests/test_lvm_root.py (+2/-0)
tests/vmtests/test_mdadm_bcache.py (+8/-0)
tests/vmtests/test_mdadm_iscsi.py (+9/-6)
tests/vmtests/test_multipath.py (+2/-0)
tests/vmtests/test_network.py (+2/-0)
tests/vmtests/test_network_alias.py (+2/-0)
tests/vmtests/test_network_bonding.py (+2/-0)
tests/vmtests/test_network_bridging.py (+4/-0)
tests/vmtests/test_network_ipv6.py (+4/-0)
tests/vmtests/test_network_mtu.py (+4/-0)
tests/vmtests/test_network_vlan.py (+2/-0)
tests/vmtests/test_nvme.py (+4/-0)
tests/vmtests/test_old_apt_features.py (+2/-0)
tests/vmtests/test_pollinate_useragent.py (+2/-0)
tests/vmtests/test_raid5_bcache.py (+11/-7)
tests/vmtests/test_simple.py (+2/-0)
tests/vmtests/test_ubuntu_core.py (+2/-0)
tests/vmtests/test_uefi_basic.py (+2/-0)
tests/vmtests/test_zfsroot.py (+2/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Needs Fixing
Review via email: mp+356860@code.launchpad.net

Commit message

vmtests: fix common collect scripts to not exit failure.

If collect scripts exit non-zero, then cloud-init in the booted system
will complain that they have done so. This adds noise to logs.

At this point, the only command in a long list that affects the exit code
is the last one. At some point in the future we may have more systematic
collection. At that point it might make sense to exit if the collection
failed.

For now, just exit 0.

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

I think the code that joins the scripts together needs to put in the exit 0, otherwise when we multi-subclass like in mdadm_iscsi, we'll have an exit 0 in the middle of a script.

review: Needs Fixing
Revision history for this message
Scott Moser (smoser) wrote :

I came across this when trying to validate cloud-init in -proposed.
I'd run something like this:

./tools/jenkins-runner \
   CURTIN_VMTEST_ADD_REPOS=proposed \
   CURTIN_VMTEST_UPGRADE_PACKAGES=cloud-init \
   CURTIN_VMTEST_SYSTEM_UPGRADE="" \
   "--filter=target_release=(xenial|bionic)"

When doing so the booted' cloud-init files would have WARN messages
logging a failure. From cloud-init's perspective that was/is quite valid.

But there was no reason for the error.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

I didn't realize that the collect_scripts array creates a part per entry in the array; so it's OK to exit 0 for each element in the array.

e27e2fc... by Scott Moser

Also remove += in extra_collect_scripts usage.

Revision history for this message
Scott Moser (smoser) wrote :

I've added another commit to the top to fix another issue i saw.

http://paste.ubuntu.com/p/3bSnVyfrkW/

the paste above is more readable, but for inclusion i'll put here also.

$ python ./mytest.py
super1=['FromSuper1', 'FromSuper1', 'fromMysub']
super2=['FromSuper1']
sub=['FromSuper1', 'FromSuper1', 'fromMysub']

$ cat mytest.py
#!/usr/bin/python3
"""This demonstrates a bug in vmtest where subclasses would
unintentionally modify the super class 'extra_collect_scripts'.

We had this in:
  TestLvmOverRaidAbs
  TestLvmIscsiAbs
  TestMdadmIscsiAbs

You can see the issue by running the script. You'll see that
MySuper.scripts actually gets 'fromMysub' in it."""

class MySuper1(object):
    scripts = ['FromSuper1']

class MySuper2(object):
    scripts = ['FromSuper1']

class MySub(MySuper1, MySuper2):
    scripts = MySuper1.scripts
    scripts += MySuper2.scripts
    scripts += ["fromMysub"]

print("super1=%s" % MySuper1.scripts)
print("super2=%s" % MySuper2.scripts)
print("sub=%s" % MySub.scripts)

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Thanks for looking at this. There's one typo inline and otherwise approve with vmtest run.

Revision history for this message
Chad Smith (chad.smith) wrote :

Other than the exiti typo per ryan's review I just had a question about the UnsupportedZfs test that shouldn't block this branch.

de19516... by Scott Moser

Fix typo- thanks rharper.

Revision history for this message
Scott Moser (smoser) wrote :

Addressed Ryan's comment, and agree with Chads.

Lets merge this upon completion of a vmtest from it.

I started one at
 https://jenkins.ubuntu.com/server/job/curtin-vmtest-devel-debug/115/console
with --filter=target_release=bionic

I figured that would just get a quicker result.
I'm fine to do a full run if others think that is needed.

Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ryan Harper (raharper) wrote :

Starting another bionic vmtest run:

https://jenkins.ubuntu.com/server/job/curtin-vmtest-devel-debug/122/console

If passes with mark approved and land.

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

Passed, marking Approved.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py
2index 3e0b412..893afd4 100644
3--- a/tests/vmtests/__init__.py
4+++ b/tests/vmtests/__init__.py
5@@ -517,9 +517,11 @@ DEFAULT_COLLECT_SCRIPTS = {
6 ls -al /dev/disk/by-uuid/ | cat >ls_al_byuuid
7 blkid -o export | cat >blkid.out
8 find /boot | cat > find_boot.out
9- [ -e /sys/firmware/efi ] && {
10+ if [ -e /sys/firmware/efi ]; then
11 efibootmgr -v | cat >efibootmgr.out;
12- }
13+ fi
14+
15+ exit 0
16 """)],
17 'centos': [textwrap.dedent("""
18 # XXX: command | cat >output is required for Centos under SELinux
19@@ -530,6 +532,8 @@ DEFAULT_COLLECT_SCRIPTS = {
20 rpm -q --queryformat '%{VERSION}\n' cloud-init |tee rpm_ci_version
21 rpm -E '%rhel' > rpm_dist_version_major
22 cp -a /etc/centos-release .
23+
24+ exit 0
25 """)],
26 'ubuntu': [textwrap.dedent("""
27 cd OUTPUT_COLLECT_D
28@@ -543,6 +547,8 @@ DEFAULT_COLLECT_SCRIPTS = {
29 out=$(apt-config shell v Acquire::HTTP::Proxy)
30 eval "$out"
31 echo "$v" > apt-proxy
32+
33+ exit 0
34 """)]
35 }
36
37diff --git a/tests/vmtests/test_apt_config_cmd.py b/tests/vmtests/test_apt_config_cmd.py
38index f9b6a09..9f47887 100644
39--- a/tests/vmtests/test_apt_config_cmd.py
40+++ b/tests/vmtests/test_apt_config_cmd.py
41@@ -23,6 +23,8 @@ class TestAptConfigCMD(VMBaseClass):
42 cp /etc/apt/sources.list.d/curtin-dev-ubuntu-test-archive-*.list .
43 cp /etc/cloud/cloud.cfg.d/curtin-preserve-sources.cfg .
44 apt-cache policy | grep proposed > proposed-enabled
45+
46+ exit 0
47 """)]
48
49 def test_cmd_proposed_enabled(self):
50diff --git a/tests/vmtests/test_apt_source.py b/tests/vmtests/test_apt_source.py
51index bb502b2..f48f30a 100644
52--- a/tests/vmtests/test_apt_source.py
53+++ b/tests/vmtests/test_apt_source.py
54@@ -34,6 +34,8 @@ class TestAptSrcAbs(VMBaseClass):
55 apt-config dump | grep Retries > aptconf
56 cp /etc/apt/sources.list sources.list
57 cp /etc/cloud/cloud.cfg.d/curtin-preserve-sources.cfg .
58+
59+ exit 0
60 """)]
61 mirror = "http://us.archive.ubuntu.com/ubuntu"
62 secmirror = "http://security.ubuntu.com/ubuntu"
63diff --git a/tests/vmtests/test_basic.py b/tests/vmtests/test_basic.py
64index 54e3df8..17f8ef7 100644
65--- a/tests/vmtests/test_basic.py
66+++ b/tests/vmtests/test_basic.py
67@@ -32,6 +32,8 @@ class TestBasicAbs(VMBaseClass):
68 btrfs inspect-internal dump-super $dev |
69 awk '/^dev_item.fsid/ {print $2}'
70 fi | cat >$f
71+
72+ exit 0
73 """)]
74
75 def _kname_to_uuid(self, kname):
76@@ -230,6 +232,8 @@ class TestBasicScsiAbs(TestBasicAbs):
77 btrfs inspect-internal dump-super $dev |
78 awk '/^dev_item.fsid/ {print $2}'
79 fi | cat >$f
80+
81+ exit 0
82 """)]
83
84 def test_ptable(self):
85diff --git a/tests/vmtests/test_bcache_basic.py b/tests/vmtests/test_bcache_basic.py
86index b4191b6..332a4db 100644
87--- a/tests/vmtests/test_bcache_basic.py
88+++ b/tests/vmtests/test_bcache_basic.py
89@@ -20,6 +20,8 @@ class TestBcacheBasic(VMBaseClass):
90 bcache-super-show /dev/vda2 > bcache_super_vda2
91 ls /sys/fs/bcache > bcache_ls
92 cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
93+
94+ exit 0
95 """)]
96
97 def test_bcache_output_files_exist(self):
98diff --git a/tests/vmtests/test_fs_battery.py b/tests/vmtests/test_fs_battery.py
99index defdf1a..2df19cb 100644
100--- a/tests/vmtests/test_fs_battery.py
101+++ b/tests/vmtests/test_fs_battery.py
102@@ -100,6 +100,8 @@ class TestFsBattery(VMBaseClass):
103 echo "$part umount: PASS" ||
104 echo "$part umount: FAIL: $out"
105 done >> battery-mount-umount
106+
107+ exit 0
108 """)]
109
110 def get_fs_entries(self):
111diff --git a/tests/vmtests/test_iscsi.py b/tests/vmtests/test_iscsi.py
112index a800df5..ca9b9a7 100644
113--- a/tests/vmtests/test_iscsi.py
114+++ b/tests/vmtests/test_iscsi.py
115@@ -23,6 +23,8 @@ class TestBasicIscsiAbs(VMBaseClass):
116 cp -a /etc/iscsi ./etc_iscsi
117 bash -c \
118 'for f in /mnt/iscsi*; do cp $f/testfile testfile${f: -1}; done'
119+
120+ exit 0
121 """)]
122
123 def test_fstab_has_netdev_option(self):
124diff --git a/tests/vmtests/test_lvm.py b/tests/vmtests/test_lvm.py
125index 37053fe..6d79f5b 100644
126--- a/tests/vmtests/test_lvm.py
127+++ b/tests/vmtests/test_lvm.py
128@@ -17,6 +17,8 @@ class TestLvmAbs(VMBaseClass):
129 cd OUTPUT_COLLECT_D
130 pvdisplay -C --separator = -o vg_name,pv_name --noheadings > pvs
131 lvdisplay -C --separator = -o lv_name,vg_name --noheadings > lvs
132+
133+ exit 0
134 """)]
135 fstab_expected = {
136 '/dev/vg1/lv1': '/srv/data',
137diff --git a/tests/vmtests/test_lvm_iscsi.py b/tests/vmtests/test_lvm_iscsi.py
138index 091461e..1b3fcd0 100644
139--- a/tests/vmtests/test_lvm_iscsi.py
140+++ b/tests/vmtests/test_lvm_iscsi.py
141@@ -17,13 +17,15 @@ class TestLvmIscsiAbs(TestLvmAbs, TestBasicIscsiAbs):
142 conf_file = "examples/tests/lvm_iscsi.yaml"
143 nr_testfiles = 4
144
145- extra_collect_scripts = TestLvmAbs.extra_collect_scripts
146- extra_collect_scripts += TestBasicIscsiAbs.extra_collect_scripts
147- extra_collect_scripts += [textwrap.dedent(
148- """
149- cd OUTPUT_COLLECT_D
150- ls -al /sys/class/block/dm*/slaves/ > dm_slaves
151- """)]
152+ extra_collect_scripts = (
153+ TestLvmAbs.extra_collect_scripts +
154+ TestBasicIscsiAbs.extra_collect_scripts +
155+ [textwrap.dedent("""
156+ cd OUTPUT_COLLECT_D
157+ ls -al /sys/class/block/dm*/slaves/ > dm_slaves
158+
159+ exit 0
160+ """)])
161
162 fstab_expected = {
163 'UUID=6de56115-9500-424b-8151-221b270ec708': '/mnt/iscsi1',
164diff --git a/tests/vmtests/test_lvm_raid.py b/tests/vmtests/test_lvm_raid.py
165index 99a33f2..92c68f4 100644
166--- a/tests/vmtests/test_lvm_raid.py
167+++ b/tests/vmtests/test_lvm_raid.py
168@@ -14,14 +14,18 @@ class TestLvmOverRaidAbs(TestMdadmAbs, TestLvmAbs):
169 dirty_disks = True
170 extra_disks = ['10G'] * 4
171
172- extra_collect_scripts = TestLvmAbs.extra_collect_scripts
173- extra_collect_scripts += TestMdadmAbs.extra_collect_scripts
174- extra_collect_scripts += [textwrap.dedent("""
175- cd OUTPUT_COLLECT_D
176- ls -al /dev/md* > dev_md
177- cp -a /etc/mdadm etc_mdadm
178- cp -a /etc/lvm etc_lvm
179- """)]
180+ extra_collect_scripts = (
181+ TestLvmAbs.extra_collect_scripts +
182+ TestMdadmAbs.extra_collect_scripts +
183+ [textwrap.dedent("""
184+ cd OUTPUT_COLLECT_D
185+ ls -al /dev/md* > dev_md
186+ cp -a /etc/mdadm etc_mdadm
187+ cp -a /etc/lvm etc_lvm
188+
189+ exit 0
190+ """)]
191+ )
192
193 fstab_expected = {
194 '/dev/vg1/lv1': '/srv/data',
195diff --git a/tests/vmtests/test_lvm_root.py b/tests/vmtests/test_lvm_root.py
196index 7e7472d..d726a45 100644
197--- a/tests/vmtests/test_lvm_root.py
198+++ b/tests/vmtests/test_lvm_root.py
199@@ -26,6 +26,8 @@ class TestLvmRootAbs(VMBaseClass):
200 vgdisplay > vgdisplay
201 lvdisplay > lvdisplay
202 ls -al /dev/root_vg/ > dev_root_vg
203+
204+ exit 0
205 """)]
206 fstab_expected = {
207 'UUID=04836770-e989-460f-8774-8e277ddcb40f': '/',
208diff --git a/tests/vmtests/test_mdadm_bcache.py b/tests/vmtests/test_mdadm_bcache.py
209index adfa55b..752e829 100644
210--- a/tests/vmtests/test_mdadm_bcache.py
211+++ b/tests/vmtests/test_mdadm_bcache.py
212@@ -23,6 +23,8 @@ class TestMdadmAbs(VMBaseClass):
213 ls -al /sys/fs/bcache/* > lsal_sys_fs_bcache_star
214 ls -al /dev/bcache* > lsal_dev_bcache_star
215 ls -al /dev/bcache/by_uuid/* > lsal_dev_bcache_byuuid_star
216+
217+ exit 0
218 """)]
219
220 def test_mdadm_output_files_exist(self):
221@@ -63,6 +65,8 @@ class TestMdadmBcacheAbs(TestMdadmAbs):
222 cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
223 cat /sys/block/bcache1/bcache/cache_mode >> bcache_cache_mode
224 cat /sys/block/bcache2/bcache/cache_mode >> bcache_cache_mode
225+
226+ exit 0
227 """)]
228 fstab_expected = {
229 '/dev/vda1': '/media/sda1',
230@@ -357,6 +361,8 @@ class TestRaid6bootAbs(TestMdadmAbs):
231 TestMdadmAbs.extra_collect_scripts + [textwrap.dedent("""
232 cd OUTPUT_COLLECT_D
233 mdadm --detail --scan > mdadm_detail
234+
235+ exit 0
236 """)])
237
238 def test_raid6_output_files_exist(self):
239@@ -493,6 +499,8 @@ class TestAllindataAbs(TestMdadmAbs):
240 mkdir -p /tmp/xfstest
241 mount /dev/mapper/dmcrypt0 /tmp/xfstest
242 xfs_info /tmp/xfstest/ > xfs_info
243+
244+ exit 0
245 """)])
246 fstab_expected = {
247 '/dev/vg1/lv1': '/srv/data',
248diff --git a/tests/vmtests/test_mdadm_iscsi.py b/tests/vmtests/test_mdadm_iscsi.py
249index 537baec..7ba8725 100644
250--- a/tests/vmtests/test_mdadm_iscsi.py
251+++ b/tests/vmtests/test_mdadm_iscsi.py
252@@ -18,12 +18,15 @@ class TestMdadmIscsiAbs(TestMdadmAbs, TestBasicIscsiAbs):
253 conf_file = "examples/tests/mdadm_iscsi.yaml"
254 nr_testfiles = 1
255
256- extra_collect_scripts = TestMdadmAbs.extra_collect_scripts
257- extra_collect_scripts += TestBasicIscsiAbs.extra_collect_scripts
258- extra_collect_scripts += [textwrap.dedent("""
259- cd OUTPUT_COLLECT_D
260- ls -al /sys/class/block/md*/slaves/ > md_slaves
261- """)]
262+ extra_collect_scripts = (
263+ TestMdadmAbs.extra_collect_scripts +
264+ TestBasicIscsiAbs.extra_collect_scripts +
265+ [textwrap.dedent("""
266+ cd OUTPUT_COLLECT_D
267+ ls -al /sys/class/block/md*/slaves/ > md_slaves
268+
269+ exit 0
270+ """)])
271
272
273 class Centos70TestIscsiMdadm(centos_relbase.centos70_xenial,
274diff --git a/tests/vmtests/test_multipath.py b/tests/vmtests/test_multipath.py
275index a6bd8ce..f8f0e51 100644
276--- a/tests/vmtests/test_multipath.py
277+++ b/tests/vmtests/test_multipath.py
278@@ -22,6 +22,8 @@ class TestMultipathBasicAbs(VMBaseClass):
279 cp -a /etc/multipath* .
280 readlink -f /sys/class/block/sda/holders/dm-0 > holders_sda
281 readlink -f /sys/class/block/sdb/holders/dm-0 > holders_sdb
282+
283+ exit 0
284 """)]
285
286 def test_multipath_disks_match(self):
287diff --git a/tests/vmtests/test_network.py b/tests/vmtests/test_network.py
288index ce4cdb9..07f1eee 100644
289--- a/tests/vmtests/test_network.py
290+++ b/tests/vmtests/test_network.py
291@@ -49,6 +49,8 @@ class TestNetworkBaseTestsAbs(VMBaseClass):
292 cp -a /etc/systemd ./etc_systemd ||:
293 journalctl --no-pager -b -x | tee journalctl_out
294 sleep 10 && ip a | tee ip_a
295+
296+ exit 0
297 """)]
298
299 def test_output_files_exist(self):
300diff --git a/tests/vmtests/test_network_alias.py b/tests/vmtests/test_network_alias.py
301index 1d1837f..5f70e3c 100644
302--- a/tests/vmtests/test_network_alias.py
303+++ b/tests/vmtests/test_network_alias.py
304@@ -26,6 +26,8 @@ class CentosTestNetworkAliasAbs(TestNetworkAliasAbs):
305 cp -a /var/log/cloud-init* .
306 cp -a /var/lib/cloud ./var_lib_cloud
307 cp -a /run/cloud-init ./run_cloud-init
308+
309+ exit 0
310 """)]
311
312 def test_etc_resolvconf(self):
313diff --git a/tests/vmtests/test_network_bonding.py b/tests/vmtests/test_network_bonding.py
314index 572f240..883945c 100644
315--- a/tests/vmtests/test_network_bonding.py
316+++ b/tests/vmtests/test_network_bonding.py
317@@ -33,6 +33,8 @@ class CentosTestNetworkBondingAbs(TestNetworkBondingAbs):
318 cp -a /var/lib/cloud ./var_lib_cloud
319 cp -a /run/cloud-init ./run_cloud-init
320 rpm -qf `which ifenslave` |tee ifenslave_installed
321+
322+ exit 0
323 """)]
324
325 def test_ifenslave_package_status(self):
326diff --git a/tests/vmtests/test_network_bridging.py b/tests/vmtests/test_network_bridging.py
327index ed9b728..29bff31 100644
328--- a/tests/vmtests/test_network_bridging.py
329+++ b/tests/vmtests/test_network_bridging.py
330@@ -102,6 +102,8 @@ class TestBridgeNetworkAbs(TestNetworkBaseTestsAbs):
331 grep -r . /sys/class/net/br0 > sysfs_br0
332 grep -r . /sys/class/net/br0/brif/eth1 > sysfs_br0_eth1
333 grep -r . /sys/class/net/br0/brif/eth2 > sysfs_br0_eth2
334+
335+ exit 0
336 """)]
337
338 def test_output_files_exist_bridge(self):
339@@ -200,6 +202,8 @@ class CentosTestBridgeNetworkAbs(TestBridgeNetworkAbs):
340 cp -a /var/lib/cloud ./var_lib_cloud
341 cp -a /run/cloud-init ./run_cloud-init
342 rpm -qf `which brctl` |tee bridge-utils_installed
343+
344+ exit 0
345 """)]
346
347 def test_etc_network_interfaces(self):
348diff --git a/tests/vmtests/test_network_ipv6.py b/tests/vmtests/test_network_ipv6.py
349index b8a69e8..ee2802d 100644
350--- a/tests/vmtests/test_network_ipv6.py
351+++ b/tests/vmtests/test_network_ipv6.py
352@@ -21,6 +21,8 @@ class TestNetworkIPV6Abs(TestNetworkBaseTestsAbs):
353 grep . -r /sys/class/net/bond0/ > sysfs_bond0 || :
354 grep . -r /sys/class/net/bond0.108/ > sysfs_bond0.108 || :
355 grep . -r /sys/class/net/bond0.208/ > sysfs_bond0.208 || :
356+
357+ exit 0
358 """)]
359
360
361@@ -32,6 +34,8 @@ class CentosTestNetworkIPV6Abs(TestNetworkIPV6Abs):
362 cp -a /var/log/cloud-init* .
363 cp -a /var/lib/cloud ./var_lib_cloud
364 cp -a /run/cloud-init ./run_cloud-init
365+
366+ exit 0
367 """)]
368
369 def test_etc_network_interfaces(self):
370diff --git a/tests/vmtests/test_network_mtu.py b/tests/vmtests/test_network_mtu.py
371index eaa383b..3478e1d 100644
372--- a/tests/vmtests/test_network_mtu.py
373+++ b/tests/vmtests/test_network_mtu.py
374@@ -36,6 +36,8 @@ class TestNetworkMtuAbs(TestNetworkIPV6Abs):
375 if [ -e /var/log/upstart ]; then
376 cp -a /var/log/upstart ./var_log_upstart
377 fi
378+
379+ exit 0
380 """)]
381
382 def _load_mtu_data(self, ifname):
383@@ -128,6 +130,8 @@ class CentosTestNetworkMtuAbs(TestNetworkMtuAbs):
384 cp -a /var/log/cloud-init* .
385 cp -a /var/lib/cloud ./var_lib_cloud
386 cp -a /run/cloud-init ./run_cloud-init
387+
388+ exit 0
389 """)]
390
391 def test_etc_network_interfaces(self):
392diff --git a/tests/vmtests/test_network_vlan.py b/tests/vmtests/test_network_vlan.py
393index 9e55bfa..21dc43f 100644
394--- a/tests/vmtests/test_network_vlan.py
395+++ b/tests/vmtests/test_network_vlan.py
396@@ -18,6 +18,8 @@ class TestNetworkVlanAbs(TestNetworkBaseTestsAbs):
397 ip -d link show interface1.2668 |tee ip_link_show_interface1.2668
398 ip -d link show interface1.2669 |tee ip_link_show_interface1.2669
399 ip -d link show interface1.2670 |tee ip_link_show_interface1.2670
400+
401+ exit 0
402 """)]
403
404 def get_vlans(self):
405diff --git a/tests/vmtests/test_nvme.py b/tests/vmtests/test_nvme.py
406index f3d1ae2..b528eb5 100644
407--- a/tests/vmtests/test_nvme.py
408+++ b/tests/vmtests/test_nvme.py
409@@ -27,6 +27,8 @@ class TestNvmeAbs(VMBaseClass):
410 ls /sys/class/ > sys_class
411 ls /sys/class/nvme/ > ls_nvme
412 ls /dev/nvme* > ls_dev_nvme
413+
414+ exit 0
415 """)]
416
417 def _test_nvme_device_names(self, expected):
418@@ -102,6 +104,8 @@ class TestNvmeBcacheAbs(TestNvmeAbs):
419 bcache-super-show /dev/nvme0n1p1 > bcache_super_nvme0n1p1
420 ls /sys/fs/bcache > bcache_ls
421 cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
422+
423+ exit 0
424 """)]
425
426 def test_bcache_output_files_exist(self):
427diff --git a/tests/vmtests/test_old_apt_features.py b/tests/vmtests/test_old_apt_features.py
428index 33561a3..190de4b 100644
429--- a/tests/vmtests/test_old_apt_features.py
430+++ b/tests/vmtests/test_old_apt_features.py
431@@ -50,6 +50,8 @@ class TestOldAptAbs(VMBaseClass):
432 cp /etc/apt/sources.list .
433 cp /etc/cloud/cloud.cfg.d/curtin-preserve-sources.cfg .
434 cp /etc/cloud/cloud.cfg.d/90_dpkg.cfg .
435+
436+ exit 0
437 """)]
438 arch = util.get_architecture()
439 if arch in ['amd64', 'i386']:
440diff --git a/tests/vmtests/test_pollinate_useragent.py b/tests/vmtests/test_pollinate_useragent.py
441index 13dd28c..a85154f 100644
442--- a/tests/vmtests/test_pollinate_useragent.py
443+++ b/tests/vmtests/test_pollinate_useragent.py
444@@ -18,6 +18,8 @@ class TestPollinateUserAgent(VMBaseClass):
445 cd OUTPUT_COLLECT_D
446 cp -a /etc/pollinate etc_pollinate
447 pollinate --print-user-agent > pollinate_print_user_agent
448+
449+ exit 0
450 """)]
451
452 def test_pollinate_user_agent(self):
453diff --git a/tests/vmtests/test_raid5_bcache.py b/tests/vmtests/test_raid5_bcache.py
454index 8d24f8e..d9282cb 100644
455--- a/tests/vmtests/test_raid5_bcache.py
456+++ b/tests/vmtests/test_raid5_bcache.py
457@@ -16,6 +16,8 @@ class TestMdadmAbs(VMBaseClass):
458 mdadm --detail --scan > mdadm_status
459 mdadm --detail --scan | grep -c ubuntu > mdadm_active1
460 grep -c active /proc/mdstat > mdadm_active2
461+
462+ exit 0
463 """)]
464
465 def test_mdadm_output_files_exist(self):
466@@ -33,13 +35,15 @@ class TestMdadmBcacheAbs(TestMdadmAbs):
467 conf_file = "examples/tests/raid5bcache.yaml"
468 disk_to_check = [('md0', 0), ('sda', 2)]
469
470- extra_collect_scripts = TestMdadmAbs.extra_collect_scripts
471- extra_collect_scripts += [textwrap.dedent("""
472- cd OUTPUT_COLLECT_D
473- bcache-super-show /dev/vda2 > bcache_super_vda2
474- ls /sys/fs/bcache > bcache_ls
475- cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
476- """)]
477+ extra_collect_scripts = (
478+ TestMdadmAbs.extra_collect_scripts +
479+ [textwrap.dedent("""\
480+ cd OUTPUT_COLLECT_D
481+ bcache-super-show /dev/vda2 > bcache_super_vda2
482+ ls /sys/fs/bcache > bcache_ls
483+ cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
484+
485+ exit 0""")])
486 fstab_expected = {
487 '/dev/bcache0': '/',
488 '/dev/md0': '/srv/data',
489diff --git a/tests/vmtests/test_simple.py b/tests/vmtests/test_simple.py
490index 8948f72..36d4748 100644
491--- a/tests/vmtests/test_simple.py
492+++ b/tests/vmtests/test_simple.py
493@@ -15,6 +15,8 @@ class TestSimple(VMBaseClass):
494 extra_collect_scripts = [textwrap.dedent("""
495 cd OUTPUT_COLLECT_D
496 cp /etc/netplan/50-cloud-init.yaml netplan.yaml
497+
498+ exit 0
499 """)]
500
501
502diff --git a/tests/vmtests/test_ubuntu_core.py b/tests/vmtests/test_ubuntu_core.py
503index 732399b..a282940 100644
504--- a/tests/vmtests/test_ubuntu_core.py
505+++ b/tests/vmtests/test_ubuntu_core.py
506@@ -18,6 +18,8 @@ class TestUbuntuCoreAbs(VMBaseClass):
507 cp -a /etc/cloud ./etc_cloud |:
508 cp -a /home . |:
509 cp -a /var/lib/extrausers . |:
510+
511+ exit 0
512 """)]
513
514 def test_ubuntu_core_snaps_installed(self):
515diff --git a/tests/vmtests/test_uefi_basic.py b/tests/vmtests/test_uefi_basic.py
516index 8eb7f7e..88f5d59 100644
517--- a/tests/vmtests/test_uefi_basic.py
518+++ b/tests/vmtests/test_uefi_basic.py
519@@ -24,6 +24,8 @@ class TestBasicAbs(VMBaseClass):
520 blockdev --getss /dev/vda | cat >vda_blockdev_getss
521 blockdev --getpbsz /dev/vda | cat >vda_blockdev_getpbsz
522 blockdev --getbsz /dev/vda | cat >vda_blockdev_getbsz
523+
524+ exit 0
525 """)]
526
527 def test_sys_firmware_efi(self):
528diff --git a/tests/vmtests/test_zfsroot.py b/tests/vmtests/test_zfsroot.py
529index 4e257ae..a0f0601 100644
530--- a/tests/vmtests/test_zfsroot.py
531+++ b/tests/vmtests/test_zfsroot.py
532@@ -17,6 +17,8 @@ class TestZfsRootAbs(VMBaseClass):
533 zfs list > zfs_list
534 zpool list > zpool_list
535 zpool status > zpool_status
536+
537+ exit 0
538 """)]
539
540 @skip_if_flag('expected_failure')

Subscribers

People subscribed via source and target branches