Merge lp:~raharper/curtin/trunk.delete-eth0-cfg-in-target into lp:~curtin-dev/curtin/trunk

Proposed by Ryan Harper
Status: Merged
Merged at revision: 389
Proposed branch: lp:~raharper/curtin/trunk.delete-eth0-cfg-in-target
Merge into: lp:~curtin-dev/curtin/trunk
Diff against target: 576 lines (+129/-56)
19 files modified
curtin/commands/curthooks.py (+38/-0)
curtin/util.py (+10/-0)
examples/network-iscsiroot.yaml (+3/-3)
examples/tests/basic_network.yaml (+3/-3)
examples/tests/basic_network_static.yaml (+1/-1)
examples/tests/bonding_network.yaml (+5/-5)
examples/tests/network_source.yaml (+4/-4)
examples/tests/vlan_network.yaml (+20/-20)
tests/unittests/test_net.py (+14/-14)
tests/vmtests/__init__.py (+12/-0)
tests/vmtests/test_basic.py (+2/-0)
tests/vmtests/test_bcache_basic.py (+1/-0)
tests/vmtests/test_bonding.py (+1/-0)
tests/vmtests/test_lvm.py (+1/-0)
tests/vmtests/test_mdadm_bcache.py (+2/-0)
tests/vmtests/test_network.py (+8/-6)
tests/vmtests/test_nvme.py (+1/-0)
tests/vmtests/test_raid5_bcache.py (+2/-0)
tests/vmtests/test_uefi_basic.py (+1/-0)
To merge this branch: bzr merge lp:~raharper/curtin/trunk.delete-eth0-cfg-in-target
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Scott Moser Pending
Review via email: mp+295084@code.launchpad.net

Commit message

Detect and remove legacy /etc/network/interfaces.d/eth0.cfg from target

Prior to Xenial release, Ubuntu Cloud images included a default network
configuration in /etc/network/interfaces.d/eth0.conf. The presence of
this legacy configuration file can cause a delay during boot when cloud-
init is expecting a non-existent interface to become available. curtin
installations handle configuring networking in the target installed
system subsequently the embedded configuration is not needed.

This patch reuses most of cloud-init's version of detecting and examining the legacy config, confirming if the contents are what is expected. Upon finding expected content, the file will be removed, otherwise it will remain.

Additional changes to vmtest and unittest were added to remove the reliance on fallback nic naming (eth0); we always use non-kernel names in our configuration now. An additional common test has been added to check that in all cases we ensure we remove the embedded config.

Description of the change

Detect and remove legacy /etc/network/interfaces.d/eth0.cfg from target

Prior to Xenial release, Ubuntu Cloud images included a default network
configuration in /etc/network/interfaces.d/eth0.conf. The presence of
this legacy configuration file can cause a delay during boot when cloud-
init is expecting a non-existent interface to become available. curtin
installations handle configuring networking in the target installed
system subsequently the embedded configuration is not needed.

This patch reuses most of cloud-init's version of detecting and examining the legacy config, confirming if the contents are what is expected. Upon finding expected content, the file will be removed, otherwise it will remain.

Additional changes to vmtest and unittest were added to remove the reliance on fallback nic naming (eth0); we always use non-kernel names in our configuration now. An additional common test has been added to check that in all cases we ensure we remove the embedded config.

