Merge lp:~smoser/curtin/trunk.yakkety into lp:~curtin-dev/curtin/trunk

Proposed by Scott Moser
Status: Merged
Merged at revision: 393
Proposed branch: lp:~smoser/curtin/trunk.yakkety
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 734 lines (+259/-153)
13 files modified
curtin/commands/curthooks.py (+2/-2)
tests/vmtests/__init__.py (+2/-2)
tests/vmtests/helpers.py (+169/-0)
tests/vmtests/releases.py (+5/-0)
tests/vmtests/test_basic.py (+4/-4)
tests/vmtests/test_bcache_basic.py (+4/-0)
tests/vmtests/test_bonding.py (+6/-44)
tests/vmtests/test_lvm.py (+4/-4)
tests/vmtests/test_mdadm_bcache.py (+24/-24)
tests/vmtests/test_network.py (+19/-57)
tests/vmtests/test_nvme.py (+4/-4)
tests/vmtests/test_raid5_bcache.py (+8/-4)
tests/vmtests/test_uefi_basic.py (+8/-8)
To merge this branch: bzr merge lp:~smoser/curtin/trunk.yakkety
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Needs Fixing
Review via email: mp+297534@code.launchpad.net

Commit message

tests/vmtests: add yakkety, remove vivid

Vivid is unsupported now, so remove those tests.
Add Yakkety tests for any test that had a xenial test.

The one thing that is questionable here is the usage of 'linux-generic'
as the fallback, where previously there was none.
The change means that linux-generic kernel would be installed
even if there was a useful kernel installed in the image.

Fix ifconfig output parsing to work for yakkety, And remove the code
duplication by putting the ifconfig parser into helpers.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~smoser/curtin/trunk.yakkety updated
403. By Scott Moser

fix flake8

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

Looks good, minor nits.

Also, I don't think that we're installing a kernel if we don't need one. There should be some discussion on the defaults in the code.

Can we control or set that on a per-test basis (ie, supply curtin config to set the default kernel or kernel mapping)? I'd like to not slow down curtin vmtest with unnecessary kernel installs.

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

So yeah, the one thing questionable is the installation of linux-generic
by default, and that could actually be an issue. See the comment i put in revno 398 here:

| set fallback kernel to 'linux-generic'
|
| this is making yakkety work much nicer, and we should definitely have a
| fallback. I'm just not sure that this is the right way to do this. It seems
| like some more involved kernel package handling might be needed.
|
| For example
| * an image might have a kernel installed already.
| They'd reasonably want to just use that kernel as is.
| * installing 'package' could result in 2 kernels being installed
| and 'package' kernel not even being selected as it is older.
|
| some thought required.

Not sure what the best thing to do here is. I had started on a more
involved patch that would go looking for a kernel. Heres some doc
i started to write:

+# kernel config
+# package: ensure this package is installed
+# fallback-package: kernel-package
+# mapping: {release: {'X.Y.Z': {'package'}}}
+#
+# kernel package selection is done by:
+# if package is provided and not None use it.
+# install 'package' or fail trying.
+# if the booted release/kernel-version is found in 'mapping', use it.
+# if 'package' is avialable in apt:
+# install it or fail trying
+#
+# # At this point either package == None or fallback mapping kernel not
+# # installable.
+# if fallback is set to None
+# do not attempt installation of anything
+# elif there is *any* kernel package installed:
+# let it be, do nothing.
+# else:
+# if fallback package is installed:
+# do nothing (do not upgrade it if it is present)
+# else
+# attempt install 'fallback' or fail trying

I thought we should also possibly add a 'purge-others' option that would
possibly even default to true. Where if a kernel package was installed
then others in the image would be removed. This would be the only
real way to guarantee that the kernel isntalled woudl be the one booted.

lp:~smoser/curtin/trunk.yakkety updated
404. By Scott Moser

add example ifconfig output

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

added some example content in the parsers.

lp:~smoser/curtin/trunk.yakkety updated
405. By Scott Moser

