Merge lp:~raharper/curtin/trunk.delete-eth0-cfg-in-target into lp:~curtin-dev/curtin/trunk
- trunk.delete-eth0-cfg-in-target
- Merge into trunk
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 |
Related bugs: |
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/
Prior to Xenial release, Ubuntu Cloud images included a default network
configuration in /etc/network/
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/
Prior to Xenial release, Ubuntu Cloud images included a default network
configuration in /etc/network/
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.
Server Team CI bot (server-team-bot) wrote : | # |
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'.
Scott Moser (smoser) wrote : | # |
oh yeah, and move your description to the commit m essage and fix the new lines that seemed inserted somehow.
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(
> > + try:
>
> attempting to remove seems not that useful. rather 'removed' or 'did not
> remove' would be better.
> LOG.debug(
> except..
> LOG.debug(
>
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_
> > contents = "\n".join(
> > ['#!/bin/sh',
>
>
> --
>
> https:/
> 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.
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:391
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
- 392. By Ryan Harper
-
util.del_file: don't log success until the file is removed.
Server Team CI bot (server-team-bot) wrote : | # |
PASSED: Continuous integration, rev:392
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
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 | 149 | os.unlink(dpkg_cfg) | 149 | os.unlink(dpkg_cfg) |
6 | 150 | 150 | ||
7 | 151 | 151 | ||
8 | 152 | def _maybe_remove_legacy_eth0(target, | ||
9 | 153 | path="/etc/network/interfaces.d/eth0.cfg"): | ||
10 | 154 | """Ubuntu cloud images previously included a 'eth0.cfg' that had | ||
11 | 155 | hard coded content. That file would interfere with the rendered | ||
12 | 156 | configuration if it was present. | ||
13 | 157 | |||
14 | 158 | if the file does not exist do nothing. | ||
15 | 159 | If the file exists: | ||
16 | 160 | - with known content, remove it and warn | ||
17 | 161 | - with unknown content, leave it and warn | ||
18 | 162 | """ | ||
19 | 163 | |||
20 | 164 | cfg = os.path.sep.join([target, path]) | ||
21 | 165 | if not os.path.exists(cfg): | ||
22 | 166 | LOG.warn('Failed to find legacy conf file %s', cfg) | ||
23 | 167 | return | ||
24 | 168 | |||
25 | 169 | bmsg = "Dynamic networking config may not apply." | ||
26 | 170 | try: | ||
27 | 171 | contents = util.load_file(cfg) | ||
28 | 172 | known_contents = ["auto eth0", "iface eth0 inet dhcp"] | ||
29 | 173 | lines = [f.strip() for f in contents.splitlines() | ||
30 | 174 | if not f.startswith("#")] | ||
31 | 175 | if lines == known_contents: | ||
32 | 176 | util.del_file(cfg) | ||
33 | 177 | msg = "removed %s with known contents" % cfg | ||
34 | 178 | else: | ||
35 | 179 | msg = (bmsg + " '%s' exists with user configured content." % cfg) | ||
36 | 180 | except: | ||
37 | 181 | msg = bmsg + " %s exists, but could not be read." % cfg | ||
38 | 182 | LOG.exception(msg) | ||
39 | 183 | return | ||
40 | 184 | |||
41 | 185 | LOG.warn(msg) | ||
42 | 186 | |||
43 | 187 | |||
44 | 152 | def setup_zipl(cfg, target): | 188 | def setup_zipl(cfg, target): |
45 | 153 | if platform.machine() != 's390x': | 189 | if platform.machine() != 's390x': |
46 | 154 | return | 190 | return |
47 | @@ -522,6 +558,8 @@ | |||
48 | 522 | LOG.debug("copying interfaces") | 558 | LOG.debug("copying interfaces") |
49 | 523 | copy_interfaces(interfaces, target) | 559 | copy_interfaces(interfaces, target) |
50 | 524 | 560 | ||
51 | 561 | _maybe_remove_legacy_eth0(target) | ||
52 | 562 | |||
53 | 525 | 563 | ||
54 | 526 | def copy_interfaces(interfaces, target): | 564 | def copy_interfaces(interfaces, target): |
55 | 527 | if not interfaces: | 565 | if not interfaces: |
56 | 528 | 566 | ||
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 | 288 | return fp.read() | 288 | return fp.read() |
62 | 289 | 289 | ||
63 | 290 | 290 | ||
64 | 291 | def del_file(path): | ||
65 | 292 | try: | ||
66 | 293 | os.unlink(path) | ||
67 | 294 | LOG.debug("del_file: removed %s", path) | ||
68 | 295 | except OSError as e: | ||
69 | 296 | LOG.exception("del_file: %s did not exist.", path) | ||
70 | 297 | if e.errno != errno.ENOENT: | ||
71 | 298 | raise e | ||
72 | 299 | |||
73 | 300 | |||
74 | 291 | def disable_daemons_in_root(target): | 301 | def disable_daemons_in_root(target): |
75 | 292 | contents = "\n".join( | 302 | contents = "\n".join( |
76 | 293 | ['#!/bin/sh', | 303 | ['#!/bin/sh', |
77 | 294 | 304 | ||
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 | 5 | # to prevent networking restarts from up/down'ing the | 5 | # to prevent networking restarts from up/down'ing the |
83 | 6 | # interface | 6 | # interface |
84 | 7 | - type: physical | 7 | - type: physical |
86 | 8 | name: eth0 | 8 | name: interface0 |
87 | 9 | mac_address: "c0:d6:9f:2c:e8:80" | 9 | mac_address: "c0:d6:9f:2c:e8:80" |
88 | 10 | subnets: | 10 | subnets: |
89 | 11 | - type: dhcp4 | 11 | - type: dhcp4 |
90 | 12 | control: manual | 12 | control: manual |
91 | 13 | # control: auto this is the default if control isn't present | 13 | # control: auto this is the default if control isn't present |
92 | 14 | - type: physical | 14 | - type: physical |
94 | 15 | name: eth1 | 15 | name: interface1 |
95 | 16 | mtu: 1492 | 16 | mtu: 1492 |
96 | 17 | mac_address: "aa:d6:9f:2c:e8:80" | 17 | mac_address: "aa:d6:9f:2c:e8:80" |
97 | 18 | subnets: | 18 | subnets: |
98 | @@ -25,7 +25,7 @@ | |||
99 | 25 | # and we want to auto configure this | 25 | # and we want to auto configure this |
100 | 26 | # when present | 26 | # when present |
101 | 27 | - type: physical | 27 | - type: physical |
103 | 28 | name: eth2 | 28 | name: interface2 |
104 | 29 | mac_address: "cf:d6:af:48:e8:80" | 29 | mac_address: "cf:d6:af:48:e8:80" |
105 | 30 | subnets: | 30 | subnets: |
106 | 31 | - type: static | 31 | - type: static |
107 | 32 | 32 | ||
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 | 4 | config: | 4 | config: |
113 | 5 | # Physical interfaces. | 5 | # Physical interfaces. |
114 | 6 | - type: physical | 6 | - type: physical |
116 | 7 | name: eth0 | 7 | name: interface0 |
117 | 8 | mac_address: "52:54:00:12:34:00" | 8 | mac_address: "52:54:00:12:34:00" |
118 | 9 | subnets: | 9 | subnets: |
119 | 10 | - type: dhcp4 | 10 | - type: dhcp4 |
120 | 11 | - type: physical | 11 | - type: physical |
122 | 12 | name: eth1 | 12 | name: interface1 |
123 | 13 | mtu: 1492 | 13 | mtu: 1492 |
124 | 14 | mac_address: "52:54:00:12:34:02" | 14 | mac_address: "52:54:00:12:34:02" |
125 | 15 | subnets: | 15 | subnets: |
126 | @@ -22,5 +22,5 @@ | |||
127 | 22 | dns_search: | 22 | dns_search: |
128 | 23 | - barley.maas | 23 | - barley.maas |
129 | 24 | - type: physical | 24 | - type: physical |
131 | 25 | name: eth2 | 25 | name: interface2 |
132 | 26 | mac_address: "52:54:00:12:34:04" | 26 | mac_address: "52:54:00:12:34:04" |
133 | 27 | 27 | ||
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 | 4 | config: | 4 | config: |
139 | 5 | # Physical interfaces. | 5 | # Physical interfaces. |
140 | 6 | - type: physical | 6 | - type: physical |
142 | 7 | name: eth0 | 7 | name: interface0 |
143 | 8 | mac_address: "52:54:00:12:34:00" | 8 | mac_address: "52:54:00:12:34:00" |
144 | 9 | subnets: | 9 | subnets: |
145 | 10 | - type: static | 10 | - type: static |
146 | 11 | 11 | ||
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 | 4 | config: | 4 | config: |
152 | 5 | # Physical interfaces. | 5 | # Physical interfaces. |
153 | 6 | - type: physical | 6 | - type: physical |
155 | 7 | name: eth0 | 7 | name: interface0 |
156 | 8 | mac_address: "52:54:00:12:34:00" | 8 | mac_address: "52:54:00:12:34:00" |
157 | 9 | subnets: | 9 | subnets: |
158 | 10 | - type: dhcp4 | 10 | - type: dhcp4 |
159 | 11 | - type: physical | 11 | - type: physical |
161 | 12 | name: eth1 | 12 | name: interface1 |
162 | 13 | mac_address: "52:54:00:12:34:02" | 13 | mac_address: "52:54:00:12:34:02" |
163 | 14 | - type: physical | 14 | - type: physical |
165 | 15 | name: eth2 | 15 | name: interface2 |
166 | 16 | mac_address: "52:54:00:12:34:04" | 16 | mac_address: "52:54:00:12:34:04" |
167 | 17 | # Bond. | 17 | # Bond. |
168 | 18 | - type: bond | 18 | - type: bond |
169 | 19 | name: bond0 | 19 | name: bond0 |
170 | 20 | mac_address: "52:54:00:12:34:06" | 20 | mac_address: "52:54:00:12:34:06" |
171 | 21 | bond_interfaces: | 21 | bond_interfaces: |
174 | 22 | - eth1 | 22 | - interface1 |
175 | 23 | - eth2 | 23 | - interface2 |
176 | 24 | params: | 24 | params: |
177 | 25 | bond-mode: active-backup | 25 | bond-mode: active-backup |
178 | 26 | subnets: | 26 | subnets: |
179 | 27 | 27 | ||
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 | 3 | config: | 3 | config: |
185 | 4 | # Physical interfaces. | 4 | # Physical interfaces. |
186 | 5 | - type: physical | 5 | - type: physical |
188 | 6 | name: eth0 | 6 | name: interface0 |
189 | 7 | mac_address: "52:54:00:12:34:00" | 7 | mac_address: "52:54:00:12:34:00" |
190 | 8 | subnets: | 8 | subnets: |
191 | 9 | - type: dhcp4 | 9 | - type: dhcp4 |
192 | 10 | - type: physical | 10 | - type: physical |
194 | 11 | name: eth1 | 11 | name: interface1 |
195 | 12 | mtu: 1492 | 12 | mtu: 1492 |
196 | 13 | mac_address: "52:54:00:12:34:02" | 13 | mac_address: "52:54:00:12:34:02" |
197 | 14 | subnets: | 14 | subnets: |
198 | @@ -21,11 +21,11 @@ | |||
199 | 21 | dns_search: | 21 | dns_search: |
200 | 22 | - barley.maas | 22 | - barley.maas |
201 | 23 | - type: physical | 23 | - type: physical |
203 | 24 | name: eth2 | 24 | name: interface2 |
204 | 25 | mac_address: "52:54:00:12:34:04" | 25 | mac_address: "52:54:00:12:34:04" |
205 | 26 | 26 | ||
206 | 27 | curthooks_commands: | 27 | curthooks_commands: |
207 | 28 | # use curtin to inject a eni config file outside of the network yaml | 28 | # use curtin to inject a eni config file outside of the network yaml |
208 | 29 | # this allows us to test user installed configurations outside of | 29 | # this allows us to test user installed configurations outside of |
209 | 30 | # curtin's control | 30 | # curtin's control |
211 | 31 | 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"] | 31 | 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 | 32 | 32 | ||
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 | 1 | network: | 1 | network: |
218 | 2 | config: | 2 | config: |
220 | 3 | - id: eth0 | 3 | - id: interface0 |
221 | 4 | mac_address: d4:be:d9:a8:49:13 | 4 | mac_address: d4:be:d9:a8:49:13 |
222 | 5 | mtu: 1500 | 5 | mtu: 1500 |
224 | 6 | name: eth0 | 6 | name: interface0 |
225 | 7 | subnets: | 7 | subnets: |
226 | 8 | - address: 10.245.168.16/21 | 8 | - address: 10.245.168.16/21 |
227 | 9 | dns_nameservers: | 9 | dns_nameservers: |
228 | @@ -11,69 +11,69 @@ | |||
229 | 11 | gateway: 10.245.168.1 | 11 | gateway: 10.245.168.1 |
230 | 12 | type: static | 12 | type: static |
231 | 13 | type: physical | 13 | type: physical |
233 | 14 | - id: eth1 | 14 | - id: interface1 |
234 | 15 | mac_address: d4:be:d9:a8:49:15 | 15 | mac_address: d4:be:d9:a8:49:15 |
235 | 16 | mtu: 1500 | 16 | mtu: 1500 |
237 | 17 | name: eth1 | 17 | name: interface1 |
238 | 18 | subnets: | 18 | subnets: |
239 | 19 | - address: 10.245.188.2/24 | 19 | - address: 10.245.188.2/24 |
240 | 20 | dns_nameservers: [] | 20 | dns_nameservers: [] |
241 | 21 | type: static | 21 | type: static |
242 | 22 | type: physical | 22 | type: physical |
244 | 23 | - id: eth2 | 23 | - id: interface2 |
245 | 24 | mac_address: d4:be:d9:a8:49:17 | 24 | mac_address: d4:be:d9:a8:49:17 |
246 | 25 | mtu: 1500 | 25 | mtu: 1500 |
248 | 26 | name: eth2 | 26 | name: interface2 |
249 | 27 | subnets: | 27 | subnets: |
250 | 28 | - type: manual | 28 | - type: manual |
251 | 29 | type: physical | 29 | type: physical |
253 | 30 | - id: eth3 | 30 | - id: interface3 |
254 | 31 | mac_address: d4:be:d9:a8:49:19 | 31 | mac_address: d4:be:d9:a8:49:19 |
255 | 32 | mtu: 1500 | 32 | mtu: 1500 |
257 | 33 | name: eth3 | 33 | name: interface3 |
258 | 34 | subnets: | 34 | subnets: |
259 | 35 | - type: manual | 35 | - type: manual |
260 | 36 | type: physical | 36 | type: physical |
262 | 37 | - id: eth1.2667 | 37 | - id: interface1.2667 |
263 | 38 | mtu: 1500 | 38 | mtu: 1500 |
265 | 39 | name: eth1.2667 | 39 | name: interface1.2667 |
266 | 40 | subnets: | 40 | subnets: |
267 | 41 | - address: 10.245.184.2/24 | 41 | - address: 10.245.184.2/24 |
268 | 42 | dns_nameservers: [] | 42 | dns_nameservers: [] |
269 | 43 | type: static | 43 | type: static |
270 | 44 | type: vlan | 44 | type: vlan |
271 | 45 | vlan_id: 2667 | 45 | vlan_id: 2667 |
274 | 46 | vlan_link: eth1 | 46 | vlan_link: interface1 |
275 | 47 | - id: eth1.2668 | 47 | - id: interface1.2668 |
276 | 48 | mtu: 1500 | 48 | mtu: 1500 |
278 | 49 | name: eth1.2668 | 49 | name: interface1.2668 |
279 | 50 | subnets: | 50 | subnets: |
280 | 51 | - address: 10.245.185.1/24 | 51 | - address: 10.245.185.1/24 |
281 | 52 | dns_nameservers: [] | 52 | dns_nameservers: [] |
282 | 53 | type: static | 53 | type: static |
283 | 54 | type: vlan | 54 | type: vlan |
284 | 55 | vlan_id: 2668 | 55 | vlan_id: 2668 |
287 | 56 | vlan_link: eth1 | 56 | vlan_link: interface1 |
288 | 57 | - id: eth1.2669 | 57 | - id: interface1.2669 |
289 | 58 | mtu: 1500 | 58 | mtu: 1500 |
291 | 59 | name: eth1.2669 | 59 | name: interface1.2669 |
292 | 60 | subnets: | 60 | subnets: |
293 | 61 | - address: 10.245.186.1/24 | 61 | - address: 10.245.186.1/24 |
294 | 62 | dns_nameservers: [] | 62 | dns_nameservers: [] |
295 | 63 | type: static | 63 | type: static |
296 | 64 | type: vlan | 64 | type: vlan |
297 | 65 | vlan_id: 2669 | 65 | vlan_id: 2669 |
300 | 66 | vlan_link: eth1 | 66 | vlan_link: interface1 |
301 | 67 | - id: eth1.2670 | 67 | - id: interface1.2670 |
302 | 68 | mtu: 1500 | 68 | mtu: 1500 |
304 | 69 | name: eth1.2670 | 69 | name: interface1.2670 |
305 | 70 | subnets: | 70 | subnets: |
306 | 71 | - address: 10.245.187.2/24 | 71 | - address: 10.245.187.2/24 |
307 | 72 | dns_nameservers: [] | 72 | dns_nameservers: [] |
308 | 73 | type: static | 73 | type: static |
309 | 74 | type: vlan | 74 | type: vlan |
310 | 75 | vlan_id: 2670 | 75 | vlan_id: 2670 |
312 | 76 | vlan_link: eth1 | 76 | vlan_link: interface1 |
313 | 77 | - address: 10.245.168.2 | 77 | - address: 10.245.168.2 |
314 | 78 | search: | 78 | search: |
315 | 79 | - dellstack | 79 | - dellstack |
316 | 80 | 80 | ||
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 | 497 | auto lo | 497 | auto lo |
322 | 498 | iface lo inet loopback | 498 | iface lo inet loopback |
323 | 499 | 499 | ||
326 | 500 | auto eth0 | 500 | auto interface0 |
327 | 501 | iface eth0 inet dhcp | 501 | iface interface0 inet dhcp |
328 | 502 | 502 | ||
331 | 503 | auto eth1 | 503 | auto interface1 |
332 | 504 | iface eth1 inet manual | 504 | iface interface1 inet manual |
333 | 505 | bond-mode active-backup | 505 | bond-mode active-backup |
334 | 506 | bond-master bond0 | 506 | bond-master bond0 |
335 | 507 | 507 | ||
338 | 508 | auto eth2 | 508 | auto interface2 |
339 | 509 | iface eth2 inet manual | 509 | iface interface2 inet manual |
340 | 510 | bond-mode active-backup | 510 | bond-mode active-backup |
341 | 511 | bond-master bond0 | 511 | bond-master bond0 |
342 | 512 | 512 | ||
343 | @@ -537,22 +537,22 @@ | |||
344 | 537 | auto lo | 537 | auto lo |
345 | 538 | iface lo inet loopback | 538 | iface lo inet loopback |
346 | 539 | 539 | ||
349 | 540 | # control-manual eth0 | 540 | # control-manual interface0 |
350 | 541 | iface eth0 inet dhcp | 541 | iface interface0 inet dhcp |
351 | 542 | 542 | ||
354 | 543 | auto eth1 | 543 | auto interface1 |
355 | 544 | iface eth1 inet static | 544 | iface interface1 inet static |
356 | 545 | address 192.168.14.2/24 | 545 | address 192.168.14.2/24 |
357 | 546 | gateway 192.168.14.1 | 546 | gateway 192.168.14.1 |
358 | 547 | mtu 1492 | 547 | mtu 1492 |
359 | 548 | 548 | ||
362 | 549 | auto eth1:1 | 549 | auto interface1:1 |
363 | 550 | iface eth1:1 inet static | 550 | iface interface1:1 inet static |
364 | 551 | address 192.168.14.4/24 | 551 | address 192.168.14.4/24 |
365 | 552 | mtu 1492 | 552 | mtu 1492 |
366 | 553 | 553 | ||
369 | 554 | allow-hotplug eth2 | 554 | allow-hotplug interface2 |
370 | 555 | iface eth2 inet static | 555 | iface interface2 inet static |
371 | 556 | gateway 10.11.12.1 | 556 | gateway 10.11.12.1 |
372 | 557 | address 10.11.12.13/22 | 557 | address 10.11.12.13/22 |
373 | 558 | 558 | ||
374 | 559 | 559 | ||
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 | 745 | self.assertIn(link, contents) | 745 | self.assertIn(link, contents) |
380 | 746 | self.assertIn(diskname, contents) | 746 | self.assertIn(diskname, contents) |
381 | 747 | 747 | ||
382 | 748 | def test_interfacesd_eth0_removed(self): | ||
383 | 749 | """ Check that curtin has removed /etc/network/interfaces.d/eth0.cfg | ||
384 | 750 | by examining the output of a find /etc/network > find_interfaces.d | ||
385 | 751 | """ | ||
386 | 752 | fpath = os.path.join(self.td.collect, "find_interfacesd") | ||
387 | 753 | interfacesd = util.load_file(fpath) | ||
388 | 754 | self.assertNotIn("/etc/network/interfaces.d/eth0.cfg", | ||
389 | 755 | interfacesd.split("\n")) | ||
390 | 756 | |||
391 | 748 | def run(self, result): | 757 | def run(self, result): |
392 | 749 | super(VMBaseClass, self).run(result) | 758 | super(VMBaseClass, self).run(result) |
393 | 750 | self.record_result(result) | 759 | self.record_result(result) |
394 | @@ -844,6 +853,9 @@ | |||
395 | 844 | def test_dname(self): | 853 | def test_dname(self): |
396 | 845 | pass | 854 | pass |
397 | 846 | 855 | ||
398 | 856 | def test_interfacesd_eth0_removed(self): | ||
399 | 857 | pass | ||
400 | 858 | |||
401 | 847 | def _maybe_raise(self, exc): | 859 | def _maybe_raise(self, exc): |
402 | 848 | if self.allow_test_fails: | 860 | if self.allow_test_fails: |
403 | 849 | raise exc | 861 | raise exc |
404 | 850 | 862 | ||
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 | 25 | cat /etc/fstab > fstab | 25 | cat /etc/fstab > fstab |
410 | 26 | mkdir -p /dev/disk/by-dname | 26 | mkdir -p /dev/disk/by-dname |
411 | 27 | ls /dev/disk/by-dname/ > ls_dname | 27 | ls /dev/disk/by-dname/ > ls_dname |
412 | 28 | find /etc/network/interfaces.d > find_interfacesd | ||
413 | 28 | 29 | ||
414 | 29 | v="" | 30 | v="" |
415 | 30 | out=$(apt-config shell v Acquire::HTTP::Proxy) | 31 | out=$(apt-config shell v Acquire::HTTP::Proxy) |
416 | @@ -145,6 +146,7 @@ | |||
417 | 145 | cat /etc/fstab > fstab | 146 | cat /etc/fstab > fstab |
418 | 146 | mkdir -p /dev/disk/by-dname | 147 | mkdir -p /dev/disk/by-dname |
419 | 147 | ls /dev/disk/by-dname/ > ls_dname | 148 | ls /dev/disk/by-dname/ > ls_dname |
420 | 149 | find /etc/network/interfaces.d > find_interfacesd | ||
421 | 148 | 150 | ||
422 | 149 | v="" | 151 | v="" |
423 | 150 | out=$(apt-config shell v Acquire::HTTP::Proxy) | 152 | out=$(apt-config shell v Acquire::HTTP::Proxy) |
424 | 151 | 153 | ||
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 | 18 | cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode | 18 | cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode |
430 | 19 | cat /proc/mounts > proc_mounts | 19 | cat /proc/mounts > proc_mounts |
431 | 20 | cat /proc/partitions > proc_partitions | 20 | cat /proc/partitions > proc_partitions |
432 | 21 | find /etc/network/interfaces.d > find_interfacesd | ||
433 | 21 | """)] | 22 | """)] |
434 | 22 | 23 | ||
435 | 23 | def test_bcache_output_files_exist(self): | 24 | def test_bcache_output_files_exist(self): |
436 | 24 | 25 | ||
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 | 59 | ip -o route show > ip_route_show | 59 | ip -o route show > ip_route_show |
442 | 60 | route -n > route_n | 60 | route -n > route_n |
443 | 61 | dpkg-query -W -f '${Status}' ifenslave > ifenslave_installed | 61 | dpkg-query -W -f '${Status}' ifenslave > ifenslave_installed |
444 | 62 | find /etc/network/interfaces.d > find_interfacesd | ||
445 | 62 | """)] | 63 | """)] |
446 | 63 | 64 | ||
447 | 64 | def test_output_files_exist(self): | 65 | def test_output_files_exist(self): |
448 | 65 | 66 | ||
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 | 12 | cd OUTPUT_COLLECT_D | 12 | cd OUTPUT_COLLECT_D |
454 | 13 | cat /etc/fstab > fstab | 13 | cat /etc/fstab > fstab |
455 | 14 | ls /dev/disk/by-dname > ls_dname | 14 | ls /dev/disk/by-dname > ls_dname |
456 | 15 | find /etc/network/interfaces.d > find_interfacesd | ||
457 | 15 | pvdisplay -C --separator = -o vg_name,pv_name --noheadings > pvs | 16 | pvdisplay -C --separator = -o vg_name,pv_name --noheadings > pvs |
458 | 16 | lvdisplay -C --separator = -o lv_name,vg_name --noheadings > lvs | 17 | lvdisplay -C --separator = -o lv_name,vg_name --noheadings > lvs |
459 | 17 | """)] | 18 | """)] |
460 | 18 | 19 | ||
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 | 16 | mdadm --detail --scan | grep -c ubuntu > mdadm_active1 | 16 | mdadm --detail --scan | grep -c ubuntu > mdadm_active1 |
466 | 17 | grep -c active /proc/mdstat > mdadm_active2 | 17 | grep -c active /proc/mdstat > mdadm_active2 |
467 | 18 | ls /dev/disk/by-dname > ls_dname | 18 | ls /dev/disk/by-dname > ls_dname |
468 | 19 | find /etc/network/interfaces.d > find_interfacesd | ||
469 | 19 | """)] | 20 | """)] |
470 | 20 | 21 | ||
471 | 21 | def test_mdadm_output_files_exist(self): | 22 | def test_mdadm_output_files_exist(self): |
472 | @@ -55,6 +56,7 @@ | |||
473 | 55 | cat /sys/block/bcache1/bcache/cache_mode >> bcache_cache_mode | 56 | cat /sys/block/bcache1/bcache/cache_mode >> bcache_cache_mode |
474 | 56 | cat /sys/block/bcache2/bcache/cache_mode >> bcache_cache_mode | 57 | cat /sys/block/bcache2/bcache/cache_mode >> bcache_cache_mode |
475 | 57 | cat /proc/mounts > proc_mounts | 58 | cat /proc/mounts > proc_mounts |
476 | 59 | find /etc/network/interfaces.d > find_interfacesd | ||
477 | 58 | """)] | 60 | """)] |
478 | 59 | fstab_expected = { | 61 | fstab_expected = { |
479 | 60 | '/dev/vda1': '/media/sda1', | 62 | '/dev/vda1': '/media/sda1', |
480 | 61 | 63 | ||
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 | 57 | ifconfig -a > ifconfig_a | 57 | ifconfig -a > ifconfig_a |
486 | 58 | cp -av /etc/network/interfaces . | 58 | cp -av /etc/network/interfaces . |
487 | 59 | cp -av /etc/network/interfaces.d . | 59 | cp -av /etc/network/interfaces.d . |
488 | 60 | find /etc/network/interfaces.d > find_interfacesd | ||
489 | 60 | cp /etc/resolv.conf . | 61 | cp /etc/resolv.conf . |
490 | 61 | cp -av /etc/udev/rules.d/70-persistent-net.rules . | 62 | cp -av /etc/udev/rules.d/70-persistent-net.rules . |
491 | 62 | ip -o route show > ip_route_show | 63 | ip -o route show > ip_route_show |
492 | @@ -245,10 +246,10 @@ | |||
493 | 245 | collect_scripts = TestNetworkAbs.collect_scripts + [textwrap.dedent(""" | 246 | collect_scripts = TestNetworkAbs.collect_scripts + [textwrap.dedent(""" |
494 | 246 | cd OUTPUT_COLLECT_D | 247 | cd OUTPUT_COLLECT_D |
495 | 247 | dpkg-query -W -f '${Status}' vlan > vlan_installed | 248 | dpkg-query -W -f '${Status}' vlan > vlan_installed |
500 | 248 | ip -d link show eth1.2667 > ip_link_show_eth1.2667 | 249 | ip -d link show interface1.2667 > ip_link_show_interface1.2667 |
501 | 249 | ip -d link show eth1.2668 > ip_link_show_eth1.2668 | 250 | ip -d link show interface1.2668 > ip_link_show_interface1.2668 |
502 | 250 | ip -d link show eth1.2669 > ip_link_show_eth1.2669 | 251 | ip -d link show interface1.2669 > ip_link_show_interface1.2669 |
503 | 251 | ip -d link show eth1.2670 > ip_link_show_eth1.2670 | 252 | ip -d link show interface1.2670 > ip_link_show_interface1.2670 |
504 | 252 | """)] | 253 | """)] |
505 | 253 | 254 | ||
506 | 254 | def get_vlans(self): | 255 | def get_vlans(self): |
507 | @@ -309,6 +310,7 @@ | |||
508 | 309 | ifconfig -a > ifconfig_a | 310 | ifconfig -a > ifconfig_a |
509 | 310 | cp -av /etc/network/interfaces . | 311 | cp -av /etc/network/interfaces . |
510 | 311 | cp -a /etc/network/interfaces.d . | 312 | cp -a /etc/network/interfaces.d . |
511 | 313 | find /etc/network/interfaces.d > find_interfacesd | ||
512 | 312 | cp /etc/resolv.conf . | 314 | cp /etc/resolv.conf . |
513 | 313 | cp -av /etc/udev/rules.d/70-persistent-net.rules . | 315 | cp -av /etc/udev/rules.d/70-persistent-net.rules . |
514 | 314 | ip -o route show > ip_route_show | 316 | ip -o route show > ip_route_show |
515 | @@ -317,7 +319,7 @@ | |||
516 | 317 | 319 | ||
517 | 318 | def test_source_cfg_exists(self): | 320 | def test_source_cfg_exists(self): |
518 | 319 | """Test that our curthooks wrote our injected config.""" | 321 | """Test that our curthooks wrote our injected config.""" |
520 | 320 | self.output_files_exist(["interfaces.d/eth2.cfg"]) | 322 | self.output_files_exist(["interfaces.d/interface2.cfg"]) |
521 | 321 | 323 | ||
522 | 322 | def test_etc_network_interfaces_source_cfg(self): | 324 | def test_etc_network_interfaces_source_cfg(self): |
523 | 323 | """ Compare injected configuration as parsed by curtin matches | 325 | """ Compare injected configuration as parsed by curtin matches |
524 | @@ -344,7 +346,7 @@ | |||
525 | 344 | print('parsed ifconfig dict:\n{}'.format( | 346 | print('parsed ifconfig dict:\n{}'.format( |
526 | 345 | yaml.dump(ifconfig_dict, default_flow_style=False, indent=4))) | 347 | yaml.dump(ifconfig_dict, default_flow_style=False, indent=4))) |
527 | 346 | 348 | ||
529 | 347 | iface = 'eth2' | 349 | iface = 'interface2' |
530 | 348 | self.assertTrue(iface in curtin_ifaces) | 350 | self.assertTrue(iface in curtin_ifaces) |
531 | 349 | 351 | ||
532 | 350 | expected_address = curtin_ifaces[iface].get('address', None) | 352 | expected_address = curtin_ifaces[iface].get('address', None) |
533 | 351 | 353 | ||
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 | 33 | cat /etc/fstab > fstab | 33 | cat /etc/fstab > fstab |
539 | 34 | mkdir -p /dev/disk/by-dname | 34 | mkdir -p /dev/disk/by-dname |
540 | 35 | ls /dev/disk/by-dname/ > ls_dname | 35 | ls /dev/disk/by-dname/ > ls_dname |
541 | 36 | find /etc/network/interfaces.d > find_interfacesd | ||
542 | 36 | 37 | ||
543 | 37 | v="" | 38 | v="" |
544 | 38 | out=$(apt-config shell v Acquire::HTTP::Proxy) | 39 | out=$(apt-config shell v Acquire::HTTP::Proxy) |
545 | 39 | 40 | ||
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 | 16 | mdadm --detail --scan | grep -c ubuntu > mdadm_active1 | 16 | mdadm --detail --scan | grep -c ubuntu > mdadm_active1 |
551 | 17 | grep -c active /proc/mdstat > mdadm_active2 | 17 | grep -c active /proc/mdstat > mdadm_active2 |
552 | 18 | ls /dev/disk/by-dname > ls_dname | 18 | ls /dev/disk/by-dname > ls_dname |
553 | 19 | find /etc/network/interfaces.d > find_interfacesd | ||
554 | 19 | """)] | 20 | """)] |
555 | 20 | 21 | ||
556 | 21 | def test_mdadm_output_files_exist(self): | 22 | def test_mdadm_output_files_exist(self): |
557 | @@ -41,6 +42,7 @@ | |||
558 | 41 | cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode | 42 | cat /sys/block/bcache0/bcache/cache_mode > bcache_cache_mode |
559 | 42 | cat /proc/mounts > proc_mounts | 43 | cat /proc/mounts > proc_mounts |
560 | 43 | cat /proc/partitions > proc_partitions | 44 | cat /proc/partitions > proc_partitions |
561 | 45 | find /etc/network/interfaces.d > find_interfacesd | ||
562 | 44 | """)] | 46 | """)] |
563 | 45 | fstab_expected = { | 47 | fstab_expected = { |
564 | 46 | '/dev/bcache0': '/', | 48 | '/dev/bcache0': '/', |
565 | 47 | 49 | ||
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 | 23 | cat /etc/fstab > fstab | 23 | cat /etc/fstab > fstab |
571 | 24 | mkdir -p /dev/disk/by-dname | 24 | mkdir -p /dev/disk/by-dname |
572 | 25 | ls /dev/disk/by-dname/ > ls_dname | 25 | ls /dev/disk/by-dname/ > ls_dname |
573 | 26 | find /etc/network/interfaces.d > find_interfacesd | ||
574 | 26 | ls /sys/firmware/efi/ > ls_sys_firmware_efi | 27 | ls /sys/firmware/efi/ > ls_sys_firmware_efi |
575 | 27 | cat /sys/class/block/vda/queue/logical_block_size > vda_lbs | 28 | cat /sys/class/block/vda/queue/logical_block_size > vda_lbs |
576 | 28 | cat /sys/class/block/vda/queue/physical_block_size > vda_pbs | 29 | cat /sys/class/block/vda/queue/physical_block_size > vda_pbs |
PASSED: Continuous integration, rev:390 /server- team-jenkins. canonical. com/job/ curtin- ci/229/ /server- team-jenkins. canonical. com/job/ generic- update- mp/226/ console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /server- team-jenkins. canonical. com/job/ curtin- ci/229/ rebuild
https:/