To post a comment you must log in.
Revision history for this message
Server Team CI bot (server-team-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Scott Moser (smoser) wrote :

one nit pick inline other than that, looks great.
i'd keep the '_maybe_remove', but for curtin's case it is much more a 'probably_remove'.

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

oh yeah, and move your description to the commit m essage and fix the new lines that seemed inserted somehow.

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

On Thu, May 19, 2016 at 11:41 AM, Scott Moser <email address hidden> wrote:

> one nit pick inline other than that, looks great.
> i'd keep the '_maybe_remove', but for curtin's case it is much more a
> 'probably_remove'.
>

Indeed; other than when users have touched it (which in curtin's case will
almost never happen).

>
>
> Diff comments:
>
> >
> > === modified file 'curtin/util.py'
> > --- curtin/util.py 2016-04-04 19:09:47 +0000
> > +++ curtin/util.py 2016-05-18 14:11:09 +0000
> > @@ -288,6 +288,15 @@
> > return fp.read()
> >
> >
> > +def del_file(path):
> > + LOG.debug("Attempting to remove %s", path)
> > + try:
>
> attempting to remove seems not that useful. rather 'removed' or 'did not
> remove' would be better.
> LOG.debug("del_file: removed %s", path)
> except..
> LOG.debug("del_file: %s did not exist.").
>

This is lift 100% from cloud-init. So, I'll fix here and then MP to
cloud-init =)

>
> just thinking as we look at a log, 'attempting to remove' doesn't tell you
> all that much.
>

Yeah, but I was lazy.