shrink dictionary vertically in doc string

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'curtin/commands/curthooks.py'
2--- curtin/commands/curthooks.py 2016-05-17 21:14:36 +0000
3+++ curtin/commands/curthooks.py 2016-06-16 18:45:24 +0000
4@@ -238,7 +238,7 @@
5
6 def install_kernel(cfg, target):
7 kernel_cfg = cfg.get('kernel', {'package': None,
8- 'fallback-package': None,
9+ 'fallback-package': "linux-generic",
10 'mapping': {}})
11 if kernel_cfg is not None:
12 kernel_package = kernel_cfg.get('package')
13@@ -270,7 +270,7 @@
14 LOG.warn("Couldn't detect kernel package to install for %s."
15 % kernel)
16 if kernel_fallback is not None:
17- util.install_packages([kernel_fallback])
18+ util.install_packages([kernel_fallback], target=target)
19 return
20
21 package = "linux-{flavor}{map_suffix}".format(
22
23=== modified file 'tests/vmtests/__init__.py'
24--- tests/vmtests/__init__.py 2016-05-18 01:08:46 +0000
25+++ tests/vmtests/__init__.py 2016-06-16 18:45:24 +0000
26@@ -510,8 +510,8 @@
27 logger.debug('')
28 try:
29 if os.path.exists(cls.install_log):
30- with open(cls.install_log) as l:
31- install_log = l.read()
32+ with open(cls.install_log, 'rb') as l:
33+ install_log = l.read().decode('utf-8', errors='replace')
34 errmsg, errors = check_install_log(install_log)
35 if errmsg:
36 for e in errors:
37
38=== modified file 'tests/vmtests/helpers.py'
39--- tests/vmtests/helpers.py 2016-01-11 16:59:28 +0000
40+++ tests/vmtests/helpers.py 2016-06-16 18:45:24 +0000
41@@ -117,3 +117,172 @@
42 if getattr(test_case, 'release', ''):
43 releases.add(getattr(test_case, 'release'))
44 return sorted(releases)
45+
46+
47+def _parse_ifconfig_xenial(ifconfig_out):
48+ """Parse ifconfig output from xenial or earlier and return a dictionary.
49+ given content like below, return:
50+ {'eth0': {'address': '10.8.1.78', 'broadcast': '10.8.1.255',
51+ 'inet6': [{'address': 'fe80::216:3eff:fe63:c05d',
52+ 'prefixlen': '64', 'scope': 'Link'},
53+ {'address': 'fdec:2922:2f07:0:216:3eff:fe63:c05d',
54+ 'prefixlen': '64', 'scope': 'Global'}],
55+ 'interface': 'eth0', 'link_encap': 'Ethernet',
56+ 'mac_address': '00:16:3e:63:c0:5d', 'mtu': 1500,
57+ 'multicast': True, 'netmask': '255.255.255.0',
58+ 'running': True, 'up': True}}
59+
60+ eth0 Link encap:Ethernet HWaddr 00:16:3e:63:c0:5d
61+ inet addr:10.8.1.78 Bcast:10.8.1.255 Mask:255.255.255.0
62+ inet6 addr: fe80::216:3eff:fe63:c05d/64 Scope:Link
63+ inet6 addr: fdec:2922:2f07:0:216:3eff:fe63:c05d/64 Scope:Global
64+ UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
65+ RX packets:21503 errors:0 dropped:0 overruns:0 frame:0
66+ TX packets:11346 errors:0 dropped:0 overruns:0 carrier:0
67+ collisions:0 txqueuelen:1000
68+ RX bytes:31556357 (31.5 MB) TX bytes:870943 (870.9 KB)
69+ """
70+ ifaces = {}
71+ combined_fields = {'addr': 'address', 'Bcast': 'broadcast',
72+ 'Mask': 'netmask', 'MTU': 'mtu',
73+ 'encap': 'link_encap'}
74+ boolmap = {'RUNNING': 'running', 'UP': 'up', 'MULTICAST': 'multicast'}
75+
76+ for line in ifconfig_out.splitlines():
77+ if not line:
78+ continue
79+ if not line.startswith(" "):
80+ cur_iface = line.split()[0].rstrip(":")
81+ cur_data = {'inet6': [], 'interface': cur_iface}
82+ for t in boolmap.values():
83+ cur_data[t] = False
84+ ifaces[cur_iface] = cur_data
85+
86+ toks = line.split()
87+
88+ if toks[0] == "inet6":
89+ cidr = toks[2]
90+ address, prefixlen = cidr.split("/")
91+ scope = toks[3].split(":")[1]
92+ cur_ipv6 = {'address': address, 'scope': scope,
93+ 'prefixlen': prefixlen}
94+ cur_data['inet6'].append(cur_ipv6)
95+ continue
96+
97+ for i in range(0, len(toks)):
98+ cur_tok = toks[i]
99+ try:
100+ next_tok = toks[i+1]
101+ except IndexError:
102+ next_tok = None
103+
104+ if cur_tok == "HWaddr":
105+ cur_data['mac_address'] = next_tok
106+ elif ":" in cur_tok:
107+ key, _colon, val = cur_tok.partition(":")
108+ if key in combined_fields:
109+ cur_data[combined_fields[key]] = val
110+ elif cur_tok in boolmap:
111+ cur_data[boolmap[cur_tok]] = True
112+
113+ if 'mtu' in cur_data:
114+ cur_data['mtu'] = int(cur_data['mtu'])
115+
116+ return ifaces
117+
118+
119+def _parse_ifconfig_yakkety(ifconfig_out):
120+ """Parse ifconfig output from yakkety or later(?) and return a dictionary.
121+
122+ given ifconfig output like below, return:
123+ {'ens2': {'address': '10.5.0.78',
124+ 'broadcast': '10.5.255.255',
125+ 'broadcast_flag': True,
126+ 'inet6': [{'address': 'fe80::f816:3eff:fe05:9673',
127+ 'prefixlen': '64', 'scopeid': '0x20<link>'},
128+ {'address': 'fe80::f816:3eff:fe05:9673',
129+ 'prefixlen': '64', 'scopeid': '0x20<link>'}],
130+ 'interface': 'ens2', 'link_encap': 'Ethernet',
131+ 'mac_address': 'fa:16:3e:05:96:73', 'mtu': 1500,
132+ 'multicast': True, 'netmask': '255.255.0.0',
133+ 'running': True, 'up': True}}
134+
135+ ens2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
136+ inet 10.5.0.78 netmask 255.255.0.0 broadcast 10.5.255.255
137+ inet6 fe80::f816:3eff:fe05:9673 prefixlen 64 scopeid 0x20<link>
138+ inet6 fe80::f816:3eff:fe05:9673 prefixlen 64 scopeid 0x20<link>
139+ ether fa:16:3e:05:96:73 txqueuelen 1000 (Ethernet)
140+ RX packets 33196 bytes 48916947 (48.9 MB)
141+ RX errors 0 dropped 0 overruns 0 frame 0
142+ TX packets 5458 bytes 411486 (411.4 KB)
143+ TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
144+ """
145+ fmap = {'mtu': 'mtu', 'inet': 'address',
146+ 'netmask': 'netmask', 'broadcast': 'broadcast',
147+ 'ether': 'mac_address'}
148+ boolmap = {'RUNNING': 'running', 'UP': 'up', 'MULTICAST': 'multicast',
149+ 'BROADCAST': 'broadcast_flag'}
150+
151+ ifaces = {}
152+ for line in ifconfig_out.splitlines():
153+ if not line:
154+ continue
155+ if not line.startswith(" "):
156+ cur_iface = line.split()[0].rstrip(":")
157+ cur_data = {'inet6': [], 'interface': cur_iface}
158+ for t in boolmap.values():
159+ cur_data[t] = False
160+ ifaces[cur_iface] = cur_data
161+
162+ toks = line.split()
163+ if toks[0] == "inet6":
164+ cur_ipv6 = {'address': toks[1]}
165+ cur_data['inet6'].append(cur_ipv6)
166+
167+ for i in range(0, len(toks)):
168+ cur_tok = toks[i]
169+ try:
170+ next_tok = toks[i+1]
171+ except IndexError:
172+ next_tok = None
173+ if cur_tok in fmap:
174+ cur_data[fmap[cur_tok]] = next_tok
175+ elif cur_tok in ('prefixlen', 'scopeid'):
176+ cur_ipv6[cur_tok] = next_tok
177+ cur_data['inet6'].append
178+ elif cur_tok.startswith("flags="):
179+ # flags=4163<UP,BROADCAST,RUNNING,MULTICAST>
180+ flags = cur_tok[cur_tok.find("<") + 1:
181+ cur_tok.rfind(">")].split(",")
182+ for flag in flags:
183+ if flag in boolmap:
184+ cur_data[boolmap[flag]] = True
185+ elif cur_tok == "(Ethernet)":
186+ cur_data['link_encap'] = 'Ethernet'
187+
188+ if 'mtu' in cur_data:
189+ cur_data['mtu'] = int(cur_data['mtu'])
190+
191+ return ifaces
192+
193+
194+def ifconfig_to_dict(ifconfig_a):
195+ # if the first token of the first line ends in a ':' then assume yakkety
196+ # parse ifconfig output and return a dictionary.
197+ #
198+ # return a dictionary of network information like:
199+ # {'ens2': {'address': '10.5.0.78', 'broadcast': '10.5.255.255',
200+ # 'broadcast_flag': True,
201+ # 'inet6': [{'address': 'fe80::f816:3eff:fe05:9673',
202+ # 'prefixlen': '64', 'scopeid': '0x20<link>'},
203+ # {'address': 'fe80::f816:3eff:fe05:9673',
204+ # 'prefixlen': '64', 'scopeid': '0x20<link>'}],
205+ # 'interface': 'ens2', 'link_encap': 'Ethernet',
206+ # 'mac_address': 'fa:16:3e:05:96:73', 'mtu': 1500,
207+ # 'multicast': True, 'netmask': '255.255.0.0',
208+ # 'running': True, 'up': True}}
209+ line = ifconfig_a.lstrip().splitlines()[0]
210+ if line.split()[0].endswith(":"):
211+ return _parse_ifconfig_yakkety(ifconfig_a)
212+ else:
213+ return _parse_ifconfig_xenial(ifconfig_a)
214
215=== modified file 'tests/vmtests/releases.py'
216--- tests/vmtests/releases.py 2016-04-11 20:26:08 +0000
217+++ tests/vmtests/releases.py 2016-06-16 18:45:24 +0000
218@@ -46,6 +46,10 @@
219 release = "xenial"
220
221
222+class _YakketyBase(_ReleaseBase):
223+ release = "yakkety"
224+
225+
226 class _Releases(object):
227 precise = _PreciseBase
228 precise_hwe_t = _PreciseHWET
229@@ -56,6 +60,7 @@
230 vivid = _VividBase
231 wily = _WilyBase
232 xenial = _XenialBase
233+ yakkety = _YakketyBase
234
235 base_vm_classes = _Releases
236
237
238=== modified file 'tests/vmtests/test_basic.py'
239--- tests/vmtests/test_basic.py 2016-05-17 20:55:46 +0000
240+++ tests/vmtests/test_basic.py 2016-06-16 18:45:24 +0000
241@@ -223,13 +223,13 @@
242 __test__ = False
243
244
245-class VividTestBasic(relbase.vivid, TestBasicAbs):
246- __test__ = True
247-
248-
249 class WilyTestBasic(relbase.wily, TestBasicAbs):
250 __test__ = True
251
252
253 class XenialTestBasic(relbase.xenial, TestBasicAbs):
254 __test__ = True
255+
256+
257+class YakketyTestBasic(relbase.yakkety, TestBasicAbs):
258+ __test__ = True
259
260=== modified file 'tests/vmtests/test_bcache_basic.py'
261--- tests/vmtests/test_bcache_basic.py 2016-05-17 20:55:46 +0000
262+++ tests/vmtests/test_bcache_basic.py 2016-06-16 18:45:24 +0000
263@@ -50,3 +50,7 @@
264
265 class XenialBcacheBasic(relbase.xenial, TestBcacheBasic):
266 __test__ = True
267+
268+
269+class YakketyBcacheBasic(relbase.yakkety, TestBcacheBasic):
270+ __test__ = True
271
272=== modified file 'tests/vmtests/test_bonding.py'
273--- tests/vmtests/test_bonding.py 2016-05-17 20:55:46 +0000
274+++ tests/vmtests/test_bonding.py 2016-06-16 18:45:24 +0000
275@@ -1,4 +1,4 @@
276-from . import VMBaseClass, logger
277+from . import VMBaseClass, logger, helpers
278 from .releases import base_vm_classes as relbase
279
280 import ipaddress
281@@ -8,44 +8,6 @@
282 import yaml
283
284
285-def iface_extract(input):
286- mo = re.search(r'^(?P<interface>\w+|\w+:\d+)\s+' +
287- r'Link encap:(?P<link_encap>\S+)\s+' +
288- r'(HWaddr\s+(?P<mac_address>\S+))?' +
289- r'(\s+inet addr:(?P<address>\S+))?' +
290- r'(\s+Bcast:(?P<broadcast>\S+)\s+)?' +
291- r'(Mask:(?P<netmask>\S+)\s+)?',
292- input, re.MULTILINE)
293-
294- mtu = re.search(r'(\s+MTU:(?P<mtu>\d+)\s+)\s+', input, re.MULTILINE)
295- mtu_info = mtu.groupdict('')
296- mtu_info['mtu'] = int(mtu_info['mtu'])
297-
298- if mo:
299- info = mo.groupdict('')
300- info['running'] = False
301- info['up'] = False
302- info['multicast'] = False
303- if 'RUNNING' in input:
304- info['running'] = True
305- if 'UP' in input:
306- info['up'] = True
307- if 'MULTICAST' in input:
308- info['multicast'] = True
309- info.update(mtu_info)
310- return info
311- return {}
312-
313-
314-def ifconfig_to_dict(ifconfig):
315- interfaces = {}
316- for iface in [iface_extract(iface) for iface in ifconfig.split('\n\n')
317- if iface.strip()]:
318- interfaces[iface['interface']] = iface
319-
320- return interfaces
321-
322-
323 class TestNetworkAbs(VMBaseClass):
324 interactive = False
325 conf_file = "examples/tests/bonding_network.yaml"
326@@ -96,7 +58,7 @@
327 ifconfig_a = fp.read()
328 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
329
330- ifconfig_dict = ifconfig_to_dict(ifconfig_a)
331+ ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
332 logger.debug('parsed ifcfg dict:\n{}'.format(
333 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
334
335@@ -230,13 +192,13 @@
336 __test__ = True
337
338
339-class VividTestBonding(relbase.vivid, TestNetworkAbs):
340- __test__ = True
341-
342-
343 class WilyTestBonding(relbase.wily, TestNetworkAbs):
344 __test__ = True
345
346
347 class XenialTestBonding(relbase.xenial, TestNetworkAbs):
348 __test__ = True
349+
350+
351+class YakketyTestBonding(relbase.yakkety, TestNetworkAbs):
352+ __test__ = True
353
354=== modified file 'tests/vmtests/test_lvm.py'
355--- tests/vmtests/test_lvm.py 2016-05-19 20:46:36 +0000
356+++ tests/vmtests/test_lvm.py 2016-06-16 18:45:24 +0000
357@@ -63,13 +63,13 @@
358 print("test_dname does not work for Trusty")
359
360
361-class VividTestLvm(relbase.vivid, TestLvmAbs):
362- __test__ = True
363-
364-
365 class WilyTestLvm(relbase.wily, TestLvmAbs):
366 __test__ = True
367
368
369 class XenialTestLvm(relbase.xenial, TestLvmAbs):
370 __test__ = True
371+
372+
373+class YakketyTestLvm(relbase.yakkety, TestLvmAbs):
374+ __test__ = True
375
376=== modified file 'tests/vmtests/test_mdadm_bcache.py'
377--- tests/vmtests/test_mdadm_bcache.py 2016-05-18 01:08:46 +0000
378+++ tests/vmtests/test_mdadm_bcache.py 2016-06-16 18:45:24 +0000
379@@ -130,10 +130,6 @@
380 __test__ = True
381
382
383-class VividTestMdadmBcache(relbase.vivid, TestMdadmBcacheAbs):
384- __test__ = True
385-
386-
387 class WilyTestMdadmBcache(relbase.wily, TestMdadmBcacheAbs):
388 __test__ = True
389
390@@ -142,6 +138,10 @@
391 __test__ = True
392
393
394+class YakketyTestMdadmBcache(relbase.yakkety, TestMdadmBcacheAbs):
395+ __test__ = True
396+
397+
398 class TestMirrorbootAbs(TestMdadmAbs):
399 # alternative config for more complex setup
400 conf_file = "examples/tests/mirrorboot.yaml"
401@@ -170,10 +170,6 @@
402 __test__ = True
403
404
405-class VividTestMirrorboot(relbase.vivid, TestMirrorbootAbs):
406- __test__ = True
407-
408-
409 class WilyTestMirrorboot(relbase.wily, TestMirrorbootAbs):
410 __test__ = True
411
412@@ -182,6 +178,10 @@
413 __test__ = True
414
415
416+class YakketyTestMirrorboot(relbase.yakkety, TestMirrorbootAbs):
417+ __test__ = True
418+
419+
420 class TestRaid5bootAbs(TestMdadmAbs):
421 # alternative config for more complex setup
422 conf_file = "examples/tests/raid5boot.yaml"
423@@ -211,10 +211,6 @@
424 __test__ = True
425
426
427-class VividTestRaid5boot(relbase.vivid, TestRaid5bootAbs):
428- __test__ = True
429-
430-
431 class WilyTestRaid5boot(relbase.wily, TestRaid5bootAbs):
432 __test__ = True
433
434@@ -223,6 +219,10 @@
435 __test__ = True
436
437
438+class YakketyTestRaid5boot(relbase.yakkety, TestRaid5bootAbs):
439+ __test__ = True
440+
441+
442 class TestRaid6bootAbs(TestMdadmAbs):
443 # alternative config for more complex setup
444 conf_file = "examples/tests/raid6boot.yaml"
445@@ -264,10 +264,6 @@
446 __test__ = True
447
448
449-class VividTestRaid6boot(relbase.vivid, TestRaid6bootAbs):
450- __test__ = True
451-
452-
453 class WilyTestRaid6boot(relbase.wily, TestRaid6bootAbs):
454 __test__ = True
455
456@@ -276,6 +272,10 @@
457 __test__ = True
458
459
460+class YakketyTestRaid6boot(relbase.yakkety, TestRaid6bootAbs):
461+ __test__ = True
462+
463+
464 class TestRaid10bootAbs(TestMdadmAbs):
465 # alternative config for more complex setup
466 conf_file = "examples/tests/raid10boot.yaml"
467@@ -305,10 +305,6 @@
468 __test__ = True
469
470
471-class VividTestRaid10boot(relbase.vivid, TestRaid10bootAbs):
472- __test__ = True
473-
474-
475 class WilyTestRaid10boot(relbase.wily, TestRaid10bootAbs):
476 __test__ = True
477
478@@ -317,6 +313,10 @@
479 __test__ = True
480
481
482+class YakketyTestRaid10boot(relbase.yakkety, TestRaid10bootAbs):
483+ __test__ = True
484+
485+
486 class TestAllindataAbs(TestMdadmAbs):
487 # more complex, needs more time
488 # alternative config for more complex setup
489@@ -403,13 +403,13 @@
490 __test__ = False # lukes=no does not disable mounting of device
491
492
493-class VividTestAllindata(relbase.vivid, TestAllindataAbs):
494- __test__ = True
495-
496-
497 class WilyTestAllindata(relbase.wily, TestAllindataAbs):
498 __test__ = True
499
500
501 class XenialTestAllindata(relbase.xenial, TestAllindataAbs):
502 __test__ = True
503+
504+
505+class YakketyTestAllindata(relbase.yakkety, TestAllindataAbs):
506+ __test__ = True
507
508=== modified file 'tests/vmtests/test_network.py'
509--- tests/vmtests/test_network.py 2016-05-17 20:55:46 +0000
510+++ tests/vmtests/test_network.py 2016-06-16 18:45:24 +0000
511@@ -1,4 +1,4 @@
512-from . import VMBaseClass, logger
513+from . import VMBaseClass, logger, helpers
514 from .releases import base_vm_classes as relbase
515
516 import ipaddress
517@@ -9,44 +9,6 @@
518 import yaml
519
520
521-def iface_extract(input):
522- mo = re.search(r'^(?P<interface>\w+|\w+:\d+|\w+\.\d+)\s+' +
523- r'Link encap:(?P<link_encap>\S+)\s+' +
524- r'(HWaddr\s+(?P<mac_address>\S+))?' +
525- r'(\s+inet addr:(?P<address>\S+))?' +
526- r'(\s+Bcast:(?P<broadcast>\S+)\s+)?' +
527- r'(Mask:(?P<netmask>\S+)\s+)?',
528- input, re.MULTILINE)
529-
530- mtu = re.search(r'(\s+MTU:(?P<mtu>\d+)\s+)\s+', input, re.MULTILINE)
531- mtu_info = mtu.groupdict('')
532- mtu_info['mtu'] = int(mtu_info['mtu'])
533-
534- if mo:
535- info = mo.groupdict('')
536- info['running'] = False
537- info['up'] = False
538- info['multicast'] = False
539- if 'RUNNING' in input:
540- info['running'] = True
541- if 'UP' in input:
542- info['up'] = True
543- if 'MULTICAST' in input:
544- info['multicast'] = True
545- info.update(mtu_info)
546- return info
547- return {}
548-
549-
550-def ifconfig_to_dict(ifconfig):
551- interfaces = {}
552- for iface in [iface_extract(iface) for iface in ifconfig.split('\n\n')
553- if iface.strip()]:
554- interfaces[iface['interface']] = iface
555-
556- return interfaces
557-
558-
559 class TestNetworkAbs(VMBaseClass):
560 interactive = False
561 conf_file = "examples/tests/basic_network.yaml"
562@@ -132,7 +94,7 @@
563 ifconfig_a = fp.read()
564 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
565
566- ifconfig_dict = ifconfig_to_dict(ifconfig_a)
567+ ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
568 logger.debug('parsed ifcfg dict:\n{}'.format(
569 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
570
571@@ -340,7 +302,7 @@
572 ifconfig_a = fp.read()
573 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
574
575- ifconfig_dict = ifconfig_to_dict(ifconfig_a)
576+ ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
577 logger.debug('parsed ifconfig dict:\n{}'.format(
578 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
579 print('parsed ifconfig dict:\n{}'.format(
580@@ -411,14 +373,6 @@
581 __test__ = False
582
583
584-class VividTestNetwork(relbase.vivid, TestNetworkAbs):
585- __test__ = True
586-
587-
588-class VividTestNetworkStatic(relbase.vivid, TestNetworkStaticAbs):
589- __test__ = True
590-
591-
592 class WilyTestNetwork(relbase.wily, TestNetworkAbs):
593 __test__ = True
594
595@@ -435,6 +389,14 @@
596 __test__ = True
597
598
599+class YakketyTestNetwork(relbase.yakkety, TestNetworkAbs):
600+ __test__ = True
601+
602+
603+class YakketyTestNetworkStatic(relbase.yakkety, TestNetworkStaticAbs):
604+ __test__ = True
605+
606+
607 class PreciseTestNetworkVlan(relbase.precise, TestNetworkVlanAbs):
608 __test__ = True
609
610@@ -455,10 +417,6 @@
611 __test__ = True
612
613
614-class VividTestNetworkVlan(relbase.vivid, TestNetworkVlanAbs):
615- __test__ = True
616-
617-
618 class WilyTestNetworkVlan(relbase.wily, TestNetworkVlanAbs):
619 __test__ = True
620
621@@ -467,6 +425,10 @@
622 __test__ = True
623
624
625+class YakketyTestNetworkVlan(relbase.yakkety, TestNetworkVlanAbs):
626+ __test__ = True
627+
628+
629 class PreciseTestNetworkENISource(relbase.precise, TestNetworkENISource):
630 __test__ = False
631 # not working, still debugging though; possible older ifupdown doesn't
632@@ -477,13 +439,13 @@
633 __test__ = True
634
635
636-class VividTestNetworkENISource(relbase.vivid, TestNetworkENISource):
637- __test__ = True
638-
639-
640 class WilyTestNetworkENISource(relbase.wily, TestNetworkENISource):
641 __test__ = True
642
643
644 class XenialTestNetworkENISource(relbase.xenial, TestNetworkENISource):
645 __test__ = True
646+
647+
648+class YakketyTestNetworkENISource(relbase.yakkety, TestNetworkENISource):
649+ __test__ = True
650
651=== modified file 'tests/vmtests/test_nvme.py'
652--- tests/vmtests/test_nvme.py 2016-05-17 20:55:46 +0000
653+++ tests/vmtests/test_nvme.py 2016-06-16 18:45:24 +0000
654@@ -74,13 +74,13 @@
655 print("test_ptable does not work for Trusty")
656
657
658-class VividTestNvme(relbase.vivid, TestNvmeAbs):
659- __test__ = True
660-
661-
662 class WilyTestNvme(relbase.wily, TestNvmeAbs):
663 __test__ = True
664
665
666 class XenialTestNvme(relbase.xenial, TestNvmeAbs):
667 __test__ = True
668+
669+
670+class YakketyTestNvme(relbase.yakkety, TestNvmeAbs):
671+ __test__ = True
672
673=== modified file 'tests/vmtests/test_raid5_bcache.py'
674--- tests/vmtests/test_raid5_bcache.py 2016-05-17 20:55:46 +0000
675+++ tests/vmtests/test_raid5_bcache.py 2016-06-16 18:45:24 +0000
676@@ -93,9 +93,13 @@
677 __test__ = False
678
679
680-class VividTestRaid5Bcache(relbase.vivid, TestMdadmBcacheAbs):
681- __test__ = True
682-
683-
684 class WilyTestRaid5Bcache(relbase.wily, TestMdadmBcacheAbs):
685 __test__ = True
686+
687+
688+class XenialTestRaid5Bcache(relbase.xenial, TestMdadmBcacheAbs):
689+ __test__ = True
690+
691+
692+class YakketyTestRaid5Bcache(relbase.yakkety, TestMdadmBcacheAbs):
693+ __test__ = True
694
695=== modified file 'tests/vmtests/test_uefi_basic.py'
696--- tests/vmtests/test_uefi_basic.py 2016-05-17 20:55:46 +0000
697+++ tests/vmtests/test_uefi_basic.py 2016-06-16 18:45:24 +0000
698@@ -108,14 +108,14 @@
699 __test__ = True
700
701
702-class VividUefiTestBasic(relbase.vivid, TestBasicAbs):
703- __test__ = True
704-
705-
706 class XenialUefiTestBasic(relbase.xenial, TestBasicAbs):
707 __test__ = True
708
709
710+class YakketyUefiTestBasic(relbase.yakkety, TestBasicAbs):
711+ __test__ = True
712+
713+
714 class PreciseUefiTestBasic4k(PreciseUefiTestBasic):
715 disk_block_size = 4096
716
717@@ -124,13 +124,13 @@
718 disk_block_size = 4096
719
720
721-class VividUefiTestBasic4k(VividUefiTestBasic):
722- disk_block_size = 4096
723-
724-
725 class WilyUefiTestBasic4k(WilyUefiTestBasic):
726 disk_block_size = 4096
727
728
729 class XenialUefiTestBasic4k(XenialUefiTestBasic):
730 disk_block_size = 4096
731+
732+
733+class YakketyUefiTestBasic4k(YakketyUefiTestBasic):
734+ disk_block_size = 4096

Subscribers

People subscribed via source and target branches