Merge lp:~raharper/curtin/new-bionic-upstream-snapshot-v1 into lp:~curtin-dev/curtin/bionic
- new-bionic-upstream-snapshot-v1
- Merge into bionic
Proposed by
Ryan Harper
Status: | Merged |
---|---|
Merged at revision: | 83 |
Proposed branch: | lp:~raharper/curtin/new-bionic-upstream-snapshot-v1 |
Merge into: | lp:~curtin-dev/curtin/bionic |
Diff against target: |
1202 lines (+350/-270) 36 files modified
curtin/block/__init__.py (+11/-5) curtin/block/clear_holders.py (+33/-4) curtin/commands/block_meta.py (+23/-20) curtin/commands/block_wipe.py (+4/-0) curtin/commands/clear_holders.py (+1/-1) debian/changelog (+17/-0) examples/tests/bcache-wipe-xfs.yaml (+74/-0) examples/tests/uefi_basic.yaml (+23/-0) tests/unittests/test_clear_holders.py (+82/-0) tests/unittests/test_commands_block_meta.py (+11/-15) tests/vmtests/__init__.py (+14/-15) tests/vmtests/releases.py (+0/-11) tests/vmtests/test_basic.py (+0/-48) tests/vmtests/test_bcache_basic.py (+0/-4) tests/vmtests/test_bcache_bug1718699.py (+21/-0) tests/vmtests/test_iscsi.py (+0/-4) tests/vmtests/test_lvm.py (+0/-8) tests/vmtests/test_lvm_iscsi.py (+0/-4) tests/vmtests/test_mdadm_iscsi.py (+0/-4) tests/vmtests/test_network.py (+0/-5) tests/vmtests/test_network_alias.py (+0/-5) tests/vmtests/test_network_bonding.py (+0/-8) tests/vmtests/test_network_enisource.py (+0/-6) tests/vmtests/test_network_ipv6.py (+0/-5) tests/vmtests/test_network_ipv6_enisource.py (+0/-7) tests/vmtests/test_network_ipv6_static.py (+0/-5) tests/vmtests/test_network_ipv6_vlan.py (+0/-16) tests/vmtests/test_network_mtu.py (+1/-6) tests/vmtests/test_network_static.py (+0/-6) tests/vmtests/test_network_static_routes.py (+0/-6) tests/vmtests/test_network_vlan.py (+0/-16) tests/vmtests/test_nvme.py (+0/-5) tests/vmtests/test_raid5_bcache.py (+0/-5) tests/vmtests/test_uefi_basic.py (+1/-15) tools/launch (+10/-10) tools/xkvm (+24/-1) |
To merge this branch: | bzr merge lp:~raharper/curtin/new-bionic-upstream-snapshot-v1 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
curtin developers | Pending | ||
Review via email: mp+333332@code.launchpad.net |
Commit message
Description of the change
* New upstream snapshot.
- Drop Precise from vmtest
- clear_holders: bcache log IO/OS exceptions but do not raise
- vmtest: Support newer qemu and multipath.
- block: enable control over exclusive_open use when wiping volumes
- block: handle wiping bcache parts (LP: #1718699)
- vmtests: Defer ArtfulNetworkMtu SkipbyDate to 2018
- bcache: accept sysfs write failure in shutdown handler if path missing
(LP: #1700564)
- vmtest: Rephrase a message about no disks to be less scary
- block_meta: use block.wipe_
(LP: #1722322)
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'curtin/block/__init__.py' | |||
2 | --- curtin/block/__init__.py 2017-08-03 19:48:07 +0000 | |||
3 | +++ curtin/block/__init__.py 2017-11-07 18:32:47 +0000 | |||
4 | @@ -776,17 +776,21 @@ | |||
5 | 776 | 776 | ||
6 | 777 | 777 | ||
7 | 778 | @contextmanager | 778 | @contextmanager |
9 | 779 | def exclusive_open(path): | 779 | def exclusive_open(path, exclusive=True): |
10 | 780 | """ | 780 | """ |
12 | 781 | Obtain an exclusive file-handle to the file/device specified | 781 | Obtain an exclusive file-handle to the file/device specified unless |
13 | 782 | caller specifics exclusive=False. | ||
14 | 782 | """ | 783 | """ |
15 | 783 | mode = 'rb+' | 784 | mode = 'rb+' |
16 | 784 | fd = None | 785 | fd = None |
17 | 785 | if not os.path.exists(path): | 786 | if not os.path.exists(path): |
18 | 786 | raise ValueError("No such file at path: %s" % path) | 787 | raise ValueError("No such file at path: %s" % path) |
19 | 787 | 788 | ||
20 | 789 | flags = os.O_RDWR | ||
21 | 790 | if exclusive: | ||
22 | 791 | flags += os.O_EXCL | ||
23 | 788 | try: | 792 | try: |
25 | 789 | fd = os.open(path, os.O_RDWR | os.O_EXCL) | 793 | fd = os.open(path, flags) |
26 | 790 | try: | 794 | try: |
27 | 791 | fd_needs_closing = True | 795 | fd_needs_closing = True |
28 | 792 | with os.fdopen(fd, mode) as fo: | 796 | with os.fdopen(fd, mode) as fo: |
29 | @@ -875,7 +879,8 @@ | |||
30 | 875 | return zero_file_at_offsets(path, offsets, buflen=buflen, count=count) | 879 | return zero_file_at_offsets(path, offsets, buflen=buflen, count=count) |
31 | 876 | 880 | ||
32 | 877 | 881 | ||
34 | 878 | def zero_file_at_offsets(path, offsets, buflen=1024, count=1024, strict=False): | 882 | def zero_file_at_offsets(path, offsets, buflen=1024, count=1024, strict=False, |
35 | 883 | exclusive=True): | ||
36 | 879 | """ | 884 | """ |
37 | 880 | write zeros to file at specified offsets | 885 | write zeros to file at specified offsets |
38 | 881 | """ | 886 | """ |
39 | @@ -890,7 +895,8 @@ | |||
40 | 890 | tot = buflen * count | 895 | tot = buflen * count |
41 | 891 | msg_vals = {'path': path, 'tot': buflen * count} | 896 | msg_vals = {'path': path, 'tot': buflen * count} |
42 | 892 | 897 | ||
44 | 893 | with exclusive_open(path) as fp: | 898 | # allow caller to control if we require exclusive open |
45 | 899 | with exclusive_open(path, exclusive=exclusive) as fp: | ||
46 | 894 | # get the size by seeking to end. | 900 | # get the size by seeking to end. |
47 | 895 | fp.seek(0, 2) | 901 | fp.seek(0, 2) |
48 | 896 | size = fp.tell() | 902 | size = fp.tell() |
49 | 897 | 903 | ||
50 | === modified file 'curtin/block/clear_holders.py' | |||
51 | --- curtin/block/clear_holders.py 2017-06-12 19:43:55 +0000 | |||
52 | +++ curtin/block/clear_holders.py 2017-11-07 18:32:47 +0000 | |||
53 | @@ -93,6 +93,24 @@ | |||
54 | 93 | return path | 93 | return path |
55 | 94 | 94 | ||
56 | 95 | 95 | ||
57 | 96 | def maybe_stop_bcache_device(device): | ||
58 | 97 | """Attempt to stop the provided device_path or raise unexpected errors.""" | ||
59 | 98 | bcache_stop = os.path.join(device, 'stop') | ||
60 | 99 | try: | ||
61 | 100 | util.write_file(bcache_stop, '1', mode=None) | ||
62 | 101 | except (IOError, OSError) as e: | ||
63 | 102 | # Note: if we get any exceptions in the above exception classes | ||
64 | 103 | # it is a result of attempting to write "1" into the sysfs path | ||
65 | 104 | # The range of errors changes depending on when we race with | ||
66 | 105 | # the kernel asynchronously removing the sysfs path. Therefore | ||
67 | 106 | # we log the exception errno we got, but do not re-raise as | ||
68 | 107 | # the calling process is watching whether the same sysfs path | ||
69 | 108 | # is being removed; if it fails to go away then we'll have | ||
70 | 109 | # a log of the exceptions to debug. | ||
71 | 110 | LOG.debug('Error writing to bcache stop file %s, device removed: %s', | ||
72 | 111 | bcache_stop, e) | ||
73 | 112 | |||
74 | 113 | |||
75 | 96 | def shutdown_bcache(device): | 114 | def shutdown_bcache(device): |
76 | 97 | """ | 115 | """ |
77 | 98 | Shut down bcache for specified bcache device | 116 | Shut down bcache for specified bcache device |
78 | @@ -132,8 +150,7 @@ | |||
79 | 132 | os.path.basename(bcache_cache_sysfs)) | 150 | os.path.basename(bcache_cache_sysfs)) |
80 | 133 | else: | 151 | else: |
81 | 134 | LOG.info('stopping bcache cacheset at: %s', bcache_cache_sysfs) | 152 | LOG.info('stopping bcache cacheset at: %s', bcache_cache_sysfs) |
84 | 135 | util.write_file(os.path.join(bcache_cache_sysfs, 'stop'), | 153 | maybe_stop_bcache_device(bcache_cache_sysfs) |
83 | 136 | '1', mode=None) | ||
85 | 137 | try: | 154 | try: |
86 | 138 | util.wait_for_removal(bcache_cache_sysfs, retries=removal_retries) | 155 | util.wait_for_removal(bcache_cache_sysfs, retries=removal_retries) |
87 | 139 | except OSError: | 156 | except OSError: |
88 | @@ -162,8 +179,7 @@ | |||
89 | 162 | return | 179 | return |
90 | 163 | else: | 180 | else: |
91 | 164 | LOG.info('stopping bcache backing device at: %s', bcache_block_sysfs) | 181 | LOG.info('stopping bcache backing device at: %s', bcache_block_sysfs) |
94 | 165 | util.write_file(os.path.join(bcache_block_sysfs, 'stop'), | 182 | maybe_stop_bcache_device(bcache_block_sysfs) |
93 | 166 | '1', mode=None) | ||
95 | 167 | try: | 183 | try: |
96 | 168 | # wait for them all to go away | 184 | # wait for them all to go away |
97 | 169 | for dev in [device, bcache_block_sysfs] + slave_paths: | 185 | for dev in [device, bcache_block_sysfs] + slave_paths: |
98 | @@ -244,6 +260,19 @@ | |||
99 | 244 | LOG.info("extended partitions do not need wiping, so skipping: '%s'", | 260 | LOG.info("extended partitions do not need wiping, so skipping: '%s'", |
100 | 245 | blockdev) | 261 | blockdev) |
101 | 246 | else: | 262 | else: |
102 | 263 | # some volumes will be claimed by the bcache layer but do not surface | ||
103 | 264 | # an actual /dev/bcacheN device which owns the parts (backing, cache) | ||
104 | 265 | # The result is that some volumes cannot be wiped while bcache claims | ||
105 | 266 | # the device. Resolve this by stopping bcache layer on those volumes | ||
106 | 267 | # if present. | ||
107 | 268 | for bcache_path in ['bcache', 'bcache/set']: | ||
108 | 269 | stop_path = os.path.join(device, bcache_path) | ||
109 | 270 | if os.path.exists(stop_path): | ||
110 | 271 | LOG.debug('Attempting to release bcache layer from device: %s', | ||
111 | 272 | device) | ||
112 | 273 | maybe_stop_bcache_device(stop_path) | ||
113 | 274 | continue | ||
114 | 275 | |||
115 | 247 | retries = [1, 3, 5, 7] | 276 | retries = [1, 3, 5, 7] |
116 | 248 | LOG.info('wiping superblock on %s', blockdev) | 277 | LOG.info('wiping superblock on %s', blockdev) |
117 | 249 | for attempt, wait in enumerate(retries): | 278 | for attempt, wait in enumerate(retries): |
118 | 250 | 279 | ||
119 | === modified file 'curtin/commands/block_meta.py' | |||
120 | --- curtin/commands/block_meta.py 2017-06-12 19:43:55 +0000 | |||
121 | +++ curtin/commands/block_meta.py 2017-11-07 18:32:47 +0000 | |||
122 | @@ -384,7 +384,11 @@ | |||
123 | 384 | LOG.info("labeling device: '%s' with '%s' partition table", disk, | 384 | LOG.info("labeling device: '%s' with '%s' partition table", disk, |
124 | 385 | ptable) | 385 | ptable) |
125 | 386 | if ptable == "gpt": | 386 | if ptable == "gpt": |
127 | 387 | util.subp(["sgdisk", "--clear", disk]) | 387 | # Wipe both MBR and GPT that may be present on the disk. |
128 | 388 | # N.B.: wipe_volume wipes 1M at front and end of the disk. | ||
129 | 389 | # This could destroy disk data in filesystems that lived | ||
130 | 390 | # there. | ||
131 | 391 | block.wipe_volume(disk, mode='superblock') | ||
132 | 388 | elif ptable in _dos_names: | 392 | elif ptable in _dos_names: |
133 | 389 | util.subp(["parted", disk, "--script", "mklabel", "msdos"]) | 393 | util.subp(["parted", disk, "--script", "mklabel", "msdos"]) |
134 | 390 | else: | 394 | else: |
135 | @@ -544,6 +548,24 @@ | |||
136 | 544 | info.get('id'), device, disk_ptable) | 548 | info.get('id'), device, disk_ptable) |
137 | 545 | LOG.debug("partnum: %s offset_sectors: %s length_sectors: %s", | 549 | LOG.debug("partnum: %s offset_sectors: %s length_sectors: %s", |
138 | 546 | partnumber, offset_sectors, length_sectors) | 550 | partnumber, offset_sectors, length_sectors) |
139 | 551 | |||
140 | 552 | # Wipe the partition if told to do so, do not wipe dos extended partitions | ||
141 | 553 | # as this may damage the extended partition table | ||
142 | 554 | if config.value_as_boolean(info.get('wipe')): | ||
143 | 555 | LOG.info("Preparing partition location on disk %s", disk) | ||
144 | 556 | if info.get('flag') == "extended": | ||
145 | 557 | LOG.warn("extended partitions do not need wiping, so skipping: " | ||
146 | 558 | "'%s'" % info.get('id')) | ||
147 | 559 | else: | ||
148 | 560 | # wipe the start of the new partition first by zeroing 1M at the | ||
149 | 561 | # length of the previous partition | ||
150 | 562 | wipe_offset = int(offset_sectors * logical_block_size_bytes) | ||
151 | 563 | LOG.debug('Wiping 1M on %s at offset %s', disk, wipe_offset) | ||
152 | 564 | # We don't require exclusive access as we're wiping data at an | ||
153 | 565 | # offset and the current holder maybe part of the current storage | ||
154 | 566 | # configuration. | ||
155 | 567 | block.zero_file_at_offsets(disk, [wipe_offset], exclusive=False) | ||
156 | 568 | |||
157 | 547 | if disk_ptable == "msdos": | 569 | if disk_ptable == "msdos": |
158 | 548 | if flag in ["extended", "logical", "primary"]: | 570 | if flag in ["extended", "logical", "primary"]: |
159 | 549 | partition_type = flag | 571 | partition_type = flag |
160 | @@ -565,25 +587,6 @@ | |||
161 | 565 | else: | 587 | else: |
162 | 566 | raise ValueError("parent partition has invalid partition table") | 588 | raise ValueError("parent partition has invalid partition table") |
163 | 567 | 589 | ||
164 | 568 | # check if we've triggered hidden metadata like md, lvm or bcache | ||
165 | 569 | part_kname = get_path_to_storage_volume(info.get('id'), storage_config) | ||
166 | 570 | holders = clear_holders.get_holders(part_kname) | ||
167 | 571 | if len(holders) > 0: | ||
168 | 572 | LOG.debug('Detected block holders on partition %s: %s', part_kname, | ||
169 | 573 | holders) | ||
170 | 574 | clear_holders.clear_holders(part_kname) | ||
171 | 575 | clear_holders.assert_clear(part_kname) | ||
172 | 576 | |||
173 | 577 | # Wipe the partition if told to do so, do not wipe dos extended partitions | ||
174 | 578 | # as this may damage the extended partition table | ||
175 | 579 | if config.value_as_boolean(info.get('wipe')): | ||
176 | 580 | if info.get('flag') == "extended": | ||
177 | 581 | LOG.warn("extended partitions do not need wiping, so skipping: " | ||
178 | 582 | "'%s'" % info.get('id')) | ||
179 | 583 | else: | ||
180 | 584 | block.wipe_volume( | ||
181 | 585 | get_path_to_storage_volume(info.get('id'), storage_config), | ||
182 | 586 | mode=info.get('wipe')) | ||
183 | 587 | # Make the name if needed | 590 | # Make the name if needed |
184 | 588 | if storage_config.get(device).get('name') and partition_type != 'extended': | 591 | if storage_config.get(device).get('name') and partition_type != 'extended': |
185 | 589 | make_dname(info.get('id'), storage_config) | 592 | make_dname(info.get('id'), storage_config) |
186 | 590 | 593 | ||
187 | === modified file 'curtin/commands/block_wipe.py' | |||
188 | --- curtin/commands/block_wipe.py 2016-09-29 18:31:02 +0000 | |||
189 | +++ curtin/commands/block_wipe.py 2017-11-07 18:32:47 +0000 | |||
190 | @@ -18,11 +18,15 @@ | |||
191 | 18 | import sys | 18 | import sys |
192 | 19 | import curtin.block as block | 19 | import curtin.block as block |
193 | 20 | from . import populate_one_subcmd | 20 | from . import populate_one_subcmd |
194 | 21 | from .. import log | ||
195 | 22 | |||
196 | 23 | LOG = log.LOG | ||
197 | 21 | 24 | ||
198 | 22 | 25 | ||
199 | 23 | def wipe_main(args): | 26 | def wipe_main(args): |
200 | 24 | for blockdev in args.devices: | 27 | for blockdev in args.devices: |
201 | 25 | try: | 28 | try: |
202 | 29 | LOG.debug('Wiping volume %s with mode=%s', blockdev, args.mode) | ||
203 | 26 | block.wipe_volume(blockdev, mode=args.mode) | 30 | block.wipe_volume(blockdev, mode=args.mode) |
204 | 27 | except Exception as e: | 31 | except Exception as e: |
205 | 28 | sys.stderr.write( | 32 | sys.stderr.write( |
206 | 29 | 33 | ||
207 | === modified file 'curtin/commands/clear_holders.py' | |||
208 | --- curtin/commands/clear_holders.py 2016-09-29 18:31:02 +0000 | |||
209 | +++ curtin/commands/clear_holders.py 2017-11-07 18:32:47 +0000 | |||
210 | @@ -28,7 +28,7 @@ | |||
211 | 28 | raise ValueError('invalid devices specified') | 28 | raise ValueError('invalid devices specified') |
212 | 29 | block.clear_holders.start_clear_holders_deps() | 29 | block.clear_holders.start_clear_holders_deps() |
213 | 30 | block.clear_holders.clear_holders(args.devices, try_preserve=args.preserve) | 30 | block.clear_holders.clear_holders(args.devices, try_preserve=args.preserve) |
215 | 31 | if args.try_preserve: | 31 | if args.preserve: |
216 | 32 | print('ran clear_holders attempting to preserve data. however, ' | 32 | print('ran clear_holders attempting to preserve data. however, ' |
217 | 33 | 'hotplug support for some devices may cause holders to restart ') | 33 | 'hotplug support for some devices may cause holders to restart ') |
218 | 34 | block.clear_holders.assert_clear(args.devices) | 34 | block.clear_holders.assert_clear(args.devices) |
219 | 35 | 35 | ||
220 | === modified file 'debian/changelog' | |||
221 | --- debian/changelog 2017-10-06 02:22:45 +0000 | |||
222 | +++ debian/changelog 2017-11-07 18:32:47 +0000 | |||
223 | @@ -1,3 +1,20 @@ | |||
224 | 1 | curtin (0.1.0~bzr541-0ubuntu1) bionic; urgency=medium | ||
225 | 2 | |||
226 | 3 | * New upstream snapshot. | ||
227 | 4 | - Drop Precise from vmtest | ||
228 | 5 | - clear_holders: bcache log IO/OS exceptions but do not raise | ||
229 | 6 | - vmtest: Support newer qemu and multipath. | ||
230 | 7 | - block: enable control over exclusive_open use when wiping volumes | ||
231 | 8 | - block: handle wiping bcache parts (LP: #1718699) | ||
232 | 9 | - vmtests: Defer ArtfulNetworkMtu SkipbyDate to 2018 | ||
233 | 10 | - bcache: accept sysfs write failure in shutdown handler if path missing | ||
234 | 11 | (LP: #1700564) | ||
235 | 12 | - vmtest: Rephrase a message about no disks to be less scary | ||
236 | 13 | - block_meta: use block.wipe_volume(mode=superblock) to clear MBR/GPT tables | ||
237 | 14 | (LP: #1722322) | ||
238 | 15 | |||
239 | 16 | -- Ryan Harper <ryan.harper@canonical.com> Tue, 07 Nov 2017 11:13:00 -0600 | ||
240 | 17 | |||
241 | 1 | curtin (0.1.0~bzr532-0ubuntu1) artful; urgency=medium | 18 | curtin (0.1.0~bzr532-0ubuntu1) artful; urgency=medium |
242 | 2 | 19 | ||
243 | 3 | * New upstream snapshot. | 20 | * New upstream snapshot. |
244 | 4 | 21 | ||
245 | === added file 'examples/tests/bcache-wipe-xfs.yaml' | |||
246 | --- examples/tests/bcache-wipe-xfs.yaml 1970-01-01 00:00:00 +0000 | |||
247 | +++ examples/tests/bcache-wipe-xfs.yaml 2017-11-07 18:32:47 +0000 | |||
248 | @@ -0,0 +1,74 @@ | |||
249 | 1 | showtrace: true | ||
250 | 2 | |||
251 | 3 | early_commands: | ||
252 | 4 | # Create a partitioned disk with bcache metadata in one of the partitions. | ||
253 | 5 | # Then, wipe the partition table. This leaves "buried" bcache data that | ||
254 | 6 | # would be seen as soon as the disk was partitioned and cause problems | ||
255 | 7 | # for curtin's use of the disk. | ||
256 | 8 | # This config recreates issue LP: #1718699 | ||
257 | 9 | 00_blockmeta: [env, -u, OUTPUT_FSTAB, TARGET_MOUNT_POINT=/tmp/my.bdir/target, | ||
258 | 10 | WORKING_DIR=/tmp/my.bdir/work.d, curtin, --showtrace, -v, | ||
259 | 11 | block-meta, --umount, custom] | ||
260 | 12 | 01_clear_holders: [curtin, clear-holders, --preserve, /dev/vdb] | ||
261 | 13 | 02_quick_erase: [curtin, block-wipe, --mode, superblock, /dev/vdb] | ||
262 | 14 | |||
263 | 15 | storage: | ||
264 | 16 | config: | ||
265 | 17 | - grub_device: true | ||
266 | 18 | id: vdb | ||
267 | 19 | name: vdb | ||
268 | 20 | path: /dev/vdb | ||
269 | 21 | ptable: msdos | ||
270 | 22 | type: disk | ||
271 | 23 | wipe: superblock | ||
272 | 24 | - id: vdc | ||
273 | 25 | name: vdc | ||
274 | 26 | path: /dev/vdc | ||
275 | 27 | type: disk | ||
276 | 28 | wipe: superblock | ||
277 | 29 | - device: vdb | ||
278 | 30 | id: vdb-part1 | ||
279 | 31 | name: vdb-part1 | ||
280 | 32 | number: 1 | ||
281 | 33 | offset: 4194304B | ||
282 | 34 | size: 3997171712B | ||
283 | 35 | type: partition | ||
284 | 36 | uuid: 1d112703-1ff7-49fb-9655-741016e216bf | ||
285 | 37 | wipe: superblock | ||
286 | 38 | - device: vdb | ||
287 | 39 | id: vdb-part2 | ||
288 | 40 | name: vdb-part2 | ||
289 | 41 | number: 2 | ||
290 | 42 | size: 3997171712B | ||
291 | 43 | type: partition | ||
292 | 44 | uuid: ec219a2e-c4a5-4623-b66a-965da2c6c1f1 | ||
293 | 45 | wipe: superblock | ||
294 | 46 | - backing_device: vdc | ||
295 | 47 | cache_device: vdb-part2 | ||
296 | 48 | cache_mode: writeback | ||
297 | 49 | id: bcache0 | ||
298 | 50 | name: bcache0 | ||
299 | 51 | type: bcache | ||
300 | 52 | - fstype: ext4 | ||
301 | 53 | id: vdb-part1_format | ||
302 | 54 | label: '' | ||
303 | 55 | type: format | ||
304 | 56 | uuid: 0687dc8f-c089-4f30-8603-0ddf646a5dd7 | ||
305 | 57 | volume: vdb-part1 | ||
306 | 58 | - fstype: xfs | ||
307 | 59 | id: bcache0_format | ||
308 | 60 | label: '' | ||
309 | 61 | type: format | ||
310 | 62 | uuid: c40a45b2-1f12-454e-a0ec-784eb4ded4e6 | ||
311 | 63 | volume: bcache0 | ||
312 | 64 | - device: vdb-part1_format | ||
313 | 65 | id: vdb-part1_mount | ||
314 | 66 | options: '' | ||
315 | 67 | path: / | ||
316 | 68 | type: mount | ||
317 | 69 | - device: bcache0_format | ||
318 | 70 | id: bcache0_mount | ||
319 | 71 | options: '' | ||
320 | 72 | path: /var/lib/ceph-bcache/test-disk | ||
321 | 73 | type: mount | ||
322 | 74 | version: 1 | ||
323 | 0 | 75 | ||
324 | === modified file 'examples/tests/uefi_basic.yaml' | |||
325 | --- examples/tests/uefi_basic.yaml 2016-08-05 20:47:14 +0000 | |||
326 | +++ examples/tests/uefi_basic.yaml 2017-11-07 18:32:47 +0000 | |||
327 | @@ -1,4 +1,12 @@ | |||
328 | 1 | showtrace: true | 1 | showtrace: true |
329 | 2 | |||
330 | 3 | early_commands: | ||
331 | 4 | # Recreate and test LP:1722322 | ||
332 | 5 | # Make one disk dirty with an MBR and a storage configuration | ||
333 | 6 | # GPT and don't supply wipe: superblock. This will exercise | ||
334 | 7 | # curtin use of sgdisk --zap-all instead of --clear (GPT only) | ||
335 | 8 | blockmeta: ["parted", /dev/vdc, "--script", "mklabel", "msdos"] | ||
336 | 9 | |||
337 | 2 | storage: | 10 | storage: |
338 | 3 | config: | 11 | config: |
339 | 4 | - id: id_disk0 | 12 | - id: id_disk0 |
340 | @@ -55,4 +63,19 @@ | |||
341 | 55 | id: id_efi_mount | 63 | id: id_efi_mount |
342 | 56 | path: /boot/efi | 64 | path: /boot/efi |
343 | 57 | type: mount | 65 | type: mount |
344 | 66 | - id: pnum_disk | ||
345 | 67 | type: disk | ||
346 | 68 | path: /dev/vdc | ||
347 | 69 | name: pnum_disk | ||
348 | 70 | ptable: gpt | ||
349 | 71 | - id: pnum_disk_p1 | ||
350 | 72 | type: partition | ||
351 | 73 | number: 1 | ||
352 | 74 | size: 1GB | ||
353 | 75 | device: pnum_disk | ||
354 | 76 | - id: pnum_disk_p2 | ||
355 | 77 | type: partition | ||
356 | 78 | number: 10 | ||
357 | 79 | size: 1GB | ||
358 | 80 | device: pnum_disk | ||
359 | 58 | version: 1 | 81 | version: 1 |
360 | 59 | 82 | ||
361 | === modified file 'tests/unittests/test_clear_holders.py' | |||
362 | --- tests/unittests/test_clear_holders.py 2017-08-03 19:48:07 +0000 | |||
363 | +++ tests/unittests/test_clear_holders.py 2017-11-07 18:32:47 +0000 | |||
364 | @@ -1,3 +1,4 @@ | |||
365 | 1 | import errno | ||
366 | 1 | import mock | 2 | import mock |
367 | 2 | import os | 3 | import os |
368 | 3 | import textwrap | 4 | import textwrap |
369 | @@ -329,6 +330,52 @@ | |||
370 | 329 | mock.call(cset, retries=self.remove_retries) | 330 | mock.call(cset, retries=self.remove_retries) |
371 | 330 | ]) | 331 | ]) |
372 | 331 | 332 | ||
373 | 333 | # test bcache shutdown with 'stop' sysfs write failure | ||
374 | 334 | @mock.patch('curtin.block.clear_holders.udev.udevadm_settle') | ||
375 | 335 | @mock.patch('curtin.block.clear_holders.get_bcache_sys_path') | ||
376 | 336 | @mock.patch('curtin.block.clear_holders.util') | ||
377 | 337 | @mock.patch('curtin.block.clear_holders.os') | ||
378 | 338 | @mock.patch('curtin.block.clear_holders.LOG') | ||
379 | 339 | @mock.patch('curtin.block.clear_holders.get_bcache_using_dev') | ||
380 | 340 | def test_shutdown_bcache_stop_sysfs_write_fails(self, mock_get_bcache, | ||
381 | 341 | mock_log, mock_os, | ||
382 | 342 | mock_util, | ||
383 | 343 | mock_get_bcache_block, | ||
384 | 344 | mock_udevadm_settle): | ||
385 | 345 | """Test writes sysfs write failures pass if file not present""" | ||
386 | 346 | device = "/sys/class/block/null" | ||
387 | 347 | mock_os.path.exists.side_effect = iter([ | ||
388 | 348 | True, # backing device exists | ||
389 | 349 | True, # cset device not present (already removed) | ||
390 | 350 | False, # backing device is removed with cset | ||
391 | 351 | False, # bcache/stop sysfs is missing (already removed) | ||
392 | 352 | ]) | ||
393 | 353 | cset = '/sys/fs/bcache/fake' | ||
394 | 354 | mock_get_bcache.return_value = cset | ||
395 | 355 | mock_get_bcache_block.return_value = device + '/bcache' | ||
396 | 356 | mock_os.path.join.side_effect = os.path.join | ||
397 | 357 | |||
398 | 358 | # make writes to sysfs fail | ||
399 | 359 | mock_util.write_file.side_effect = IOError(errno.ENOENT, | ||
400 | 360 | "File not found") | ||
401 | 361 | |||
402 | 362 | clear_holders.shutdown_bcache(device) | ||
403 | 363 | |||
404 | 364 | self.assertEqual(2, len(mock_log.info.call_args_list)) | ||
405 | 365 | self.assertEqual(3, len(mock_os.path.exists.call_args_list)) | ||
406 | 366 | self.assertEqual(1, len(mock_get_bcache.call_args_list)) | ||
407 | 367 | self.assertEqual(1, len(mock_get_bcache_block.call_args_list)) | ||
408 | 368 | self.assertEqual(1, len(mock_util.write_file.call_args_list)) | ||
409 | 369 | self.assertEqual(1, len(mock_util.wait_for_removal.call_args_list)) | ||
410 | 370 | |||
411 | 371 | mock_get_bcache.assert_called_with(device, strict=False) | ||
412 | 372 | mock_util.write_file.assert_has_calls([ | ||
413 | 373 | mock.call(cset + '/stop', '1', mode=None), | ||
414 | 374 | ]) | ||
415 | 375 | mock_util.wait_for_removal.assert_has_calls([ | ||
416 | 376 | mock.call(cset, retries=self.remove_retries) | ||
417 | 377 | ]) | ||
418 | 378 | |||
419 | 332 | @mock.patch('curtin.block.clear_holders.LOG') | 379 | @mock.patch('curtin.block.clear_holders.LOG') |
420 | 333 | @mock.patch('curtin.block.clear_holders.block.sys_block_path') | 380 | @mock.patch('curtin.block.clear_holders.block.sys_block_path') |
421 | 334 | @mock.patch('curtin.block.clear_holders.lvm') | 381 | @mock.patch('curtin.block.clear_holders.lvm') |
422 | @@ -531,6 +578,41 @@ | |||
423 | 531 | for tree, result in test_trees_and_results: | 578 | for tree, result in test_trees_and_results: |
424 | 532 | self.assertEqual(clear_holders.format_holders_tree(tree), result) | 579 | self.assertEqual(clear_holders.format_holders_tree(tree), result) |
425 | 533 | 580 | ||
426 | 581 | @mock.patch('curtin.block.clear_holders.util.write_file') | ||
427 | 582 | def test_maybe_stop_bcache_device_raises_errors(self, m_write_file): | ||
428 | 583 | """Non-IO/OS exceptions are raised by maybe_stop_bcache_device.""" | ||
429 | 584 | m_write_file.side_effect = ValueError('Crazy Value Error') | ||
430 | 585 | with self.assertRaises(ValueError) as cm: | ||
431 | 586 | clear_holders.maybe_stop_bcache_device('does/not/matter') | ||
432 | 587 | self.assertEqual('Crazy Value Error', str(cm.exception)) | ||
433 | 588 | self.assertEqual( | ||
434 | 589 | mock.call('does/not/matter/stop', '1', mode=None), | ||
435 | 590 | m_write_file.call_args) | ||
436 | 591 | |||
437 | 592 | @mock.patch('curtin.block.clear_holders.LOG') | ||
438 | 593 | @mock.patch('curtin.block.clear_holders.util.write_file') | ||
439 | 594 | def test_maybe_stop_bcache_device_handles_oserror(self, m_write_file, | ||
440 | 595 | m_log): | ||
441 | 596 | """When OSError.NOENT is raised, log the condition and move on.""" | ||
442 | 597 | m_write_file.side_effect = OSError(errno.ENOENT, 'Expected oserror') | ||
443 | 598 | clear_holders.maybe_stop_bcache_device('does/not/matter') | ||
444 | 599 | self.assertEqual( | ||
445 | 600 | 'Error writing to bcache stop file %s, device removed: %s', | ||
446 | 601 | m_log.debug.call_args[0][0]) | ||
447 | 602 | self.assertEqual('does/not/matter/stop', m_log.debug.call_args[0][1]) | ||
448 | 603 | |||
449 | 604 | @mock.patch('curtin.block.clear_holders.LOG') | ||
450 | 605 | @mock.patch('curtin.block.clear_holders.util.write_file') | ||
451 | 606 | def test_maybe_stop_bcache_device_handles_ioerror(self, m_write_file, | ||
452 | 607 | m_log): | ||
453 | 608 | """When IOError.NOENT is raised, log the condition and move on.""" | ||
454 | 609 | m_write_file.side_effect = IOError(errno.ENOENT, 'Expected ioerror') | ||
455 | 610 | clear_holders.maybe_stop_bcache_device('does/not/matter') | ||
456 | 611 | self.assertEqual( | ||
457 | 612 | 'Error writing to bcache stop file %s, device removed: %s', | ||
458 | 613 | m_log.debug.call_args[0][0]) | ||
459 | 614 | self.assertEqual('does/not/matter/stop', m_log.debug.call_args[0][1]) | ||
460 | 615 | |||
461 | 534 | def test_get_holder_types(self): | 616 | def test_get_holder_types(self): |
462 | 535 | """test clear_holders.get_holder_types""" | 617 | """test clear_holders.get_holder_types""" |
463 | 536 | test_trees_and_results = [ | 618 | test_trees_and_results = [ |
464 | 537 | 619 | ||
465 | === modified file 'tests/unittests/test_commands_block_meta.py' | |||
466 | --- tests/unittests/test_commands_block_meta.py 2017-08-03 19:48:07 +0000 | |||
467 | +++ tests/unittests/test_commands_block_meta.py 2017-11-07 18:32:47 +0000 | |||
468 | @@ -130,6 +130,8 @@ | |||
469 | 130 | 'mock_clear_holders') | 130 | 'mock_clear_holders') |
470 | 131 | self.add_patch('curtin.block.clear_holders.assert_clear', | 131 | self.add_patch('curtin.block.clear_holders.assert_clear', |
471 | 132 | 'mock_assert_clear') | 132 | 'mock_assert_clear') |
472 | 133 | self.add_patch('curtin.block.zero_file_at_offsets', | ||
473 | 134 | 'mock_block_zero_file') | ||
474 | 133 | 135 | ||
475 | 134 | self.target = "my_target" | 136 | self.target = "my_target" |
476 | 135 | self.config = { | 137 | self.config = { |
477 | @@ -177,32 +179,26 @@ | |||
478 | 177 | self.mock_clear_holders.assert_called_with(disk) | 179 | self.mock_clear_holders.assert_called_with(disk) |
479 | 178 | self.mock_assert_clear.assert_called_with(disk) | 180 | self.mock_assert_clear.assert_called_with(disk) |
480 | 179 | 181 | ||
482 | 180 | def test_partition_handler_calls_clear_holder(self): | 182 | def test_partition_handler_wipes_at_partition_offset(self): |
483 | 183 | """ Test wiping partition at offset prior to creating partition""" | ||
484 | 181 | disk_info = self.storage_config.get('sda') | 184 | disk_info = self.storage_config.get('sda') |
485 | 182 | part_info = self.storage_config.get('sda-part1') | 185 | part_info = self.storage_config.get('sda-part1') |
486 | 183 | disk_kname = disk_info.get('path') | 186 | disk_kname = disk_info.get('path') |
487 | 184 | part_kname = disk_kname + '1' | 187 | part_kname = disk_kname + '1' |
488 | 185 | self.mock_getpath.side_effect = iter([ | 188 | self.mock_getpath.side_effect = iter([ |
492 | 186 | disk_info.get('id'), | 189 | disk_kname, |
490 | 187 | part_kname, | ||
491 | 188 | part_kname, | ||
493 | 189 | part_kname, | 190 | part_kname, |
494 | 190 | ]) | 191 | ]) |
495 | 191 | |||
496 | 192 | self.mock_block_get_part_table_type.return_value = 'dos' | 192 | self.mock_block_get_part_table_type.return_value = 'dos' |
497 | 193 | kname = 'xxx' | 193 | kname = 'xxx' |
498 | 194 | self.mock_block_path_to_kname.return_value = kname | 194 | self.mock_block_path_to_kname.return_value = kname |
499 | 195 | self.mock_block_sys_block_path.return_value = '/sys/class/block/xxx' | 195 | self.mock_block_sys_block_path.return_value = '/sys/class/block/xxx' |
500 | 196 | self.mock_subp.side_effect = iter([ | ||
501 | 197 | ("", 0), # parted mkpart | ||
502 | 198 | ("", 0), # ?? | ||
503 | 199 | ]) | ||
504 | 200 | holders = ['md1'] | ||
505 | 201 | self.mock_get_holders.return_value = holders | ||
506 | 202 | 196 | ||
507 | 203 | block_meta.partition_handler(part_info, self.storage_config) | 197 | block_meta.partition_handler(part_info, self.storage_config) |
508 | 204 | 198 | ||
513 | 205 | print("clear_holders: %s" % self.mock_clear_holders.call_args_list) | 199 | part_offset = 2048 * 512 |
514 | 206 | print("assert_clear: %s" % self.mock_assert_clear.call_args_list) | 200 | self.mock_block_zero_file.assert_called_with(disk_kname, [part_offset], |
515 | 207 | self.mock_clear_holders.assert_called_with(part_kname) | 201 | exclusive=False) |
516 | 208 | self.mock_assert_clear.assert_called_with(part_kname) | 202 | self.mock_subp.assert_called_with(['parted', disk_kname, '--script', |
517 | 203 | 'mkpart', 'primary', '2048s', | ||
518 | 204 | '1001471s'], capture=True) | ||
519 | 209 | 205 | ||
520 | === modified file 'tests/vmtests/__init__.py' | |||
521 | --- tests/vmtests/__init__.py 2017-10-06 02:20:08 +0000 | |||
522 | +++ tests/vmtests/__init__.py 2017-11-07 18:32:47 +0000 | |||
523 | @@ -699,9 +699,6 @@ | |||
524 | 699 | logger.info('Detected centos, adding default config %s', | 699 | logger.info('Detected centos, adding default config %s', |
525 | 700 | centos_default) | 700 | centos_default) |
526 | 701 | 701 | ||
527 | 702 | if cls.multipath: | ||
528 | 703 | disks = disks * cls.multipath_num_paths | ||
529 | 704 | |||
530 | 705 | # set reporting logger | 702 | # set reporting logger |
531 | 706 | cls.reporting_log = os.path.join(cls.td.logs, 'webhooks-events.json') | 703 | cls.reporting_log = os.path.join(cls.td.logs, 'webhooks-events.json') |
532 | 707 | reporting_logger = CaptureReporting(cls.reporting_log) | 704 | reporting_logger = CaptureReporting(cls.reporting_log) |
533 | @@ -727,7 +724,7 @@ | |||
534 | 727 | })) | 724 | })) |
535 | 728 | configs.append(reporting_config) | 725 | configs.append(reporting_config) |
536 | 729 | 726 | ||
538 | 730 | cmd.extend(uefi_flags + netdevs + disks + | 727 | cmd.extend(uefi_flags + netdevs + cls.mpath_diskargs(disks) + |
539 | 731 | [ftypes['vmtest.root-image'], "--kernel=%s" % | 728 | [ftypes['vmtest.root-image'], "--kernel=%s" % |
540 | 732 | ftypes['boot-kernel'], "--initrd=%s" % | 729 | ftypes['boot-kernel'], "--initrd=%s" % |
541 | 733 | ftypes['boot-initrd'], "--", "curtin", "-vv", "install"] + | 730 | ftypes['boot-initrd'], "--", "curtin", "-vv", "install"] + |
542 | @@ -825,11 +822,6 @@ | |||
543 | 825 | # unlike NVMe disks, we do not want to configure the iSCSI disks | 822 | # unlike NVMe disks, we do not want to configure the iSCSI disks |
544 | 826 | # via KVM, which would use qemu's iSCSI target layer. | 823 | # via KVM, which would use qemu's iSCSI target layer. |
545 | 827 | 824 | ||
546 | 828 | if cls.multipath: | ||
547 | 829 | target_disks = target_disks * cls.multipath_num_paths | ||
548 | 830 | extra_disks = extra_disks * cls.multipath_num_paths | ||
549 | 831 | nvme_disks = nvme_disks * cls.multipath_num_paths | ||
550 | 832 | |||
551 | 833 | # output disk is always virtio-blk, with serial of output_disk.img | 825 | # output disk is always virtio-blk, with serial of output_disk.img |
552 | 834 | output_disk = '--disk={},driver={},format={},{},{}'.format( | 826 | output_disk = '--disk={},driver={},format={},{},{}'.format( |
553 | 835 | cls.td.output_disk, 'virtio-blk', | 827 | cls.td.output_disk, 'virtio-blk', |
554 | @@ -840,11 +832,9 @@ | |||
555 | 840 | # create xkvm cmd | 832 | # create xkvm cmd |
556 | 841 | cmd = (["tools/xkvm", "-v", dowait] + | 833 | cmd = (["tools/xkvm", "-v", dowait] + |
557 | 842 | uefi_flags + netdevs + | 834 | uefi_flags + netdevs + |
563 | 843 | target_disks + extra_disks + nvme_disks + | 835 | cls.mpath_diskargs(target_disks + extra_disks + nvme_disks) + |
564 | 844 | ["--", "-drive", | 836 | ["--disk=file=%s,if=virtio,media=cdrom" % cls.td.seed_disk] + |
565 | 845 | "file=%s,if=virtio,media=cdrom" % cls.td.seed_disk, | 837 | ["--", "-smp", cls.get_config_smp(), "-m", "1024"]) |
561 | 846 | "-smp", cls.get_config_smp(), | ||
562 | 847 | "-m", "1024"]) | ||
566 | 848 | 838 | ||
567 | 849 | if not cls.interactive: | 839 | if not cls.interactive: |
568 | 850 | if cls.arch == 's390x': | 840 | if cls.arch == 's390x': |
569 | @@ -1007,6 +997,15 @@ | |||
570 | 1007 | # prepending ./ makes '/root/file' or 'root/file' work as expected. | 997 | # prepending ./ makes '/root/file' or 'root/file' work as expected. |
571 | 1008 | return os.path.normpath(os.path.join(cls.td.collect, "./" + path)) | 998 | return os.path.normpath(os.path.join(cls.td.collect, "./" + path)) |
572 | 1009 | 999 | ||
573 | 1000 | @classmethod | ||
574 | 1001 | def mpath_diskargs(cls, disks): | ||
575 | 1002 | """make multipath versions of --disk args in disks.""" | ||
576 | 1003 | if not cls.multipath: | ||
577 | 1004 | return disks | ||
578 | 1005 | opt = ",file.locking=off" | ||
579 | 1006 | return ([d if d == "--disk" else d + opt for d in disks] * | ||
580 | 1007 | cls.multipath_num_paths) | ||
581 | 1008 | |||
582 | 1010 | # Misc functions that are useful for many tests | 1009 | # Misc functions that are useful for many tests |
583 | 1011 | def output_files_exist(self, files): | 1010 | def output_files_exist(self, files): |
584 | 1012 | logger.debug('checking files exist: %s', files) | 1011 | logger.debug('checking files exist: %s', files) |
585 | @@ -1459,7 +1458,7 @@ | |||
586 | 1459 | logger.info('Taring %s disks sparsely to %s', len(disks), outfile) | 1458 | logger.info('Taring %s disks sparsely to %s', len(disks), outfile) |
587 | 1460 | util.subp(cmd, capture=True) | 1459 | util.subp(cmd, capture=True) |
588 | 1461 | else: | 1460 | else: |
590 | 1462 | logger.error('Failed to find "disks" dir under tmpdir: %s', tmpdir) | 1461 | logger.debug('No "disks" dir found in tmpdir: %s', tmpdir) |
591 | 1463 | 1462 | ||
592 | 1464 | 1463 | ||
593 | 1465 | def boot_log_wrap(name, func, cmd, console_log, timeout, purpose): | 1464 | def boot_log_wrap(name, func, cmd, console_log, timeout, purpose): |
594 | 1466 | 1465 | ||
595 | === modified file 'tests/vmtests/releases.py' | |||
596 | --- tests/vmtests/releases.py 2017-08-03 19:48:07 +0000 | |||
597 | +++ tests/vmtests/releases.py 2017-11-07 18:32:47 +0000 | |||
598 | @@ -39,15 +39,6 @@ | |||
599 | 39 | target_release = "centos66" | 39 | target_release = "centos66" |
600 | 40 | 40 | ||
601 | 41 | 41 | ||
602 | 42 | class _PreciseBase(_UbuntuBase): | ||
603 | 43 | release = "precise" | ||
604 | 44 | |||
605 | 45 | |||
606 | 46 | class _PreciseHWET(_UbuntuBase): | ||
607 | 47 | release = "precise" | ||
608 | 48 | krel = "trusty" | ||
609 | 49 | |||
610 | 50 | |||
611 | 51 | class _TrustyBase(_UbuntuBase): | 42 | class _TrustyBase(_UbuntuBase): |
612 | 52 | release = "trusty" | 43 | release = "trusty" |
613 | 53 | 44 | ||
614 | @@ -90,8 +81,6 @@ | |||
615 | 90 | 81 | ||
616 | 91 | 82 | ||
617 | 92 | class _Releases(object): | 83 | class _Releases(object): |
618 | 93 | precise = _PreciseBase | ||
619 | 94 | precise_hwe_t = _PreciseHWET | ||
620 | 95 | trusty = _TrustyBase | 84 | trusty = _TrustyBase |
621 | 96 | trusty_hwe_u = _TrustyHWEU | 85 | trusty_hwe_u = _TrustyHWEU |
622 | 97 | trusty_hwe_v = _TrustyHWEV | 86 | trusty_hwe_v = _TrustyHWEV |
623 | 98 | 87 | ||
624 | === modified file 'tests/vmtests/test_basic.py' | |||
625 | --- tests/vmtests/test_basic.py 2017-08-03 19:48:07 +0000 | |||
626 | +++ tests/vmtests/test_basic.py 2017-11-07 18:32:47 +0000 | |||
627 | @@ -137,49 +137,6 @@ | |||
628 | 137 | self.assertEqual(source_version, installed_version) | 137 | self.assertEqual(source_version, installed_version) |
629 | 138 | 138 | ||
630 | 139 | 139 | ||
631 | 140 | class PreciseTestBasic(relbase.precise, TestBasicAbs): | ||
632 | 141 | __test__ = True | ||
633 | 142 | |||
634 | 143 | collect_scripts = [textwrap.dedent(""" | ||
635 | 144 | cd OUTPUT_COLLECT_D | ||
636 | 145 | blkid -o export /dev/vda > blkid_output_vda | ||
637 | 146 | blkid -o export /dev/vda1 > blkid_output_vda1 | ||
638 | 147 | blkid -o export /dev/vda2 > blkid_output_vda2 | ||
639 | 148 | f="btrfs_uuid_vdd" | ||
640 | 149 | btrfs-show /dev/vdd | awk '/uuid/ {print $4}' > $f | ||
641 | 150 | cat /proc/partitions > proc_partitions | ||
642 | 151 | ls -al /dev/disk/by-uuid/ > ls_uuid | ||
643 | 152 | cat /etc/fstab > fstab | ||
644 | 153 | mkdir -p /dev/disk/by-dname | ||
645 | 154 | ls /dev/disk/by-dname/ > ls_dname | ||
646 | 155 | find /etc/network/interfaces.d > find_interfacesd | ||
647 | 156 | |||
648 | 157 | v="" | ||
649 | 158 | out=$(apt-config shell v Acquire::HTTP::Proxy) | ||
650 | 159 | eval "$out" | ||
651 | 160 | echo "$v" > apt-proxy | ||
652 | 161 | """)] | ||
653 | 162 | |||
654 | 163 | def test_whole_disk_format(self): | ||
655 | 164 | # confirm the whole disk format is the expected device | ||
656 | 165 | btrfs_uuid = self.load_collect_file("btrfs_uuid_vdd").strip() | ||
657 | 166 | |||
658 | 167 | self.assertTrue(btrfs_uuid is not None) | ||
659 | 168 | self.assertEqual(len(btrfs_uuid), 36) | ||
660 | 169 | |||
661 | 170 | # extract uuid from ls_uuid by kname | ||
662 | 171 | kname_uuid = self._kname_to_uuid('vdd') | ||
663 | 172 | |||
664 | 173 | # compare them | ||
665 | 174 | self.assertEqual(kname_uuid, btrfs_uuid) | ||
666 | 175 | |||
667 | 176 | def test_ptable(self): | ||
668 | 177 | print("test_ptable does not work for Precise") | ||
669 | 178 | |||
670 | 179 | def test_dname(self): | ||
671 | 180 | print("test_dname does not work for Precise") | ||
672 | 181 | |||
673 | 182 | |||
674 | 183 | class TrustyTestBasic(relbase.trusty, TestBasicAbs): | 140 | class TrustyTestBasic(relbase.trusty, TestBasicAbs): |
675 | 184 | __test__ = True | 141 | __test__ = True |
676 | 185 | 142 | ||
677 | @@ -193,11 +150,6 @@ | |||
678 | 193 | print("test_ptable does not work for Trusty") | 150 | print("test_ptable does not work for Trusty") |
679 | 194 | 151 | ||
680 | 195 | 152 | ||
681 | 196 | class PreciseHWETTestBasic(relbase.precise_hwe_t, PreciseTestBasic): | ||
682 | 197 | # FIXME: off due to test_whole_disk_format failing | ||
683 | 198 | __test__ = False | ||
684 | 199 | |||
685 | 200 | |||
686 | 201 | class TrustyHWEXTestBasic(relbase.trusty_hwe_x, TrustyTestBasic): | 153 | class TrustyHWEXTestBasic(relbase.trusty_hwe_x, TrustyTestBasic): |
687 | 202 | __test__ = True | 154 | __test__ = True |
688 | 203 | 155 | ||
689 | 204 | 156 | ||
690 | === modified file 'tests/vmtests/test_bcache_basic.py' | |||
691 | --- tests/vmtests/test_bcache_basic.py 2017-08-03 19:48:07 +0000 | |||
692 | +++ tests/vmtests/test_bcache_basic.py 2017-11-07 18:32:47 +0000 | |||
693 | @@ -43,10 +43,6 @@ | |||
694 | 43 | self.check_file_regex("cmdline", r"root=UUID=") | 43 | self.check_file_regex("cmdline", r"root=UUID=") |
695 | 44 | 44 | ||
696 | 45 | 45 | ||
697 | 46 | class PreciseHWETBcacheBasic(relbase.precise_hwe_t, TestBcacheBasic): | ||
698 | 47 | __test__ = True | ||
699 | 48 | |||
700 | 49 | |||
701 | 50 | class TrustyBcacheBasic(relbase.trusty, TestBcacheBasic): | 46 | class TrustyBcacheBasic(relbase.trusty, TestBcacheBasic): |
702 | 51 | __test__ = False # covered by test_raid5_bcache | 47 | __test__ = False # covered by test_raid5_bcache |
703 | 52 | 48 | ||
704 | 53 | 49 | ||
705 | === added file 'tests/vmtests/test_bcache_bug1718699.py' | |||
706 | --- tests/vmtests/test_bcache_bug1718699.py 1970-01-01 00:00:00 +0000 | |||
707 | +++ tests/vmtests/test_bcache_bug1718699.py 2017-11-07 18:32:47 +0000 | |||
708 | @@ -0,0 +1,21 @@ | |||
709 | 1 | from .releases import base_vm_classes as relbase | ||
710 | 2 | from .test_bcache_basic import TestBcacheBasic | ||
711 | 3 | |||
712 | 4 | |||
713 | 5 | class TestBcacheBug1718699(TestBcacheBasic): | ||
714 | 6 | conf_file = "examples/tests/bcache-wipe-xfs.yaml" | ||
715 | 7 | dirty_disks = False | ||
716 | 8 | nr_cpus = 2 | ||
717 | 9 | extra_disks = ['10G'] | ||
718 | 10 | |||
719 | 11 | |||
720 | 12 | class XenialTestBcacheBug1718699(relbase.xenial, TestBcacheBug1718699): | ||
721 | 13 | __test__ = True | ||
722 | 14 | |||
723 | 15 | |||
724 | 16 | class ZestyTestBcacheBug1718699(relbase.zesty, TestBcacheBug1718699): | ||
725 | 17 | __test__ = True | ||
726 | 18 | |||
727 | 19 | |||
728 | 20 | class ArtfulTestBcacheBug1718699(relbase.artful, TestBcacheBug1718699): | ||
729 | 21 | __test__ = True | ||
730 | 0 | 22 | ||
731 | === modified file 'tests/vmtests/test_iscsi.py' | |||
732 | --- tests/vmtests/test_iscsi.py 2017-08-03 19:48:07 +0000 | |||
733 | +++ tests/vmtests/test_iscsi.py 2017-11-07 18:32:47 +0000 | |||
734 | @@ -47,10 +47,6 @@ | |||
735 | 47 | (testfile, expected_content, content)) | 47 | (testfile, expected_content, content)) |
736 | 48 | 48 | ||
737 | 49 | 49 | ||
738 | 50 | class PreciseTestIscsiBasic(relbase.precise, TestBasicIscsiAbs): | ||
739 | 51 | __test__ = True | ||
740 | 52 | |||
741 | 53 | |||
742 | 54 | class TrustyTestIscsiBasic(relbase.trusty, TestBasicIscsiAbs): | 50 | class TrustyTestIscsiBasic(relbase.trusty, TestBasicIscsiAbs): |
743 | 55 | __test__ = True | 51 | __test__ = True |
744 | 56 | 52 | ||
745 | 57 | 53 | ||
746 | === modified file 'tests/vmtests/test_lvm.py' | |||
747 | --- tests/vmtests/test_lvm.py 2017-08-03 19:48:07 +0000 | |||
748 | +++ tests/vmtests/test_lvm.py 2017-11-07 18:32:47 +0000 | |||
749 | @@ -48,14 +48,6 @@ | |||
750 | 48 | raise SkipTest("test_dname does not work for %s" % self.release) | 48 | raise SkipTest("test_dname does not work for %s" % self.release) |
751 | 49 | 49 | ||
752 | 50 | 50 | ||
753 | 51 | class PreciseTestLvm(relbase.precise, TestLvmAbs): | ||
754 | 52 | __test__ = True | ||
755 | 53 | |||
756 | 54 | |||
757 | 55 | class PreciseHWETTestLvm(relbase.precise_hwe_t, PreciseTestLvm): | ||
758 | 56 | __test__ = True | ||
759 | 57 | |||
760 | 58 | |||
761 | 59 | class TrustyTestLvm(relbase.trusty, TestLvmAbs): | 51 | class TrustyTestLvm(relbase.trusty, TestLvmAbs): |
762 | 60 | __test__ = True | 52 | __test__ = True |
763 | 61 | 53 | ||
764 | 62 | 54 | ||
765 | === modified file 'tests/vmtests/test_lvm_iscsi.py' | |||
766 | --- tests/vmtests/test_lvm_iscsi.py 2017-10-06 02:20:08 +0000 | |||
767 | +++ tests/vmtests/test_lvm_iscsi.py 2017-11-07 18:32:47 +0000 | |||
768 | @@ -47,10 +47,6 @@ | |||
769 | 47 | self.check_file_strippedline("pvs", "vg2=/dev/sdb6") | 47 | self.check_file_strippedline("pvs", "vg2=/dev/sdb6") |
770 | 48 | 48 | ||
771 | 49 | 49 | ||
772 | 50 | class PreciseTestIscsiLvm(relbase.precise, TestLvmIscsiAbs): | ||
773 | 51 | __test__ = True | ||
774 | 52 | |||
775 | 53 | |||
776 | 54 | class TrustyTestIscsiLvm(relbase.trusty, TestLvmIscsiAbs): | 50 | class TrustyTestIscsiLvm(relbase.trusty, TestLvmIscsiAbs): |
777 | 55 | __test__ = True | 51 | __test__ = True |
778 | 56 | 52 | ||
779 | 57 | 53 | ||
780 | === modified file 'tests/vmtests/test_mdadm_iscsi.py' | |||
781 | --- tests/vmtests/test_mdadm_iscsi.py 2017-10-06 02:20:08 +0000 | |||
782 | +++ tests/vmtests/test_mdadm_iscsi.py 2017-11-07 18:32:47 +0000 | |||
783 | @@ -22,10 +22,6 @@ | |||
784 | 22 | """)] | 22 | """)] |
785 | 23 | 23 | ||
786 | 24 | 24 | ||
787 | 25 | class PreciseTestIscsiMdadm(relbase.precise, TestMdadmIscsiAbs): | ||
788 | 26 | __test__ = True | ||
789 | 27 | |||
790 | 28 | |||
791 | 29 | class TrustyTestIscsiMdadm(relbase.trusty, TestMdadmIscsiAbs): | 25 | class TrustyTestIscsiMdadm(relbase.trusty, TestMdadmIscsiAbs): |
792 | 30 | __test__ = True | 26 | __test__ = True |
793 | 31 | 27 | ||
794 | 32 | 28 | ||
795 | === modified file 'tests/vmtests/test_network.py' | |||
796 | --- tests/vmtests/test_network.py 2017-10-06 02:20:08 +0000 | |||
797 | +++ tests/vmtests/test_network.py 2017-11-07 18:32:47 +0000 | |||
798 | @@ -449,11 +449,6 @@ | |||
799 | 449 | pass | 449 | pass |
800 | 450 | 450 | ||
801 | 451 | 451 | ||
802 | 452 | class PreciseHWETTestNetworkBasic(relbase.precise_hwe_t, TestNetworkBasicAbs): | ||
803 | 453 | # FIXME: off due to hang at test: Starting execute cloud user/final scripts | ||
804 | 454 | __test__ = False | ||
805 | 455 | |||
806 | 456 | |||
807 | 457 | class TrustyTestNetworkBasic(relbase.trusty, TestNetworkBasicAbs): | 452 | class TrustyTestNetworkBasic(relbase.trusty, TestNetworkBasicAbs): |
808 | 458 | __test__ = True | 453 | __test__ = True |
809 | 459 | 454 | ||
810 | 460 | 455 | ||
811 | === modified file 'tests/vmtests/test_network_alias.py' | |||
812 | --- tests/vmtests/test_network_alias.py 2017-08-03 19:48:07 +0000 | |||
813 | +++ tests/vmtests/test_network_alias.py 2017-11-07 18:32:47 +0000 | |||
814 | @@ -41,11 +41,6 @@ | |||
815 | 41 | __test__ = True | 41 | __test__ = True |
816 | 42 | 42 | ||
817 | 43 | 43 | ||
818 | 44 | class PreciseHWETTestNetworkAlias(relbase.precise_hwe_t, TestNetworkAliasAbs): | ||
819 | 45 | # FIXME: off due to hang at test: Starting execute cloud user/final scripts | ||
820 | 46 | __test__ = True | ||
821 | 47 | |||
822 | 48 | |||
823 | 49 | class TrustyTestNetworkAlias(relbase.trusty, TestNetworkAliasAbs): | 44 | class TrustyTestNetworkAlias(relbase.trusty, TestNetworkAliasAbs): |
824 | 50 | __test__ = True | 45 | __test__ = True |
825 | 51 | 46 | ||
826 | 52 | 47 | ||
827 | === modified file 'tests/vmtests/test_network_bonding.py' | |||
828 | --- tests/vmtests/test_network_bonding.py 2017-10-06 02:20:08 +0000 | |||
829 | +++ tests/vmtests/test_network_bonding.py 2017-11-07 18:32:47 +0000 | |||
830 | @@ -38,14 +38,6 @@ | |||
831 | 38 | pass | 38 | pass |
832 | 39 | 39 | ||
833 | 40 | 40 | ||
834 | 41 | class PreciseHWETTestBonding(relbase.precise_hwe_t, TestNetworkBondingAbs): | ||
835 | 42 | __test__ = True | ||
836 | 43 | |||
837 | 44 | def test_ifenslave_installed(self): | ||
838 | 45 | self.assertIn("ifenslave-2.6", self.debian_packages, | ||
839 | 46 | "ifenslave deb not installed") | ||
840 | 47 | |||
841 | 48 | |||
842 | 49 | class TrustyTestBonding(relbase.trusty, TestNetworkBondingAbs): | 41 | class TrustyTestBonding(relbase.trusty, TestNetworkBondingAbs): |
843 | 50 | __test__ = False | 42 | __test__ = False |
844 | 51 | 43 | ||
845 | 52 | 44 | ||
846 | === modified file 'tests/vmtests/test_network_enisource.py' | |||
847 | --- tests/vmtests/test_network_enisource.py 2017-10-06 02:20:08 +0000 | |||
848 | +++ tests/vmtests/test_network_enisource.py 2017-11-07 18:32:47 +0000 | |||
849 | @@ -79,12 +79,6 @@ | |||
850 | 79 | self.assertEqual(_nocidr(expected_address), _nocidr(actual_address)) | 79 | self.assertEqual(_nocidr(expected_address), _nocidr(actual_address)) |
851 | 80 | 80 | ||
852 | 81 | 81 | ||
853 | 82 | class PreciseTestNetworkENISource(relbase.precise, TestNetworkENISource): | ||
854 | 83 | __test__ = False | ||
855 | 84 | # not working, still debugging though; possible older ifupdown doesn't | ||
856 | 85 | # like the multiple iface method. | ||
857 | 86 | |||
858 | 87 | |||
859 | 88 | class TrustyTestNetworkENISource(relbase.trusty, TestNetworkENISource): | 82 | class TrustyTestNetworkENISource(relbase.trusty, TestNetworkENISource): |
860 | 89 | __test__ = True | 83 | __test__ = True |
861 | 90 | 84 | ||
862 | 91 | 85 | ||
863 | === modified file 'tests/vmtests/test_network_ipv6.py' | |||
864 | --- tests/vmtests/test_network_ipv6.py 2017-10-06 02:20:08 +0000 | |||
865 | +++ tests/vmtests/test_network_ipv6.py 2017-11-07 18:32:47 +0000 | |||
866 | @@ -40,11 +40,6 @@ | |||
867 | 40 | pass | 40 | pass |
868 | 41 | 41 | ||
869 | 42 | 42 | ||
870 | 43 | class PreciseHWETTestNetwork(relbase.precise_hwe_t, TestNetworkIPV6Abs): | ||
871 | 44 | # FIXME: off due to hang at test: Starting execute cloud user/final scripts | ||
872 | 45 | __test__ = False | ||
873 | 46 | |||
874 | 47 | |||
875 | 48 | class TrustyTestNetworkIPV6(relbase.trusty, TestNetworkIPV6Abs): | 43 | class TrustyTestNetworkIPV6(relbase.trusty, TestNetworkIPV6Abs): |
876 | 49 | __test__ = True | 44 | __test__ = True |
877 | 50 | 45 | ||
878 | 51 | 46 | ||
879 | === modified file 'tests/vmtests/test_network_ipv6_enisource.py' | |||
880 | --- tests/vmtests/test_network_ipv6_enisource.py 2017-10-06 02:20:08 +0000 | |||
881 | +++ tests/vmtests/test_network_ipv6_enisource.py 2017-11-07 18:32:47 +0000 | |||
882 | @@ -12,13 +12,6 @@ | |||
883 | 12 | pass | 12 | pass |
884 | 13 | 13 | ||
885 | 14 | 14 | ||
886 | 15 | class PreciseTestNetworkIPV6ENISource(relbase.precise, | ||
887 | 16 | TestNetworkIPV6ENISource): | ||
888 | 17 | __test__ = False | ||
889 | 18 | # not working, still debugging though; possible older ifupdown doesn't | ||
890 | 19 | # like the multiple iface method. | ||
891 | 20 | |||
892 | 21 | |||
893 | 22 | class TrustyTestNetworkIPV6ENISource(relbase.trusty, TestNetworkIPV6ENISource): | 15 | class TrustyTestNetworkIPV6ENISource(relbase.trusty, TestNetworkIPV6ENISource): |
894 | 23 | __test__ = True | 16 | __test__ = True |
895 | 24 | 17 | ||
896 | 25 | 18 | ||
897 | === modified file 'tests/vmtests/test_network_ipv6_static.py' | |||
898 | --- tests/vmtests/test_network_ipv6_static.py 2017-08-03 19:48:07 +0000 | |||
899 | +++ tests/vmtests/test_network_ipv6_static.py 2017-11-07 18:32:47 +0000 | |||
900 | @@ -13,11 +13,6 @@ | |||
901 | 13 | conf_file = "examples/tests/basic_network_static_ipv6.yaml" | 13 | conf_file = "examples/tests/basic_network_static_ipv6.yaml" |
902 | 14 | 14 | ||
903 | 15 | 15 | ||
904 | 16 | class PreciseHWETTestNetworkIPV6Static(relbase.precise_hwe_t, | ||
905 | 17 | TestNetworkIPV6StaticAbs): | ||
906 | 18 | __test__ = True | ||
907 | 19 | |||
908 | 20 | |||
909 | 21 | class TrustyTestNetworkIPV6Static(relbase.trusty, TestNetworkIPV6StaticAbs): | 16 | class TrustyTestNetworkIPV6Static(relbase.trusty, TestNetworkIPV6StaticAbs): |
910 | 22 | __test__ = True | 17 | __test__ = True |
911 | 23 | 18 | ||
912 | 24 | 19 | ||
913 | === modified file 'tests/vmtests/test_network_ipv6_vlan.py' | |||
914 | --- tests/vmtests/test_network_ipv6_vlan.py 2017-10-06 02:20:08 +0000 | |||
915 | +++ tests/vmtests/test_network_ipv6_vlan.py 2017-11-07 18:32:47 +0000 | |||
916 | @@ -12,22 +12,6 @@ | |||
917 | 12 | conf_file = "examples/tests/vlan_network_ipv6.yaml" | 12 | conf_file = "examples/tests/vlan_network_ipv6.yaml" |
918 | 13 | 13 | ||
919 | 14 | 14 | ||
920 | 15 | class PreciseTestNetworkIPV6Vlan(relbase.precise, TestNetworkIPV6VlanAbs): | ||
921 | 16 | __test__ = True | ||
922 | 17 | |||
923 | 18 | # precise ip -d link show output is different (of course) | ||
924 | 19 | def test_vlan_enabled(self): | ||
925 | 20 | |||
926 | 21 | # we must have at least one | ||
927 | 22 | self.assertGreaterEqual(len(self.get_vlans()), 1) | ||
928 | 23 | |||
929 | 24 | # did they get configured? | ||
930 | 25 | for vlan in self.get_vlans(): | ||
931 | 26 | link_file = "ip_link_show_" + vlan['name'] | ||
932 | 27 | vlan_msg = "vlan id " + str(vlan['vlan_id']) | ||
933 | 28 | self.check_file_regex(link_file, vlan_msg) | ||
934 | 29 | |||
935 | 30 | |||
936 | 31 | class TrustyTestNetworkIPV6Vlan(relbase.trusty, TestNetworkIPV6VlanAbs): | 15 | class TrustyTestNetworkIPV6Vlan(relbase.trusty, TestNetworkIPV6VlanAbs): |
937 | 32 | __test__ = True | 16 | __test__ = True |
938 | 33 | 17 | ||
939 | 34 | 18 | ||
940 | === modified file 'tests/vmtests/test_network_mtu.py' | |||
941 | --- tests/vmtests/test_network_mtu.py 2017-10-06 02:20:08 +0000 | |||
942 | +++ tests/vmtests/test_network_mtu.py 2017-11-07 18:32:47 +0000 | |||
943 | @@ -155,11 +155,6 @@ | |||
944 | 155 | pass | 155 | pass |
945 | 156 | 156 | ||
946 | 157 | 157 | ||
947 | 158 | class PreciseHWETTestNetworkMtu(relbase.precise_hwe_t, TestNetworkMtuAbs): | ||
948 | 159 | # FIXME: Precise mtu / ipv6 is buggy | ||
949 | 160 | __test__ = False | ||
950 | 161 | |||
951 | 162 | |||
952 | 163 | class TrustyTestNetworkMtu(relbase.trusty, TestNetworkMtuAbs): | 158 | class TrustyTestNetworkMtu(relbase.trusty, TestNetworkMtuAbs): |
953 | 164 | __test__ = True | 159 | __test__ = True |
954 | 165 | 160 | ||
955 | @@ -203,7 +198,7 @@ | |||
956 | 203 | @classmethod | 198 | @classmethod |
957 | 204 | def setUpClass(cls): | 199 | def setUpClass(cls): |
958 | 205 | cls.skip_by_date(cls.__name__, cls.release, "1671951", | 200 | cls.skip_by_date(cls.__name__, cls.release, "1671951", |
960 | 206 | fixby=(2017, 10, 20), removeby=(2018, 1, 23)) | 201 | fixby=(2018, 1, 20), removeby=(2018, 2, 23)) |
961 | 207 | super().setUpClass() | 202 | super().setUpClass() |
962 | 208 | 203 | ||
963 | 209 | 204 | ||
964 | 210 | 205 | ||
965 | === modified file 'tests/vmtests/test_network_static.py' | |||
966 | --- tests/vmtests/test_network_static.py 2017-08-03 19:48:07 +0000 | |||
967 | +++ tests/vmtests/test_network_static.py 2017-11-07 18:32:47 +0000 | |||
968 | @@ -28,12 +28,6 @@ | |||
969 | 28 | pass | 28 | pass |
970 | 29 | 29 | ||
971 | 30 | 30 | ||
972 | 31 | class PreciseHWETTestNetworkStatic(relbase.precise_hwe_t, | ||
973 | 32 | TestNetworkStaticAbs): | ||
974 | 33 | # FIXME: off due to hang at test: Starting execute cloud user/final scripts | ||
975 | 34 | __test__ = False | ||
976 | 35 | |||
977 | 36 | |||
978 | 37 | class TrustyTestNetworkStatic(relbase.trusty, TestNetworkStaticAbs): | 31 | class TrustyTestNetworkStatic(relbase.trusty, TestNetworkStaticAbs): |
979 | 38 | __test__ = True | 32 | __test__ = True |
980 | 39 | 33 | ||
981 | 40 | 34 | ||
982 | === modified file 'tests/vmtests/test_network_static_routes.py' | |||
983 | --- tests/vmtests/test_network_static_routes.py 2017-08-03 19:48:07 +0000 | |||
984 | +++ tests/vmtests/test_network_static_routes.py 2017-11-07 18:32:47 +0000 | |||
985 | @@ -16,12 +16,6 @@ | |||
986 | 16 | conf_file = "examples/tests/network_static_routes.yaml" | 16 | conf_file = "examples/tests/network_static_routes.yaml" |
987 | 17 | 17 | ||
988 | 18 | 18 | ||
989 | 19 | class PreciseHWETTestNetworkStaticRoutes(relbase.precise_hwe_t, | ||
990 | 20 | TestNetworkStaticRoutesAbs): | ||
991 | 21 | # FIXME: off due to hang at test: Starting execute cloud user/final scripts | ||
992 | 22 | __test__ = False | ||
993 | 23 | |||
994 | 24 | |||
995 | 25 | class TrustyTestNetworkStaticRoutes(relbase.trusty, | 19 | class TrustyTestNetworkStaticRoutes(relbase.trusty, |
996 | 26 | TestNetworkStaticRoutesAbs): | 20 | TestNetworkStaticRoutesAbs): |
997 | 27 | __test__ = True | 21 | __test__ = True |
998 | 28 | 22 | ||
999 | === modified file 'tests/vmtests/test_network_vlan.py' | |||
1000 | --- tests/vmtests/test_network_vlan.py 2017-10-06 02:20:08 +0000 | |||
1001 | +++ tests/vmtests/test_network_vlan.py 2017-11-07 18:32:47 +0000 | |||
1002 | @@ -68,22 +68,6 @@ | |||
1003 | 68 | pass | 68 | pass |
1004 | 69 | 69 | ||
1005 | 70 | 70 | ||
1006 | 71 | class PreciseTestNetworkVlan(relbase.precise, TestNetworkVlanAbs): | ||
1007 | 72 | __test__ = True | ||
1008 | 73 | |||
1009 | 74 | # precise ip -d link show output is different (of course) | ||
1010 | 75 | def test_vlan_enabled(self): | ||
1011 | 76 | |||
1012 | 77 | # we must have at least one | ||
1013 | 78 | self.assertGreaterEqual(len(self.get_vlans()), 1) | ||
1014 | 79 | |||
1015 | 80 | # did they get configured? | ||
1016 | 81 | for vlan in self.get_vlans(): | ||
1017 | 82 | link_file = "ip_link_show_" + vlan['name'] | ||
1018 | 83 | vlan_msg = "vlan id " + str(vlan['vlan_id']) | ||
1019 | 84 | self.check_file_regex(link_file, vlan_msg) | ||
1020 | 85 | |||
1021 | 86 | |||
1022 | 87 | class TrustyTestNetworkVlan(relbase.trusty, TestNetworkVlanAbs): | 71 | class TrustyTestNetworkVlan(relbase.trusty, TestNetworkVlanAbs): |
1023 | 88 | __test__ = True | 72 | __test__ = True |
1024 | 89 | 73 | ||
1025 | 90 | 74 | ||
1026 | === modified file 'tests/vmtests/test_nvme.py' | |||
1027 | --- tests/vmtests/test_nvme.py 2017-08-03 19:48:07 +0000 | |||
1028 | +++ tests/vmtests/test_nvme.py 2017-11-07 18:32:47 +0000 | |||
1029 | @@ -53,11 +53,6 @@ | |||
1030 | 53 | self.check_file_strippedline("ls_dev_nvme", "/dev/nvme1") | 53 | self.check_file_strippedline("ls_dev_nvme", "/dev/nvme1") |
1031 | 54 | 54 | ||
1032 | 55 | 55 | ||
1033 | 56 | class PreciseTestNvme(relbase.precise, TestNvmeAbs): | ||
1034 | 57 | __test__ = False | ||
1035 | 58 | # Precise kernel doesn't have NVME support, with TrustyHWE it would | ||
1036 | 59 | |||
1037 | 60 | |||
1038 | 61 | class TrustyTestNvme(relbase.trusty, TestNvmeAbs): | 56 | class TrustyTestNvme(relbase.trusty, TestNvmeAbs): |
1039 | 62 | __test__ = True | 57 | __test__ = True |
1040 | 63 | 58 | ||
1041 | 64 | 59 | ||
1042 | === modified file 'tests/vmtests/test_raid5_bcache.py' | |||
1043 | --- tests/vmtests/test_raid5_bcache.py 2017-08-03 19:48:07 +0000 | |||
1044 | +++ tests/vmtests/test_raid5_bcache.py 2017-11-07 18:32:47 +0000 | |||
1045 | @@ -65,11 +65,6 @@ | |||
1046 | 65 | self.check_file_regex("bcache_cache_mode", r"\[writeback\]") | 65 | self.check_file_regex("bcache_cache_mode", r"\[writeback\]") |
1047 | 66 | 66 | ||
1048 | 67 | 67 | ||
1049 | 68 | class PreciseHWETTestRaid5Bcache(relbase.precise_hwe_t, TestMdadmBcacheAbs): | ||
1050 | 69 | # FIXME: off due to failing install: RUN_ARRAY failed: Invalid argument | ||
1051 | 70 | __test__ = False | ||
1052 | 71 | |||
1053 | 72 | |||
1054 | 73 | class TrustyTestRaid5Bcache(relbase.trusty, TestMdadmBcacheAbs): | 68 | class TrustyTestRaid5Bcache(relbase.trusty, TestMdadmBcacheAbs): |
1055 | 74 | __test__ = True | 69 | __test__ = True |
1056 | 75 | # FIXME(LP: #1523037): dname does not work on trusty, so we cannot expect | 70 | # FIXME(LP: #1523037): dname does not work on trusty, so we cannot expect |
1057 | 76 | 71 | ||
1058 | === modified file 'tests/vmtests/test_uefi_basic.py' | |||
1059 | --- tests/vmtests/test_uefi_basic.py 2017-08-03 19:48:07 +0000 | |||
1060 | +++ tests/vmtests/test_uefi_basic.py 2017-11-07 18:32:47 +0000 | |||
1061 | @@ -9,7 +9,7 @@ | |||
1062 | 9 | interactive = False | 9 | interactive = False |
1063 | 10 | arch_skip = ["s390x"] | 10 | arch_skip = ["s390x"] |
1064 | 11 | conf_file = "examples/tests/uefi_basic.yaml" | 11 | conf_file = "examples/tests/uefi_basic.yaml" |
1066 | 12 | extra_disks = [] | 12 | extra_disks = ['4G'] |
1067 | 13 | uefi = True | 13 | uefi = True |
1068 | 14 | disk_to_check = [('main_disk', 1), ('main_disk', 2), ('main_disk', 3)] | 14 | disk_to_check = [('main_disk', 1), ('main_disk', 2), ('main_disk', 3)] |
1069 | 15 | collect_scripts = [textwrap.dedent(""" | 15 | collect_scripts = [textwrap.dedent(""" |
1070 | @@ -76,16 +76,6 @@ | |||
1071 | 76 | self.assertEqual(self.disk_block_size, size) | 76 | self.assertEqual(self.disk_block_size, size) |
1072 | 77 | 77 | ||
1073 | 78 | 78 | ||
1074 | 79 | class PreciseUefiTestBasic(relbase.precise, TestBasicAbs): | ||
1075 | 80 | __test__ = True | ||
1076 | 81 | |||
1077 | 82 | def test_ptable(self): | ||
1078 | 83 | print("test_ptable does not work for Precise") | ||
1079 | 84 | |||
1080 | 85 | def test_dname(self): | ||
1081 | 86 | print("test_dname does not work for Precise") | ||
1082 | 87 | |||
1083 | 88 | |||
1084 | 89 | class TrustyUefiTestBasic(relbase.trusty, TestBasicAbs): | 79 | class TrustyUefiTestBasic(relbase.trusty, TestBasicAbs): |
1085 | 90 | __test__ = True | 80 | __test__ = True |
1086 | 91 | 81 | ||
1087 | @@ -115,10 +105,6 @@ | |||
1088 | 115 | __test__ = True | 105 | __test__ = True |
1089 | 116 | 106 | ||
1090 | 117 | 107 | ||
1091 | 118 | class PreciseUefiTestBasic4k(PreciseUefiTestBasic): | ||
1092 | 119 | disk_block_size = 4096 | ||
1093 | 120 | |||
1094 | 121 | |||
1095 | 122 | class TrustyUefiTestBasic4k(TrustyUefiTestBasic): | 108 | class TrustyUefiTestBasic4k(TrustyUefiTestBasic): |
1096 | 123 | disk_block_size = 4096 | 109 | disk_block_size = 4096 |
1097 | 124 | 110 | ||
1098 | 125 | 111 | ||
1099 | === modified file 'tools/launch' | |||
1100 | --- tools/launch 2017-08-03 19:48:07 +0000 | |||
1101 | +++ tools/launch 2017-11-07 18:32:47 +0000 | |||
1102 | @@ -583,11 +583,10 @@ | |||
1103 | 583 | bs_args="${bs_args},physical_block_size=$phybs" | 583 | bs_args="${bs_args},physical_block_size=$phybs" |
1104 | 584 | bs_args="${bs_args},min_io_size=$logbs" | 584 | bs_args="${bs_args},min_io_size=$logbs" |
1105 | 585 | 585 | ||
1111 | 586 | disk_args=( "${disk_args[@]}" "-drive" | 586 | t="file=${src},if=none,cache=unsafe,format=$fmt," |
1112 | 587 | "file=${src},if=none,cache=unsafe,format=$fmt,id=drv${id},index=$id" ) | 587 | t="${t}id=drv${id},index=$id," |
1113 | 588 | 588 | t="${t}driver=${driver},${bs_args}${devopts}" | |
1114 | 589 | disk_args=( "${disk_args[@]}" "-device" | 589 | disk_args[${#disk_args[@]}]="--disk=$t" |
1110 | 590 | "${driver},drive=drv${id},${bs_args}${devopts}" ) | ||
1115 | 591 | 590 | ||
1116 | 592 | done | 591 | done |
1117 | 593 | 592 | ||
1118 | @@ -754,7 +753,7 @@ | |||
1119 | 754 | seed="${TEMP_D}/seed.img" | 753 | seed="${TEMP_D}/seed.img" |
1120 | 755 | cloud-localds "$seed" "$udata" "$mdata" || | 754 | cloud-localds "$seed" "$udata" "$mdata" || |
1121 | 756 | { error "failed cloud-localds"; return 1; } | 755 | { error "failed cloud-localds"; return 1; } |
1123 | 757 | seedargs=( "-drive" "file=${seed},if=virtio,media=cdrom" ) | 756 | seedargs=( "--disk=file=${seed},if=virtio,media=cdrom" ) |
1124 | 758 | fi | 757 | fi |
1125 | 759 | 758 | ||
1126 | 760 | local netargs | 759 | local netargs |
1127 | @@ -779,13 +778,14 @@ | |||
1128 | 779 | fi | 778 | fi |
1129 | 780 | fi | 779 | fi |
1130 | 781 | # -monitor stdio | 780 | # -monitor stdio |
1131 | 781 | local bootdisk="--disk=file=$bootimg,id=boot,index=1,cache=unsafe" | ||
1132 | 782 | cmd=( | 782 | cmd=( |
1134 | 783 | xkvm "${pt[@]}" "${netargs[@]}" -- | 783 | xkvm "${pt[@]}" "${netargs[@]}" |
1135 | 784 | "$bootdisk" | ||
1136 | 785 | "${disk_args[@]}" | ||
1137 | 786 | -- | ||
1138 | 784 | -smp ${smp} | 787 | -smp ${smp} |
1139 | 785 | -m ${mem} ${serial_args} ${video} | 788 | -m ${mem} ${serial_args} ${video} |
1140 | 786 | -drive "file=$bootimg,if=none,cache=unsafe,format=qcow2,id=boot,index=0" | ||
1141 | 787 | -device "virtio-blk,drive=boot" | ||
1142 | 788 | "${disk_args[@]}" | ||
1143 | 789 | "${seedargs[@]}" | 789 | "${seedargs[@]}" |
1144 | 790 | ) | 790 | ) |
1145 | 791 | 791 | ||
1146 | 792 | 792 | ||
1147 | === modified file 'tools/xkvm' | |||
1148 | --- tools/xkvm 2016-12-02 02:04:27 +0000 | |||
1149 | +++ tools/xkvm 2017-11-07 18:32:47 +0000 | |||
1150 | @@ -11,6 +11,8 @@ | |||
1151 | 11 | # OVS_CLEANUP gets populated with bridge:devname pairs used with ovs | 11 | # OVS_CLEANUP gets populated with bridge:devname pairs used with ovs |
1152 | 12 | OVS_CLEANUP=( ) | 12 | OVS_CLEANUP=( ) |
1153 | 13 | MAC_PREFIX="52:54:00:12:34" | 13 | MAC_PREFIX="52:54:00:12:34" |
1154 | 14 | # allow this to be set externally. | ||
1155 | 15 | _QEMU_SUPPORTS_FILE_LOCKING="${_QEMU_SUPPORTS_FILE_LOCKING}" | ||
1156 | 14 | KVM="kvm" | 16 | KVM="kvm" |
1157 | 15 | declare -A KVM_DEVOPTS | 17 | declare -A KVM_DEVOPTS |
1158 | 16 | 18 | ||
1159 | @@ -119,6 +121,21 @@ | |||
1160 | 119 | return 1 | 121 | return 1 |
1161 | 120 | } | 122 | } |
1162 | 121 | 123 | ||
1163 | 124 | qemu_supports_file_locking() { | ||
1164 | 125 | # hackily check if qemu has file.locking in -drive params (LP: #1716028) | ||
1165 | 126 | if [ -z "$_QEMU_SUPPORTS_FILE_LOCKING" ]; then | ||
1166 | 127 | # The only way we could find to check presense of file.locking is | ||
1167 | 128 | # qmp (query-qmp-schema). Simply checking if the virtio-blk driver | ||
1168 | 129 | # supports 'share-rw' is expected to be equivalent and simpler. | ||
1169 | 130 | isdevopt virtio-blk share-rw && | ||
1170 | 131 | _QEMU_SUPPORTS_FILE_LOCKING=true || | ||
1171 | 132 | _QEMU_SUPPORTS_FILE_LOCKING=false | ||
1172 | 133 | debug 1 "qemu supports file locking = ${_QEMU_SUPPORTS_FILE_LOCKING}" | ||
1173 | 134 | fi | ||
1174 | 135 | [ "$_QEMU_SUPPORTS_FILE_LOCKING" = "true" ] | ||
1175 | 136 | return | ||
1176 | 137 | } | ||
1177 | 138 | |||
1178 | 122 | padmac() { | 139 | padmac() { |
1179 | 123 | # return a full mac, given a subset. | 140 | # return a full mac, given a subset. |
1180 | 124 | # assume whatever is input is the last portion to be | 141 | # assume whatever is input is the last portion to be |
1181 | @@ -443,7 +460,7 @@ | |||
1182 | 443 | out=$(LANG=C qemu-img info "$file") && | 460 | out=$(LANG=C qemu-img info "$file") && |
1183 | 444 | fmt=$(echo "$out" | awk '$0 ~ /^file format:/ { print $3 }') || | 461 | fmt=$(echo "$out" | awk '$0 ~ /^file format:/ { print $3 }') || |
1184 | 445 | { error "failed to determine format of $file"; return 1; } | 462 | { error "failed to determine format of $file"; return 1; } |
1186 | 446 | else | 463 | elif [ -z "$fmt" ]; then |
1187 | 447 | fmt=raw | 464 | fmt=raw |
1188 | 448 | fi | 465 | fi |
1189 | 449 | if [ -z "$driver" ]; then | 466 | if [ -z "$driver" ]; then |
1190 | @@ -470,6 +487,12 @@ | |||
1191 | 470 | id=*|if=*|driver=*|$file|file=*) continue;; | 487 | id=*|if=*|driver=*|$file|file=*) continue;; |
1192 | 471 | fmt=*|format=*) continue;; | 488 | fmt=*|format=*) continue;; |
1193 | 472 | serial=*|bus=*|unit=*|index=*) continue;; | 489 | serial=*|bus=*|unit=*|index=*) continue;; |
1194 | 490 | file.locking=*) | ||
1195 | 491 | qemu_supports_file_locking || { | ||
1196 | 492 | debug 2 "qemu has no file locking." \ | ||
1197 | 493 | "Dropping '$tok' from: $cur" | ||
1198 | 494 | continue | ||
1199 | 495 | };; | ||
1200 | 473 | esac | 496 | esac |
1201 | 474 | isdevopt "$driver" "$tok" && devopts="${devopts},$tok" || | 497 | isdevopt "$driver" "$tok" && devopts="${devopts},$tok" || |
1202 | 475 | diskopts="${diskopts},${tok}" | 498 | diskopts="${diskopts},${tok}" |