>
> > + os.unlink(path)
> > + except OSError as e:
> > + if e.errno != errno.ENOENT:
> > + raise e
> > +
> > +
> > def disable_daemons_in_root(target):
> > contents = "\n".join(
> > ['#!/bin/sh',
>
>
> --
>
> https://code.launchpad.net/~raharper/curtin/trunk.delete-eth0-cfg-in-target/+merge/295084
> You are the owner of lp:~raharper/curtin/trunk.delete-eth0-cfg-in-target.
>

391. By Ryan Harper

curtin/util.del_file: make log messages more useful.

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

util.del_file: don't log success until the file is removed.

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-04-17 22:35:20 +0000
3+++ curtin/commands/curthooks.py 2016-05-19 18:43:17 +0000
4@@ -149,6 +149,42 @@
5 os.unlink(dpkg_cfg)
6
7
8+def _maybe_remove_legacy_eth0(target,
9+ path="/etc/network/interfaces.d/eth0.cfg"):
10+ """Ubuntu cloud images previously included a 'eth0.cfg' that had
11+ hard coded content. That file would interfere with the rendered
12+ configuration if it was present.
13+
14+ if the file does not exist do nothing.
15+ If the file exists:
16+ - with known content, remove it and warn
17+ - with unknown content, leave it and warn
18+ """
19+
20+ cfg = os.path.sep.join([target, path])
21+ if not os.path.exists(cfg):
22+ LOG.warn('Failed to find legacy conf file %s', cfg)
23+ return
24+
25+ bmsg = "Dynamic networking config may not apply."
26+ try:
27+ contents = util.load_file(cfg)
28+ known_contents = ["auto eth0", "iface eth0 inet dhcp"]
29+ lines = [f.strip() for f in contents.splitlines()
30+ if not f.startswith("#")]
31+ if lines == known_contents:
32+ util.del_file(cfg)
33+ msg = "removed %s with known contents" % cfg
34+ else:
35+ msg = (bmsg + " '%s' exists with user configured content." % cfg)
36+ except:
37+ msg = bmsg + " %s exists, but could not be read." % cfg
38+ LOG.exception(msg)
39+ return
40+
41+ LOG.warn(msg)
42+
43+
44 def setup_zipl(cfg, target):
45 if platform.machine() != 's390x':
46 return
47@@ -522,6 +558,8 @@
48 LOG.debug("copying interfaces")
49 copy_interfaces(interfaces, target)
50
51+ _maybe_remove_legacy_eth0(target)
52+
53
54 def copy_interfaces(interfaces, target):
55 if not interfaces:
56
57=== modified file 'curtin/util.py'
58--- curtin/util.py 2016-04-04 19:09:47 +0000
59+++ curtin/util.py 2016-05-19 18:43:17 +0000
60@@ -288,6 +288,16 @@
61 return fp.read()
62
63
64+def del_file(path):
65+ try:
66+ os.unlink(path)
67+ LOG.debug("del_file: removed %s", path)
68+ except OSError as e:
69+ LOG.exception("del_file: %s did not exist.", path)
70+ if e.errno != errno.ENOENT:
71+ raise e
72+
73+
74 def disable_daemons_in_root(target):
75 contents = "\n".join(
76 ['#!/bin/sh',
77
78=== modified file 'examples/network-iscsiroot.yaml'
79--- examples/network-iscsiroot.yaml 2016-04-15 20:33:51 +0000
80+++ examples/network-iscsiroot.yaml 2016-05-19 18:43:17 +0000
81@@ -5,14 +5,14 @@
82 # to prevent networking restarts from up/down'ing the
83 # interface
84 - type: physical
85- name: eth0
86+ name: interface0
87 mac_address: "c0:d6:9f:2c:e8:80"
88 subnets:
89 - type: dhcp4
90 control: manual
91 # control: auto this is the default if control isn't present
92 - type: physical
93- name: eth1
94+ name: interface1
95 mtu: 1492
96 mac_address: "aa:d6:9f:2c:e8:80"
97 subnets:
98@@ -25,7 +25,7 @@
99 # and we want to auto configure this
100 # when present
101 - type: physical
102- name: eth2
103+ name: interface2
104 mac_address: "cf:d6:af:48:e8:80"
105 subnets:
106 - type: static
107
108=== modified file 'examples/tests/basic_network.yaml'
109--- examples/tests/basic_network.yaml 2016-04-04 16:03:32 +0000
110+++ examples/tests/basic_network.yaml 2016-05-19 18:43:17 +0000
111@@ -4,12 +4,12 @@
112 config:
113 # Physical interfaces.
114 - type: physical
115- name: eth0
116+ name: interface0
117 mac_address: "52:54:00:12:34:00"
118 subnets:
119 - type: dhcp4
120 - type: physical
121- name: eth1
122+ name: interface1
123 mtu: 1492
124 mac_address: "52:54:00:12:34:02"
125 subnets:
126@@ -22,5 +22,5 @@
127 dns_search:
128 - barley.maas
129 - type: physical
130- name: eth2
131+ name: interface2
132 mac_address: "52:54:00:12:34:04"
133
134=== modified file 'examples/tests/basic_network_static.yaml'
135--- examples/tests/basic_network_static.yaml 2016-04-04 16:03:32 +0000
136+++ examples/tests/basic_network_static.yaml 2016-05-19 18:43:17 +0000
137@@ -4,7 +4,7 @@
138 config:
139 # Physical interfaces.
140 - type: physical
141- name: eth0
142+ name: interface0
143 mac_address: "52:54:00:12:34:00"
144 subnets:
145 - type: static
146
147=== modified file 'examples/tests/bonding_network.yaml'
148--- examples/tests/bonding_network.yaml 2016-04-17 22:35:20 +0000
149+++ examples/tests/bonding_network.yaml 2016-05-19 18:43:17 +0000
150@@ -4,23 +4,23 @@
151 config:
152 # Physical interfaces.
153 - type: physical
154- name: eth0
155+ name: interface0
156 mac_address: "52:54:00:12:34:00"
157 subnets:
158 - type: dhcp4
159 - type: physical
160- name: eth1
161+ name: interface1
162 mac_address: "52:54:00:12:34:02"
163 - type: physical
164- name: eth2
165+ name: interface2
166 mac_address: "52:54:00:12:34:04"
167 # Bond.
168 - type: bond
169 name: bond0
170 mac_address: "52:54:00:12:34:06"
171 bond_interfaces:
172- - eth1
173- - eth2
174+ - interface1
175+ - interface2
176 params:
177 bond-mode: active-backup
178 subnets:
179
180=== modified file 'examples/tests/network_source.yaml'
181--- examples/tests/network_source.yaml 2016-04-07 15:06:04 +0000
182+++ examples/tests/network_source.yaml 2016-05-19 18:43:17 +0000
183@@ -3,12 +3,12 @@
184 config:
185 # Physical interfaces.
186 - type: physical
187- name: eth0
188+ name: interface0
189 mac_address: "52:54:00:12:34:00"
190 subnets:
191 - type: dhcp4
192 - type: physical
193- name: eth1
194+ name: interface1
195 mtu: 1492
196 mac_address: "52:54:00:12:34:02"
197 subnets:
198@@ -21,11 +21,11 @@
199 dns_search:
200 - barley.maas
201 - type: physical
202- name: eth2
203+ name: interface2
204 mac_address: "52:54:00:12:34:04"
205
206 curthooks_commands:
207 # use curtin to inject a eni config file outside of the network yaml
208 # this allows us to test user installed configurations outside of
209 # curtin's control
210- aa_cleanup: ['curtin', 'in-target', '--', 'sh', '-c', "rm -f /etc/network/interfaces.d/eth0.cfg; /bin/echo -e 'auto eth2\niface eth2 inet static\n address 192.168.23.23/24\n' > /etc/network/interfaces.d/eth2.cfg"]
211+ aa_cleanup: ['curtin', 'in-target', '--', 'sh', '-c', "rm -f /etc/network/interfaces.d/eth0.cfg; /bin/echo -e 'auto interface2\niface interface2 inet static\n address 192.168.23.23/24\n' > /etc/network/interfaces.d/interface2.cfg"]
212
213=== modified file 'examples/tests/vlan_network.yaml'
214--- examples/tests/vlan_network.yaml 2016-04-14 19:14:11 +0000
215+++ examples/tests/vlan_network.yaml 2016-05-19 18:43:17 +0000
216@@ -1,9 +1,9 @@
217 network:
218 config:
219- - id: eth0
220+ - id: interface0
221 mac_address: d4:be:d9:a8:49:13
222 mtu: 1500
223- name: eth0
224+ name: interface0
225 subnets:
226 - address: 10.245.168.16/21
227 dns_nameservers:
228@@ -11,69 +11,69 @@
229 gateway: 10.245.168.1
230 type: static
231 type: physical
232- - id: eth1
233+ - id: interface1
234 mac_address: d4:be:d9:a8:49:15
235 mtu: 1500
236- name: eth1
237+ name: interface1
238 subnets:
239 - address: 10.245.188.2/24
240 dns_nameservers: []
241 type: static
242 type: physical
243- - id: eth2
244+ - id: interface2
245 mac_address: d4:be:d9:a8:49:17
246 mtu: 1500
247- name: eth2
248+ name: interface2
249 subnets:
250 - type: manual
251 type: physical
252- - id: eth3
253+ - id: interface3
254 mac_address: d4:be:d9:a8:49:19
255 mtu: 1500
256- name: eth3
257+ name: interface3
258 subnets:
259 - type: manual
260 type: physical
261- - id: eth1.2667
262+ - id: interface1.2667
263 mtu: 1500
264- name: eth1.2667
265+ name: interface1.2667
266 subnets:
267 - address: 10.245.184.2/24
268 dns_nameservers: []
269 type: static
270 type: vlan
271 vlan_id: 2667
272- vlan_link: eth1
273- - id: eth1.2668
274+ vlan_link: interface1
275+ - id: interface1.2668
276 mtu: 1500
277- name: eth1.2668
278+ name: interface1.2668
279 subnets:
280 - address: 10.245.185.1/24
281 dns_nameservers: []
282 type: static
283 type: vlan
284 vlan_id: 2668
285- vlan_link: eth1
286- - id: eth1.2669
287+ vlan_link: interface1
288+ - id: interface1.2669
289 mtu: 1500
290- name: eth1.2669
291+ name: interface1.2669
292 subnets:
293 - address: 10.245.186.1/24
294 dns_nameservers: []
295 type: static
296 type: vlan
297 vlan_id: 2669
298- vlan_link: eth1
299- - id: eth1.2670
300+ vlan_link: interface1
301+ - id: interface1.2670
302 mtu: 1500
303- name: eth1.2670
304+ name: interface1.2670
305 subnets:
306 - address: 10.245.187.2/24
307 dns_nameservers: []
308 type: static
309 type: vlan
310 vlan_id: 2670
311- vlan_link: eth1
312+ vlan_link: interface1
313 - address: 10.245.168.2
314 search:
315 - dellstack
316
317=== modified file 'tests/unittests/test_net.py'
318--- tests/unittests/test_net.py 2016-04-20 20:03:00 +0000
319+++ tests/unittests/test_net.py 2016-05-19 18:43:17 +0000
320@@ -497,16 +497,16 @@
321 auto lo
322 iface lo inet loopback
323
324- auto eth0
325- iface eth0 inet dhcp
326+ auto interface0
327+ iface interface0 inet dhcp
328
329- auto eth1
330- iface eth1 inet manual
331+ auto interface1
332+ iface interface1 inet manual
333 bond-mode active-backup
334 bond-master bond0
335
336- auto eth2
337- iface eth2 inet manual
338+ auto interface2
339+ iface interface2 inet manual
340 bond-mode active-backup
341 bond-master bond0
342
343@@ -537,22 +537,22 @@
344 auto lo
345 iface lo inet loopback
346
347- # control-manual eth0
348- iface eth0 inet dhcp
349+ # control-manual interface0
350+ iface interface0 inet dhcp
351
352- auto eth1
353- iface eth1 inet static
354+ auto interface1
355+ iface interface1 inet static
356 address 192.168.14.2/24
357 gateway 192.168.14.1
358 mtu 1492
359
360- auto eth1:1
361- iface eth1:1 inet static
362+ auto interface1:1
363+ iface interface1:1 inet static
364 address 192.168.14.4/24
365 mtu 1492
366
367- allow-hotplug eth2
368- iface eth2 inet static
369+ allow-hotplug interface2
370+ iface interface2 inet static
371 gateway 10.11.12.1
372 address 10.11.12.13/22
373
374
375=== modified file 'tests/vmtests/__init__.py'
376--- tests/vmtests/__init__.py 2016-04-20 20:06:01 +0000
377+++ tests/vmtests/__init__.py 2016-05-19 18:43:17 +0000
378@@ -745,6 +745,15 @@
379 self.assertIn(link, contents)
380 self.assertIn(diskname, contents)
381
382+ def test_interfacesd_eth0_removed(self):
383+ """ Check that curtin has removed /etc/network/interfaces.d/eth0.cfg
384+ by examining the output of a find /etc/network > find_interfaces.d
385+ """
386+ fpath = os.path.join(self.td.collect, "find_interfacesd")
387+ interfacesd = util.load_file(fpath)
388+ self.assertNotIn("/etc/network/interfaces.d/eth0.cfg",
389+ interfacesd.split("\n"))
390+
391 def run(self, result):
392 super(VMBaseClass, self).run(result)
393 self.record_result(result)
394@@ -844,6 +853,9 @@
395 def test_dname(self):
396 pass
397
398+ def test_interfacesd_eth0_removed(self):
399+ pass
400+
401 def _maybe_raise(self, exc):
402 if self.allow_test_fails:
403 raise exc
404
405=== modified file 'tests/vmtests/test_basic.py'
406--- tests/vmtests/test_basic.py 2016-04-04 18:20:33 +0000
407+++ tests/vmtests/test_basic.py 2016-05-19 18:43:17 +0000
408@@ -25,6 +25,7 @@
409 cat /etc/fstab > fstab
410 mkdir -p /dev/disk/by-dname
411 ls /dev/disk/by-dname/ > ls_dname
412+ find /etc/network/interfaces.d > find_interfacesd
413
414 v=""
415 out=$(apt-config shell v Acquire::HTTP::Proxy)
416@@ -145,6 +146,7 @@
417 cat /etc/fstab > fstab
418 mkdir -p /dev/disk/by-dname
419 ls /dev/disk/by-dname/ > ls_dname
420+ find /etc/network/interfaces.d > find_interfacesd
421
422 v=""
423 out=$(apt-config shell v Acquire::HTTP::Proxy)
424
425=== modified file 'tests/vmtests/test_bcache_basic.py'
426--- tests/vmtests/test_bcache_basic.py 2016-04-04 15:48:10 +0000
427+++ tests/vmtests/test_bcache_basic.py 2016-05-19 18:43:17 +0000
428@@ -18,6 +18,7 @@
429 cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
430 cat /proc/mounts > proc_mounts
431 cat /proc/partitions > proc_partitions
432+ find /etc/network/interfaces.d > find_interfacesd
433 """)]
434
435 def test_bcache_output_files_exist(self):
436
437=== modified file 'tests/vmtests/test_bonding.py'
438--- tests/vmtests/test_bonding.py 2016-04-04 18:53:03 +0000
439+++ tests/vmtests/test_bonding.py 2016-05-19 18:43:17 +0000
440@@ -59,6 +59,7 @@
441 ip -o route show > ip_route_show
442 route -n > route_n
443 dpkg-query -W -f '${Status}' ifenslave > ifenslave_installed
444+ find /etc/network/interfaces.d > find_interfacesd
445 """)]
446
447 def test_output_files_exist(self):
448
449=== modified file 'tests/vmtests/test_lvm.py'
450--- tests/vmtests/test_lvm.py 2016-03-03 11:46:13 +0000
451+++ tests/vmtests/test_lvm.py 2016-05-19 18:43:17 +0000
452@@ -12,6 +12,7 @@
453 cd OUTPUT_COLLECT_D
454 cat /etc/fstab > fstab
455 ls /dev/disk/by-dname > ls_dname
456+ find /etc/network/interfaces.d > find_interfacesd
457 pvdisplay -C --separator = -o vg_name,pv_name --noheadings > pvs
458 lvdisplay -C --separator = -o lv_name,vg_name --noheadings > lvs
459 """)]
460
461=== modified file 'tests/vmtests/test_mdadm_bcache.py'
462--- tests/vmtests/test_mdadm_bcache.py 2016-04-17 22:35:20 +0000
463+++ tests/vmtests/test_mdadm_bcache.py 2016-05-19 18:43:17 +0000
464@@ -16,6 +16,7 @@
465 mdadm --detail --scan | grep -c ubuntu > mdadm_active1
466 grep -c active /proc/mdstat > mdadm_active2
467 ls /dev/disk/by-dname > ls_dname
468+ find /etc/network/interfaces.d > find_interfacesd
469 """)]
470
471 def test_mdadm_output_files_exist(self):
472@@ -55,6 +56,7 @@
473 cat /sys/block/bcache1/bcache/cache_mode >> bcache_cache_mode
474 cat /sys/block/bcache2/bcache/cache_mode >> bcache_cache_mode
475 cat /proc/mounts > proc_mounts
476+ find /etc/network/interfaces.d > find_interfacesd
477 """)]
478 fstab_expected = {
479 '/dev/vda1': '/media/sda1',
480
481=== modified file 'tests/vmtests/test_network.py'
482--- tests/vmtests/test_network.py 2016-04-14 19:14:11 +0000
483+++ tests/vmtests/test_network.py 2016-05-19 18:43:17 +0000
484@@ -57,6 +57,7 @@
485 ifconfig -a > ifconfig_a
486 cp -av /etc/network/interfaces .
487 cp -av /etc/network/interfaces.d .
488+ find /etc/network/interfaces.d > find_interfacesd
489 cp /etc/resolv.conf .
490 cp -av /etc/udev/rules.d/70-persistent-net.rules .
491 ip -o route show > ip_route_show
492@@ -245,10 +246,10 @@
493 collect_scripts = TestNetworkAbs.collect_scripts + [textwrap.dedent("""
494 cd OUTPUT_COLLECT_D
495 dpkg-query -W -f '${Status}' vlan > vlan_installed
496- ip -d link show eth1.2667 > ip_link_show_eth1.2667
497- ip -d link show eth1.2668 > ip_link_show_eth1.2668
498- ip -d link show eth1.2669 > ip_link_show_eth1.2669
499- ip -d link show eth1.2670 > ip_link_show_eth1.2670
500+ ip -d link show interface1.2667 > ip_link_show_interface1.2667
501+ ip -d link show interface1.2668 > ip_link_show_interface1.2668
502+ ip -d link show interface1.2669 > ip_link_show_interface1.2669
503+ ip -d link show interface1.2670 > ip_link_show_interface1.2670
504 """)]
505
506 def get_vlans(self):
507@@ -309,6 +310,7 @@
508 ifconfig -a > ifconfig_a
509 cp -av /etc/network/interfaces .
510 cp -a /etc/network/interfaces.d .
511+ find /etc/network/interfaces.d > find_interfacesd
512 cp /etc/resolv.conf .
513 cp -av /etc/udev/rules.d/70-persistent-net.rules .
514 ip -o route show > ip_route_show
515@@ -317,7 +319,7 @@
516
517 def test_source_cfg_exists(self):
518 """Test that our curthooks wrote our injected config."""
519- self.output_files_exist(["interfaces.d/eth2.cfg"])
520+ self.output_files_exist(["interfaces.d/interface2.cfg"])
521
522 def test_etc_network_interfaces_source_cfg(self):
523 """ Compare injected configuration as parsed by curtin matches
524@@ -344,7 +346,7 @@
525 print('parsed ifconfig dict:\n{}'.format(
526 yaml.dump(ifconfig_dict, default_flow_style=False, indent=4)))
527
528- iface = 'eth2'
529+ iface = 'interface2'
530 self.assertTrue(iface in curtin_ifaces)
531
532 expected_address = curtin_ifaces[iface].get('address', None)
533
534=== modified file 'tests/vmtests/test_nvme.py'
535--- tests/vmtests/test_nvme.py 2016-04-04 18:20:33 +0000
536+++ tests/vmtests/test_nvme.py 2016-05-19 18:43:17 +0000
537@@ -33,6 +33,7 @@
538 cat /etc/fstab > fstab
539 mkdir -p /dev/disk/by-dname
540 ls /dev/disk/by-dname/ > ls_dname
541+ find /etc/network/interfaces.d > find_interfacesd
542
543 v=""
544 out=$(apt-config shell v Acquire::HTTP::Proxy)
545
546=== modified file 'tests/vmtests/test_raid5_bcache.py'
547--- tests/vmtests/test_raid5_bcache.py 2016-04-17 22:35:20 +0000
548+++ tests/vmtests/test_raid5_bcache.py 2016-05-19 18:43:17 +0000
549@@ -16,6 +16,7 @@
550 mdadm --detail --scan | grep -c ubuntu > mdadm_active1
551 grep -c active /proc/mdstat > mdadm_active2
552 ls /dev/disk/by-dname > ls_dname
553+ find /etc/network/interfaces.d > find_interfacesd
554 """)]
555
556 def test_mdadm_output_files_exist(self):
557@@ -41,6 +42,7 @@
558 cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode
559 cat /proc/mounts > proc_mounts
560 cat /proc/partitions > proc_partitions
561+ find /etc/network/interfaces.d > find_interfacesd
562 """)]
563 fstab_expected = {
564 '/dev/bcache0': '/',
565
566=== modified file 'tests/vmtests/test_uefi_basic.py'
567--- tests/vmtests/test_uefi_basic.py 2016-04-08 03:43:26 +0000
568+++ tests/vmtests/test_uefi_basic.py 2016-05-19 18:43:17 +0000
569@@ -23,6 +23,7 @@
570 cat /etc/fstab > fstab
571 mkdir -p /dev/disk/by-dname
572 ls /dev/disk/by-dname/ > ls_dname
573+ find /etc/network/interfaces.d > find_interfacesd
574 ls /sys/firmware/efi/ > ls_sys_firmware_efi
575 cat /sys/class/block/vda/queue/logical_block_size > vda_lbs
576 cat /sys/class/block/vda/queue/physical_block_size > vda_pbs

Subscribers

People subscribed via source and target branches