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
=== modified file 'curtin/commands/curthooks.py'
--- curtin/commands/curthooks.py 2016-05-17 21:14:36 +0000
+++ curtin/commands/curthooks.py 2016-06-16 18:45:24 +0000
@@ -238,7 +238,7 @@
238238
239def install_kernel(cfg, target):239def install_kernel(cfg, target):
240 kernel_cfg = cfg.get('kernel', {'package': None,240 kernel_cfg = cfg.get('kernel', {'package': None,
241 'fallback-package': None,241 'fallback-package': "linux-generic",
242 'mapping': {}})242 'mapping': {}})
243 if kernel_cfg is not None:243 if kernel_cfg is not None:
244 kernel_package = kernel_cfg.get('package')244 kernel_package = kernel_cfg.get('package')
@@ -270,7 +270,7 @@
270 LOG.warn("Couldn't detect kernel package to install for %s."270 LOG.warn("Couldn't detect kernel package to install for %s."
271 % kernel)271 % kernel)
272 if kernel_fallback is not None:272 if kernel_fallback is not None:
273 util.install_packages([kernel_fallback])273 util.install_packages([kernel_fallback], target=target)
274 return274 return
275275
276 package = "linux-{flavor}{map_suffix}".format(276 package = "linux-{flavor}{map_suffix}".format(
277277
=== modified file 'tests/vmtests/__init__.py'
--- tests/vmtests/__init__.py 2016-05-18 01:08:46 +0000
+++ tests/vmtests/__init__.py 2016-06-16 18:45:24 +0000
@@ -510,8 +510,8 @@
510 logger.debug('')510 logger.debug('')
511 try:511 try:
512 if os.path.exists(cls.install_log):512 if os.path.exists(cls.install_log):
513 with open(cls.install_log) as l:513 with open(cls.install_log, 'rb') as l:
514 install_log = l.read()514 install_log = l.read().decode('utf-8', errors='replace')
515 errmsg, errors = check_install_log(install_log)515 errmsg, errors = check_install_log(install_log)
516 if errmsg:516 if errmsg:
517 for e in errors:517 for e in errors:
518518
=== modified file 'tests/vmtests/helpers.py'
--- tests/vmtests/helpers.py 2016-01-11 16:59:28 +0000
+++ tests/vmtests/helpers.py 2016-06-16 18:45:24 +0000
@@ -117,3 +117,172 @@
117 if getattr(test_case, 'release', ''):117 if getattr(test_case, 'release', ''):
118 releases.add(getattr(test_case, 'release'))118 releases.add(getattr(test_case, 'release'))
119 return sorted(releases)119 return sorted(releases)
120
121
122def _parse_ifconfig_xenial(ifconfig_out):
123 """Parse ifconfig output from xenial or earlier and return a dictionary.
124 given content like below, return:
125 {'eth0': {'address': '10.8.1.78', 'broadcast': '10.8.1.255',
126 'inet6': [{'address': 'fe80::216:3eff:fe63:c05d',
127 'prefixlen': '64', 'scope': 'Link'},
128 {'address': 'fdec:2922:2f07:0:216:3eff:fe63:c05d',
129 'prefixlen': '64', 'scope': 'Global'}],
130 'interface': 'eth0', 'link_encap': 'Ethernet',
131 'mac_address': '00:16:3e:63:c0:5d', 'mtu': 1500,
132 'multicast': True, 'netmask': '255.255.255.0',
133 'running': True, 'up': True}}
134
135 eth0 Link encap:Ethernet HWaddr 00:16:3e:63:c0:5d
136 inet addr:10.8.1.78 Bcast:10.8.1.255 Mask:255.255.255.0
137 inet6 addr: fe80::216:3eff:fe63:c05d/64 Scope:Link
138 inet6 addr: fdec:2922:2f07:0:216:3eff:fe63:c05d/64 Scope:Global
139 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
140 RX packets:21503 errors:0 dropped:0 overruns:0 frame:0
141 TX packets:11346 errors:0 dropped:0 overruns:0 carrier:0
142 collisions:0 txqueuelen:1000
143 RX bytes:31556357 (31.5 MB) TX bytes:870943 (870.9 KB)
144 """
145 ifaces = {}
146 combined_fields = {'addr': 'address', 'Bcast': 'broadcast',
147 'Mask': 'netmask', 'MTU': 'mtu',
148 'encap': 'link_encap'}
149 boolmap = {'RUNNING': 'running', 'UP': 'up', 'MULTICAST': 'multicast'}
150
151 for line in ifconfig_out.splitlines():
152 if not line:
153 continue
154 if not line.startswith(" "):
155 cur_iface = line.split()[0].rstrip(":")
156 cur_data = {'inet6': [], 'interface': cur_iface}
157 for t in boolmap.values():
158 cur_data[t] = False
159 ifaces[cur_iface] = cur_data
160
161 toks = line.split()
162
163 if toks[0] == "inet6":
164 cidr = toks[2]
165 address, prefixlen = cidr.split("/")
166 scope = toks[3].split(":")[1]
167 cur_ipv6 = {'address': address, 'scope': scope,
168 'prefixlen': prefixlen}
169 cur_data['inet6'].append(cur_ipv6)
170 continue
171
172 for i in range(0, len(toks)):
173 cur_tok = toks[i]
174 try:
175 next_tok = toks[i+1]
176 except IndexError:
177 next_tok = None
178
179 if cur_tok == "HWaddr":
180 cur_data['mac_address'] = next_tok
181 elif ":" in cur_tok:
182 key, _colon, val = cur_tok.partition(":")
183 if key in combined_fields:
184 cur_data[combined_fields[key]] = val
185 elif cur_tok in boolmap:
186 cur_data[boolmap[cur_tok]] = True
187
188 if 'mtu' in cur_data:
189 cur_data['mtu'] = int(cur_data['mtu'])
190
191 return ifaces
192
193
194def _parse_ifconfig_yakkety(ifconfig_out):
195 """Parse ifconfig output from yakkety or later(?) and return a dictionary.
196
197 given ifconfig output like below, return:
198 {'ens2': {'address': '10.5.0.78',
199 '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
210 ens2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
211 inet 10.5.0.78 netmask 255.255.0.0 broadcast 10.5.255.255
212 inet6 fe80::f816:3eff:fe05:9673 prefixlen 64 scopeid 0x20<link>
213 inet6 fe80::f816:3eff:fe05:9673 prefixlen 64 scopeid 0x20<link>
214 ether fa:16:3e:05:96:73 txqueuelen 1000 (Ethernet)
215 RX packets 33196 bytes 48916947 (48.9 MB)
216 RX errors 0 dropped 0 overruns 0 frame 0
217 TX packets 5458 bytes 411486 (411.4 KB)
218 TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
219 """
220 fmap = {'mtu': 'mtu', 'inet': 'address',
221 'netmask': 'netmask', 'broadcast': 'broadcast',
222 'ether': 'mac_address'}
223 boolmap = {'RUNNING': 'running', 'UP': 'up', 'MULTICAST': 'multicast',
224 'BROADCAST': 'broadcast_flag'}
225
226 ifaces = {}
227 for line in ifconfig_out.splitlines():
228 if not line:
229 continue
230 if not line.startswith(" "):
231 cur_iface = line.split()[0].rstrip(":")
232 cur_data = {'inet6': [], 'interface': cur_iface}
233 for t in boolmap.values():
234 cur_data[t] = False
235 ifaces[cur_iface] = cur_data
236
237 toks = line.split()
238 if toks[0] == "inet6":
239 cur_ipv6 = {'address': toks[1]}
240 cur_data['inet6'].append(cur_ipv6)
241
242 for i in range(0, len(toks)):
243 cur_tok = toks[i]
244 try:
245 next_tok = toks[i+1]
246 except IndexError:
247 next_tok = None
248 if cur_tok in fmap:
249 cur_data[fmap[cur_tok]] = next_tok
250 elif cur_tok in ('prefixlen', 'scopeid'):
251 cur_ipv6[cur_tok] = next_tok
252 cur_data['inet6'].append
253 elif cur_tok.startswith("flags="):
254 # flags=4163<UP,BROADCAST,RUNNING,MULTICAST>
255 flags = cur_tok[cur_tok.find("<") + 1:
256 cur_tok.rfind(">")].split(",")
257 for flag in flags:
258 if flag in boolmap:
259 cur_data[boolmap[flag]] = True
260 elif cur_tok == "(Ethernet)":
261 cur_data['link_encap'] = 'Ethernet'
262
263 if 'mtu' in cur_data:
264 cur_data['mtu'] = int(cur_data['mtu'])
265
266 return ifaces
267
268
269def ifconfig_to_dict(ifconfig_a):
270 # if the first token of the first line ends in a ':' then assume yakkety
271 # parse ifconfig output and return a dictionary.
272 #
273 # return a dictionary of network information like:
274 # {'ens2': {'address': '10.5.0.78', 'broadcast': '10.5.255.255',
275 # 'broadcast_flag': True,
276 # 'inet6': [{'address': 'fe80::f816:3eff:fe05:9673',
277 # 'prefixlen': '64', 'scopeid': '0x20<link>'},
278 # {'address': 'fe80::f816:3eff:fe05:9673',
279 # 'prefixlen': '64', 'scopeid': '0x20<link>'}],
280 # 'interface': 'ens2', 'link_encap': 'Ethernet',
281 # 'mac_address': 'fa:16:3e:05:96:73', 'mtu': 1500,
282 # 'multicast': True, 'netmask': '255.255.0.0',
283 # 'running': True, 'up': True}}
284 line = ifconfig_a.lstrip().splitlines()[0]
285 if line.split()[0].endswith(":"):
286 return _parse_ifconfig_yakkety(ifconfig_a)
287 else:
288 return _parse_ifconfig_xenial(ifconfig_a)
120289
=== modified file 'tests/vmtests/releases.py'
--- tests/vmtests/releases.py 2016-04-11 20:26:08 +0000
+++ tests/vmtests/releases.py 2016-06-16 18:45:24 +0000
@@ -46,6 +46,10 @@
46 release = "xenial"46 release = "xenial"
4747
4848
49class _YakketyBase(_ReleaseBase):
50 release = "yakkety"
51
52
49class _Releases(object):53class _Releases(object):
50 precise = _PreciseBase54 precise = _PreciseBase
51 precise_hwe_t = _PreciseHWET55 precise_hwe_t = _PreciseHWET
@@ -56,6 +60,7 @@
56 vivid = _VividBase60 vivid = _VividBase
57 wily = _WilyBase61 wily = _WilyBase
58 xenial = _XenialBase62 xenial = _XenialBase
63 yakkety = _YakketyBase
5964
60base_vm_classes = _Releases65base_vm_classes = _Releases
6166
6267
=== modified file 'tests/vmtests/test_basic.py'
--- tests/vmtests/test_basic.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_basic.py 2016-06-16 18:45:24 +0000
@@ -223,13 +223,13 @@
223 __test__ = False223 __test__ = False
224224
225225
226class VividTestBasic(relbase.vivid, TestBasicAbs):
227 __test__ = True
228
229
230class WilyTestBasic(relbase.wily, TestBasicAbs):226class WilyTestBasic(relbase.wily, TestBasicAbs):
231 __test__ = True227 __test__ = True
232228
233229
234class XenialTestBasic(relbase.xenial, TestBasicAbs):230class XenialTestBasic(relbase.xenial, TestBasicAbs):
235 __test__ = True231 __test__ = True
232
233
234class YakketyTestBasic(relbase.yakkety, TestBasicAbs):
235 __test__ = True
236236
=== modified file 'tests/vmtests/test_bcache_basic.py'
--- tests/vmtests/test_bcache_basic.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_bcache_basic.py 2016-06-16 18:45:24 +0000
@@ -50,3 +50,7 @@
5050
51class XenialBcacheBasic(relbase.xenial, TestBcacheBasic):51class XenialBcacheBasic(relbase.xenial, TestBcacheBasic):
52 __test__ = True52 __test__ = True
53
54
55class YakketyBcacheBasic(relbase.yakkety, TestBcacheBasic):
56 __test__ = True
5357
=== modified file 'tests/vmtests/test_bonding.py'
--- tests/vmtests/test_bonding.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_bonding.py 2016-06-16 18:45:24 +0000
@@ -1,4 +1,4 @@
1from . import VMBaseClass, logger1from . import VMBaseClass, logger, helpers
2from .releases import base_vm_classes as relbase2from .releases import base_vm_classes as relbase
33
4import ipaddress4import ipaddress
@@ -8,44 +8,6 @@
8import yaml8import yaml
99
1010
11def iface_extract(input):
12 mo = re.search(r'^(?P<interface>\w+|\w+:\d+)\s+' +
13 r'Link encap:(?P<link_encap>\S+)\s+' +
14 r'(HWaddr\s+(?P<mac_address>\S+))?' +
15 r'(\s+inet addr:(?P<address>\S+))?' +
16 r'(\s+Bcast:(?P<broadcast>\S+)\s+)?' +
17 r'(Mask:(?P<netmask>\S+)\s+)?',
18 input, re.MULTILINE)
19
20 mtu = re.search(r'(\s+MTU:(?P<mtu>\d+)\s+)\s+', input, re.MULTILINE)
21 mtu_info = mtu.groupdict('')
22 mtu_info['mtu'] = int(mtu_info['mtu'])
23
24 if mo:
25 info = mo.groupdict('')
26 info['running'] = False
27 info['up'] = False
28 info['multicast'] = False
29 if 'RUNNING' in input:
30 info['running'] = True
31 if 'UP' in input:
32 info['up'] = True
33 if 'MULTICAST' in input:
34 info['multicast'] = True
35 info.update(mtu_info)
36 return info
37 return {}
38
39
40def ifconfig_to_dict(ifconfig):
41 interfaces = {}
42 for iface in [iface_extract(iface) for iface in ifconfig.split('\n\n')
43 if iface.strip()]:
44 interfaces[iface['interface']] = iface
45
46 return interfaces
47
48
49class TestNetworkAbs(VMBaseClass):11class TestNetworkAbs(VMBaseClass):
50 interactive = False12 interactive = False
51 conf_file = "examples/tests/bonding_network.yaml"13 conf_file = "examples/tests/bonding_network.yaml"
@@ -96,7 +58,7 @@
96 ifconfig_a = fp.read()58 ifconfig_a = fp.read()
97 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))59 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
9860
99 ifconfig_dict = ifconfig_to_dict(ifconfig_a)61 ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
100 logger.debug('parsed ifcfg dict:\n{}'.format(62 logger.debug('parsed ifcfg dict:\n{}'.format(
101 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))63 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
10264
@@ -230,13 +192,13 @@
230 __test__ = True192 __test__ = True
231193
232194
233class VividTestBonding(relbase.vivid, TestNetworkAbs):
234 __test__ = True
235
236
237class WilyTestBonding(relbase.wily, TestNetworkAbs):195class WilyTestBonding(relbase.wily, TestNetworkAbs):
238 __test__ = True196 __test__ = True
239197
240198
241class XenialTestBonding(relbase.xenial, TestNetworkAbs):199class XenialTestBonding(relbase.xenial, TestNetworkAbs):
242 __test__ = True200 __test__ = True
201
202
203class YakketyTestBonding(relbase.yakkety, TestNetworkAbs):
204 __test__ = True
243205
=== modified file 'tests/vmtests/test_lvm.py'
--- tests/vmtests/test_lvm.py 2016-05-19 20:46:36 +0000
+++ tests/vmtests/test_lvm.py 2016-06-16 18:45:24 +0000
@@ -63,13 +63,13 @@
63 print("test_dname does not work for Trusty")63 print("test_dname does not work for Trusty")
6464
6565
66class VividTestLvm(relbase.vivid, TestLvmAbs):
67 __test__ = True
68
69
70class WilyTestLvm(relbase.wily, TestLvmAbs):66class WilyTestLvm(relbase.wily, TestLvmAbs):
71 __test__ = True67 __test__ = True
7268
7369
74class XenialTestLvm(relbase.xenial, TestLvmAbs):70class XenialTestLvm(relbase.xenial, TestLvmAbs):
75 __test__ = True71 __test__ = True
72
73
74class YakketyTestLvm(relbase.yakkety, TestLvmAbs):
75 __test__ = True
7676
=== modified file 'tests/vmtests/test_mdadm_bcache.py'
--- tests/vmtests/test_mdadm_bcache.py 2016-05-18 01:08:46 +0000
+++ tests/vmtests/test_mdadm_bcache.py 2016-06-16 18:45:24 +0000
@@ -130,10 +130,6 @@
130 __test__ = True130 __test__ = True
131131
132132
133class VividTestMdadmBcache(relbase.vivid, TestMdadmBcacheAbs):
134 __test__ = True
135
136
137class WilyTestMdadmBcache(relbase.wily, TestMdadmBcacheAbs):133class WilyTestMdadmBcache(relbase.wily, TestMdadmBcacheAbs):
138 __test__ = True134 __test__ = True
139135
@@ -142,6 +138,10 @@
142 __test__ = True138 __test__ = True
143139
144140
141class YakketyTestMdadmBcache(relbase.yakkety, TestMdadmBcacheAbs):
142 __test__ = True
143
144
145class TestMirrorbootAbs(TestMdadmAbs):145class TestMirrorbootAbs(TestMdadmAbs):
146 # alternative config for more complex setup146 # alternative config for more complex setup
147 conf_file = "examples/tests/mirrorboot.yaml"147 conf_file = "examples/tests/mirrorboot.yaml"
@@ -170,10 +170,6 @@
170 __test__ = True170 __test__ = True
171171
172172
173class VividTestMirrorboot(relbase.vivid, TestMirrorbootAbs):
174 __test__ = True
175
176
177class WilyTestMirrorboot(relbase.wily, TestMirrorbootAbs):173class WilyTestMirrorboot(relbase.wily, TestMirrorbootAbs):
178 __test__ = True174 __test__ = True
179175
@@ -182,6 +178,10 @@
182 __test__ = True178 __test__ = True
183179
184180
181class YakketyTestMirrorboot(relbase.yakkety, TestMirrorbootAbs):
182 __test__ = True
183
184
185class TestRaid5bootAbs(TestMdadmAbs):185class TestRaid5bootAbs(TestMdadmAbs):
186 # alternative config for more complex setup186 # alternative config for more complex setup
187 conf_file = "examples/tests/raid5boot.yaml"187 conf_file = "examples/tests/raid5boot.yaml"
@@ -211,10 +211,6 @@
211 __test__ = True211 __test__ = True
212212
213213
214class VividTestRaid5boot(relbase.vivid, TestRaid5bootAbs):
215 __test__ = True
216
217
218class WilyTestRaid5boot(relbase.wily, TestRaid5bootAbs):214class WilyTestRaid5boot(relbase.wily, TestRaid5bootAbs):
219 __test__ = True215 __test__ = True
220216
@@ -223,6 +219,10 @@
223 __test__ = True219 __test__ = True
224220
225221
222class YakketyTestRaid5boot(relbase.yakkety, TestRaid5bootAbs):
223 __test__ = True
224
225
226class TestRaid6bootAbs(TestMdadmAbs):226class TestRaid6bootAbs(TestMdadmAbs):
227 # alternative config for more complex setup227 # alternative config for more complex setup
228 conf_file = "examples/tests/raid6boot.yaml"228 conf_file = "examples/tests/raid6boot.yaml"
@@ -264,10 +264,6 @@
264 __test__ = True264 __test__ = True
265265
266266
267class VividTestRaid6boot(relbase.vivid, TestRaid6bootAbs):
268 __test__ = True
269
270
271class WilyTestRaid6boot(relbase.wily, TestRaid6bootAbs):267class WilyTestRaid6boot(relbase.wily, TestRaid6bootAbs):
272 __test__ = True268 __test__ = True
273269
@@ -276,6 +272,10 @@
276 __test__ = True272 __test__ = True
277273
278274
275class YakketyTestRaid6boot(relbase.yakkety, TestRaid6bootAbs):
276 __test__ = True
277
278
279class TestRaid10bootAbs(TestMdadmAbs):279class TestRaid10bootAbs(TestMdadmAbs):
280 # alternative config for more complex setup280 # alternative config for more complex setup
281 conf_file = "examples/tests/raid10boot.yaml"281 conf_file = "examples/tests/raid10boot.yaml"
@@ -305,10 +305,6 @@
305 __test__ = True305 __test__ = True
306306
307307
308class VividTestRaid10boot(relbase.vivid, TestRaid10bootAbs):
309 __test__ = True
310
311
312class WilyTestRaid10boot(relbase.wily, TestRaid10bootAbs):308class WilyTestRaid10boot(relbase.wily, TestRaid10bootAbs):
313 __test__ = True309 __test__ = True
314310
@@ -317,6 +313,10 @@
317 __test__ = True313 __test__ = True
318314
319315
316class YakketyTestRaid10boot(relbase.yakkety, TestRaid10bootAbs):
317 __test__ = True
318
319
320class TestAllindataAbs(TestMdadmAbs):320class TestAllindataAbs(TestMdadmAbs):
321 # more complex, needs more time321 # more complex, needs more time
322 # alternative config for more complex setup322 # alternative config for more complex setup
@@ -403,13 +403,13 @@
403 __test__ = False # lukes=no does not disable mounting of device403 __test__ = False # lukes=no does not disable mounting of device
404404
405405
406class VividTestAllindata(relbase.vivid, TestAllindataAbs):
407 __test__ = True
408
409
410class WilyTestAllindata(relbase.wily, TestAllindataAbs):406class WilyTestAllindata(relbase.wily, TestAllindataAbs):
411 __test__ = True407 __test__ = True
412408
413409
414class XenialTestAllindata(relbase.xenial, TestAllindataAbs):410class XenialTestAllindata(relbase.xenial, TestAllindataAbs):
415 __test__ = True411 __test__ = True
412
413
414class YakketyTestAllindata(relbase.yakkety, TestAllindataAbs):
415 __test__ = True
416416
=== modified file 'tests/vmtests/test_network.py'
--- tests/vmtests/test_network.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_network.py 2016-06-16 18:45:24 +0000
@@ -1,4 +1,4 @@
1from . import VMBaseClass, logger1from . import VMBaseClass, logger, helpers
2from .releases import base_vm_classes as relbase2from .releases import base_vm_classes as relbase
33
4import ipaddress4import ipaddress
@@ -9,44 +9,6 @@
9import yaml9import yaml
1010
1111
12def iface_extract(input):
13 mo = re.search(r'^(?P<interface>\w+|\w+:\d+|\w+\.\d+)\s+' +
14 r'Link encap:(?P<link_encap>\S+)\s+' +
15 r'(HWaddr\s+(?P<mac_address>\S+))?' +
16 r'(\s+inet addr:(?P<address>\S+))?' +
17 r'(\s+Bcast:(?P<broadcast>\S+)\s+)?' +
18 r'(Mask:(?P<netmask>\S+)\s+)?',
19 input, re.MULTILINE)
20
21 mtu = re.search(r'(\s+MTU:(?P<mtu>\d+)\s+)\s+', input, re.MULTILINE)
22 mtu_info = mtu.groupdict('')
23 mtu_info['mtu'] = int(mtu_info['mtu'])
24
25 if mo:
26 info = mo.groupdict('')
27 info['running'] = False
28 info['up'] = False
29 info['multicast'] = False
30 if 'RUNNING' in input:
31 info['running'] = True
32 if 'UP' in input:
33 info['up'] = True
34 if 'MULTICAST' in input:
35 info['multicast'] = True
36 info.update(mtu_info)
37 return info
38 return {}
39
40
41def ifconfig_to_dict(ifconfig):
42 interfaces = {}
43 for iface in [iface_extract(iface) for iface in ifconfig.split('\n\n')
44 if iface.strip()]:
45 interfaces[iface['interface']] = iface
46
47 return interfaces
48
49
50class TestNetworkAbs(VMBaseClass):12class TestNetworkAbs(VMBaseClass):
51 interactive = False13 interactive = False
52 conf_file = "examples/tests/basic_network.yaml"14 conf_file = "examples/tests/basic_network.yaml"
@@ -132,7 +94,7 @@
132 ifconfig_a = fp.read()94 ifconfig_a = fp.read()
133 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))95 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
13496
135 ifconfig_dict = ifconfig_to_dict(ifconfig_a)97 ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
136 logger.debug('parsed ifcfg dict:\n{}'.format(98 logger.debug('parsed ifcfg dict:\n{}'.format(
137 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))99 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
138100
@@ -340,7 +302,7 @@
340 ifconfig_a = fp.read()302 ifconfig_a = fp.read()
341 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))303 logger.debug('ifconfig -a:\n{}'.format(ifconfig_a))
342304
343 ifconfig_dict = ifconfig_to_dict(ifconfig_a)305 ifconfig_dict = helpers.ifconfig_to_dict(ifconfig_a)
344 logger.debug('parsed ifconfig dict:\n{}'.format(306 logger.debug('parsed ifconfig dict:\n{}'.format(
345 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))307 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
346 print('parsed ifconfig dict:\n{}'.format(308 print('parsed ifconfig dict:\n{}'.format(
@@ -411,14 +373,6 @@
411 __test__ = False373 __test__ = False
412374
413375
414class VividTestNetwork(relbase.vivid, TestNetworkAbs):
415 __test__ = True
416
417
418class VividTestNetworkStatic(relbase.vivid, TestNetworkStaticAbs):
419 __test__ = True
420
421
422class WilyTestNetwork(relbase.wily, TestNetworkAbs):376class WilyTestNetwork(relbase.wily, TestNetworkAbs):
423 __test__ = True377 __test__ = True
424378
@@ -435,6 +389,14 @@
435 __test__ = True389 __test__ = True
436390
437391
392class YakketyTestNetwork(relbase.yakkety, TestNetworkAbs):
393 __test__ = True
394
395
396class YakketyTestNetworkStatic(relbase.yakkety, TestNetworkStaticAbs):
397 __test__ = True
398
399
438class PreciseTestNetworkVlan(relbase.precise, TestNetworkVlanAbs):400class PreciseTestNetworkVlan(relbase.precise, TestNetworkVlanAbs):
439 __test__ = True401 __test__ = True
440402
@@ -455,10 +417,6 @@
455 __test__ = True417 __test__ = True
456418
457419
458class VividTestNetworkVlan(relbase.vivid, TestNetworkVlanAbs):
459 __test__ = True
460
461
462class WilyTestNetworkVlan(relbase.wily, TestNetworkVlanAbs):420class WilyTestNetworkVlan(relbase.wily, TestNetworkVlanAbs):
463 __test__ = True421 __test__ = True
464422
@@ -467,6 +425,10 @@
467 __test__ = True425 __test__ = True
468426
469427
428class YakketyTestNetworkVlan(relbase.yakkety, TestNetworkVlanAbs):
429 __test__ = True
430
431
470class PreciseTestNetworkENISource(relbase.precise, TestNetworkENISource):432class PreciseTestNetworkENISource(relbase.precise, TestNetworkENISource):
471 __test__ = False433 __test__ = False
472 # not working, still debugging though; possible older ifupdown doesn't434 # not working, still debugging though; possible older ifupdown doesn't
@@ -477,13 +439,13 @@
477 __test__ = True439 __test__ = True
478440
479441
480class VividTestNetworkENISource(relbase.vivid, TestNetworkENISource):
481 __test__ = True
482
483
484class WilyTestNetworkENISource(relbase.wily, TestNetworkENISource):442class WilyTestNetworkENISource(relbase.wily, TestNetworkENISource):
485 __test__ = True443 __test__ = True
486444
487445
488class XenialTestNetworkENISource(relbase.xenial, TestNetworkENISource):446class XenialTestNetworkENISource(relbase.xenial, TestNetworkENISource):
489 __test__ = True447 __test__ = True
448
449
450class YakketyTestNetworkENISource(relbase.yakkety, TestNetworkENISource):
451 __test__ = True
490452
=== modified file 'tests/vmtests/test_nvme.py'
--- tests/vmtests/test_nvme.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_nvme.py 2016-06-16 18:45:24 +0000
@@ -74,13 +74,13 @@
74 print("test_ptable does not work for Trusty")74 print("test_ptable does not work for Trusty")
7575
7676
77class VividTestNvme(relbase.vivid, TestNvmeAbs):
78 __test__ = True
79
80
81class WilyTestNvme(relbase.wily, TestNvmeAbs):77class WilyTestNvme(relbase.wily, TestNvmeAbs):
82 __test__ = True78 __test__ = True
8379
8480
85class XenialTestNvme(relbase.xenial, TestNvmeAbs):81class XenialTestNvme(relbase.xenial, TestNvmeAbs):
86 __test__ = True82 __test__ = True
83
84
85class YakketyTestNvme(relbase.yakkety, TestNvmeAbs):
86 __test__ = True
8787
=== modified file 'tests/vmtests/test_raid5_bcache.py'
--- tests/vmtests/test_raid5_bcache.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_raid5_bcache.py 2016-06-16 18:45:24 +0000
@@ -93,9 +93,13 @@
93 __test__ = False93 __test__ = False
9494
9595
96class VividTestRaid5Bcache(relbase.vivid, TestMdadmBcacheAbs):
97 __test__ = True
98
99
100class WilyTestRaid5Bcache(relbase.wily, TestMdadmBcacheAbs):96class WilyTestRaid5Bcache(relbase.wily, TestMdadmBcacheAbs):
101 __test__ = True97 __test__ = True
98
99
100class XenialTestRaid5Bcache(relbase.xenial, TestMdadmBcacheAbs):
101 __test__ = True
102
103
104class YakketyTestRaid5Bcache(relbase.yakkety, TestMdadmBcacheAbs):
105 __test__ = True
102106
=== modified file 'tests/vmtests/test_uefi_basic.py'
--- tests/vmtests/test_uefi_basic.py 2016-05-17 20:55:46 +0000
+++ tests/vmtests/test_uefi_basic.py 2016-06-16 18:45:24 +0000
@@ -108,14 +108,14 @@
108 __test__ = True108 __test__ = True
109109
110110
111class VividUefiTestBasic(relbase.vivid, TestBasicAbs):
112 __test__ = True
113
114
115class XenialUefiTestBasic(relbase.xenial, TestBasicAbs):111class XenialUefiTestBasic(relbase.xenial, TestBasicAbs):
116 __test__ = True112 __test__ = True
117113
118114
115class YakketyUefiTestBasic(relbase.yakkety, TestBasicAbs):
116 __test__ = True
117
118
119class PreciseUefiTestBasic4k(PreciseUefiTestBasic):119class PreciseUefiTestBasic4k(PreciseUefiTestBasic):
120 disk_block_size = 4096120 disk_block_size = 4096
121121
@@ -124,13 +124,13 @@
124 disk_block_size = 4096124 disk_block_size = 4096
125125
126126
127class VividUefiTestBasic4k(VividUefiTestBasic):
128 disk_block_size = 4096
129
130
131class WilyUefiTestBasic4k(WilyUefiTestBasic):127class WilyUefiTestBasic4k(WilyUefiTestBasic):
132 disk_block_size = 4096128 disk_block_size = 4096
133129
134130
135class XenialUefiTestBasic4k(XenialUefiTestBasic):131class XenialUefiTestBasic4k(XenialUefiTestBasic):
136 disk_block_size = 4096132 disk_block_size = 4096
133
134
135class YakketyUefiTestBasic4k(YakketyUefiTestBasic):
136 disk_block_size = 4096

Subscribers

People subscribed via source and target branches