Merge ~chad.smith/curtin:ubuntu/devel into curtin:ubuntu/devel
- Git
- lp:~chad.smith/curtin
- ubuntu/devel
- Merge into ubuntu/devel
Proposed by
Chad Smith
Status: | Merged |
---|---|
Merged at revision: | cfa2da2bd7a47b5bd585d04f824be7e3c22ccd5e |
Proposed branch: | ~chad.smith/curtin:ubuntu/devel |
Merge into: | curtin:ubuntu/devel |
Diff against target: |
2225 lines (+662/-342) 51 files modified
bin/curtin (+1/-1) curtin/__main__.py (+4/-0) curtin/block/__init__.py (+14/-10) curtin/block/clear_holders.py (+24/-2) curtin/block/mkfs.py (+2/-2) curtin/commands/__main__.py (+4/-0) curtin/commands/curthooks.py (+3/-1) curtin/commands/features.py (+20/-0) curtin/commands/main.py (+3/-3) debian/changelog (+25/-0) doc/topics/integration-testing.rst (+4/-0) doc/topics/storage.rst (+79/-3) examples/tests/install_disable_unmount.yaml (+2/-2) examples/tests/mirrorboot-msdos-partition.yaml (+2/-2) examples/tests/mirrorboot-uefi.yaml (+4/-4) examples/tests/vmtest_pollinate.yaml (+10/-0) tests/unittests/test_clear_holders.py (+94/-38) tests/vmtests/__init__.py (+201/-73) tests/vmtests/releases.py (+19/-20) tests/vmtests/test_apt_config_cmd.py (+2/-2) tests/vmtests/test_basic.py (+20/-10) tests/vmtests/test_bcache_basic.py (+2/-2) tests/vmtests/test_bcache_bug1718699.py (+2/-2) tests/vmtests/test_fs_battery.py (+4/-0) tests/vmtests/test_iscsi.py (+2/-2) tests/vmtests/test_journald_reporter.py (+2/-2) tests/vmtests/test_lvm.py (+3/-2) tests/vmtests/test_lvm_iscsi.py (+2/-2) tests/vmtests/test_lvm_root.py (+5/-35) tests/vmtests/test_mdadm_bcache.py (+17/-21) tests/vmtests/test_mdadm_iscsi.py (+2/-2) tests/vmtests/test_multipath.py (+2/-2) tests/vmtests/test_network.py (+2/-2) tests/vmtests/test_network_alias.py (+2/-2) tests/vmtests/test_network_bonding.py (+15/-26) tests/vmtests/test_network_bridging.py (+18/-26) tests/vmtests/test_network_ipv6.py (+2/-2) tests/vmtests/test_network_ipv6_static.py (+2/-2) tests/vmtests/test_network_ipv6_vlan.py (+2/-2) tests/vmtests/test_network_mtu.py (+4/-12) tests/vmtests/test_network_static.py (+2/-2) tests/vmtests/test_network_static_routes.py (+2/-2) tests/vmtests/test_network_vlan.py (+3/-3) tests/vmtests/test_nvme.py (+5/-4) tests/vmtests/test_pollinate_useragent.py (+3/-0) tests/vmtests/test_raid5_bcache.py (+2/-2) tests/vmtests/test_simple.py (+2/-2) tests/vmtests/test_uefi_basic.py (+4/-4) tests/vmtests/test_zfsroot.py (+6/-2) tools/xkvm (+5/-1) tox.ini (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Server Team CI bot | continuous-integration | Approve | |
Scott Moser (community) | Approve | ||
Review via email: mp+352901@code.launchpad.net |
Commit message
Sync new-upstream-
Description of the change
To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:cfa2da2bd7a
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
Click here to trigger a rebuild:
https:/
review:
Approve
(continuous-integration)
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | diff --git a/bin/curtin b/bin/curtin | |||
2 | index 6c4e457..793fbcb 100755 | |||
3 | --- a/bin/curtin | |||
4 | +++ b/bin/curtin | |||
5 | @@ -1,7 +1,7 @@ | |||
6 | 1 | #!/bin/sh | 1 | #!/bin/sh |
7 | 2 | # This file is part of curtin. See LICENSE file for copyright and license info. | 2 | # This file is part of curtin. See LICENSE file for copyright and license info. |
8 | 3 | 3 | ||
10 | 4 | PY3OR2_MAIN="curtin.commands.main" | 4 | PY3OR2_MAIN="curtin" |
11 | 5 | PY3OR2_MCHECK="curtin.deps.check" | 5 | PY3OR2_MCHECK="curtin.deps.check" |
12 | 6 | PY3OR2_PYTHONS=${PY3OR2_PYTHONS:-"python3:python"} | 6 | PY3OR2_PYTHONS=${PY3OR2_PYTHONS:-"python3:python"} |
13 | 7 | PYTHON=${PY3OR2_PYTHON} | 7 | PYTHON=${PY3OR2_PYTHON} |
14 | diff --git a/curtin/__main__.py b/curtin/__main__.py | |||
15 | 8 | new file mode 100644 | 8 | new file mode 100644 |
16 | index 0000000..5b6aeca | |||
17 | --- /dev/null | |||
18 | +++ b/curtin/__main__.py | |||
19 | @@ -0,0 +1,4 @@ | |||
20 | 1 | if __name__ == '__main__': | ||
21 | 2 | from .commands.main import main | ||
22 | 3 | import sys | ||
23 | 4 | sys.exit(main()) | ||
24 | diff --git a/curtin/block/__init__.py b/curtin/block/__init__.py | |||
25 | index a8ee8a6..b49b9d3 100644 | |||
26 | --- a/curtin/block/__init__.py | |||
27 | +++ b/curtin/block/__init__.py | |||
28 | @@ -378,24 +378,28 @@ def stop_all_unused_multipath_devices(): | |||
29 | 378 | LOG.warn("Failed to stop multipath devices: %s", e) | 378 | LOG.warn("Failed to stop multipath devices: %s", e) |
30 | 379 | 379 | ||
31 | 380 | 380 | ||
33 | 381 | def rescan_block_devices(warn_on_fail=True): | 381 | def rescan_block_devices(devices=None, warn_on_fail=True): |
34 | 382 | """ | 382 | """ |
35 | 383 | run 'blockdev --rereadpt' for all block devices not currently mounted | 383 | run 'blockdev --rereadpt' for all block devices not currently mounted |
36 | 384 | """ | 384 | """ |
45 | 385 | unused = get_unused_blockdev_info() | 385 | if not devices: |
46 | 386 | devices = [] | 386 | unused = get_unused_blockdev_info() |
47 | 387 | for devname, data in unused.items(): | 387 | devices = [] |
48 | 388 | if data.get('RM') == "1": | 388 | for devname, data in unused.items(): |
49 | 389 | continue | 389 | if data.get('RM') == "1": |
50 | 390 | if data.get('RO') != "0" or data.get('TYPE') != "disk": | 390 | continue |
51 | 391 | continue | 391 | if data.get('RO') != "0" or data.get('TYPE') != "disk": |
52 | 392 | devices.append(data['device_path']) | 392 | continue |
53 | 393 | devices.append(data['device_path']) | ||
54 | 393 | 394 | ||
55 | 394 | if not devices: | 395 | if not devices: |
56 | 395 | LOG.debug("no devices found to rescan") | 396 | LOG.debug("no devices found to rescan") |
57 | 396 | return | 397 | return |
58 | 397 | 398 | ||
60 | 398 | cmd = ['blockdev', '--rereadpt'] + devices | 399 | # blockdev needs /dev/ parameters, convert if needed |
61 | 400 | cmd = ['blockdev', '--rereadpt'] + [dev if dev.startswith('/dev/') | ||
62 | 401 | else sysfs_to_devpath(dev) | ||
63 | 402 | for dev in devices] | ||
64 | 399 | try: | 403 | try: |
65 | 400 | util.subp(cmd, capture=True) | 404 | util.subp(cmd, capture=True) |
66 | 401 | except util.ProcessExecutionError as e: | 405 | except util.ProcessExecutionError as e: |
67 | diff --git a/curtin/block/clear_holders.py b/curtin/block/clear_holders.py | |||
68 | index 20c572b..9d73b28 100644 | |||
69 | --- a/curtin/block/clear_holders.py | |||
70 | +++ b/curtin/block/clear_holders.py | |||
71 | @@ -300,6 +300,9 @@ def wipe_superblock(device): | |||
72 | 300 | else: | 300 | else: |
73 | 301 | raise e | 301 | raise e |
74 | 302 | 302 | ||
75 | 303 | # gather any partitions | ||
76 | 304 | partitions = block.get_sysfs_partitions(device) | ||
77 | 305 | |||
78 | 303 | # release zfs member by exporting the pool | 306 | # release zfs member by exporting the pool |
79 | 304 | if block.is_zfs_member(blockdev): | 307 | if block.is_zfs_member(blockdev): |
80 | 305 | poolname = zfs.device_to_poolname(blockdev) | 308 | poolname = zfs.device_to_poolname(blockdev) |
81 | @@ -325,6 +328,27 @@ def wipe_superblock(device): | |||
82 | 325 | 328 | ||
83 | 326 | _wipe_superblock(blockdev) | 329 | _wipe_superblock(blockdev) |
84 | 327 | 330 | ||
85 | 331 | # if we had partitions, make sure they've been removed | ||
86 | 332 | if partitions: | ||
87 | 333 | LOG.debug('%s had partitions, issuing partition reread', device) | ||
88 | 334 | retries = [.5, .5, 1, 2, 5, 7] | ||
89 | 335 | for attempt, wait in enumerate(retries): | ||
90 | 336 | try: | ||
91 | 337 | # only rereadpt on wiped device | ||
92 | 338 | block.rescan_block_devices(devices=[blockdev]) | ||
93 | 339 | # may raise IOError, OSError due to wiped partition table | ||
94 | 340 | curparts = block.get_sysfs_partitions(device) | ||
95 | 341 | if len(curparts) == 0: | ||
96 | 342 | return | ||
97 | 343 | except (IOError, OSError): | ||
98 | 344 | if attempt + 1 >= len(retries): | ||
99 | 345 | raise | ||
100 | 346 | |||
101 | 347 | LOG.debug("%s partitions still present, rereading pt" | ||
102 | 348 | " (%s/%s). sleeping %ss before retry", | ||
103 | 349 | device, attempt + 1, len(retries), wait) | ||
104 | 350 | time.sleep(wait) | ||
105 | 351 | |||
106 | 328 | 352 | ||
107 | 329 | def _wipe_superblock(blockdev, exclusive=True): | 353 | def _wipe_superblock(blockdev, exclusive=True): |
108 | 330 | """ No checks, just call wipe_volume """ | 354 | """ No checks, just call wipe_volume """ |
109 | @@ -579,8 +603,6 @@ def clear_holders(base_paths, try_preserve=False): | |||
110 | 579 | dev_info['dev_type']) | 603 | dev_info['dev_type']) |
111 | 580 | continue | 604 | continue |
112 | 581 | 605 | ||
113 | 582 | # scan before we check | ||
114 | 583 | block.rescan_block_devices(warn_on_fail=False) | ||
115 | 584 | if os.path.exists(dev_info['device']): | 606 | if os.path.exists(dev_info['device']): |
116 | 585 | LOG.info("shutdown running on holder type: '%s' syspath: '%s'", | 607 | LOG.info("shutdown running on holder type: '%s' syspath: '%s'", |
117 | 586 | dev_info['dev_type'], dev_info['device']) | 608 | dev_info['dev_type'], dev_info['device']) |
118 | diff --git a/curtin/block/mkfs.py b/curtin/block/mkfs.py | |||
119 | index a199d05..f39017c 100644 | |||
120 | --- a/curtin/block/mkfs.py | |||
121 | +++ b/curtin/block/mkfs.py | |||
122 | @@ -8,7 +8,7 @@ from curtin import block | |||
123 | 8 | 8 | ||
124 | 9 | import string | 9 | import string |
125 | 10 | import os | 10 | import os |
127 | 11 | from uuid import uuid1 | 11 | from uuid import uuid4 |
128 | 12 | 12 | ||
129 | 13 | mkfs_commands = { | 13 | mkfs_commands = { |
130 | 14 | "btrfs": "mkfs.btrfs", | 14 | "btrfs": "mkfs.btrfs", |
131 | @@ -191,7 +191,7 @@ def mkfs(path, fstype, strict=False, label=None, uuid=None, force=False): | |||
132 | 191 | 191 | ||
133 | 192 | # If uuid is not specified, generate one and try to use it | 192 | # If uuid is not specified, generate one and try to use it |
134 | 193 | if uuid is None: | 193 | if uuid is None: |
136 | 194 | uuid = str(uuid1()) | 194 | uuid = str(uuid4()) |
137 | 195 | cmd.extend(get_flag_mapping("uuid", fs_family, param=uuid, strict=strict)) | 195 | cmd.extend(get_flag_mapping("uuid", fs_family, param=uuid, strict=strict)) |
138 | 196 | 196 | ||
139 | 197 | if fs_family == "fat": | 197 | if fs_family == "fat": |
140 | diff --git a/curtin/commands/__main__.py b/curtin/commands/__main__.py | |||
141 | 198 | new file mode 100644 | 198 | new file mode 100644 |
142 | index 0000000..41c6d17 | |||
143 | --- /dev/null | |||
144 | +++ b/curtin/commands/__main__.py | |||
145 | @@ -0,0 +1,4 @@ | |||
146 | 1 | if __name__ == '__main__': | ||
147 | 2 | from .main import main | ||
148 | 3 | import sys | ||
149 | 4 | sys.exit(main()) | ||
150 | diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py | |||
151 | index a514560..f9a5a66 100644 | |||
152 | --- a/curtin/commands/curthooks.py | |||
153 | +++ b/curtin/commands/curthooks.py | |||
154 | @@ -679,7 +679,9 @@ def install_missing_packages(cfg, target): | |||
155 | 679 | needed_packages.add(pkg) | 679 | needed_packages.add(pkg) |
156 | 680 | 680 | ||
157 | 681 | # Filter out ifupdown network packages on netplan enabled systems. | 681 | # Filter out ifupdown network packages on netplan enabled systems. |
159 | 682 | if 'ifupdown' not in installed_packages and 'nplan' in installed_packages: | 682 | has_netplan = ('nplan' in installed_packages or |
160 | 683 | 'netplan.io' in installed_packages) | ||
161 | 684 | if 'ifupdown' not in installed_packages and has_netplan: | ||
162 | 683 | drops = set(['bridge-utils', 'ifenslave', 'vlan']) | 685 | drops = set(['bridge-utils', 'ifenslave', 'vlan']) |
163 | 684 | if needed_packages.union(drops): | 686 | if needed_packages.union(drops): |
164 | 685 | LOG.debug("Skipping install of %s. Not needed on netplan system.", | 687 | LOG.debug("Skipping install of %s. Not needed on netplan system.", |
165 | diff --git a/curtin/commands/features.py b/curtin/commands/features.py | |||
166 | 686 | new file mode 100644 | 688 | new file mode 100644 |
167 | index 0000000..0f6085b | |||
168 | --- /dev/null | |||
169 | +++ b/curtin/commands/features.py | |||
170 | @@ -0,0 +1,20 @@ | |||
171 | 1 | # This file is part of curtin. See LICENSE file for copyright and license info. | ||
172 | 2 | """List the supported feature names to stdout.""" | ||
173 | 3 | |||
174 | 4 | import sys | ||
175 | 5 | from .. import FEATURES | ||
176 | 6 | from . import populate_one_subcmd | ||
177 | 7 | |||
178 | 8 | CMD_ARGUMENTS = ((tuple())) | ||
179 | 9 | |||
180 | 10 | |||
181 | 11 | def features_main(args): | ||
182 | 12 | sys.stdout.write("\n".join(sorted(FEATURES)) + "\n") | ||
183 | 13 | sys.exit(0) | ||
184 | 14 | |||
185 | 15 | |||
186 | 16 | def POPULATE_SUBCMD(parser): | ||
187 | 17 | populate_one_subcmd(parser, CMD_ARGUMENTS, features_main) | ||
188 | 18 | parser.description = __doc__ | ||
189 | 19 | |||
190 | 20 | # vi: ts=4 expandtab syntax=python | ||
191 | diff --git a/curtin/commands/main.py b/curtin/commands/main.py | |||
192 | index 779bb03..bccfc51 100644 | |||
193 | --- a/curtin/commands/main.py | |||
194 | +++ b/curtin/commands/main.py | |||
195 | @@ -16,9 +16,9 @@ VERSIONSTR = version.version_string() | |||
196 | 16 | SUB_COMMAND_MODULES = [ | 16 | SUB_COMMAND_MODULES = [ |
197 | 17 | 'apply_net', 'apt-config', 'block-attach-iscsi', 'block-detach-iscsi', | 17 | 'apply_net', 'apt-config', 'block-attach-iscsi', 'block-detach-iscsi', |
198 | 18 | 'block-info', 'block-meta', 'block-wipe', 'clear-holders', 'curthooks', | 18 | 'block-info', 'block-meta', 'block-wipe', 'clear-holders', 'curthooks', |
202 | 19 | 'collect-logs', 'extract', 'hook', 'install', 'mkfs', 'in-target', | 19 | 'collect-logs', 'extract', 'features', |
203 | 20 | 'net-meta', 'pack', 'swap', 'system-install', 'system-upgrade', 'unmount', | 20 | 'hook', 'install', 'mkfs', 'in-target', 'net-meta', 'pack', 'swap', |
204 | 21 | 'version', | 21 | 'system-install', 'system-upgrade', 'unmount', 'version', |
205 | 22 | ] | 22 | ] |
206 | 23 | 23 | ||
207 | 24 | 24 | ||
208 | diff --git a/debian/changelog b/debian/changelog | |||
209 | index dfd5560..8f013e6 100644 | |||
210 | --- a/debian/changelog | |||
211 | +++ b/debian/changelog | |||
212 | @@ -1,3 +1,28 @@ | |||
213 | 1 | curtin (18.1-44-g2b12b8fc-0ubuntu1) cosmic; urgency=medium | ||
214 | 2 | |||
215 | 3 | * New upstream snapshot. | ||
216 | 4 | - Add main so that 'python3 -m curtin' does the right thing. | ||
217 | 5 | - Add subcommand 'features'. | ||
218 | 6 | - block: use uuid4 (random) when autogenerating UUIDS for filesystems | ||
219 | 7 | - vmtests: Increase size of root filesystems. | ||
220 | 8 | - clear-holders: reread ptable after wiping disks with partitions | ||
221 | 9 | - vmtest: Skip proposed pocket on dev release when 'proposed' in ADD_REPOS. | ||
222 | 10 | - tests: remove Ubuntu Artful [Joshua Powers] | ||
223 | 11 | - vmtests: Let a raised SkipTest go through skip_by_date. | ||
224 | 12 | - vmtests: Increase root fs to give upgrades to -proposed more space. | ||
225 | 13 | - vmtest: Order the vmtest_pollinate late_command earlier. | ||
226 | 14 | - vmtest: always add 'curtin/vmtest' to installed pollinate user_agent. | ||
227 | 15 | - vmtests: make skip_by_date a decorator that runs and reports. | ||
228 | 16 | - vmtests: always declare certain attributes and remove redundant tests. | ||
229 | 17 | - vmtests: Add Cosmic release to tests [Joshua Powers] | ||
230 | 18 | - vmtests: skip TrustyTestMdadmBcache until 2019-01-22. | ||
231 | 19 | - tox: use simplestreams from git repository rather than bzr. | ||
232 | 20 | - document that you can set ptable on raids [Michael Hudson-Doyle] | ||
233 | 21 | - vmtests: move skip-by date of xfs root and xfs boot out 1 year. | ||
234 | 22 | - vmtests: network_mtu move fixby date out 4 months from last value | ||
235 | 23 | |||
236 | 24 | -- Chad Smith <chad.smith@canonical.com> Fri, 10 Aug 2018 09:22:12 -0600 | ||
237 | 25 | |||
238 | 1 | curtin (18.1-25-g9d0e557e-0ubuntu1) cosmic; urgency=medium | 26 | curtin (18.1-25-g9d0e557e-0ubuntu1) cosmic; urgency=medium |
239 | 2 | 27 | ||
240 | 3 | * New upstream snapshot. | 28 | * New upstream snapshot. |
241 | diff --git a/doc/topics/integration-testing.rst b/doc/topics/integration-testing.rst | |||
242 | index 7753068..6093b55 100644 | |||
243 | --- a/doc/topics/integration-testing.rst | |||
244 | +++ b/doc/topics/integration-testing.rst | |||
245 | @@ -314,6 +314,10 @@ Some environment variables affect the running of vmtest | |||
246 | 314 | setting (auto), then a upgrade will be done to make sure to include | 314 | setting (auto), then a upgrade will be done to make sure to include |
247 | 315 | any new packages. | 315 | any new packages. |
248 | 316 | 316 | ||
249 | 317 | The string 'proposed' is handled specially. It will enable the | ||
250 | 318 | Ubuntu -proposed pocket for non-devel releases. If you wish to test | ||
251 | 319 | the -proposed pocket for a devel release, use 'PROPOSED'. | ||
252 | 320 | |||
253 | 317 | - ``CURTIN_VMTEST_SYSTEM_UPGRADE``: default 'auto' | 321 | - ``CURTIN_VMTEST_SYSTEM_UPGRADE``: default 'auto' |
254 | 318 | The default setting of 'auto' means to do a system upgrade if | 322 | The default setting of 'auto' means to do a system upgrade if |
255 | 319 | there are additional repos added. To enable this explicitly, set | 323 | there are additional repos added. To enable this explicitly, set |
256 | diff --git a/doc/topics/storage.rst b/doc/topics/storage.rst | |||
257 | index ca6253c..b28964b 100644 | |||
258 | --- a/doc/topics/storage.rst | |||
259 | +++ b/doc/topics/storage.rst | |||
260 | @@ -60,9 +60,9 @@ table. A disk command may contain all or some of the following keys: | |||
261 | 60 | 60 | ||
262 | 61 | **ptable**: *msdos, gpt* | 61 | **ptable**: *msdos, gpt* |
263 | 62 | 62 | ||
267 | 63 | If the ``ptable`` key is present and a valid type of partition table, curtin | 63 | If the ``ptable`` key is present and a curtin will create an empty |
268 | 64 | will create an empty partition table of that type on the disk. At the moment, | 64 | partition table of that type on the disk. Curtin supports msdos and |
269 | 65 | msdos and gpt partition tables are supported. | 65 | gpt partition tables. |
270 | 66 | 66 | ||
271 | 67 | **serial**: *<serial number>* | 67 | **serial**: *<serial number>* |
272 | 68 | 68 | ||
273 | @@ -613,6 +613,11 @@ The ``spare_devices`` key specifies a list of the devices that will be used for | |||
274 | 613 | spares in the raid array. Each device must be referenced by ``id`` and the | 613 | spares in the raid array. Each device must be referenced by ``id`` and the |
275 | 614 | device must be previously defined in the storage configuration. May be empty. | 614 | device must be previously defined in the storage configuration. May be empty. |
276 | 615 | 615 | ||
277 | 616 | **ptable**: *msdos, gpt* | ||
278 | 617 | |||
279 | 618 | To partition the array rather than mounting it directly, the | ||
280 | 619 | ``ptable`` key must be present and a valid type of partition table, | ||
281 | 620 | i.e. msdos or gpt. | ||
282 | 616 | 621 | ||
283 | 617 | **Config Example**:: | 622 | **Config Example**:: |
284 | 618 | 623 | ||
285 | @@ -801,6 +806,7 @@ Learn by examples. | |||
286 | 801 | - LVM | 806 | - LVM |
287 | 802 | - Bcache | 807 | - Bcache |
288 | 803 | - RAID Boot | 808 | - RAID Boot |
289 | 809 | - Partitioned RAID | ||
290 | 804 | - RAID5 + Bcache | 810 | - RAID5 + Bcache |
291 | 805 | - ZFS Root Simple | 811 | - ZFS Root Simple |
292 | 806 | - ZFS Root | 812 | - ZFS Root |
293 | @@ -1045,6 +1051,76 @@ RAID Boot | |||
294 | 1045 | path: / | 1051 | path: / |
295 | 1046 | device: md_root | 1052 | device: md_root |
296 | 1047 | 1053 | ||
297 | 1054 | Partitioned RAID | ||
298 | 1055 | ~~~~~~~~~~~~~~~~ | ||
299 | 1056 | |||
300 | 1057 | :: | ||
301 | 1058 | |||
302 | 1059 | storage: | ||
303 | 1060 | config: | ||
304 | 1061 | - type: disk | ||
305 | 1062 | id: disk-0 | ||
306 | 1063 | ptable: gpt | ||
307 | 1064 | path: /dev/vda | ||
308 | 1065 | wipe: superblock | ||
309 | 1066 | grub_device: true | ||
310 | 1067 | - type: disk | ||
311 | 1068 | id: disk-1 | ||
312 | 1069 | path: /dev/vdb | ||
313 | 1070 | wipe: superblock | ||
314 | 1071 | - type: disk | ||
315 | 1072 | id: disk-2 | ||
316 | 1073 | path: /dev/vdc | ||
317 | 1074 | wipe: superblock | ||
318 | 1075 | - type: partition | ||
319 | 1076 | id: part-0 | ||
320 | 1077 | device: disk-0 | ||
321 | 1078 | size: 1048576 | ||
322 | 1079 | flag: bios_grub | ||
323 | 1080 | - type: partition | ||
324 | 1081 | id: part-1 | ||
325 | 1082 | device: disk-0 | ||
326 | 1083 | size: 21471690752 | ||
327 | 1084 | - id: raid-0 | ||
328 | 1085 | type: raid | ||
329 | 1086 | name: md0 | ||
330 | 1087 | raidlevel: 1 | ||
331 | 1088 | devices: [disk-2, disk-1] | ||
332 | 1089 | ptable: gpt | ||
333 | 1090 | - type: partition | ||
334 | 1091 | id: part-2 | ||
335 | 1092 | device: raid-0 | ||
336 | 1093 | size: 10737418240 | ||
337 | 1094 | - type: partition | ||
338 | 1095 | id: part-3 | ||
339 | 1096 | device: raid-0 | ||
340 | 1097 | size: 10735321088, | ||
341 | 1098 | - type: format | ||
342 | 1099 | id: fs-0 | ||
343 | 1100 | fstype: ext4 | ||
344 | 1101 | volume: part-1 | ||
345 | 1102 | - type: format | ||
346 | 1103 | id: fs-1 | ||
347 | 1104 | fstype: xfs | ||
348 | 1105 | volume: part-2 | ||
349 | 1106 | - type: format | ||
350 | 1107 | id: fs-2 | ||
351 | 1108 | fstype: ext4 | ||
352 | 1109 | volume: part-3 | ||
353 | 1110 | - type: mount | ||
354 | 1111 | id: mount-0 | ||
355 | 1112 | device: fs-0 | ||
356 | 1113 | path: / | ||
357 | 1114 | - type: mount | ||
358 | 1115 | id: mount-1 | ||
359 | 1116 | device: fs-1 | ||
360 | 1117 | path: /srv | ||
361 | 1118 | - type: mount | ||
362 | 1119 | id: mount-2 | ||
363 | 1120 | device: fs-2 | ||
364 | 1121 | path: /home | ||
365 | 1122 | version: 1 | ||
366 | 1123 | |||
367 | 1048 | 1124 | ||
368 | 1049 | RAID5 + Bcache | 1125 | RAID5 + Bcache |
369 | 1050 | ~~~~~~~~~~~~~~ | 1126 | ~~~~~~~~~~~~~~ |
370 | diff --git a/examples/tests/install_disable_unmount.yaml b/examples/tests/install_disable_unmount.yaml | |||
371 | index d3e583f..c0cd759 100644 | |||
372 | --- a/examples/tests/install_disable_unmount.yaml | |||
373 | +++ b/examples/tests/install_disable_unmount.yaml | |||
374 | @@ -14,5 +14,5 @@ post_cmds: | |||
375 | 14 | late_commands: | 14 | late_commands: |
376 | 15 | 01_get_proc_mounts: [sh, -c, *cat_proc_mounts] | 15 | 01_get_proc_mounts: [sh, -c, *cat_proc_mounts] |
377 | 16 | 02_write_out_target: [sh, -c, *echo_target_mp] | 16 | 02_write_out_target: [sh, -c, *echo_target_mp] |
380 | 17 | 03_unmount_target: [curtin, unmount] | 17 | 99a_unmount_target: [curtin, unmount] |
381 | 18 | 04_get_proc_mounts: [cat, /proc/mounts] | 18 | 99b_get_proc_mounts: [cat, /proc/mounts] |
382 | diff --git a/examples/tests/mirrorboot-msdos-partition.yaml b/examples/tests/mirrorboot-msdos-partition.yaml | |||
383 | index 1a418fa..2b111a7 100644 | |||
384 | --- a/examples/tests/mirrorboot-msdos-partition.yaml | |||
385 | +++ b/examples/tests/mirrorboot-msdos-partition.yaml | |||
386 | @@ -47,7 +47,7 @@ storage: | |||
387 | 47 | name: md0-part1 | 47 | name: md0-part1 |
388 | 48 | number: 1 | 48 | number: 1 |
389 | 49 | offset: 4194304B | 49 | offset: 4194304B |
391 | 50 | size: 2GB | 50 | size: 3GB |
392 | 51 | type: partition | 51 | type: partition |
393 | 52 | uuid: 4f4fa336-2762-48e4-ae54-9451141665cd | 52 | uuid: 4f4fa336-2762-48e4-ae54-9451141665cd |
394 | 53 | wipe: superblock | 53 | wipe: superblock |
395 | @@ -55,7 +55,7 @@ storage: | |||
396 | 55 | id: md0-part2 | 55 | id: md0-part2 |
397 | 56 | name: md0-part2 | 56 | name: md0-part2 |
398 | 57 | number: 2 | 57 | number: 2 |
400 | 58 | size: 2GB | 58 | size: 1.5GB |
401 | 59 | type: partition | 59 | type: partition |
402 | 60 | uuid: c2d21fd3-3cde-4432-8eab-f08594bbe76e | 60 | uuid: c2d21fd3-3cde-4432-8eab-f08594bbe76e |
403 | 61 | wipe: superblock | 61 | wipe: superblock |
404 | diff --git a/examples/tests/mirrorboot-uefi.yaml b/examples/tests/mirrorboot-uefi.yaml | |||
405 | index e1f393f..ca55be9 100644 | |||
406 | --- a/examples/tests/mirrorboot-uefi.yaml | |||
407 | +++ b/examples/tests/mirrorboot-uefi.yaml | |||
408 | @@ -30,7 +30,7 @@ storage: | |||
409 | 30 | id: sda-part2 | 30 | id: sda-part2 |
410 | 31 | name: sda-part2 | 31 | name: sda-part2 |
411 | 32 | number: 2 | 32 | number: 2 |
413 | 33 | size: 2G | 33 | size: 3G |
414 | 34 | type: partition | 34 | type: partition |
415 | 35 | uuid: 47c97eae-f35d-473f-8f3d-d64161d571f1 | 35 | uuid: 47c97eae-f35d-473f-8f3d-d64161d571f1 |
416 | 36 | wipe: superblock | 36 | wipe: superblock |
417 | @@ -38,7 +38,7 @@ storage: | |||
418 | 38 | id: sda-part3 | 38 | id: sda-part3 |
419 | 39 | name: sda-part3 | 39 | name: sda-part3 |
420 | 40 | number: 3 | 40 | number: 3 |
422 | 41 | size: 2G | 41 | size: 1G |
423 | 42 | type: partition | 42 | type: partition |
424 | 43 | uuid: e3202633-841c-4936-a520-b18d1f7938ea | 43 | uuid: e3202633-841c-4936-a520-b18d1f7938ea |
425 | 44 | wipe: superblock | 44 | wipe: superblock |
426 | @@ -56,7 +56,7 @@ storage: | |||
427 | 56 | id: sdb-part2 | 56 | id: sdb-part2 |
428 | 57 | name: sdb-part2 | 57 | name: sdb-part2 |
429 | 58 | number: 2 | 58 | number: 2 |
431 | 59 | size: 2G | 59 | size: 3G |
432 | 60 | type: partition | 60 | type: partition |
433 | 61 | uuid: a33a83dd-d1bf-4940-bf3e-6d931de85dbc | 61 | uuid: a33a83dd-d1bf-4940-bf3e-6d931de85dbc |
434 | 62 | wipe: superblock | 62 | wipe: superblock |
435 | @@ -72,7 +72,7 @@ storage: | |||
436 | 72 | id: sdb-part3 | 72 | id: sdb-part3 |
437 | 73 | name: sdb-part3 | 73 | name: sdb-part3 |
438 | 74 | number: 3 | 74 | number: 3 |
440 | 75 | size: 2G | 75 | size: 1G |
441 | 76 | type: partition | 76 | type: partition |
442 | 77 | uuid: 27e29758-fdcf-4c6a-8578-c92f907a8a9d | 77 | uuid: 27e29758-fdcf-4c6a-8578-c92f907a8a9d |
443 | 78 | wipe: superblock | 78 | wipe: superblock |
444 | diff --git a/examples/tests/vmtest_pollinate.yaml b/examples/tests/vmtest_pollinate.yaml | |||
445 | 79 | new file mode 100644 | 79 | new file mode 100644 |
446 | index 0000000..e4fac06 | |||
447 | --- /dev/null | |||
448 | +++ b/examples/tests/vmtest_pollinate.yaml | |||
449 | @@ -0,0 +1,10 @@ | |||
450 | 1 | # this updates pollinate in the installed target to add a vmtest identifier. | ||
451 | 2 | # specifically pollinate's user-agent should contain 'curtin/vmtest'. | ||
452 | 3 | _vmtest_pollinate: | ||
453 | 4 | - &pvmtest | | ||
454 | 5 | cfg="/etc/pollinate/add-user-agent" | ||
455 | 6 | [ -d "${cfg%/*}" ] || exit 0 | ||
456 | 7 | echo curtin/vmtest >> "$cfg" | ||
457 | 8 | |||
458 | 9 | late_commands: | ||
459 | 10 | 01_vmtest_pollinate: ['curtin', 'in-target', '--', 'sh', '-c', *pvmtest] | ||
460 | diff --git a/tests/unittests/test_clear_holders.py b/tests/unittests/test_clear_holders.py | |||
461 | index ceb5615..6c29171 100644 | |||
462 | --- a/tests/unittests/test_clear_holders.py | |||
463 | +++ b/tests/unittests/test_clear_holders.py | |||
464 | @@ -10,7 +10,7 @@ from .helpers import CiTestCase | |||
465 | 10 | 10 | ||
466 | 11 | 11 | ||
467 | 12 | class TestClearHolders(CiTestCase): | 12 | class TestClearHolders(CiTestCase): |
469 | 13 | test_blockdev = '/dev/null' | 13 | test_blockdev = '/wark/dev/null' |
470 | 14 | test_syspath = '/sys/class/block/null' | 14 | test_syspath = '/sys/class/block/null' |
471 | 15 | remove_retries = [0.2] * 150 # clear_holders defaults to 30 seconds | 15 | remove_retries = [0.2] * 150 # clear_holders defaults to 30 seconds |
472 | 16 | example_holders_trees = [ | 16 | example_holders_trees = [ |
473 | @@ -153,7 +153,7 @@ class TestClearHolders(CiTestCase): | |||
474 | 153 | # | 153 | # |
475 | 154 | 154 | ||
476 | 155 | device = self.test_syspath | 155 | device = self.test_syspath |
478 | 156 | mock_block.sys_block_path.return_value = '/dev/null' | 156 | mock_block.sys_block_path.return_value = self.test_blockdev |
479 | 157 | bcache_cset_uuid = 'c08ae789-a964-46fb-a66e-650f0ae78f94' | 157 | bcache_cset_uuid = 'c08ae789-a964-46fb-a66e-650f0ae78f94' |
480 | 158 | 158 | ||
481 | 159 | mock_os.path.exists.return_value = True | 159 | mock_os.path.exists.return_value = True |
482 | @@ -189,9 +189,8 @@ class TestClearHolders(CiTestCase): | |||
483 | 189 | def test_shutdown_bcache_non_sysfs_device(self, mock_get_bcache, mock_log, | 189 | def test_shutdown_bcache_non_sysfs_device(self, mock_get_bcache, mock_log, |
484 | 190 | mock_os, mock_util, | 190 | mock_os, mock_util, |
485 | 191 | mock_get_bcache_block): | 191 | mock_get_bcache_block): |
486 | 192 | device = "/dev/fakenull" | ||
487 | 193 | with self.assertRaises(ValueError): | 192 | with self.assertRaises(ValueError): |
489 | 194 | clear_holders.shutdown_bcache(device) | 193 | clear_holders.shutdown_bcache(self.test_blockdev) |
490 | 195 | 194 | ||
491 | 196 | self.assertEqual(0, len(mock_get_bcache.call_args_list)) | 195 | self.assertEqual(0, len(mock_get_bcache.call_args_list)) |
492 | 197 | self.assertEqual(0, len(mock_log.call_args_list)) | 196 | self.assertEqual(0, len(mock_log.call_args_list)) |
493 | @@ -208,11 +207,10 @@ class TestClearHolders(CiTestCase): | |||
494 | 208 | def test_shutdown_bcache_no_device(self, mock_get_bcache, mock_log, | 207 | def test_shutdown_bcache_no_device(self, mock_get_bcache, mock_log, |
495 | 209 | mock_os, mock_util, | 208 | mock_os, mock_util, |
496 | 210 | mock_get_bcache_block, mock_block): | 209 | mock_get_bcache_block, mock_block): |
499 | 211 | device = "/sys/class/block/null" | 210 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
498 | 212 | mock_block.sysfs_to_devpath.return_value = '/dev/null' | ||
500 | 213 | mock_os.path.exists.return_value = False | 211 | mock_os.path.exists.return_value = False |
501 | 214 | 212 | ||
503 | 215 | clear_holders.shutdown_bcache(device) | 213 | clear_holders.shutdown_bcache(self.test_syspath) |
504 | 216 | 214 | ||
505 | 217 | self.assertEqual(3, len(mock_log.info.call_args_list)) | 215 | self.assertEqual(3, len(mock_log.info.call_args_list)) |
506 | 218 | self.assertEqual(1, len(mock_os.path.exists.call_args_list)) | 216 | self.assertEqual(1, len(mock_os.path.exists.call_args_list)) |
507 | @@ -229,18 +227,17 @@ class TestClearHolders(CiTestCase): | |||
508 | 229 | def test_shutdown_bcache_no_cset(self, mock_get_bcache, mock_log, | 227 | def test_shutdown_bcache_no_cset(self, mock_get_bcache, mock_log, |
509 | 230 | mock_os, mock_util, | 228 | mock_os, mock_util, |
510 | 231 | mock_get_bcache_block, mock_block): | 229 | mock_get_bcache_block, mock_block): |
513 | 232 | device = "/sys/class/block/null" | 230 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
512 | 233 | mock_block.sysfs_to_devpath.return_value = '/dev/null' | ||
514 | 234 | mock_os.path.exists.side_effect = iter([ | 231 | mock_os.path.exists.side_effect = iter([ |
515 | 235 | True, # backing device exists | 232 | True, # backing device exists |
516 | 236 | False, # cset device not present (already removed) | 233 | False, # cset device not present (already removed) |
517 | 237 | True, # backing device (still) exists | 234 | True, # backing device (still) exists |
518 | 238 | ]) | 235 | ]) |
519 | 239 | mock_get_bcache.return_value = '/sys/fs/bcache/fake' | 236 | mock_get_bcache.return_value = '/sys/fs/bcache/fake' |
521 | 240 | mock_get_bcache_block.return_value = device + '/bcache' | 237 | mock_get_bcache_block.return_value = self.test_syspath + '/bcache' |
522 | 241 | mock_os.path.join.side_effect = os.path.join | 238 | mock_os.path.join.side_effect = os.path.join |
523 | 242 | 239 | ||
525 | 243 | clear_holders.shutdown_bcache(device) | 240 | clear_holders.shutdown_bcache(self.test_syspath) |
526 | 244 | 241 | ||
527 | 245 | self.assertEqual(4, len(mock_log.info.call_args_list)) | 242 | self.assertEqual(4, len(mock_log.info.call_args_list)) |
528 | 246 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) | 243 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) |
529 | @@ -249,14 +246,15 @@ class TestClearHolders(CiTestCase): | |||
530 | 249 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) | 246 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) |
531 | 250 | self.assertEqual(2, len(mock_util.wait_for_removal.call_args_list)) | 247 | self.assertEqual(2, len(mock_util.wait_for_removal.call_args_list)) |
532 | 251 | 248 | ||
537 | 252 | mock_get_bcache.assert_called_with(device, strict=False) | 249 | mock_get_bcache.assert_called_with(self.test_syspath, strict=False) |
538 | 253 | mock_get_bcache_block.assert_called_with(device, strict=False) | 250 | mock_get_bcache_block.assert_called_with(self.test_syspath, |
539 | 254 | mock_util.write_file.assert_called_with(device + '/bcache/stop', | 251 | strict=False) |
540 | 255 | '1', mode=None) | 252 | mock_util.write_file.assert_called_with( |
541 | 253 | self.test_syspath + '/bcache/stop', '1', mode=None) | ||
542 | 256 | retries = self.remove_retries | 254 | retries = self.remove_retries |
543 | 257 | mock_util.wait_for_removal.assert_has_calls([ | 255 | mock_util.wait_for_removal.assert_has_calls([ |
546 | 258 | mock.call(device, retries=retries), | 256 | mock.call(self.test_syspath, retries=retries), |
547 | 259 | mock.call(device + '/bcache', retries=retries)]) | 257 | mock.call(self.test_syspath + '/bcache', retries=retries)]) |
548 | 260 | 258 | ||
549 | 261 | @mock.patch('curtin.block.clear_holders.block') | 259 | @mock.patch('curtin.block.clear_holders.block') |
550 | 262 | @mock.patch('curtin.block.clear_holders.udev.udevadm_settle') | 260 | @mock.patch('curtin.block.clear_holders.udev.udevadm_settle') |
551 | @@ -271,8 +269,7 @@ class TestClearHolders(CiTestCase): | |||
552 | 271 | mock_get_bcache_block, | 269 | mock_get_bcache_block, |
553 | 272 | mock_udevadm_settle, | 270 | mock_udevadm_settle, |
554 | 273 | mock_block): | 271 | mock_block): |
557 | 274 | device = "/sys/class/block/null" | 272 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
556 | 275 | mock_block.sysfs_to_devpath.return_value = '/dev/null' | ||
558 | 276 | mock_os.path.exists.side_effect = iter([ | 273 | mock_os.path.exists.side_effect = iter([ |
559 | 277 | True, # backing device exists | 274 | True, # backing device exists |
560 | 278 | True, # cset device not present (already removed) | 275 | True, # cset device not present (already removed) |
561 | @@ -280,10 +277,10 @@ class TestClearHolders(CiTestCase): | |||
562 | 280 | ]) | 277 | ]) |
563 | 281 | cset = '/sys/fs/bcache/fake' | 278 | cset = '/sys/fs/bcache/fake' |
564 | 282 | mock_get_bcache.return_value = cset | 279 | mock_get_bcache.return_value = cset |
566 | 283 | mock_get_bcache_block.return_value = device + '/bcache' | 280 | mock_get_bcache_block.return_value = self.test_syspath + '/bcache' |
567 | 284 | mock_os.path.join.side_effect = os.path.join | 281 | mock_os.path.join.side_effect = os.path.join |
568 | 285 | 282 | ||
570 | 286 | clear_holders.shutdown_bcache(device) | 283 | clear_holders.shutdown_bcache(self.test_syspath) |
571 | 287 | 284 | ||
572 | 288 | self.assertEqual(4, len(mock_log.info.call_args_list)) | 285 | self.assertEqual(4, len(mock_log.info.call_args_list)) |
573 | 289 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) | 286 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) |
574 | @@ -292,14 +289,15 @@ class TestClearHolders(CiTestCase): | |||
575 | 292 | self.assertEqual(2, len(mock_util.write_file.call_args_list)) | 289 | self.assertEqual(2, len(mock_util.write_file.call_args_list)) |
576 | 293 | self.assertEqual(3, len(mock_util.wait_for_removal.call_args_list)) | 290 | self.assertEqual(3, len(mock_util.wait_for_removal.call_args_list)) |
577 | 294 | 291 | ||
580 | 295 | mock_get_bcache.assert_called_with(device, strict=False) | 292 | mock_get_bcache.assert_called_with(self.test_syspath, strict=False) |
581 | 296 | mock_get_bcache_block.assert_called_with(device, strict=False) | 293 | mock_get_bcache_block.assert_called_with(self.test_syspath, |
582 | 294 | strict=False) | ||
583 | 297 | mock_util.write_file.assert_has_calls([ | 295 | mock_util.write_file.assert_has_calls([ |
584 | 298 | mock.call(cset + '/stop', '1', mode=None), | 296 | mock.call(cset + '/stop', '1', mode=None), |
586 | 299 | mock.call(device + '/bcache/stop', '1', mode=None)]) | 297 | mock.call(self.test_syspath + '/bcache/stop', '1', mode=None)]) |
587 | 300 | mock_util.wait_for_removal.assert_has_calls([ | 298 | mock_util.wait_for_removal.assert_has_calls([ |
588 | 301 | mock.call(cset, retries=self.remove_retries), | 299 | mock.call(cset, retries=self.remove_retries), |
590 | 302 | mock.call(device, retries=self.remove_retries) | 300 | mock.call(self.test_syspath, retries=self.remove_retries) |
591 | 303 | ]) | 301 | ]) |
592 | 304 | 302 | ||
593 | 305 | @mock.patch('curtin.block.clear_holders.block') | 303 | @mock.patch('curtin.block.clear_holders.block') |
594 | @@ -315,8 +313,7 @@ class TestClearHolders(CiTestCase): | |||
595 | 315 | mock_get_bcache_block, | 313 | mock_get_bcache_block, |
596 | 316 | mock_udevadm_settle, | 314 | mock_udevadm_settle, |
597 | 317 | mock_block): | 315 | mock_block): |
600 | 318 | device = "/sys/class/block/null" | 316 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
599 | 319 | mock_block.sysfs_to_devpath.return_value = '/dev/null' | ||
601 | 320 | mock_os.path.exists.side_effect = iter([ | 317 | mock_os.path.exists.side_effect = iter([ |
602 | 321 | True, # backing device exists | 318 | True, # backing device exists |
603 | 322 | True, # cset device not present (already removed) | 319 | True, # cset device not present (already removed) |
604 | @@ -324,10 +321,10 @@ class TestClearHolders(CiTestCase): | |||
605 | 324 | ]) | 321 | ]) |
606 | 325 | cset = '/sys/fs/bcache/fake' | 322 | cset = '/sys/fs/bcache/fake' |
607 | 326 | mock_get_bcache.return_value = cset | 323 | mock_get_bcache.return_value = cset |
609 | 327 | mock_get_bcache_block.return_value = device + '/bcache' | 324 | mock_get_bcache_block.return_value = self.test_syspath + '/bcache' |
610 | 328 | mock_os.path.join.side_effect = os.path.join | 325 | mock_os.path.join.side_effect = os.path.join |
611 | 329 | 326 | ||
613 | 330 | clear_holders.shutdown_bcache(device) | 327 | clear_holders.shutdown_bcache(self.test_syspath) |
614 | 331 | 328 | ||
615 | 332 | self.assertEqual(4, len(mock_log.info.call_args_list)) | 329 | self.assertEqual(4, len(mock_log.info.call_args_list)) |
616 | 333 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) | 330 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) |
617 | @@ -336,7 +333,7 @@ class TestClearHolders(CiTestCase): | |||
618 | 336 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) | 333 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) |
619 | 337 | self.assertEqual(1, len(mock_util.wait_for_removal.call_args_list)) | 334 | self.assertEqual(1, len(mock_util.wait_for_removal.call_args_list)) |
620 | 338 | 335 | ||
622 | 339 | mock_get_bcache.assert_called_with(device, strict=False) | 336 | mock_get_bcache.assert_called_with(self.test_syspath, strict=False) |
623 | 340 | mock_util.write_file.assert_has_calls([ | 337 | mock_util.write_file.assert_has_calls([ |
624 | 341 | mock.call(cset + '/stop', '1', mode=None), | 338 | mock.call(cset + '/stop', '1', mode=None), |
625 | 342 | ]) | 339 | ]) |
626 | @@ -361,8 +358,7 @@ class TestClearHolders(CiTestCase): | |||
627 | 361 | mock_wipe, | 358 | mock_wipe, |
628 | 362 | mock_block): | 359 | mock_block): |
629 | 363 | """Test writes sysfs write failures pass if file not present""" | 360 | """Test writes sysfs write failures pass if file not present""" |
632 | 364 | device = "/sys/class/block/null" | 361 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
631 | 365 | mock_block.sysfs_to_devpath.return_value = '/dev/null' | ||
633 | 366 | mock_os.path.exists.side_effect = iter([ | 362 | mock_os.path.exists.side_effect = iter([ |
634 | 367 | True, # backing device exists | 363 | True, # backing device exists |
635 | 368 | True, # cset device not present (already removed) | 364 | True, # cset device not present (already removed) |
636 | @@ -371,14 +367,14 @@ class TestClearHolders(CiTestCase): | |||
637 | 371 | ]) | 367 | ]) |
638 | 372 | cset = '/sys/fs/bcache/fake' | 368 | cset = '/sys/fs/bcache/fake' |
639 | 373 | mock_get_bcache.return_value = cset | 369 | mock_get_bcache.return_value = cset |
641 | 374 | mock_get_bcache_block.return_value = device + '/bcache' | 370 | mock_get_bcache_block.return_value = self.test_syspath + '/bcache' |
642 | 375 | mock_os.path.join.side_effect = os.path.join | 371 | mock_os.path.join.side_effect = os.path.join |
643 | 376 | 372 | ||
644 | 377 | # make writes to sysfs fail | 373 | # make writes to sysfs fail |
645 | 378 | mock_util.write_file.side_effect = IOError(errno.ENOENT, | 374 | mock_util.write_file.side_effect = IOError(errno.ENOENT, |
646 | 379 | "File not found") | 375 | "File not found") |
647 | 380 | 376 | ||
649 | 381 | clear_holders.shutdown_bcache(device) | 377 | clear_holders.shutdown_bcache(self.test_syspath) |
650 | 382 | 378 | ||
651 | 383 | self.assertEqual(4, len(mock_log.info.call_args_list)) | 379 | self.assertEqual(4, len(mock_log.info.call_args_list)) |
652 | 384 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) | 380 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) |
653 | @@ -387,7 +383,7 @@ class TestClearHolders(CiTestCase): | |||
654 | 387 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) | 383 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) |
655 | 388 | self.assertEqual(1, len(mock_util.wait_for_removal.call_args_list)) | 384 | self.assertEqual(1, len(mock_util.wait_for_removal.call_args_list)) |
656 | 389 | 385 | ||
658 | 390 | mock_get_bcache.assert_called_with(device, strict=False) | 386 | mock_get_bcache.assert_called_with(self.test_syspath, strict=False) |
659 | 391 | mock_util.write_file.assert_has_calls([ | 387 | mock_util.write_file.assert_has_calls([ |
660 | 392 | mock.call(cset + '/stop', '1', mode=None), | 388 | mock.call(cset + '/stop', '1', mode=None), |
661 | 393 | ]) | 389 | ]) |
662 | @@ -528,10 +524,15 @@ class TestClearHolders(CiTestCase): | |||
663 | 528 | self.assertTrue(mock_log.debug.called) | 524 | self.assertTrue(mock_log.debug.called) |
664 | 529 | self.assertTrue(mock_log.critical.called) | 525 | self.assertTrue(mock_log.critical.called) |
665 | 530 | 526 | ||
666 | 527 | @mock.patch('curtin.block.clear_holders.is_swap_device') | ||
667 | 528 | @mock.patch('curtin.block.clear_holders.os.path.exists') | ||
668 | 531 | @mock.patch('curtin.block.clear_holders.LOG') | 529 | @mock.patch('curtin.block.clear_holders.LOG') |
669 | 532 | @mock.patch('curtin.block.clear_holders.block') | 530 | @mock.patch('curtin.block.clear_holders.block') |
671 | 533 | def test_clear_holders_wipe_superblock(self, mock_block, mock_log): | 531 | def test_clear_holders_wipe_superblock(self, mock_block, mock_log, |
672 | 532 | mock_os_path, mock_swap): | ||
673 | 534 | """test clear_holders.wipe_superblock handles errors right""" | 533 | """test clear_holders.wipe_superblock handles errors right""" |
674 | 534 | mock_swap.return_value = False | ||
675 | 535 | mock_os_path.return_value = False | ||
676 | 535 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev | 536 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
677 | 536 | mock_block.is_extended_partition.return_value = True | 537 | mock_block.is_extended_partition.return_value = True |
678 | 537 | clear_holders.wipe_superblock(self.test_syspath) | 538 | clear_holders.wipe_superblock(self.test_syspath) |
679 | @@ -543,12 +544,14 @@ class TestClearHolders(CiTestCase): | |||
680 | 543 | mock_block.wipe_volume.assert_called_with( | 544 | mock_block.wipe_volume.assert_called_with( |
681 | 544 | self.test_blockdev, exclusive=True, mode='superblock') | 545 | self.test_blockdev, exclusive=True, mode='superblock') |
682 | 545 | 546 | ||
683 | 547 | @mock.patch('curtin.block.clear_holders.is_swap_device') | ||
684 | 546 | @mock.patch('curtin.block.clear_holders.zfs') | 548 | @mock.patch('curtin.block.clear_holders.zfs') |
685 | 547 | @mock.patch('curtin.block.clear_holders.LOG') | 549 | @mock.patch('curtin.block.clear_holders.LOG') |
686 | 548 | @mock.patch('curtin.block.clear_holders.block') | 550 | @mock.patch('curtin.block.clear_holders.block') |
687 | 549 | def test_clear_holders_wipe_superblock_zfs(self, mock_block, mock_log, | 551 | def test_clear_holders_wipe_superblock_zfs(self, mock_block, mock_log, |
689 | 550 | mock_zfs): | 552 | mock_zfs, mock_swap): |
690 | 551 | """test clear_holders.wipe_superblock handles zfs member""" | 553 | """test clear_holders.wipe_superblock handles zfs member""" |
691 | 554 | mock_swap.return_value = False | ||
692 | 552 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev | 555 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev |
693 | 553 | mock_block.is_extended_partition.return_value = True | 556 | mock_block.is_extended_partition.return_value = True |
694 | 554 | clear_holders.wipe_superblock(self.test_syspath) | 557 | clear_holders.wipe_superblock(self.test_syspath) |
695 | @@ -563,6 +566,59 @@ class TestClearHolders(CiTestCase): | |||
696 | 563 | mock_block.wipe_volume.assert_called_with( | 566 | mock_block.wipe_volume.assert_called_with( |
697 | 564 | self.test_blockdev, exclusive=True, mode='superblock') | 567 | self.test_blockdev, exclusive=True, mode='superblock') |
698 | 565 | 568 | ||
699 | 569 | @mock.patch('curtin.block.clear_holders.is_swap_device') | ||
700 | 570 | @mock.patch('curtin.block.clear_holders.time') | ||
701 | 571 | @mock.patch('curtin.block.clear_holders.LOG') | ||
702 | 572 | @mock.patch('curtin.block.clear_holders.block') | ||
703 | 573 | def test_clear_holders_wipe_superblock_rereads_pt(self, mock_block, | ||
704 | 574 | mock_log, m_time, | ||
705 | 575 | mock_swap): | ||
706 | 576 | """test clear_holders.wipe_superblock re-reads partition table""" | ||
707 | 577 | mock_swap.return_value = False | ||
708 | 578 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev | ||
709 | 579 | mock_block.is_extended_partition.return_value = False | ||
710 | 580 | mock_block.is_zfs_member.return_value = False | ||
711 | 581 | mock_block.get_sysfs_partitions.side_effect = iter([ | ||
712 | 582 | ['p1', 'p2'], # has partitions before wipe | ||
713 | 583 | ['p1', 'p2'], # still has partitions after wipe | ||
714 | 584 | [], # partitions are now gone | ||
715 | 585 | ]) | ||
716 | 586 | clear_holders.wipe_superblock(self.test_syspath) | ||
717 | 587 | mock_block.sysfs_to_devpath.assert_called_with(self.test_syspath) | ||
718 | 588 | mock_block.wipe_volume.assert_called_with( | ||
719 | 589 | self.test_blockdev, exclusive=True, mode='superblock') | ||
720 | 590 | mock_block.get_sysfs_partitions.assert_has_calls( | ||
721 | 591 | [mock.call(self.test_syspath)] * 3) | ||
722 | 592 | mock_block.rescan_block_devices.assert_has_calls( | ||
723 | 593 | [mock.call(devices=[self.test_blockdev])] * 2) | ||
724 | 594 | |||
725 | 595 | @mock.patch('curtin.block.clear_holders.is_swap_device') | ||
726 | 596 | @mock.patch('curtin.block.clear_holders.time') | ||
727 | 597 | @mock.patch('curtin.block.clear_holders.LOG') | ||
728 | 598 | @mock.patch('curtin.block.clear_holders.block') | ||
729 | 599 | def test_clear_holders_wipe_superblock_rereads_pt_oserr(self, mock_block, | ||
730 | 600 | mock_log, m_time, | ||
731 | 601 | mock_swap): | ||
732 | 602 | """test clear_holders.wipe_superblock re-reads ptable handles oserr""" | ||
733 | 603 | mock_swap.return_value = False | ||
734 | 604 | mock_block.sysfs_to_devpath.return_value = self.test_blockdev | ||
735 | 605 | mock_block.is_extended_partition.return_value = False | ||
736 | 606 | mock_block.is_zfs_member.return_value = False | ||
737 | 607 | mock_block.get_sysfs_partitions.side_effect = iter([ | ||
738 | 608 | ['p1', 'p2'], # has partitions before wipe | ||
739 | 609 | OSError('No sysfs path for partition'), | ||
740 | 610 | [], # partitions are now gone | ||
741 | 611 | ]) | ||
742 | 612 | clear_holders.wipe_superblock(self.test_syspath) | ||
743 | 613 | mock_block.sysfs_to_devpath.assert_called_with(self.test_syspath) | ||
744 | 614 | mock_block.wipe_volume.assert_called_with( | ||
745 | 615 | self.test_blockdev, exclusive=True, mode='superblock') | ||
746 | 616 | mock_block.get_sysfs_partitions.assert_has_calls( | ||
747 | 617 | [mock.call(self.test_syspath)] * 3) | ||
748 | 618 | mock_block.rescan_block_devices.assert_has_calls( | ||
749 | 619 | [mock.call(devices=[self.test_blockdev])] * 2) | ||
750 | 620 | self.assertEqual(1, m_time.sleep.call_count) | ||
751 | 621 | |||
752 | 566 | @mock.patch('curtin.block.clear_holders.LOG') | 622 | @mock.patch('curtin.block.clear_holders.LOG') |
753 | 567 | @mock.patch('curtin.block.clear_holders.block') | 623 | @mock.patch('curtin.block.clear_holders.block') |
754 | 568 | @mock.patch('curtin.block.clear_holders.os') | 624 | @mock.patch('curtin.block.clear_holders.os') |
755 | @@ -716,7 +772,7 @@ class TestClearHolders(CiTestCase): | |||
756 | 716 | def test_assert_clear(self, mock_gen_holders_tree, mock_syspath): | 772 | def test_assert_clear(self, mock_gen_holders_tree, mock_syspath): |
757 | 717 | mock_gen_holders_tree.return_value = self.example_holders_trees[0][0] | 773 | mock_gen_holders_tree.return_value = self.example_holders_trees[0][0] |
758 | 718 | mock_syspath.side_effect = lambda x: x | 774 | mock_syspath.side_effect = lambda x: x |
760 | 719 | device = '/dev/null' | 775 | device = self.test_blockdev |
761 | 720 | with self.assertRaises(OSError): | 776 | with self.assertRaises(OSError): |
762 | 721 | clear_holders.assert_clear(device) | 777 | clear_holders.assert_clear(device) |
763 | 722 | mock_gen_holders_tree.assert_called_with(device) | 778 | mock_gen_holders_tree.assert_called_with(device) |
764 | diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py | |||
765 | index 0c3d17e..68b7442 100644 | |||
766 | --- a/tests/vmtests/__init__.py | |||
767 | +++ b/tests/vmtests/__init__.py | |||
768 | @@ -26,6 +26,7 @@ from .image_sync import query as imagesync_query | |||
769 | 26 | from .image_sync import mirror as imagesync_mirror | 26 | from .image_sync import mirror as imagesync_mirror |
770 | 27 | from .image_sync import (IMAGE_SRC_URL, IMAGE_DIR, ITEM_NAME_FILTERS) | 27 | from .image_sync import (IMAGE_SRC_URL, IMAGE_DIR, ITEM_NAME_FILTERS) |
771 | 28 | from .helpers import check_call, TimeoutExpired, ip_a_to_dict | 28 | from .helpers import check_call, TimeoutExpired, ip_a_to_dict |
772 | 29 | from functools import wraps | ||
773 | 29 | from unittest import TestCase, SkipTest | 30 | from unittest import TestCase, SkipTest |
774 | 30 | 31 | ||
775 | 31 | try: | 32 | try: |
776 | @@ -55,6 +56,7 @@ SYSTEM_UPGRADE = os.environ.get("CURTIN_VMTEST_SYSTEM_UPGRADE", "auto") | |||
777 | 55 | 56 | ||
778 | 56 | 57 | ||
779 | 57 | _UNSUPPORTED_UBUNTU = None | 58 | _UNSUPPORTED_UBUNTU = None |
780 | 59 | _DEVEL_UBUNTU = None | ||
781 | 58 | 60 | ||
782 | 59 | _TOPDIR = None | 61 | _TOPDIR = None |
783 | 60 | 62 | ||
784 | @@ -354,6 +356,7 @@ def skip_if_flag(flag): | |||
785 | 354 | def decorator(func): | 356 | def decorator(func): |
786 | 355 | """the name test_wrapper below has to start with test, or nose's | 357 | """the name test_wrapper below has to start with test, or nose's |
787 | 356 | filter will not run it.""" | 358 | filter will not run it.""" |
788 | 359 | @wraps(func) | ||
789 | 357 | def test_wrapper(self, *args, **kwargs): | 360 | def test_wrapper(self, *args, **kwargs): |
790 | 358 | val = getattr(self, flag, None) | 361 | val = getattr(self, flag, None) |
791 | 359 | if val: | 362 | if val: |
792 | @@ -364,6 +367,132 @@ def skip_if_flag(flag): | |||
793 | 364 | return decorator | 367 | return decorator |
794 | 365 | 368 | ||
795 | 366 | 369 | ||
796 | 370 | def skip_by_date(bugnum, fixby, removeby=None, skips=None, install=True): | ||
797 | 371 | """A decorator to skip a test or test class based on current date. | ||
798 | 372 | |||
799 | 373 | @param bugnum: A bug number with which to identify the action. | ||
800 | 374 | @param fixby: string: A date string in the format of YYYY-MM-DD | ||
801 | 375 | tuple (YYYY,MM,DD). Raises SkipTest with testcase results until | ||
802 | 376 | the current date is >= fixby value. | ||
803 | 377 | @param removeby: string: A date string in the format of YYYY-MM-DD | ||
804 | 378 | or (YYYY,MM,DD). Raises RuntimeError with testcase results | ||
805 | 379 | if current date is >= removeby value. | ||
806 | 380 | Default value is 3 weeks past fixby value. | ||
807 | 381 | @param skips: list of test cases (string method names) to be skipped. | ||
808 | 382 | If None, all class testcases will be skipped per evaluation of | ||
809 | 383 | fixby and removeby params. This is ignored when decorating a method. | ||
810 | 384 | Example skips=["test_test1", "test_test2"] | ||
811 | 385 | @param install: boolean: When True, setUpClass raises skipTest | ||
812 | 386 | exception while "today" < "fixby" date. Useful for handling | ||
813 | 387 | testcases where the install or boot would hang. | ||
814 | 388 | install parameter is ignored when decorating a method.""" | ||
815 | 389 | def as_dtdate(date): | ||
816 | 390 | if not isinstance(date, str): | ||
817 | 391 | return date | ||
818 | 392 | return datetime.date(*map(int, date.split("-"))) | ||
819 | 393 | |||
820 | 394 | def as_str(dtdate): | ||
821 | 395 | return "%s-%02d-%02d" % (dtdate.year, dtdate.month, dtdate.day) | ||
822 | 396 | |||
823 | 397 | d_today = datetime.date.today() | ||
824 | 398 | d_fixby = as_dtdate(fixby) | ||
825 | 399 | if removeby is None: | ||
826 | 400 | # give 3 weeks by default. | ||
827 | 401 | d_removeby = d_fixby + datetime.timedelta(21) | ||
828 | 402 | else: | ||
829 | 403 | d_removeby = as_dtdate(removeby) | ||
830 | 404 | |||
831 | 405 | envname = 'CURTIN_VMTEST_SKIP_BY_DATE_BUGS' | ||
832 | 406 | envval = os.environ.get(envname, "") | ||
833 | 407 | skip_bugs = envval.replace(",", " ").split() | ||
834 | 408 | _setUpClass = "setUpClass" | ||
835 | 409 | |||
836 | 410 | def decorator(test): | ||
837 | 411 | def decorate_callable(mycallable, classname=test.__name__): | ||
838 | 412 | funcname = mycallable.__name__ | ||
839 | 413 | name = '.'.join((classname, funcname)) | ||
840 | 414 | bmsg = ("skip_by_date({name}) LP: #{bug} " | ||
841 | 415 | "fixby={fixby} removeby={removeby}: ".format( | ||
842 | 416 | name=name, bug=bugnum, | ||
843 | 417 | fixby=as_str(d_fixby), removeby=as_str(d_removeby))) | ||
844 | 418 | |||
845 | 419 | @wraps(mycallable) | ||
846 | 420 | def wrapper(*args, **kwargs): | ||
847 | 421 | skip_reason = None | ||
848 | 422 | if "*" in skip_bugs or bugnum in skip_bugs: | ||
849 | 423 | skip_reason = "skip per %s=%s" % (envname, envval) | ||
850 | 424 | elif (funcname == _setUpClass and | ||
851 | 425 | (not install and d_today < d_fixby)): | ||
852 | 426 | skip_reason = "skip per install=%s" % install | ||
853 | 427 | |||
854 | 428 | if skip_reason: | ||
855 | 429 | logger.info(bmsg + skip_reason) | ||
856 | 430 | raise SkipTest(bmsg + skip_reason) | ||
857 | 431 | |||
858 | 432 | if d_today < d_fixby: | ||
859 | 433 | tmsg = "NOT_YET_FIXBY" | ||
860 | 434 | elif d_today > d_removeby: | ||
861 | 435 | tmsg = "REMOVE_WORKAROUND" | ||
862 | 436 | else: | ||
863 | 437 | tmsg = "PAST_FIXBY" | ||
864 | 438 | |||
865 | 439 | if funcname == _setUpClass: | ||
866 | 440 | logger.info(bmsg + "Running test (%s)", tmsg) | ||
867 | 441 | |||
868 | 442 | exc = None | ||
869 | 443 | try: | ||
870 | 444 | mycallable(*args, **kwargs) | ||
871 | 445 | except SkipTest: | ||
872 | 446 | raise | ||
873 | 447 | except Exception as e: | ||
874 | 448 | exc = e | ||
875 | 449 | |||
876 | 450 | if exc is None: | ||
877 | 451 | result = "Passed." | ||
878 | 452 | elif isinstance(exc, SkipTest): | ||
879 | 453 | result = "Skipped: %s" % exc | ||
880 | 454 | else: | ||
881 | 455 | result = "Failed: %s" % exc | ||
882 | 456 | |||
883 | 457 | msg = (bmsg + "(%s)" % tmsg + " " + result) | ||
884 | 458 | |||
885 | 459 | logger.info(msg) | ||
886 | 460 | if d_today < d_fixby: | ||
887 | 461 | if funcname != _setUpClass: | ||
888 | 462 | raise SkipTest(msg) | ||
889 | 463 | else: | ||
890 | 464 | # Expected fixed. | ||
891 | 465 | if d_today > d_removeby: | ||
892 | 466 | raise RuntimeError(msg) | ||
893 | 467 | elif exc: | ||
894 | 468 | raise RuntimeError(msg) | ||
895 | 469 | |||
896 | 470 | return wrapper | ||
897 | 471 | |||
898 | 472 | def decorate_test_methods(klass): | ||
899 | 473 | for attr in dir(klass): | ||
900 | 474 | attr_value = getattr(klass, attr) | ||
901 | 475 | if not hasattr(attr_value, "__call__"): | ||
902 | 476 | continue | ||
903 | 477 | |||
904 | 478 | if attr != _setUpClass: | ||
905 | 479 | if not attr.startswith('test_'): | ||
906 | 480 | continue | ||
907 | 481 | elif not (skips is None or attr in skips): | ||
908 | 482 | continue | ||
909 | 483 | |||
910 | 484 | setattr(klass, attr, | ||
911 | 485 | decorate_callable(attr_value, | ||
912 | 486 | classname=klass.__name__)) | ||
913 | 487 | return klass | ||
914 | 488 | |||
915 | 489 | if isinstance(test, (type,)): | ||
916 | 490 | return decorate_test_methods(klass=test) | ||
917 | 491 | return decorate_callable(test) | ||
918 | 492 | |||
919 | 493 | return decorator | ||
920 | 494 | |||
921 | 495 | |||
922 | 367 | class VMBaseClass(TestCase): | 496 | class VMBaseClass(TestCase): |
923 | 368 | __test__ = False | 497 | __test__ = False |
924 | 369 | expected_failure = False | 498 | expected_failure = False |
925 | @@ -450,8 +579,8 @@ class VMBaseClass(TestCase): | |||
926 | 450 | else: | 579 | else: |
927 | 451 | target_img_verstr, target_ftypes = get_images( | 580 | target_img_verstr, target_ftypes = get_images( |
928 | 452 | IMAGE_SRC_URL, IMAGE_DIR, | 581 | IMAGE_SRC_URL, IMAGE_DIR, |
931 | 453 | cls.target_distro if cls.target_distro else cls.distro, | 582 | cls.target_distro, |
932 | 454 | cls.target_release if cls.target_release else cls.release, | 583 | cls.target_release, |
933 | 455 | cls.arch, subarch=cls.subarch if cls.subarch else None, | 584 | cls.arch, subarch=cls.subarch if cls.subarch else None, |
934 | 456 | kflavor=cls.kflavor if cls.kflavor else None, | 585 | kflavor=cls.kflavor if cls.kflavor else None, |
935 | 457 | krel=cls.target_krel, sync=CURTIN_VMTEST_IMAGE_SYNC, | 586 | krel=cls.target_krel, sync=CURTIN_VMTEST_IMAGE_SYNC, |
936 | @@ -566,61 +695,6 @@ class VMBaseClass(TestCase): | |||
937 | 566 | return disks | 695 | return disks |
938 | 567 | 696 | ||
939 | 568 | @classmethod | 697 | @classmethod |
940 | 569 | def skip_by_date(cls, bugnum, fixby, removeby=None, | ||
941 | 570 | release=None, name=None): | ||
942 | 571 | """Raise SkipTest with bug message until 'fixby'. | ||
943 | 572 | Raise RutimeError after removeby. | ||
944 | 573 | fixby and removeby support string (2018-01-01) or tuple(2018,01,01) | ||
945 | 574 | removeby defaults to 3 weeks after fixby. | ||
946 | 575 | """ | ||
947 | 576 | def as_dtdate(date): | ||
948 | 577 | if not isinstance(date, str): | ||
949 | 578 | return date | ||
950 | 579 | return datetime.date(*map(int, date.split("-"))) | ||
951 | 580 | |||
952 | 581 | def as_str(dtdate): | ||
953 | 582 | return "%s-%02d-%02d" % (dtdate.year, dtdate.month, dtdate.day) | ||
954 | 583 | |||
955 | 584 | if name is None: | ||
956 | 585 | name = cls.__name__ | ||
957 | 586 | |||
958 | 587 | if release is None: | ||
959 | 588 | release = cls.release | ||
960 | 589 | |||
961 | 590 | d_today = datetime.date.today() | ||
962 | 591 | d_fixby = as_dtdate(fixby) | ||
963 | 592 | if removeby is None: | ||
964 | 593 | # give 3 weeks by default. | ||
965 | 594 | d_removeby = d_fixby + datetime.timedelta(21) | ||
966 | 595 | else: | ||
967 | 596 | d_removeby = as_dtdate(removeby) | ||
968 | 597 | |||
969 | 598 | bmsg = ("[{name}/{rel}] skip_by_date LP: #{bug} " | ||
970 | 599 | "fixby={fixby} removeby={removeby}: ".format( | ||
971 | 600 | name=name, rel=release, bug=bugnum, | ||
972 | 601 | fixby=as_str(d_fixby), removeby=as_str(d_removeby))) | ||
973 | 602 | |||
974 | 603 | envname = 'CURTIN_VMTEST_SKIP_BY_DATE_BUGS' | ||
975 | 604 | envval = os.environ.get(envname, "") | ||
976 | 605 | skip_bugs = envval.replace(",", " ").split() | ||
977 | 606 | |||
978 | 607 | result = None | ||
979 | 608 | msg = bmsg + "Not skipping." | ||
980 | 609 | if "*" in skip_bugs or bugnum in skip_bugs: | ||
981 | 610 | msg = bmsg + "skip per %s=%s" % (envname, envval) | ||
982 | 611 | result = SkipTest | ||
983 | 612 | elif d_today < d_fixby: | ||
984 | 613 | msg = bmsg + "skip (today < fixby)" | ||
985 | 614 | result = SkipTest | ||
986 | 615 | elif d_today > d_removeby: | ||
987 | 616 | msg = bmsg + "Remove workaround." | ||
988 | 617 | result = RuntimeError | ||
989 | 618 | |||
990 | 619 | logger.info(msg) | ||
991 | 620 | if result: | ||
992 | 621 | raise result(msg) | ||
993 | 622 | |||
994 | 623 | @classmethod | ||
995 | 624 | def get_config_smp(cls): | 698 | def get_config_smp(cls): |
996 | 625 | """Get number of cpus to use for guest""" | 699 | """Get number of cpus to use for guest""" |
997 | 626 | 700 | ||
998 | @@ -670,6 +744,12 @@ class VMBaseClass(TestCase): | |||
999 | 670 | return {'kernel': {'fallback-package': package}} | 744 | return {'kernel': {'fallback-package': package}} |
1000 | 671 | 745 | ||
1001 | 672 | @classmethod | 746 | @classmethod |
1002 | 747 | def skip_by_date(cls, *args, **kwargs): | ||
1003 | 748 | """skip_by_date wrapper. this way other modules do not have | ||
1004 | 749 | to add an import of skip_by_date to start skipping.""" | ||
1005 | 750 | return skip_by_date(*args, **kwargs) | ||
1006 | 751 | |||
1007 | 752 | @classmethod | ||
1008 | 673 | def setUpClass(cls): | 753 | def setUpClass(cls): |
1009 | 674 | # initialize global logger with class name to help make sense of | 754 | # initialize global logger with class name to help make sense of |
1010 | 675 | # parallel vmtest runs which intermingle output. | 755 | # parallel vmtest runs which intermingle output. |
1011 | @@ -677,6 +757,13 @@ class VMBaseClass(TestCase): | |||
1012 | 677 | logger = _initialize_logging(name=cls.__name__) | 757 | logger = _initialize_logging(name=cls.__name__) |
1013 | 678 | cls.logger = logger | 758 | cls.logger = logger |
1014 | 679 | 759 | ||
1015 | 760 | req_attrs = ('target_distro', 'target_release', 'release', 'distro') | ||
1016 | 761 | missing = [a for a in req_attrs if not getattr(cls, a)] | ||
1017 | 762 | if missing: | ||
1018 | 763 | raise ValueError( | ||
1019 | 764 | "Class %s does not have required attrs set: %s" % | ||
1020 | 765 | (cls.__name__, missing)) | ||
1021 | 766 | |||
1022 | 680 | if is_unsupported_ubuntu(cls.release): | 767 | if is_unsupported_ubuntu(cls.release): |
1023 | 681 | raise SkipTest('"%s" is unsupported release.' % cls.release) | 768 | raise SkipTest('"%s" is unsupported release.' % cls.release) |
1024 | 682 | 769 | ||
1025 | @@ -687,7 +774,14 @@ class VMBaseClass(TestCase): | |||
1026 | 687 | raise SkipTest(reason) | 774 | raise SkipTest(reason) |
1027 | 688 | 775 | ||
1028 | 689 | setup_start = time.time() | 776 | setup_start = time.time() |
1030 | 690 | logger.info('Starting setup for testclass: {}'.format(cls.__name__)) | 777 | logger.info( |
1031 | 778 | ('Starting setup for testclass: {__name__} ' | ||
1032 | 779 | '({distro}/{release} -> ' | ||
1033 | 780 | '{target_distro}/{target_release})').format( | ||
1034 | 781 | **{k: getattr(cls, k) | ||
1035 | 782 | for k in ('__name__', 'distro', 'release', | ||
1036 | 783 | 'target_distro', 'target_release')})) | ||
1037 | 784 | |||
1038 | 691 | # set up tempdir | 785 | # set up tempdir |
1039 | 692 | cls.td = TempDir( | 786 | cls.td = TempDir( |
1040 | 693 | name=cls.__name__, | 787 | name=cls.__name__, |
1041 | @@ -823,7 +917,7 @@ class VMBaseClass(TestCase): | |||
1042 | 823 | disks.extend(cls.build_iscsi_disks()) | 917 | disks.extend(cls.build_iscsi_disks()) |
1043 | 824 | 918 | ||
1044 | 825 | # proxy config | 919 | # proxy config |
1046 | 826 | configs = [cls.conf_file] | 920 | configs = [cls.conf_file, 'examples/tests/vmtest_pollinate.yaml'] |
1047 | 827 | cls.proxy = get_apt_proxy() | 921 | cls.proxy = get_apt_proxy() |
1048 | 828 | if cls.proxy is not None and not cls.td.restored: | 922 | if cls.proxy is not None and not cls.td.restored: |
1049 | 829 | proxy_config = os.path.join(cls.td.install, 'proxy.cfg') | 923 | proxy_config = os.path.join(cls.td.install, 'proxy.cfg') |
1050 | @@ -864,14 +958,19 @@ class VMBaseClass(TestCase): | |||
1051 | 864 | system_upgrade = SYSTEM_UPGRADE | 958 | system_upgrade = SYSTEM_UPGRADE |
1052 | 865 | upgrade_packages = UPGRADE_PACKAGES | 959 | upgrade_packages = UPGRADE_PACKAGES |
1053 | 866 | if add_repos: | 960 | if add_repos: |
1062 | 867 | # enable if user has set a value here | 961 | cfg_repos = generate_repo_config(add_repos.split(","), |
1063 | 868 | if system_upgrade == "auto": | 962 | release=cls.target_release) |
1064 | 869 | system_upgrade = True | 963 | if cfg_repos: |
1065 | 870 | logger.info('Adding apt repositories: %s', add_repos) | 964 | logger.info('Adding apt repositories: %s', add_repos) |
1066 | 871 | repo_cfg = os.path.join(cls.td.install, 'add_repos.cfg') | 965 | # enable if user has set a value here |
1067 | 872 | util.write_file(repo_cfg, | 966 | if system_upgrade == "auto": |
1068 | 873 | generate_repo_config(add_repos.split(","))) | 967 | system_upgrade = True |
1069 | 874 | configs.append(repo_cfg) | 968 | repo_cfg = os.path.join(cls.td.install, 'add_repos.cfg') |
1070 | 969 | util.write_file(repo_cfg, cfg_repos) | ||
1071 | 970 | configs.append(repo_cfg) | ||
1072 | 971 | else: | ||
1073 | 972 | logger.info("add_repos=%s processed to empty config.", | ||
1074 | 973 | add_repos) | ||
1075 | 875 | elif system_upgrade == "auto": | 974 | elif system_upgrade == "auto": |
1076 | 876 | system_upgrade = False | 975 | system_upgrade = False |
1077 | 877 | 976 | ||
1078 | @@ -1146,7 +1245,7 @@ class VMBaseClass(TestCase): | |||
1079 | 1146 | """Return install uri and a list of files needed to be published.""" | 1245 | """Return install uri and a list of files needed to be published.""" |
1080 | 1147 | # if release (install environment) is the same as target | 1246 | # if release (install environment) is the same as target |
1081 | 1148 | # target (thing to install) then install via cp:// | 1247 | # target (thing to install) then install via cp:// |
1083 | 1149 | if cls.target_release in (None, cls.release): | 1248 | if cls.target_release == cls.release: |
1084 | 1150 | install_src = "cp:///media/root-ro" | 1249 | install_src = "cp:///media/root-ro" |
1085 | 1151 | return install_src, [] | 1250 | return install_src, [] |
1086 | 1152 | 1251 | ||
1087 | @@ -1339,7 +1438,7 @@ class VMBaseClass(TestCase): | |||
1088 | 1339 | 1438 | ||
1089 | 1340 | @skip_if_flag('expected_failure') | 1439 | @skip_if_flag('expected_failure') |
1090 | 1341 | def test_dname(self, disk_to_check=None): | 1440 | def test_dname(self, disk_to_check=None): |
1092 | 1342 | if "trusty" in [self.release, self.target_release]: | 1441 | if self.target_release == "trusty": |
1093 | 1343 | raise SkipTest( | 1442 | raise SkipTest( |
1094 | 1344 | "(LP: #1523037): dname does not work on trusty kernels") | 1443 | "(LP: #1523037): dname does not work on trusty kernels") |
1095 | 1345 | 1444 | ||
1096 | @@ -1393,7 +1492,7 @@ class VMBaseClass(TestCase): | |||
1097 | 1393 | def test_installed_correct_kernel_package(self): | 1492 | def test_installed_correct_kernel_package(self): |
1098 | 1394 | """ Test curtin installs the correct kernel package. """ | 1493 | """ Test curtin installs the correct kernel package. """ |
1099 | 1395 | # target_distro is set for non-ubuntu targets | 1494 | # target_distro is set for non-ubuntu targets |
1101 | 1396 | if self.target_distro is not None: | 1495 | if self.target_distro != "ubuntu": |
1102 | 1397 | raise SkipTest("Can't check non-ubuntu kernel packages") | 1496 | raise SkipTest("Can't check non-ubuntu kernel packages") |
1103 | 1398 | 1497 | ||
1104 | 1399 | kpackage = self.get_kernel_package() | 1498 | kpackage = self.get_kernel_package() |
1105 | @@ -1849,7 +1948,25 @@ def is_unsupported_ubuntu(release): | |||
1106 | 1849 | return release in _UNSUPPORTED_UBUNTU | 1948 | return release in _UNSUPPORTED_UBUNTU |
1107 | 1850 | 1949 | ||
1108 | 1851 | 1950 | ||
1110 | 1852 | def generate_repo_config(repos): | 1951 | def is_devel_release(release): |
1111 | 1952 | global _DEVEL_UBUNTU | ||
1112 | 1953 | if _DEVEL_UBUNTU is None: | ||
1113 | 1954 | udi = 'ubuntu-distro-info' | ||
1114 | 1955 | env = os.environ.get('_DEVEL_UBUNTU') | ||
1115 | 1956 | if env: | ||
1116 | 1957 | # allow it to be , or " " separated. | ||
1117 | 1958 | _DEVEL_UBUNTU = env.replace(",", " ").split() | ||
1118 | 1959 | elif util.which(udi): | ||
1119 | 1960 | _DEVEL_UBUNTU = util.subp( | ||
1120 | 1961 | [udi, '--devel'], capture=True)[0].splitlines() | ||
1121 | 1962 | else: | ||
1122 | 1963 | # no way to tell. | ||
1123 | 1964 | _DEVEL_UBUNTU = [] | ||
1124 | 1965 | |||
1125 | 1966 | return release in _DEVEL_UBUNTU | ||
1126 | 1967 | |||
1127 | 1968 | |||
1128 | 1969 | def generate_repo_config(repos, release=None): | ||
1129 | 1853 | """Generate apt yaml configuration to add specified repositories. | 1970 | """Generate apt yaml configuration to add specified repositories. |
1130 | 1854 | 1971 | ||
1131 | 1855 | @param repos: A list of add-apt-repository strings. | 1972 | @param repos: A list of add-apt-repository strings. |
1132 | @@ -1857,8 +1974,19 @@ def generate_repo_config(repos): | |||
1133 | 1857 | pocket of a particular release. | 1974 | pocket of a particular release. |
1134 | 1858 | @returns: string: A yaml string | 1975 | @returns: string: A yaml string |
1135 | 1859 | """ | 1976 | """ |
1138 | 1860 | sources = {"add_repos_%02d" % idx: {'source': v} | 1977 | sources = {} |
1139 | 1861 | for idx, v in enumerate(repos)} | 1978 | for idx, v in enumerate(repos): |
1140 | 1979 | if v == 'proposed' and is_devel_release(release): | ||
1141 | 1980 | # lower case 'proposed' is magically handled by apt repo | ||
1142 | 1981 | # processing. But dev release's -proposed is "known broken". | ||
1143 | 1982 | # if you want to test development release, then use 'PROPOSED'. | ||
1144 | 1983 | continue | ||
1145 | 1984 | if v == 'PROPOSED': | ||
1146 | 1985 | v = 'proposed' | ||
1147 | 1986 | sources['add_repos_%02d' % idx] = {'source': v} | ||
1148 | 1987 | if not sources: | ||
1149 | 1988 | return None | ||
1150 | 1989 | |||
1151 | 1862 | return yaml.dump({'apt': {'sources': sources}}) | 1990 | return yaml.dump({'apt': {'sources': sources}}) |
1152 | 1863 | 1991 | ||
1153 | 1864 | 1992 | ||
1154 | diff --git a/tests/vmtests/releases.py b/tests/vmtests/releases.py | |||
1155 | index 18a5e75..02cbfe5 100644 | |||
1156 | --- a/tests/vmtests/releases.py | |||
1157 | +++ b/tests/vmtests/releases.py | |||
1158 | @@ -11,6 +11,7 @@ class _ReleaseBase(object): | |||
1159 | 11 | class _UbuntuBase(_ReleaseBase): | 11 | class _UbuntuBase(_ReleaseBase): |
1160 | 12 | distro = "ubuntu" | 12 | distro = "ubuntu" |
1161 | 13 | kflavor = "generic" | 13 | kflavor = "generic" |
1162 | 14 | target_distro = "ubuntu" | ||
1163 | 14 | 15 | ||
1164 | 15 | 16 | ||
1165 | 16 | class _CentosFromUbuntuBase(_UbuntuBase): | 17 | class _CentosFromUbuntuBase(_UbuntuBase): |
1166 | @@ -39,6 +40,7 @@ class _UbuntuCore16FromXenialBase(_UbuntuCoreUbuntuBase): | |||
1167 | 39 | release = "xenial" | 40 | release = "xenial" |
1168 | 40 | # release for target | 41 | # release for target |
1169 | 41 | target_release = "ubuntu-core-16" | 42 | target_release = "ubuntu-core-16" |
1170 | 43 | target_distro = "ubuntu-core" | ||
1171 | 42 | 44 | ||
1172 | 43 | 45 | ||
1173 | 44 | class _Centos66FromXenialBase(_CentosFromUbuntuBase): | 46 | class _Centos66FromXenialBase(_CentosFromUbuntuBase): |
1174 | @@ -59,59 +61,56 @@ class _PreciseHWET(_PreciseBase): | |||
1175 | 59 | 61 | ||
1176 | 60 | class _TrustyBase(_UbuntuBase): | 62 | class _TrustyBase(_UbuntuBase): |
1177 | 61 | release = "trusty" | 63 | release = "trusty" |
1178 | 64 | target_release = "trusty" | ||
1179 | 62 | 65 | ||
1180 | 63 | 66 | ||
1183 | 64 | class _TrustyHWEU(_UbuntuBase): | 67 | class _TrustyHWEU(_TrustyBase): |
1182 | 65 | release = "trusty" | ||
1184 | 66 | krel = "utopic" | 68 | krel = "utopic" |
1185 | 67 | 69 | ||
1186 | 68 | 70 | ||
1189 | 69 | class _TrustyHWEV(_UbuntuBase): | 71 | class _TrustyHWEV(_TrustyBase): |
1188 | 70 | release = "trusty" | ||
1190 | 71 | krel = "vivid" | 72 | krel = "vivid" |
1191 | 72 | 73 | ||
1192 | 73 | 74 | ||
1195 | 74 | class _TrustyHWEW(_UbuntuBase): | 75 | class _TrustyHWEW(_TrustyBase): |
1194 | 75 | release = "trusty" | ||
1196 | 76 | krel = "wily" | 76 | krel = "wily" |
1197 | 77 | 77 | ||
1198 | 78 | 78 | ||
1201 | 79 | class _TrustyHWEX(_UbuntuBase): | 79 | class _TrustyHWEX(_TrustyBase): |
1200 | 80 | release = "trusty" | ||
1202 | 81 | krel = "xenial" | 80 | krel = "xenial" |
1203 | 82 | 81 | ||
1204 | 83 | 82 | ||
1206 | 84 | class _TrustyFromXenial(_UbuntuBase): | 83 | class _TrustyFromXenial(_TrustyBase): |
1207 | 85 | release = "xenial" | 84 | release = "xenial" |
1208 | 86 | target_release = "trusty" | 85 | target_release = "trusty" |
1209 | 87 | 86 | ||
1210 | 88 | 87 | ||
1211 | 89 | class _XenialBase(_UbuntuBase): | 88 | class _XenialBase(_UbuntuBase): |
1212 | 90 | release = "xenial" | 89 | release = "xenial" |
1213 | 90 | target_release = "xenial" | ||
1214 | 91 | subarch = "ga-16.04" | 91 | subarch = "ga-16.04" |
1215 | 92 | 92 | ||
1216 | 93 | 93 | ||
1219 | 94 | class _XenialGA(_UbuntuBase): | 94 | class _XenialGA(_XenialBase): |
1218 | 95 | release = "xenial" | ||
1220 | 96 | subarch = "ga-16.04" | 95 | subarch = "ga-16.04" |
1221 | 97 | 96 | ||
1222 | 98 | 97 | ||
1225 | 99 | class _XenialHWE(_UbuntuBase): | 98 | class _XenialHWE(_XenialBase): |
1224 | 100 | release = "xenial" | ||
1226 | 101 | subarch = "hwe-16.04" | 99 | subarch = "hwe-16.04" |
1227 | 102 | 100 | ||
1228 | 103 | 101 | ||
1231 | 104 | class _XenialEdge(_UbuntuBase): | 102 | class _XenialEdge(_XenialBase): |
1230 | 105 | release = "xenial" | ||
1232 | 106 | subarch = "hwe-16.04-edge" | 103 | subarch = "hwe-16.04-edge" |
1233 | 107 | 104 | ||
1234 | 108 | 105 | ||
1235 | 109 | class _ArtfulBase(_UbuntuBase): | ||
1236 | 110 | release = "artful" | ||
1237 | 111 | |||
1238 | 112 | |||
1239 | 113 | class _BionicBase(_UbuntuBase): | 106 | class _BionicBase(_UbuntuBase): |
1240 | 114 | release = "bionic" | 107 | release = "bionic" |
1241 | 108 | target_release = "bionic" | ||
1242 | 109 | |||
1243 | 110 | |||
1244 | 111 | class _CosmicBase(_UbuntuBase): | ||
1245 | 112 | release = "cosmic" | ||
1246 | 113 | target_release = "cosmic" | ||
1247 | 115 | 114 | ||
1248 | 116 | 115 | ||
1249 | 117 | class _Releases(object): | 116 | class _Releases(object): |
1250 | @@ -127,8 +126,8 @@ class _Releases(object): | |||
1251 | 127 | xenial_ga = _XenialGA | 126 | xenial_ga = _XenialGA |
1252 | 128 | xenial_hwe = _XenialHWE | 127 | xenial_hwe = _XenialHWE |
1253 | 129 | xenial_edge = _XenialEdge | 128 | xenial_edge = _XenialEdge |
1254 | 130 | artful = _ArtfulBase | ||
1255 | 131 | bionic = _BionicBase | 129 | bionic = _BionicBase |
1256 | 130 | cosmic = _CosmicBase | ||
1257 | 132 | 131 | ||
1258 | 133 | 132 | ||
1259 | 134 | class _CentosReleases(object): | 133 | class _CentosReleases(object): |
1260 | diff --git a/tests/vmtests/test_apt_config_cmd.py b/tests/vmtests/test_apt_config_cmd.py | |||
1261 | index 2c135c4..efd04f3 100644 | |||
1262 | --- a/tests/vmtests/test_apt_config_cmd.py | |||
1263 | +++ b/tests/vmtests/test_apt_config_cmd.py | |||
1264 | @@ -57,11 +57,11 @@ class XenialTestAptConfigCMDCMD(relbase.xenial, TestAptConfigCMD): | |||
1265 | 57 | __test__ = True | 57 | __test__ = True |
1266 | 58 | 58 | ||
1267 | 59 | 59 | ||
1269 | 60 | class ArtfulTestAptConfigCMDCMD(relbase.artful, TestAptConfigCMD): | 60 | class BionicTestAptConfigCMDCMD(relbase.bionic, TestAptConfigCMD): |
1270 | 61 | __test__ = True | 61 | __test__ = True |
1271 | 62 | 62 | ||
1272 | 63 | 63 | ||
1274 | 64 | class BionicTestAptConfigCMDCMD(relbase.bionic, TestAptConfigCMD): | 64 | class CosmicTestAptConfigCMDCMD(relbase.cosmic, TestAptConfigCMD): |
1275 | 65 | __test__ = True | 65 | __test__ = True |
1276 | 66 | 66 | ||
1277 | 67 | # vi: ts=4 expandtab syntax=python | 67 | # vi: ts=4 expandtab syntax=python |
1278 | diff --git a/tests/vmtests/test_basic.py b/tests/vmtests/test_basic.py | |||
1279 | index 2e47cb6..01ffc89 100644 | |||
1280 | --- a/tests/vmtests/test_basic.py | |||
1281 | +++ b/tests/vmtests/test_basic.py | |||
1282 | @@ -23,8 +23,13 @@ class TestBasicAbs(VMBaseClass): | |||
1283 | 23 | blkid -o export /dev/vda > blkid_output_vda | 23 | blkid -o export /dev/vda > blkid_output_vda |
1284 | 24 | blkid -o export /dev/vda1 > blkid_output_vda1 | 24 | blkid -o export /dev/vda1 > blkid_output_vda1 |
1285 | 25 | blkid -o export /dev/vda2 > blkid_output_vda2 | 25 | blkid -o export /dev/vda2 > blkid_output_vda2 |
1288 | 26 | f="btrfs_uuid_vdd" | 26 | dev="/dev/vdd"; f="btrfs_uuid_${dev#/dev/*}"; |
1289 | 27 | btrfs-debug-tree -r /dev/vdd | awk '/^uuid/ {print $2}' | grep "-" > $f | 27 | if command -v btrfs-debug-tree >/dev/null; then |
1290 | 28 | btrfs-debug-tree -r $dev | awk '/^uuid/ {print $2}' | grep "-" | ||
1291 | 29 | else | ||
1292 | 30 | btrfs inspect-internal dump-super $dev | | ||
1293 | 31 | awk '/^dev_item.fsid/ {print $2}' | ||
1294 | 32 | fi > $f | ||
1295 | 28 | cat /proc/partitions > proc_partitions | 33 | cat /proc/partitions > proc_partitions |
1296 | 29 | ls -al /dev/disk/by-uuid/ > ls_uuid | 34 | ls -al /dev/disk/by-uuid/ > ls_uuid |
1297 | 30 | cat /etc/fstab > fstab | 35 | cat /etc/fstab > fstab |
1298 | @@ -60,7 +65,7 @@ class TestBasicAbs(VMBaseClass): | |||
1299 | 60 | "root/curtin-install.log", "root/curtin-install-cfg.yaml"]) | 65 | "root/curtin-install.log", "root/curtin-install-cfg.yaml"]) |
1300 | 61 | 66 | ||
1301 | 62 | def test_ptable(self, disk_to_check=None): | 67 | def test_ptable(self, disk_to_check=None): |
1303 | 63 | if "trusty" in [self.release, self.target_release]: | 68 | if self.target_release == "trusty": |
1304 | 64 | raise SkipTest("No PTTYPE blkid output on trusty") | 69 | raise SkipTest("No PTTYPE blkid output on trusty") |
1305 | 65 | 70 | ||
1306 | 66 | blkid_info = self.get_blkid_data("blkid_output_vda") | 71 | blkid_info = self.get_blkid_data("blkid_output_vda") |
1307 | @@ -169,11 +174,11 @@ class XenialEdgeTestBasic(relbase.xenial_edge, TestBasicAbs): | |||
1308 | 169 | __test__ = True | 174 | __test__ = True |
1309 | 170 | 175 | ||
1310 | 171 | 176 | ||
1312 | 172 | class ArtfulTestBasic(relbase.artful, TestBasicAbs): | 177 | class BionicTestBasic(relbase.bionic, TestBasicAbs): |
1313 | 173 | __test__ = True | 178 | __test__ = True |
1314 | 174 | 179 | ||
1315 | 175 | 180 | ||
1317 | 176 | class BionicTestBasic(relbase.bionic, TestBasicAbs): | 181 | class CosmicTestBasic(relbase.cosmic, TestBasicAbs): |
1318 | 177 | __test__ = True | 182 | __test__ = True |
1319 | 178 | 183 | ||
1320 | 179 | 184 | ||
1321 | @@ -187,8 +192,13 @@ class TestBasicScsiAbs(TestBasicAbs): | |||
1322 | 187 | blkid -o export /dev/sda > blkid_output_sda | 192 | blkid -o export /dev/sda > blkid_output_sda |
1323 | 188 | blkid -o export /dev/sda1 > blkid_output_sda1 | 193 | blkid -o export /dev/sda1 > blkid_output_sda1 |
1324 | 189 | blkid -o export /dev/sda2 > blkid_output_sda2 | 194 | blkid -o export /dev/sda2 > blkid_output_sda2 |
1327 | 190 | f="btrfs_uuid_sdc" | 195 | dev="/dev/sdc"; f="btrfs_uuid_${dev#/dev/*}"; |
1328 | 191 | btrfs-debug-tree -r /dev/sdc | awk '/^uuid/ {print $2}' | grep "-" > $f | 196 | if command -v btrfs-debug-tree >/dev/null; then |
1329 | 197 | btrfs-debug-tree -r $dev | awk '/^uuid/ {print $2}' | grep "-" | ||
1330 | 198 | else | ||
1331 | 199 | btrfs inspect-internal dump-super $dev | | ||
1332 | 200 | awk '/^dev_item.fsid/ {print $2}' | ||
1333 | 201 | fi > $f | ||
1334 | 192 | cat /proc/partitions > proc_partitions | 202 | cat /proc/partitions > proc_partitions |
1335 | 193 | ls -al /dev/disk/by-uuid/ > ls_uuid | 203 | ls -al /dev/disk/by-uuid/ > ls_uuid |
1336 | 194 | ls -al /dev/disk/by-id/ > ls_disk_id | 204 | ls -al /dev/disk/by-id/ > ls_disk_id |
1337 | @@ -210,7 +220,7 @@ class TestBasicScsiAbs(TestBasicAbs): | |||
1338 | 210 | "ls_disk_id", "proc_partitions"]) | 220 | "ls_disk_id", "proc_partitions"]) |
1339 | 211 | 221 | ||
1340 | 212 | def test_ptable(self): | 222 | def test_ptable(self): |
1342 | 213 | if "trusty" in [self.release, self.target_release]: | 223 | if self.target_release == "trusty": |
1343 | 214 | raise SkipTest("No PTTYPE blkid output on trusty") | 224 | raise SkipTest("No PTTYPE blkid output on trusty") |
1344 | 215 | 225 | ||
1345 | 216 | blkid_info = self.get_blkid_data("blkid_output_sda") | 226 | blkid_info = self.get_blkid_data("blkid_output_sda") |
1346 | @@ -289,11 +299,11 @@ class XenialEdgeTestScsiBasic(relbase.xenial_edge, TestBasicScsiAbs): | |||
1347 | 289 | __test__ = True | 299 | __test__ = True |
1348 | 290 | 300 | ||
1349 | 291 | 301 | ||
1351 | 292 | class ArtfulTestScsiBasic(relbase.artful, TestBasicScsiAbs): | 302 | class BionicTestScsiBasic(relbase.bionic, TestBasicScsiAbs): |
1352 | 293 | __test__ = True | 303 | __test__ = True |
1353 | 294 | 304 | ||
1354 | 295 | 305 | ||
1356 | 296 | class BionicTestScsiBasic(relbase.bionic, TestBasicScsiAbs): | 306 | class CosmicTestScsiBasic(relbase.cosmic, TestBasicScsiAbs): |
1357 | 297 | __test__ = True | 307 | __test__ = True |
1358 | 298 | 308 | ||
1359 | 299 | # vi: ts=4 expandtab syntax=python | 309 | # vi: ts=4 expandtab syntax=python |
1360 | diff --git a/tests/vmtests/test_bcache_basic.py b/tests/vmtests/test_bcache_basic.py | |||
1361 | index 1844bc6..4989c8e 100644 | |||
1362 | --- a/tests/vmtests/test_bcache_basic.py | |||
1363 | +++ b/tests/vmtests/test_bcache_basic.py | |||
1364 | @@ -65,11 +65,11 @@ class XenialEdgeBcacheBasic(relbase.xenial_edge, TestBcacheBasic): | |||
1365 | 65 | __test__ = True | 65 | __test__ = True |
1366 | 66 | 66 | ||
1367 | 67 | 67 | ||
1369 | 68 | class ArtfulBcacheBasic(relbase.artful, TestBcacheBasic): | 68 | class BionicBcacheBasic(relbase.bionic, TestBcacheBasic): |
1370 | 69 | __test__ = True | 69 | __test__ = True |
1371 | 70 | 70 | ||
1372 | 71 | 71 | ||
1374 | 72 | class BionicBcacheBasic(relbase.bionic, TestBcacheBasic): | 72 | class CosmicBcacheBasic(relbase.cosmic, TestBcacheBasic): |
1375 | 73 | __test__ = True | 73 | __test__ = True |
1376 | 74 | 74 | ||
1377 | 75 | # vi: ts=4 expandtab syntax=python | 75 | # vi: ts=4 expandtab syntax=python |
1378 | diff --git a/tests/vmtests/test_bcache_bug1718699.py b/tests/vmtests/test_bcache_bug1718699.py | |||
1379 | index bb1b32f..bc0f1e0 100644 | |||
1380 | --- a/tests/vmtests/test_bcache_bug1718699.py | |||
1381 | +++ b/tests/vmtests/test_bcache_bug1718699.py | |||
1382 | @@ -15,11 +15,11 @@ class XenialTestBcacheBug1718699(relbase.xenial, TestBcacheBug1718699): | |||
1383 | 15 | __test__ = True | 15 | __test__ = True |
1384 | 16 | 16 | ||
1385 | 17 | 17 | ||
1387 | 18 | class ArtfulTestBcacheBug1718699(relbase.artful, TestBcacheBug1718699): | 18 | class BionicTestBcacheBug1718699(relbase.bionic, TestBcacheBug1718699): |
1388 | 19 | __test__ = True | 19 | __test__ = True |
1389 | 20 | 20 | ||
1390 | 21 | 21 | ||
1392 | 22 | class BionicTestBcacheBug1718699(relbase.bionic, TestBcacheBug1718699): | 22 | class CosmicTestBcacheBug1718699(relbase.cosmic, TestBcacheBug1718699): |
1393 | 23 | __test__ = True | 23 | __test__ = True |
1394 | 24 | 24 | ||
1395 | 25 | # vi: ts=4 expandtab syntax=python | 25 | # vi: ts=4 expandtab syntax=python |
1396 | diff --git a/tests/vmtests/test_fs_battery.py b/tests/vmtests/test_fs_battery.py | |||
1397 | index 423cc1e..3e41717 100644 | |||
1398 | --- a/tests/vmtests/test_fs_battery.py | |||
1399 | +++ b/tests/vmtests/test_fs_battery.py | |||
1400 | @@ -225,4 +225,8 @@ class BionicTestFsBattery(relbase.bionic, TestFsBattery): | |||
1401 | 225 | __test__ = True | 225 | __test__ = True |
1402 | 226 | 226 | ||
1403 | 227 | 227 | ||
1404 | 228 | class CosmicTestFsBattery(relbase.cosmic, TestFsBattery): | ||
1405 | 229 | __test__ = True | ||
1406 | 230 | |||
1407 | 231 | |||
1408 | 228 | # vi: ts=4 expandtab syntax=python | 232 | # vi: ts=4 expandtab syntax=python |
1409 | diff --git a/tests/vmtests/test_iscsi.py b/tests/vmtests/test_iscsi.py | |||
1410 | index bddd78c..1ac9660 100644 | |||
1411 | --- a/tests/vmtests/test_iscsi.py | |||
1412 | +++ b/tests/vmtests/test_iscsi.py | |||
1413 | @@ -65,11 +65,11 @@ class XenialEdgeTestIscsiBasic(relbase.xenial_edge, TestBasicIscsiAbs): | |||
1414 | 65 | __test__ = True | 65 | __test__ = True |
1415 | 66 | 66 | ||
1416 | 67 | 67 | ||
1418 | 68 | class ArtfulTestIscsiBasic(relbase.artful, TestBasicIscsiAbs): | 68 | class BionicTestIscsiBasic(relbase.bionic, TestBasicIscsiAbs): |
1419 | 69 | __test__ = True | 69 | __test__ = True |
1420 | 70 | 70 | ||
1421 | 71 | 71 | ||
1423 | 72 | class BionicTestIscsiBasic(relbase.bionic, TestBasicIscsiAbs): | 72 | class CosmicTestIscsiBasic(relbase.cosmic, TestBasicIscsiAbs): |
1424 | 73 | __test__ = True | 73 | __test__ = True |
1425 | 74 | 74 | ||
1426 | 75 | # vi: ts=4 expandtab syntax=python | 75 | # vi: ts=4 expandtab syntax=python |
1427 | diff --git a/tests/vmtests/test_journald_reporter.py b/tests/vmtests/test_journald_reporter.py | |||
1428 | index 35ece6d..ad34d52 100644 | |||
1429 | --- a/tests/vmtests/test_journald_reporter.py | |||
1430 | +++ b/tests/vmtests/test_journald_reporter.py | |||
1431 | @@ -35,11 +35,11 @@ class XenialTestJournaldReporter(relbase.xenial, TestJournaldReporter): | |||
1432 | 35 | __test__ = True | 35 | __test__ = True |
1433 | 36 | 36 | ||
1434 | 37 | 37 | ||
1436 | 38 | class ArtfulTestJournaldReporter(relbase.artful, TestJournaldReporter): | 38 | class BionicTestJournaldReporter(relbase.bionic, TestJournaldReporter): |
1437 | 39 | __test__ = True | 39 | __test__ = True |
1438 | 40 | 40 | ||
1439 | 41 | 41 | ||
1441 | 42 | class BionicTestJournaldReporter(relbase.bionic, TestJournaldReporter): | 42 | class CosmicTestJournaldReporter(relbase.cosmic, TestJournaldReporter): |
1442 | 43 | __test__ = True | 43 | __test__ = True |
1443 | 44 | 44 | ||
1444 | 45 | # vi: ts=4 expandtab syntax=python | 45 | # vi: ts=4 expandtab syntax=python |
1445 | diff --git a/tests/vmtests/test_lvm.py b/tests/vmtests/test_lvm.py | |||
1446 | index ed708fd..8972ae4 100644 | |||
1447 | --- a/tests/vmtests/test_lvm.py | |||
1448 | +++ b/tests/vmtests/test_lvm.py | |||
1449 | @@ -66,11 +66,12 @@ class XenialEdgeTestLvm(relbase.xenial_edge, TestLvmAbs): | |||
1450 | 66 | __test__ = True | 66 | __test__ = True |
1451 | 67 | 67 | ||
1452 | 68 | 68 | ||
1454 | 69 | class ArtfulTestLvm(relbase.artful, TestLvmAbs): | 69 | class BionicTestLvm(relbase.bionic, TestLvmAbs): |
1455 | 70 | __test__ = True | 70 | __test__ = True |
1456 | 71 | 71 | ||
1457 | 72 | 72 | ||
1459 | 73 | class BionicTestLvm(relbase.bionic, TestLvmAbs): | 73 | class CosmicTestLvm(relbase.cosmic, TestLvmAbs): |
1460 | 74 | __test__ = True | 74 | __test__ = True |
1461 | 75 | 75 | ||
1462 | 76 | |||
1463 | 76 | # vi: ts=4 expandtab syntax=python | 77 | # vi: ts=4 expandtab syntax=python |
1464 | diff --git a/tests/vmtests/test_lvm_iscsi.py b/tests/vmtests/test_lvm_iscsi.py | |||
1465 | index 2a11d6e..cb5f33c 100644 | |||
1466 | --- a/tests/vmtests/test_lvm_iscsi.py | |||
1467 | +++ b/tests/vmtests/test_lvm_iscsi.py | |||
1468 | @@ -75,11 +75,11 @@ class XenialEdgeTestIscsiLvm(relbase.xenial_edge, TestLvmIscsiAbs): | |||
1469 | 75 | __test__ = True | 75 | __test__ = True |
1470 | 76 | 76 | ||
1471 | 77 | 77 | ||
1473 | 78 | class ArtfulTestIscsiLvm(relbase.artful, TestLvmIscsiAbs): | 78 | class BionicTestIscsiLvm(relbase.bionic, TestLvmIscsiAbs): |
1474 | 79 | __test__ = True | 79 | __test__ = True |
1475 | 80 | 80 | ||
1476 | 81 | 81 | ||
1478 | 82 | class BionicTestIscsiLvm(relbase.bionic, TestLvmIscsiAbs): | 82 | class CosmicTestIscsiLvm(relbase.cosmic, TestLvmIscsiAbs): |
1479 | 83 | __test__ = True | 83 | __test__ = True |
1480 | 84 | 84 | ||
1481 | 85 | # vi: ts=4 expandtab syntax=python | 85 | # vi: ts=4 expandtab syntax=python |
1482 | diff --git a/tests/vmtests/test_lvm_root.py b/tests/vmtests/test_lvm_root.py | |||
1483 | index 24ecb41..8ca69d4 100644 | |||
1484 | --- a/tests/vmtests/test_lvm_root.py | |||
1485 | +++ b/tests/vmtests/test_lvm_root.py | |||
1486 | @@ -92,20 +92,6 @@ class XenialTestLvmRootXfs(relbase.xenial, TestLvmRootAbs): | |||
1487 | 92 | } | 92 | } |
1488 | 93 | 93 | ||
1489 | 94 | 94 | ||
1490 | 95 | class ArtfulTestLvmRootExt4(relbase.artful, TestLvmRootAbs): | ||
1491 | 96 | __test__ = True | ||
1492 | 97 | conf_replace = { | ||
1493 | 98 | '__ROOTFS_FORMAT__': 'ext4', | ||
1494 | 99 | } | ||
1495 | 100 | |||
1496 | 101 | |||
1497 | 102 | class ArtfulTestLvmRootXfs(relbase.artful, TestLvmRootAbs): | ||
1498 | 103 | __test__ = True | ||
1499 | 104 | conf_replace = { | ||
1500 | 105 | '__ROOTFS_FORMAT__': 'xfs', | ||
1501 | 106 | } | ||
1502 | 107 | |||
1503 | 108 | |||
1504 | 109 | class TestUefiLvmRootAbs(TestLvmRootAbs): | 95 | class TestUefiLvmRootAbs(TestLvmRootAbs): |
1505 | 110 | conf_file = "examples/tests/uefi_lvmroot.yaml" | 96 | conf_file = "examples/tests/uefi_lvmroot.yaml" |
1506 | 111 | uefi = True | 97 | uefi = True |
1507 | @@ -127,31 +113,15 @@ class XenialTestUefiLvmRootXfs(relbase.xenial, TestUefiLvmRootAbs): | |||
1508 | 127 | } | 113 | } |
1509 | 128 | 114 | ||
1510 | 129 | 115 | ||
1511 | 116 | @VMBaseClass.skip_by_date("1652822", fixby="2019-06-01") | ||
1512 | 130 | class XenialTestUefiLvmRootXfsBootXfs(relbase.xenial, TestUefiLvmRootAbs): | 117 | class XenialTestUefiLvmRootXfsBootXfs(relbase.xenial, TestUefiLvmRootAbs): |
1523 | 131 | __test__ = True | 118 | """This tests xfs root and xfs boot with uefi. |
1514 | 132 | conf_replace = { | ||
1515 | 133 | '__BOOTFS_FORMAT__': 'xfs', # Expected to fail until LP: #1652822 | ||
1516 | 134 | '__ROOTFS_FORMAT__': 'xfs', | ||
1517 | 135 | } | ||
1518 | 136 | |||
1519 | 137 | @classmethod | ||
1520 | 138 | def setUpClass(cls): | ||
1521 | 139 | cls.skip_by_date("1652822", fixby="2018-05-26") | ||
1522 | 140 | super().setUpClass() | ||
1524 | 141 | 119 | ||
1527 | 142 | 120 | It is known broken (LP: #1652822) and unlikely to be fixed without pushing, | |
1528 | 143 | class ArtfulTestUefiLvmRootExt4(relbase.artful, TestUefiLvmRootAbs): | 121 | so we skip-by for a long time.""" |
1529 | 144 | __test__ = True | 122 | __test__ = True |
1530 | 145 | conf_replace = { | 123 | conf_replace = { |
1540 | 146 | '__BOOTFS_FORMAT__': 'ext4', | 124 | '__BOOTFS_FORMAT__': 'xfs', |
1532 | 147 | '__ROOTFS_FORMAT__': 'ext4', | ||
1533 | 148 | } | ||
1534 | 149 | |||
1535 | 150 | |||
1536 | 151 | class ArtfulTestUefiLvmRootXfs(relbase.artful, TestUefiLvmRootAbs): | ||
1537 | 152 | __test__ = True | ||
1538 | 153 | conf_replace = { | ||
1539 | 154 | '__BOOTFS_FORMAT__': 'ext4', | ||
1541 | 155 | '__ROOTFS_FORMAT__': 'xfs', | 125 | '__ROOTFS_FORMAT__': 'xfs', |
1542 | 156 | } | 126 | } |
1543 | 157 | 127 | ||
1544 | diff --git a/tests/vmtests/test_mdadm_bcache.py b/tests/vmtests/test_mdadm_bcache.py | |||
1545 | index 49d4782..21cf45f 100644 | |||
1546 | --- a/tests/vmtests/test_mdadm_bcache.py | |||
1547 | +++ b/tests/vmtests/test_mdadm_bcache.py | |||
1548 | @@ -129,14 +129,10 @@ class TestMdadmBcacheAbs(TestMdadmAbs): | |||
1549 | 129 | self.test_dname(disk_to_check=self.bcache_dnames) | 129 | self.test_dname(disk_to_check=self.bcache_dnames) |
1550 | 130 | 130 | ||
1551 | 131 | 131 | ||
1552 | 132 | @VMBaseClass.skip_by_date("1754581", fixby="2019-01-22", install=False) | ||
1553 | 132 | class TrustyTestMdadmBcache(relbase.trusty, TestMdadmBcacheAbs): | 133 | class TrustyTestMdadmBcache(relbase.trusty, TestMdadmBcacheAbs): |
1554 | 133 | __test__ = True | 134 | __test__ = True |
1555 | 134 | 135 | ||
1556 | 135 | @classmethod | ||
1557 | 136 | def setUpClass(cls): | ||
1558 | 137 | cls.skip_by_date("1754581", fixby="2018-06-22") | ||
1559 | 138 | super().setUpClass() | ||
1560 | 139 | |||
1561 | 140 | 136 | ||
1562 | 141 | class TrustyHWEXTestMdadmBcache(relbase.trusty_hwe_x, TestMdadmBcacheAbs): | 137 | class TrustyHWEXTestMdadmBcache(relbase.trusty_hwe_x, TestMdadmBcacheAbs): |
1563 | 142 | __test__ = True | 138 | __test__ = True |
1564 | @@ -154,11 +150,11 @@ class XenialEdgeTestMdadmBcache(relbase.xenial_edge, TestMdadmBcacheAbs): | |||
1565 | 154 | __test__ = True | 150 | __test__ = True |
1566 | 155 | 151 | ||
1567 | 156 | 152 | ||
1569 | 157 | class ArtfulTestMdadmBcache(relbase.artful, TestMdadmBcacheAbs): | 153 | class BionicTestMdadmBcache(relbase.bionic, TestMdadmBcacheAbs): |
1570 | 158 | __test__ = True | 154 | __test__ = True |
1571 | 159 | 155 | ||
1572 | 160 | 156 | ||
1574 | 161 | class BionicTestMdadmBcache(relbase.bionic, TestMdadmBcacheAbs): | 157 | class CosmicTestMdadmBcache(relbase.cosmic, TestMdadmBcacheAbs): |
1575 | 162 | __test__ = True | 158 | __test__ = True |
1576 | 163 | 159 | ||
1577 | 164 | 160 | ||
1578 | @@ -194,11 +190,11 @@ class XenialEdgeTestMirrorboot(relbase.xenial_edge, TestMirrorbootAbs): | |||
1579 | 194 | __test__ = True | 190 | __test__ = True |
1580 | 195 | 191 | ||
1581 | 196 | 192 | ||
1583 | 197 | class ArtfulTestMirrorboot(relbase.artful, TestMirrorbootAbs): | 193 | class BionicTestMirrorboot(relbase.bionic, TestMirrorbootAbs): |
1584 | 198 | __test__ = True | 194 | __test__ = True |
1585 | 199 | 195 | ||
1586 | 200 | 196 | ||
1588 | 201 | class BionicTestMirrorboot(relbase.bionic, TestMirrorbootAbs): | 197 | class CosmicTestMirrorboot(relbase.cosmic, TestMirrorbootAbs): |
1589 | 202 | __test__ = True | 198 | __test__ = True |
1590 | 203 | 199 | ||
1591 | 204 | 200 | ||
1592 | @@ -238,12 +234,12 @@ class XenialEdgeTestMirrorbootPartitions(relbase.xenial_edge, | |||
1593 | 238 | __test__ = True | 234 | __test__ = True |
1594 | 239 | 235 | ||
1595 | 240 | 236 | ||
1597 | 241 | class ArtfulTestMirrorbootPartitions(relbase.artful, | 237 | class BionicTestMirrorbootPartitions(relbase.bionic, |
1598 | 242 | TestMirrorbootPartitionsAbs): | 238 | TestMirrorbootPartitionsAbs): |
1599 | 243 | __test__ = True | 239 | __test__ = True |
1600 | 244 | 240 | ||
1601 | 245 | 241 | ||
1603 | 246 | class BionicTestMirrorbootPartitions(relbase.bionic, | 242 | class CosmicTestMirrorbootPartitions(relbase.cosmic, |
1604 | 247 | TestMirrorbootPartitionsAbs): | 243 | TestMirrorbootPartitionsAbs): |
1605 | 248 | __test__ = True | 244 | __test__ = True |
1606 | 249 | 245 | ||
1607 | @@ -283,12 +279,12 @@ class XenialEdgeTestMirrorbootPartitionsUEFI(relbase.xenial_edge, | |||
1608 | 283 | __test__ = True | 279 | __test__ = True |
1609 | 284 | 280 | ||
1610 | 285 | 281 | ||
1612 | 286 | class ArtfulTestMirrorbootPartitionsUEFI(relbase.artful, | 282 | class BionicTestMirrorbootPartitionsUEFI(relbase.bionic, |
1613 | 287 | TestMirrorbootPartitionsUEFIAbs): | 283 | TestMirrorbootPartitionsUEFIAbs): |
1614 | 288 | __test__ = True | 284 | __test__ = True |
1615 | 289 | 285 | ||
1616 | 290 | 286 | ||
1618 | 291 | class BionicTestMirrorbootPartitionsUEFI(relbase.bionic, | 287 | class CosmicTestMirrorbootPartitionsUEFI(relbase.cosmic, |
1619 | 292 | TestMirrorbootPartitionsUEFIAbs): | 288 | TestMirrorbootPartitionsUEFIAbs): |
1620 | 293 | __test__ = True | 289 | __test__ = True |
1621 | 294 | 290 | ||
1622 | @@ -326,11 +322,11 @@ class XenialEdgeTestRaid5boot(relbase.xenial_edge, TestRaid5bootAbs): | |||
1623 | 326 | __test__ = True | 322 | __test__ = True |
1624 | 327 | 323 | ||
1625 | 328 | 324 | ||
1627 | 329 | class ArtfulTestRaid5boot(relbase.artful, TestRaid5bootAbs): | 325 | class BionicTestRaid5boot(relbase.bionic, TestRaid5bootAbs): |
1628 | 330 | __test__ = True | 326 | __test__ = True |
1629 | 331 | 327 | ||
1630 | 332 | 328 | ||
1632 | 333 | class BionicTestRaid5boot(relbase.bionic, TestRaid5bootAbs): | 329 | class CosmicTestRaid5boot(relbase.cosmic, TestRaid5bootAbs): |
1633 | 334 | __test__ = True | 330 | __test__ = True |
1634 | 335 | 331 | ||
1635 | 336 | 332 | ||
1636 | @@ -379,11 +375,11 @@ class XenialEdgeTestRaid6boot(relbase.xenial_edge, TestRaid6bootAbs): | |||
1637 | 379 | __test__ = True | 375 | __test__ = True |
1638 | 380 | 376 | ||
1639 | 381 | 377 | ||
1641 | 382 | class ArtfulTestRaid6boot(relbase.artful, TestRaid6bootAbs): | 378 | class BionicTestRaid6boot(relbase.bionic, TestRaid6bootAbs): |
1642 | 383 | __test__ = True | 379 | __test__ = True |
1643 | 384 | 380 | ||
1644 | 385 | 381 | ||
1646 | 386 | class BionicTestRaid6boot(relbase.bionic, TestRaid6bootAbs): | 382 | class CosmicTestRaid6boot(relbase.cosmic, TestRaid6bootAbs): |
1647 | 387 | __test__ = True | 383 | __test__ = True |
1648 | 388 | 384 | ||
1649 | 389 | 385 | ||
1650 | @@ -420,11 +416,11 @@ class XenialEdgeTestRaid10boot(relbase.xenial_edge, TestRaid10bootAbs): | |||
1651 | 420 | __test__ = True | 416 | __test__ = True |
1652 | 421 | 417 | ||
1653 | 422 | 418 | ||
1655 | 423 | class ArtfulTestRaid10boot(relbase.artful, TestRaid10bootAbs): | 419 | class BionicTestRaid10boot(relbase.bionic, TestRaid10bootAbs): |
1656 | 424 | __test__ = True | 420 | __test__ = True |
1657 | 425 | 421 | ||
1658 | 426 | 422 | ||
1660 | 427 | class BionicTestRaid10boot(relbase.bionic, TestRaid10bootAbs): | 423 | class CosmicTestRaid10boot(relbase.cosmic, TestRaid10bootAbs): |
1661 | 428 | __test__ = True | 424 | __test__ = True |
1662 | 429 | 425 | ||
1663 | 430 | 426 | ||
1664 | @@ -521,11 +517,11 @@ class XenialEdgeTestAllindata(relbase.xenial_edge, TestAllindataAbs): | |||
1665 | 521 | __test__ = True | 517 | __test__ = True |
1666 | 522 | 518 | ||
1667 | 523 | 519 | ||
1669 | 524 | class ArtfulTestAllindata(relbase.artful, TestAllindataAbs): | 520 | class BionicTestAllindata(relbase.bionic, TestAllindataAbs): |
1670 | 525 | __test__ = True | 521 | __test__ = True |
1671 | 526 | 522 | ||
1672 | 527 | 523 | ||
1674 | 528 | class BionicTestAllindata(relbase.bionic, TestAllindataAbs): | 524 | class CosmicTestAllindata(relbase.cosmic, TestAllindataAbs): |
1675 | 529 | __test__ = True | 525 | __test__ = True |
1676 | 530 | 526 | ||
1677 | 531 | # vi: ts=4 expandtab syntax=python | 527 | # vi: ts=4 expandtab syntax=python |
1678 | diff --git a/tests/vmtests/test_mdadm_iscsi.py b/tests/vmtests/test_mdadm_iscsi.py | |||
1679 | index 3c8e6ef..eba200a 100644 | |||
1680 | --- a/tests/vmtests/test_mdadm_iscsi.py | |||
1681 | +++ b/tests/vmtests/test_mdadm_iscsi.py | |||
1682 | @@ -41,11 +41,11 @@ class XenialEdgeTestIscsiMdadm(relbase.xenial_edge, TestMdadmIscsiAbs): | |||
1683 | 41 | __test__ = True | 41 | __test__ = True |
1684 | 42 | 42 | ||
1685 | 43 | 43 | ||
1687 | 44 | class ArtfulTestIscsiMdadm(relbase.artful, TestMdadmIscsiAbs): | 44 | class BionicTestIscsiMdadm(relbase.bionic, TestMdadmIscsiAbs): |
1688 | 45 | __test__ = True | 45 | __test__ = True |
1689 | 46 | 46 | ||
1690 | 47 | 47 | ||
1692 | 48 | class BionicTestIscsiMdadm(relbase.bionic, TestMdadmIscsiAbs): | 48 | class CosmicTestIscsiMdadm(relbase.cosmic, TestMdadmIscsiAbs): |
1693 | 49 | __test__ = True | 49 | __test__ = True |
1694 | 50 | 50 | ||
1695 | 51 | # vi: ts=4 expandtab syntax=python | 51 | # vi: ts=4 expandtab syntax=python |
1696 | diff --git a/tests/vmtests/test_multipath.py b/tests/vmtests/test_multipath.py | |||
1697 | index ffb78b8..0bf63b7 100644 | |||
1698 | --- a/tests/vmtests/test_multipath.py | |||
1699 | +++ b/tests/vmtests/test_multipath.py | |||
1700 | @@ -66,11 +66,11 @@ class XenialEdgeTestMultipathBasic(relbase.xenial_edge, TestMultipathBasicAbs): | |||
1701 | 66 | __test__ = True | 66 | __test__ = True |
1702 | 67 | 67 | ||
1703 | 68 | 68 | ||
1705 | 69 | class ArtfulTestMultipathBasic(relbase.artful, TestMultipathBasicAbs): | 69 | class BionicTestMultipathBasic(relbase.bionic, TestMultipathBasicAbs): |
1706 | 70 | __test__ = True | 70 | __test__ = True |
1707 | 71 | 71 | ||
1708 | 72 | 72 | ||
1710 | 73 | class BionicTestMultipathBasic(relbase.bionic, TestMultipathBasicAbs): | 73 | class CosmicTestMultipathBasic(relbase.cosmic, TestMultipathBasicAbs): |
1711 | 74 | __test__ = True | 74 | __test__ = True |
1712 | 75 | 75 | ||
1713 | 76 | # vi: ts=4 expandtab syntax=python | 76 | # vi: ts=4 expandtab syntax=python |
1714 | diff --git a/tests/vmtests/test_network.py b/tests/vmtests/test_network.py | |||
1715 | index 59a25fe..6532841 100644 | |||
1716 | --- a/tests/vmtests/test_network.py | |||
1717 | +++ b/tests/vmtests/test_network.py | |||
1718 | @@ -480,11 +480,11 @@ class XenialTestNetworkBasic(relbase.xenial, TestNetworkBasicAbs): | |||
1719 | 480 | __test__ = True | 480 | __test__ = True |
1720 | 481 | 481 | ||
1721 | 482 | 482 | ||
1723 | 483 | class ArtfulTestNetworkBasic(relbase.artful, TestNetworkBasicAbs): | 483 | class BionicTestNetworkBasic(relbase.bionic, TestNetworkBasicAbs): |
1724 | 484 | __test__ = True | 484 | __test__ = True |
1725 | 485 | 485 | ||
1726 | 486 | 486 | ||
1728 | 487 | class BionicTestNetworkBasic(relbase.bionic, TestNetworkBasicAbs): | 487 | class CosmicTestNetworkBasic(relbase.cosmic, TestNetworkBasicAbs): |
1729 | 488 | __test__ = True | 488 | __test__ = True |
1730 | 489 | 489 | ||
1731 | 490 | 490 | ||
1732 | diff --git a/tests/vmtests/test_network_alias.py b/tests/vmtests/test_network_alias.py | |||
1733 | index 903b395..d466299 100644 | |||
1734 | --- a/tests/vmtests/test_network_alias.py | |||
1735 | +++ b/tests/vmtests/test_network_alias.py | |||
1736 | @@ -69,11 +69,11 @@ class XenialTestNetworkAlias(relbase.xenial, TestNetworkAliasAbs): | |||
1737 | 69 | __test__ = True | 69 | __test__ = True |
1738 | 70 | 70 | ||
1739 | 71 | 71 | ||
1741 | 72 | class ArtfulTestNetworkAlias(relbase.artful, TestNetworkAliasAbs): | 72 | class BionicTestNetworkAlias(relbase.bionic, TestNetworkAliasAbs): |
1742 | 73 | __test__ = True | 73 | __test__ = True |
1743 | 74 | 74 | ||
1744 | 75 | 75 | ||
1746 | 76 | class BionicTestNetworkAlias(relbase.bionic, TestNetworkAliasAbs): | 76 | class CosmicTestNetworkAlias(relbase.cosmic, TestNetworkAliasAbs): |
1747 | 77 | __test__ = True | 77 | __test__ = True |
1748 | 78 | 78 | ||
1749 | 79 | # vi: ts=4 expandtab syntax=python | 79 | # vi: ts=4 expandtab syntax=python |
1750 | diff --git a/tests/vmtests/test_network_bonding.py b/tests/vmtests/test_network_bonding.py | |||
1751 | index 7d07413..9dba07b 100644 | |||
1752 | --- a/tests/vmtests/test_network_bonding.py | |||
1753 | +++ b/tests/vmtests/test_network_bonding.py | |||
1754 | @@ -10,9 +10,18 @@ import textwrap | |||
1755 | 10 | class TestNetworkBondingAbs(TestNetworkBaseTestsAbs): | 10 | class TestNetworkBondingAbs(TestNetworkBaseTestsAbs): |
1756 | 11 | conf_file = "examples/tests/bonding_network.yaml" | 11 | conf_file = "examples/tests/bonding_network.yaml" |
1757 | 12 | 12 | ||
1761 | 13 | def test_ifenslave_installed(self): | 13 | def test_ifenslave_package_status(self): |
1762 | 14 | self.assertIn("ifenslave", self.debian_packages, | 14 | """ifenslave is expected installed in Ubuntu < artful.""" |
1763 | 15 | "ifenslave deb not installed") | 15 | rel = self.target_release |
1764 | 16 | pkg = "ifenslave" | ||
1765 | 17 | if rel in ("precise", "trusty", "xenial"): | ||
1766 | 18 | self.assertIn( | ||
1767 | 19 | pkg, self.debian_packages, | ||
1768 | 20 | "%s package expected in %s but not found" % (pkg, rel)) | ||
1769 | 21 | else: | ||
1770 | 22 | self.assertNotIn( | ||
1771 | 23 | pkg, self.debian_packages, | ||
1772 | 24 | "%s package found but not expected in %s" % (pkg, rel)) | ||
1773 | 16 | 25 | ||
1774 | 17 | 26 | ||
1775 | 18 | class CentosTestNetworkBondingAbs(TestNetworkBondingAbs): | 27 | class CentosTestNetworkBondingAbs(TestNetworkBondingAbs): |
1776 | @@ -26,7 +35,7 @@ class CentosTestNetworkBondingAbs(TestNetworkBondingAbs): | |||
1777 | 26 | rpm -qf `which ifenslave` |tee ifenslave_installed | 35 | rpm -qf `which ifenslave` |tee ifenslave_installed |
1778 | 27 | """)] | 36 | """)] |
1779 | 28 | 37 | ||
1781 | 29 | def test_ifenslave_installed(self): | 38 | def test_ifenslave_package_status(self): |
1782 | 30 | status = self.load_collect_file("ifenslave_installed") | 39 | status = self.load_collect_file("ifenslave_installed") |
1783 | 31 | self.logger.debug('ifenslave installed: {}'.format(status)) | 40 | self.logger.debug('ifenslave installed: {}'.format(status)) |
1784 | 32 | self.assertTrue('iputils' in status) | 41 | self.assertTrue('iputils' in status) |
1785 | @@ -62,32 +71,12 @@ class XenialTestBonding(relbase.xenial, TestNetworkBondingAbs): | |||
1786 | 62 | __test__ = True | 71 | __test__ = True |
1787 | 63 | 72 | ||
1788 | 64 | 73 | ||
1789 | 65 | class ArtfulTestBonding(relbase.artful, TestNetworkBondingAbs): | ||
1790 | 66 | __test__ = True | ||
1791 | 67 | |||
1792 | 68 | def test_ifenslave_installed(self): | ||
1793 | 69 | """Artful should not have ifenslave installed.""" | ||
1794 | 70 | pass | ||
1795 | 71 | |||
1796 | 72 | def test_ifenslave_not_installed(self): | ||
1797 | 73 | """Confirm that ifenslave is not installed on artful""" | ||
1798 | 74 | self.assertNotIn('ifenslave', self.debian_packages, | ||
1799 | 75 | "ifenslave is not expected in artful: %s" % | ||
1800 | 76 | self.debian_packages.get('ifenslave')) | ||
1801 | 77 | |||
1802 | 78 | |||
1803 | 79 | class BionicTestBonding(relbase.bionic, TestNetworkBondingAbs): | 74 | class BionicTestBonding(relbase.bionic, TestNetworkBondingAbs): |
1804 | 80 | __test__ = True | 75 | __test__ = True |
1805 | 81 | 76 | ||
1806 | 82 | def test_ifenslave_installed(self): | ||
1807 | 83 | """Bionic should not have ifenslave installed.""" | ||
1808 | 84 | pass | ||
1809 | 85 | 77 | ||
1815 | 86 | def test_ifenslave_not_installed(self): | 78 | class CosmicTestBonding(relbase.cosmic, TestNetworkBondingAbs): |
1816 | 87 | """Confirm that ifenslave is not installed on bionic""" | 79 | __test__ = True |
1812 | 88 | self.assertNotIn('ifenslave', self.debian_packages, | ||
1813 | 89 | "ifenslave is not expected in bionic: %s" % | ||
1814 | 90 | self.debian_packages.get('ifenslave')) | ||
1817 | 91 | 80 | ||
1818 | 92 | 81 | ||
1819 | 93 | class Centos66TestNetworkBonding(centos_relbase.centos66fromxenial, | 82 | class Centos66TestNetworkBonding(centos_relbase.centos66fromxenial, |
1820 | diff --git a/tests/vmtests/test_network_bridging.py b/tests/vmtests/test_network_bridging.py | |||
1821 | index ca8964e..91df02e 100644 | |||
1822 | --- a/tests/vmtests/test_network_bridging.py | |||
1823 | +++ b/tests/vmtests/test_network_bridging.py | |||
1824 | @@ -109,9 +109,18 @@ class TestBridgeNetworkAbs(TestNetworkBaseTestsAbs): | |||
1825 | 109 | "sysfs_br0_eth1", | 109 | "sysfs_br0_eth1", |
1826 | 110 | "sysfs_br0_eth2"]) | 110 | "sysfs_br0_eth2"]) |
1827 | 111 | 111 | ||
1831 | 112 | def test_bridge_utils_installed(self): | 112 | def test_bridge_package_status(self): |
1832 | 113 | self.assertIn("bridge-utils", self.debian_packages, | 113 | """bridge-utils is expected installed in Ubuntu < artful.""" |
1833 | 114 | "bridge-utilsi deb not installed") | 114 | rel = self.target_release |
1834 | 115 | pkg = "bridge-utils" | ||
1835 | 116 | if rel in ("precise", "trusty", "xenial"): | ||
1836 | 117 | self.assertIn( | ||
1837 | 118 | pkg, self.debian_packages, | ||
1838 | 119 | "%s package expected in %s but not found" % (pkg, rel)) | ||
1839 | 120 | else: | ||
1840 | 121 | self.assertNotIn( | ||
1841 | 122 | pkg, self.debian_packages, | ||
1842 | 123 | "%s package found but not expected in %s" % (pkg, rel)) | ||
1843 | 115 | 124 | ||
1844 | 116 | def test_bridge_params(self): | 125 | def test_bridge_params(self): |
1845 | 117 | 126 | ||
1846 | @@ -132,11 +141,10 @@ class TestBridgeNetworkAbs(TestNetworkBaseTestsAbs): | |||
1847 | 132 | return br0 | 141 | return br0 |
1848 | 133 | 142 | ||
1849 | 134 | def _get_bridge_params(br): | 143 | def _get_bridge_params(br): |
1850 | 135 | release = ( | ||
1851 | 136 | self.target_release if self.target_release else self.release) | ||
1852 | 137 | bridge_params_uncheckable = default_bridge_params_uncheckable | 144 | bridge_params_uncheckable = default_bridge_params_uncheckable |
1853 | 138 | bridge_params_uncheckable.extend( | 145 | bridge_params_uncheckable.extend( |
1855 | 139 | release_to_bridge_params_uncheckable.get(release, [])) | 146 | release_to_bridge_params_uncheckable.get( |
1856 | 147 | self.target_release, [])) | ||
1857 | 140 | return [p for p in br.keys() | 148 | return [p for p in br.keys() |
1858 | 141 | if (p.startswith('bridge_') and | 149 | if (p.startswith('bridge_') and |
1859 | 142 | p not in bridge_params_uncheckable)] | 150 | p not in bridge_params_uncheckable)] |
1860 | @@ -200,7 +208,8 @@ class CentosTestBridgeNetworkAbs(TestBridgeNetworkAbs): | |||
1861 | 200 | def test_etc_resolvconf(self): | 208 | def test_etc_resolvconf(self): |
1862 | 201 | pass | 209 | pass |
1863 | 202 | 210 | ||
1865 | 203 | def test_bridge_utils_installed(self): | 211 | def test_bridge_package_status(self): |
1866 | 212 | """bridge-utils is expected installed in centos.""" | ||
1867 | 204 | self.output_files_exist(["bridge-utils_installed"]) | 213 | self.output_files_exist(["bridge-utils_installed"]) |
1868 | 205 | status = self.load_collect_file("bridge-utils_installed").strip() | 214 | status = self.load_collect_file("bridge-utils_installed").strip() |
1869 | 206 | self.logger.debug('bridge-utils installed: {}'.format(status)) | 215 | self.logger.debug('bridge-utils installed: {}'.format(status)) |
1870 | @@ -219,29 +228,12 @@ class Centos70TestBridgeNetwork(centos_relbase.centos70fromxenial, | |||
1871 | 219 | 228 | ||
1872 | 220 | # only testing Yakkety or newer as older releases do not yet | 229 | # only testing Yakkety or newer as older releases do not yet |
1873 | 221 | # have updated ifupdown/bridge-utils packages; | 230 | # have updated ifupdown/bridge-utils packages; |
1875 | 222 | class ArtfulTestBridging(relbase.artful, TestBridgeNetworkAbs): | 231 | class BionicTestBridging(relbase.bionic, TestBridgeNetworkAbs): |
1876 | 223 | __test__ = True | 232 | __test__ = True |
1877 | 224 | 233 | ||
1878 | 225 | def test_bridge_utils_installed(self): | ||
1879 | 226 | """bridge-utils not needed in artful.""" | ||
1880 | 227 | pass | ||
1881 | 228 | |||
1882 | 229 | def test_bridge_utils_not_installed(self): | ||
1883 | 230 | self.assertNotIn("bridge-utils", self.debian_packages, | ||
1884 | 231 | "bridge-utils is not expected in artful: %s" % | ||
1885 | 232 | self.debian_packages.get('bridge-utils')) | ||
1886 | 233 | |||
1887 | 234 | 234 | ||
1889 | 235 | class BionicTestBridging(relbase.bionic, TestBridgeNetworkAbs): | 235 | class CosmicTestBridging(relbase.cosmic, TestBridgeNetworkAbs): |
1890 | 236 | __test__ = True | 236 | __test__ = True |
1891 | 237 | 237 | ||
1892 | 238 | def test_bridge_utils_installed(self): | ||
1893 | 239 | """bridge-utils not needed in bionic.""" | ||
1894 | 240 | pass | ||
1895 | 241 | |||
1896 | 242 | def test_bridge_utils_not_installed(self): | ||
1897 | 243 | self.assertNotIn("bridge-utils", self.debian_packages, | ||
1898 | 244 | "bridge-utils is not expected in bionic: %s" % | ||
1899 | 245 | self.debian_packages.get('bridge-utils')) | ||
1900 | 246 | 238 | ||
1901 | 247 | # vi: ts=4 expandtab syntax=python | 239 | # vi: ts=4 expandtab syntax=python |
1902 | diff --git a/tests/vmtests/test_network_ipv6.py b/tests/vmtests/test_network_ipv6.py | |||
1903 | index 6d87dcf..d3c34a5 100644 | |||
1904 | --- a/tests/vmtests/test_network_ipv6.py | |||
1905 | +++ b/tests/vmtests/test_network_ipv6.py | |||
1906 | @@ -64,11 +64,11 @@ class XenialTestNetworkIPV6(relbase.xenial, TestNetworkIPV6Abs): | |||
1907 | 64 | __test__ = True | 64 | __test__ = True |
1908 | 65 | 65 | ||
1909 | 66 | 66 | ||
1911 | 67 | class ArtfulTestNetworkIPV6(relbase.artful, TestNetworkIPV6Abs): | 67 | class BionicTestNetworkIPV6(relbase.bionic, TestNetworkIPV6Abs): |
1912 | 68 | __test__ = True | 68 | __test__ = True |
1913 | 69 | 69 | ||
1914 | 70 | 70 | ||
1916 | 71 | class BionicTestNetworkIPV6(relbase.bionic, TestNetworkIPV6Abs): | 71 | class CosmicTestNetworkIPV6(relbase.cosmic, TestNetworkIPV6Abs): |
1917 | 72 | __test__ = True | 72 | __test__ = True |
1918 | 73 | 73 | ||
1919 | 74 | 74 | ||
1920 | diff --git a/tests/vmtests/test_network_ipv6_static.py b/tests/vmtests/test_network_ipv6_static.py | |||
1921 | index 81fee8f..0396e43 100644 | |||
1922 | --- a/tests/vmtests/test_network_ipv6_static.py | |||
1923 | +++ b/tests/vmtests/test_network_ipv6_static.py | |||
1924 | @@ -46,11 +46,11 @@ class XenialTestNetworkIPV6Static(relbase.xenial, TestNetworkIPV6StaticAbs): | |||
1925 | 46 | __test__ = True | 46 | __test__ = True |
1926 | 47 | 47 | ||
1927 | 48 | 48 | ||
1929 | 49 | class ArtfulTestNetworkIPV6Static(relbase.artful, TestNetworkIPV6StaticAbs): | 49 | class BionicTestNetworkIPV6Static(relbase.bionic, TestNetworkIPV6StaticAbs): |
1930 | 50 | __test__ = True | 50 | __test__ = True |
1931 | 51 | 51 | ||
1932 | 52 | 52 | ||
1934 | 53 | class BionicTestNetworkIPV6Static(relbase.bionic, TestNetworkIPV6StaticAbs): | 53 | class CosmicTestNetworkIPV6Static(relbase.cosmic, TestNetworkIPV6StaticAbs): |
1935 | 54 | __test__ = True | 54 | __test__ = True |
1936 | 55 | 55 | ||
1937 | 56 | 56 | ||
1938 | diff --git a/tests/vmtests/test_network_ipv6_vlan.py b/tests/vmtests/test_network_ipv6_vlan.py | |||
1939 | index 68cf6e0..e001da9 100644 | |||
1940 | --- a/tests/vmtests/test_network_ipv6_vlan.py | |||
1941 | +++ b/tests/vmtests/test_network_ipv6_vlan.py | |||
1942 | @@ -27,11 +27,11 @@ class XenialTestNetworkIPV6Vlan(relbase.xenial, TestNetworkIPV6VlanAbs): | |||
1943 | 27 | __test__ = True | 27 | __test__ = True |
1944 | 28 | 28 | ||
1945 | 29 | 29 | ||
1947 | 30 | class ArtfulTestNetworkIPV6Vlan(relbase.artful, TestNetworkIPV6VlanAbs): | 30 | class BionicTestNetworkIPV6Vlan(relbase.bionic, TestNetworkIPV6VlanAbs): |
1948 | 31 | __test__ = True | 31 | __test__ = True |
1949 | 32 | 32 | ||
1950 | 33 | 33 | ||
1952 | 34 | class BionicTestNetworkIPV6Vlan(relbase.bionic, TestNetworkIPV6VlanAbs): | 34 | class CosmicTestNetworkIPV6Vlan(relbase.cosmic, TestNetworkIPV6VlanAbs): |
1953 | 35 | __test__ = True | 35 | __test__ = True |
1954 | 36 | 36 | ||
1955 | 37 | 37 | ||
1956 | diff --git a/tests/vmtests/test_network_mtu.py b/tests/vmtests/test_network_mtu.py | |||
1957 | index 41b1383..7a10bf1 100644 | |||
1958 | --- a/tests/vmtests/test_network_mtu.py | |||
1959 | +++ b/tests/vmtests/test_network_mtu.py | |||
1960 | @@ -189,23 +189,15 @@ class TestNetworkMtu(relbase.xenial, TestNetworkMtuAbs): | |||
1961 | 189 | __test__ = True | 189 | __test__ = True |
1962 | 190 | 190 | ||
1963 | 191 | 191 | ||
1965 | 192 | class ArtfulTestNetworkMtu(relbase.artful, TestNetworkMtuAbs): | 192 | @TestNetworkMtuAbs.skip_by_date("1671951", fixby="2018-09-26") |
1966 | 193 | class BionicTestNetworkMtu(relbase.bionic, TestNetworkMtuAbs): | ||
1967 | 193 | __test__ = True | 194 | __test__ = True |
1968 | 194 | 195 | ||
1969 | 195 | @classmethod | ||
1970 | 196 | def setUpClass(cls): | ||
1971 | 197 | cls.skip_by_date("1671951", fixby="2018-05-26") | ||
1972 | 198 | super().setUpClass() | ||
1973 | 199 | |||
1974 | 200 | 196 | ||
1976 | 201 | class BionicTestNetworkMtu(relbase.bionic, TestNetworkMtuAbs): | 197 | @TestNetworkMtuAbs.skip_by_date("1671951", fixby="2018-09-26") |
1977 | 198 | class CosmicTestNetworkMtu(relbase.cosmic, TestNetworkMtuAbs): | ||
1978 | 202 | __test__ = True | 199 | __test__ = True |
1979 | 203 | 200 | ||
1980 | 204 | @classmethod | ||
1981 | 205 | def setUpClass(cls): | ||
1982 | 206 | cls.skip_by_date("1671951", fixby="2018-05-26") | ||
1983 | 207 | super().setUpClass() | ||
1984 | 208 | |||
1985 | 209 | 201 | ||
1986 | 210 | class Centos66TestNetworkMtu(centos_relbase.centos66fromxenial, | 202 | class Centos66TestNetworkMtu(centos_relbase.centos66fromxenial, |
1987 | 211 | CentosTestNetworkMtuAbs): | 203 | CentosTestNetworkMtuAbs): |
1988 | diff --git a/tests/vmtests/test_network_static.py b/tests/vmtests/test_network_static.py | |||
1989 | index d96d3eb..40468f3 100644 | |||
1990 | --- a/tests/vmtests/test_network_static.py | |||
1991 | +++ b/tests/vmtests/test_network_static.py | |||
1992 | @@ -60,11 +60,11 @@ class XenialTestNetworkStatic(relbase.xenial, TestNetworkStaticAbs): | |||
1993 | 60 | __test__ = True | 60 | __test__ = True |
1994 | 61 | 61 | ||
1995 | 62 | 62 | ||
1997 | 63 | class ArtfulTestNetworkStatic(relbase.artful, TestNetworkStaticAbs): | 63 | class BionicTestNetworkStatic(relbase.bionic, TestNetworkStaticAbs): |
1998 | 64 | __test__ = True | 64 | __test__ = True |
1999 | 65 | 65 | ||
2000 | 66 | 66 | ||
2002 | 67 | class BionicTestNetworkStatic(relbase.bionic, TestNetworkStaticAbs): | 67 | class CosmicTestNetworkStatic(relbase.cosmic, TestNetworkStaticAbs): |
2003 | 68 | __test__ = True | 68 | __test__ = True |
2004 | 69 | 69 | ||
2005 | 70 | 70 | ||
2006 | diff --git a/tests/vmtests/test_network_static_routes.py b/tests/vmtests/test_network_static_routes.py | |||
2007 | index 92ff267..9fa89ff 100644 | |||
2008 | --- a/tests/vmtests/test_network_static_routes.py | |||
2009 | +++ b/tests/vmtests/test_network_static_routes.py | |||
2010 | @@ -49,12 +49,12 @@ class XenialTestNetworkStaticRoutes(relbase.xenial, | |||
2011 | 49 | __test__ = True | 49 | __test__ = True |
2012 | 50 | 50 | ||
2013 | 51 | 51 | ||
2015 | 52 | class ArtfulTestNetworkStaticRoutes(relbase.artful, | 52 | class BionicTestNetworkStaticRoutes(relbase.bionic, |
2016 | 53 | TestNetworkStaticRoutesAbs): | 53 | TestNetworkStaticRoutesAbs): |
2017 | 54 | __test__ = True | 54 | __test__ = True |
2018 | 55 | 55 | ||
2019 | 56 | 56 | ||
2021 | 57 | class BionicTestNetworkStaticRoutes(relbase.bionic, | 57 | class CosmicTestNetworkStaticRoutes(relbase.cosmic, |
2022 | 58 | TestNetworkStaticRoutesAbs): | 58 | TestNetworkStaticRoutesAbs): |
2023 | 59 | __test__ = True | 59 | __test__ = True |
2024 | 60 | 60 | ||
2025 | diff --git a/tests/vmtests/test_network_vlan.py b/tests/vmtests/test_network_vlan.py | |||
2026 | index 3cb6eae..94e2966 100644 | |||
2027 | --- a/tests/vmtests/test_network_vlan.py | |||
2028 | +++ b/tests/vmtests/test_network_vlan.py | |||
2029 | @@ -35,7 +35,7 @@ class TestNetworkVlanAbs(TestNetworkBaseTestsAbs): | |||
2030 | 35 | self.output_files_exist(link_files) | 35 | self.output_files_exist(link_files) |
2031 | 36 | 36 | ||
2032 | 37 | def test_vlan_installed(self): | 37 | def test_vlan_installed(self): |
2034 | 38 | release = self.target_release if self.target_release else self.release | 38 | release = self.target_release |
2035 | 39 | if release not in ('precise', 'trusty', 'xenial', 'artful'): | 39 | if release not in ('precise', 'trusty', 'xenial', 'artful'): |
2036 | 40 | raise SkipTest("release '%s' does not need the vlan package" % | 40 | raise SkipTest("release '%s' does not need the vlan package" % |
2037 | 41 | release) | 41 | release) |
2038 | @@ -86,11 +86,11 @@ class XenialTestNetworkVlan(relbase.xenial, TestNetworkVlanAbs): | |||
2039 | 86 | __test__ = True | 86 | __test__ = True |
2040 | 87 | 87 | ||
2041 | 88 | 88 | ||
2043 | 89 | class ArtfulTestNetworkVlan(relbase.artful, TestNetworkVlanAbs): | 89 | class BionicTestNetworkVlan(relbase.bionic, TestNetworkVlanAbs): |
2044 | 90 | __test__ = True | 90 | __test__ = True |
2045 | 91 | 91 | ||
2046 | 92 | 92 | ||
2048 | 93 | class BionicTestNetworkVlan(relbase.bionic, TestNetworkVlanAbs): | 93 | class CosmicTestNetworkVlan(relbase.cosmic, TestNetworkVlanAbs): |
2049 | 94 | __test__ = True | 94 | __test__ = True |
2050 | 95 | 95 | ||
2051 | 96 | 96 | ||
2052 | diff --git a/tests/vmtests/test_nvme.py b/tests/vmtests/test_nvme.py | |||
2053 | index a9e3bc3..80d9cbf 100644 | |||
2054 | --- a/tests/vmtests/test_nvme.py | |||
2055 | +++ b/tests/vmtests/test_nvme.py | |||
2056 | @@ -75,11 +75,11 @@ class XenialEdgeTestNvme(relbase.xenial_edge, TestNvmeAbs): | |||
2057 | 75 | __test__ = True | 75 | __test__ = True |
2058 | 76 | 76 | ||
2059 | 77 | 77 | ||
2061 | 78 | class ArtfulTestNvme(relbase.artful, TestNvmeAbs): | 78 | class BionicTestNvme(relbase.bionic, TestNvmeAbs): |
2062 | 79 | __test__ = True | 79 | __test__ = True |
2063 | 80 | 80 | ||
2064 | 81 | 81 | ||
2066 | 82 | class BionicTestNvme(relbase.bionic, TestNvmeAbs): | 82 | class CosmicTestNvme(relbase.cosmic, TestNvmeAbs): |
2067 | 83 | __test__ = True | 83 | __test__ = True |
2068 | 84 | 84 | ||
2069 | 85 | 85 | ||
2070 | @@ -164,11 +164,12 @@ class XenialEdgeTestNvmeBcache(relbase.xenial_edge, TestNvmeBcacheAbs): | |||
2071 | 164 | __test__ = True | 164 | __test__ = True |
2072 | 165 | 165 | ||
2073 | 166 | 166 | ||
2075 | 167 | class ArtfulTestNvmeBcache(relbase.artful, TestNvmeBcacheAbs): | 167 | class BionicTestNvmeBcache(relbase.bionic, TestNvmeBcacheAbs): |
2076 | 168 | __test__ = True | 168 | __test__ = True |
2077 | 169 | 169 | ||
2078 | 170 | 170 | ||
2080 | 171 | class BionicTestNvmeBcache(relbase.bionic, TestNvmeBcacheAbs): | 171 | class CosmicTestNvmeBcache(relbase.cosmic, TestNvmeBcacheAbs): |
2081 | 172 | __test__ = True | 172 | __test__ = True |
2082 | 173 | 173 | ||
2083 | 174 | |||
2084 | 174 | # vi: ts=4 expandtab syntax=python | 175 | # vi: ts=4 expandtab syntax=python |
2085 | diff --git a/tests/vmtests/test_pollinate_useragent.py b/tests/vmtests/test_pollinate_useragent.py | |||
2086 | index abd6daf..201cca1 100644 | |||
2087 | --- a/tests/vmtests/test_pollinate_useragent.py | |||
2088 | +++ b/tests/vmtests/test_pollinate_useragent.py | |||
2089 | @@ -63,4 +63,7 @@ class BionicTestPollinateUserAgent(relbase.bionic, TestPollinateUserAgent): | |||
2090 | 63 | __test__ = True | 63 | __test__ = True |
2091 | 64 | 64 | ||
2092 | 65 | 65 | ||
2093 | 66 | class CosmicTestPollinateUserAgent(relbase.cosmic, TestPollinateUserAgent): | ||
2094 | 67 | __test__ = True | ||
2095 | 68 | |||
2096 | 66 | # vi: ts=4 expandtab syntax=python | 69 | # vi: ts=4 expandtab syntax=python |
2097 | diff --git a/tests/vmtests/test_raid5_bcache.py b/tests/vmtests/test_raid5_bcache.py | |||
2098 | index aa2bebf..bb00b65 100644 | |||
2099 | --- a/tests/vmtests/test_raid5_bcache.py | |||
2100 | +++ b/tests/vmtests/test_raid5_bcache.py | |||
2101 | @@ -99,11 +99,11 @@ class XenialEdgeTestRaid5Bcache(relbase.xenial_edge, TestMdadmBcacheAbs): | |||
2102 | 99 | __test__ = True | 99 | __test__ = True |
2103 | 100 | 100 | ||
2104 | 101 | 101 | ||
2106 | 102 | class ArtfulTestRaid5Bcache(relbase.artful, TestMdadmBcacheAbs): | 102 | class BionicTestRaid5Bcache(relbase.bionic, TestMdadmBcacheAbs): |
2107 | 103 | __test__ = True | 103 | __test__ = True |
2108 | 104 | 104 | ||
2109 | 105 | 105 | ||
2111 | 106 | class BionicTestRaid5Bcache(relbase.bionic, TestMdadmBcacheAbs): | 106 | class CosmicTestRaid5Bcache(relbase.cosmic, TestMdadmBcacheAbs): |
2112 | 107 | __test__ = True | 107 | __test__ = True |
2113 | 108 | 108 | ||
2114 | 109 | # vi: ts=4 expandtab syntax=python | 109 | # vi: ts=4 expandtab syntax=python |
2115 | diff --git a/tests/vmtests/test_simple.py b/tests/vmtests/test_simple.py | |||
2116 | index 54fa24d..de1c675 100644 | |||
2117 | --- a/tests/vmtests/test_simple.py | |||
2118 | +++ b/tests/vmtests/test_simple.py | |||
2119 | @@ -43,14 +43,14 @@ class XenialTestSimple(relbase.xenial, TestSimple): | |||
2120 | 43 | __test__ = True | 43 | __test__ = True |
2121 | 44 | 44 | ||
2122 | 45 | 45 | ||
2124 | 46 | class ArtfulTestSimple(relbase.artful, TestSimple): | 46 | class BionicTestSimple(relbase.bionic, TestSimple): |
2125 | 47 | __test__ = True | 47 | __test__ = True |
2126 | 48 | 48 | ||
2127 | 49 | def test_output_files_exist(self): | 49 | def test_output_files_exist(self): |
2128 | 50 | self.output_files_exist(["netplan.yaml"]) | 50 | self.output_files_exist(["netplan.yaml"]) |
2129 | 51 | 51 | ||
2130 | 52 | 52 | ||
2132 | 53 | class BionicTestSimple(relbase.bionic, TestSimple): | 53 | class CosmicTestSimple(relbase.cosmic, TestSimple): |
2133 | 54 | __test__ = True | 54 | __test__ = True |
2134 | 55 | 55 | ||
2135 | 56 | def test_output_files_exist(self): | 56 | def test_output_files_exist(self): |
2136 | diff --git a/tests/vmtests/test_uefi_basic.py b/tests/vmtests/test_uefi_basic.py | |||
2137 | index 517554f..641a077 100644 | |||
2138 | --- a/tests/vmtests/test_uefi_basic.py | |||
2139 | +++ b/tests/vmtests/test_uefi_basic.py | |||
2140 | @@ -112,11 +112,11 @@ class XenialEdgeUefiTestBasic(relbase.xenial_edge, TestBasicAbs): | |||
2141 | 112 | __test__ = True | 112 | __test__ = True |
2142 | 113 | 113 | ||
2143 | 114 | 114 | ||
2145 | 115 | class ArtfulUefiTestBasic(relbase.artful, TestBasicAbs): | 115 | class BionicUefiTestBasic(relbase.bionic, TestBasicAbs): |
2146 | 116 | __test__ = True | 116 | __test__ = True |
2147 | 117 | 117 | ||
2148 | 118 | 118 | ||
2150 | 119 | class BionicUefiTestBasic(relbase.bionic, TestBasicAbs): | 119 | class CosmicUefiTestBasic(relbase.cosmic, TestBasicAbs): |
2151 | 120 | __test__ = True | 120 | __test__ = True |
2152 | 121 | 121 | ||
2153 | 122 | 122 | ||
2154 | @@ -132,11 +132,11 @@ class XenialGAUefiTestBasic4k(XenialGAUefiTestBasic): | |||
2155 | 132 | disk_block_size = 4096 | 132 | disk_block_size = 4096 |
2156 | 133 | 133 | ||
2157 | 134 | 134 | ||
2159 | 135 | class ArtfulUefiTestBasic4k(ArtfulUefiTestBasic): | 135 | class BionicUefiTestBasic4k(BionicUefiTestBasic): |
2160 | 136 | disk_block_size = 4096 | 136 | disk_block_size = 4096 |
2161 | 137 | 137 | ||
2162 | 138 | 138 | ||
2164 | 139 | class BionicUefiTestBasic4k(BionicUefiTestBasic): | 139 | class CosmicUefiTestBasic4k(CosmicUefiTestBasic): |
2165 | 140 | disk_block_size = 4096 | 140 | disk_block_size = 4096 |
2166 | 141 | 141 | ||
2167 | 142 | # vi: ts=4 expandtab syntax=python | 142 | # vi: ts=4 expandtab syntax=python |
2168 | diff --git a/tests/vmtests/test_zfsroot.py b/tests/vmtests/test_zfsroot.py | |||
2169 | index 1ebc616..e159d17 100644 | |||
2170 | --- a/tests/vmtests/test_zfsroot.py | |||
2171 | +++ b/tests/vmtests/test_zfsroot.py | |||
2172 | @@ -96,11 +96,11 @@ class XenialEdgeTestZfsRoot(relbase.xenial_edge, TestZfsRootAbs): | |||
2173 | 96 | __test__ = True | 96 | __test__ = True |
2174 | 97 | 97 | ||
2175 | 98 | 98 | ||
2177 | 99 | class ArtfulTestZfsRoot(relbase.artful, TestZfsRootAbs): | 99 | class BionicTestZfsRoot(relbase.bionic, TestZfsRootAbs): |
2178 | 100 | __test__ = True | 100 | __test__ = True |
2179 | 101 | 101 | ||
2180 | 102 | 102 | ||
2182 | 103 | class BionicTestZfsRoot(relbase.bionic, TestZfsRootAbs): | 103 | class CosmicTestZfsRoot(relbase.cosmic, TestZfsRootAbs): |
2183 | 104 | __test__ = True | 104 | __test__ = True |
2184 | 105 | 105 | ||
2185 | 106 | 106 | ||
2186 | @@ -120,3 +120,7 @@ class XenialGAi386TestZfsRootFsType(relbase.xenial_ga, TestZfsRootFsTypeAbs, | |||
2187 | 120 | 120 | ||
2188 | 121 | class BionicTestZfsRootFsType(relbase.bionic, TestZfsRootFsTypeAbs): | 121 | class BionicTestZfsRootFsType(relbase.bionic, TestZfsRootFsTypeAbs): |
2189 | 122 | __test__ = True | 122 | __test__ = True |
2190 | 123 | |||
2191 | 124 | |||
2192 | 125 | class CosmicTestZfsRootFsType(relbase.cosmic, TestZfsRootFsTypeAbs): | ||
2193 | 126 | __test__ = True | ||
2194 | diff --git a/tools/xkvm b/tools/xkvm | |||
2195 | index deb769e..dbcba6f 100755 | |||
2196 | --- a/tools/xkvm | |||
2197 | +++ b/tools/xkvm | |||
2198 | @@ -648,9 +648,13 @@ main() { | |||
2199 | 648 | 648 | ||
2200 | 649 | local bus_devices | 649 | local bus_devices |
2201 | 650 | bus_devices=( -device "$virtio_scsi_bus,id=virtio-scsi-xkvm" ) | 650 | bus_devices=( -device "$virtio_scsi_bus,id=virtio-scsi-xkvm" ) |
2203 | 651 | cmd=( "${kvmcmd[@]}" "${archopts[@]}" | 651 | local rng_devices |
2204 | 652 | rng_devices=( -object "rng-random,filename=/dev/urandom,id=rng0" | ||
2205 | 653 | -device "virtio-rng-pci,rng=rng0" ) | ||
2206 | 654 | cmd=( "${kvmcmd[@]}" "${archopts[@]}" | ||
2207 | 652 | "${bios_opts[@]}" | 655 | "${bios_opts[@]}" |
2208 | 653 | "${bus_devices[@]}" | 656 | "${bus_devices[@]}" |
2209 | 657 | "${rng_devices[@]}" | ||
2210 | 654 | "${netargs[@]}" | 658 | "${netargs[@]}" |
2211 | 655 | "${diskargs[@]}" "${pt[@]}" ) | 659 | "${diskargs[@]}" "${pt[@]}" ) |
2212 | 656 | local pcmd=$(quote_cmd "${cmd[@]}") | 660 | local pcmd=$(quote_cmd "${cmd[@]}") |
2213 | diff --git a/tox.ini b/tox.ini | |||
2214 | index 6f14381..8e5faf2 100644 | |||
2215 | --- a/tox.ini | |||
2216 | +++ b/tox.ini | |||
2217 | @@ -51,7 +51,7 @@ commands = {envpython} -m flake8 {posargs:curtin tests/} | |||
2218 | 51 | basepython = python3 | 51 | basepython = python3 |
2219 | 52 | deps = {[testenv]deps} | 52 | deps = {[testenv]deps} |
2220 | 53 | pylint==1.8.1 | 53 | pylint==1.8.1 |
2222 | 54 | bzr+lp:simplestreams | 54 | git+https://git.launchpad.net/simplestreams |
2223 | 55 | commands = {envpython} -m pylint --errors-only {posargs:curtin tests/vmtests} | 55 | commands = {envpython} -m pylint --errors-only {posargs:curtin tests/vmtests} |
2224 | 56 | 56 | ||
2225 | 57 | [testenv:py27-pylint] | 57 | [testenv:py27-pylint] |
lgtm