Merge ~morphis/snappy-hwe-snaps/+git/network-manager:split-netplan-backend-switch-tests into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
- Git
- lp:~morphis/snappy-hwe-snaps/+git/network-manager
- split-netplan-backend-switch-tests
- Merge into master
Status: | Merged |
---|---|
Approved by: | Simon Fels |
Approved revision: | 7cf7a784451f7a1ad982dd87980e5b0a9585f202 |
Merged at revision: | 5eb0c6372ccdb26a5b0be22176c2915fde262163 |
Proposed branch: | ~morphis/snappy-hwe-snaps/+git/network-manager:split-netplan-backend-switch-tests |
Merge into: | ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master |
Diff against target: |
555 lines (+213/-105) 14 files modified
README.md (+31/-0) dev/null (+0/-42) spread.yaml (+28/-1) tests/full/dhcp-leases-are-moved/task.yaml (+21/-0) tests/full/no-netplan-default-config/task.yaml (+41/-0) tests/full/system-network-is-active/task.yaml (+9/-0) tests/image/create-image.sh (+10/-0) tests/lib/prepare-all.sh (+25/-0) tests/lib/prepare.sh (+9/-29) tests/lib/restore-each.sh (+13/-2) tests/lib/utilities.sh (+7/-1) tests/main/ethernet-managed-by-networkd/task.yaml (+7/-0) tests/main/switch-netplan-renderer/task.yaml (+11/-29) tests/main/wifi-connect-secured-ap/task.yaml (+1/-1) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jim Hodapp (community) | Approve | ||
System Enablement Bot | continuous-integration | Approve | |
Konrad Zapałowicz (community) | code | Approve | |
Review via email: mp+310166@code.launchpad.net |
Commit message
Description of the change
Reorganize spread tests into two different test suites
The first test suite is testing NetworkManager in general on an image which is not configured to use NetworkManager by default. In the second suite we configure the whole system to use NetworkManager only and ensure networkd is not used.
This does not add any new tests but moves existing ones around and fixes bugs in the new setup.
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:ddbb6ee20a8
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Konrad Zapałowicz (kzapalowicz) wrote : | # |
lgtm
Jim Hodapp (jhodapp) wrote : | # |
Only one thing I'd like to see added to this MR. It'd be very helpful to add a quick note to the README.md that shows how to run a specific test suite since this MR splits the original tests into 2 suites.
Simon Fels (morphis) wrote : | # |
@Jim: Fixed.
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:7cf7a784451
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:7cf7a784451
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Jim Hodapp (jhodapp) : | # |
Preview Diff
1 | diff --git a/README.md b/README.md |
2 | index 4794260..dbaf69f 100644 |
3 | --- a/README.md |
4 | +++ b/README.md |
5 | @@ -14,26 +14,34 @@ In order to run those tests you need the follow things |
6 | |
7 | You can install both as a snap |
8 | |
9 | +``` |
10 | $ snap install --edge --devmode ubuntu-image |
11 | $ snap install --devmode spread |
12 | +``` |
13 | |
14 | NOTE: As of today (27/10/2016) the version of spread in the store misses |
15 | some important bug fixes so you have to build your own one for now: |
16 | |
17 | +``` |
18 | $ WORKDIR=`mktemp -d` |
19 | $ export GOPATH=$WORKDIR |
20 | $ go get -d -v github.com/snapcore/spread/... |
21 | $ go build github.com/snapcore/spread/cmd/spread |
22 | $ sudo cp spread /usr/local/bin |
23 | +``` |
24 | |
25 | Make sure /usr/local/bin is in your path and is used as default: |
26 | |
27 | +``` |
28 | $ which spread |
29 | /usr/local/bin/spread |
30 | +``` |
31 | |
32 | Now you have everything to run the test suite. |
33 | |
34 | +``` |
35 | $ ./run-tests |
36 | +``` |
37 | |
38 | The script will create an image via ubuntu-image and make it available |
39 | to spread by copying it to ~/.spread/qemu or ~/snap/spread/<version>/.spread/qemu |
40 | @@ -42,9 +50,32 @@ snap. |
41 | |
42 | If you want to see more verbose debugging output of spread run |
43 | |
44 | +``` |
45 | $ ./run-tests --debug |
46 | +``` |
47 | |
48 | If you do not want to build the network-manager snap from source but test one |
49 | from a specific channel start testing with |
50 | |
51 | +``` |
52 | $ ./run-tests --channel=beta --test-from-channel |
53 | +``` |
54 | + |
55 | +You can also run spread directly which allows you run just specific tests |
56 | + |
57 | +``` |
58 | + $ spread tests/main/installation |
59 | +``` |
60 | + |
61 | +This will by default build the network-manager snap from source. If you |
62 | +want it to test it from a specific channel run |
63 | + |
64 | +``` |
65 | + $ SNAP_CHANNEL=candidate spread tests/main/installation |
66 | +``` |
67 | + |
68 | +And if you want to run an entire suite |
69 | + |
70 | +``` |
71 | + $ spread tests/main/ |
72 | +``` |
73 | diff --git a/spread.yaml b/spread.yaml |
74 | index d0900c3..d718813 100644 |
75 | --- a/spread.yaml |
76 | +++ b/spread.yaml |
77 | @@ -36,12 +36,39 @@ path: /home/network-manager |
78 | exclude: |
79 | - .git |
80 | |
81 | +prepare: | |
82 | + . $TESTSLIB/prepare-all.sh |
83 | + |
84 | suites: |
85 | tests/main/: |
86 | - summary: Full-system tests for NetworkManager being the main network management service |
87 | + summary: Full-system tests for NetworkManager without ethernet support |
88 | + systems: |
89 | + - ubuntu-core-16 |
90 | + prepare: | |
91 | + . $TESTSLIB/prepare.sh |
92 | + restore-each: | |
93 | + . $TESTSLIB/restore-each.sh |
94 | + tests/full/: |
95 | + summary: Full-system tests for NetworkManager being the only network management service |
96 | systems: |
97 | - ubuntu-core-16 |
98 | prepare: | |
99 | + . $TESTSLIB/utilities.sh |
100 | + stop_after_first_reboot |
101 | + # Force snapd state to be regenerated so that it also preserves |
102 | + # the netplan renderer switch configuration file. |
103 | + rm -f /home/network-manager/snapd-state.tar.gz |
104 | + switch_netplan_to_network_manager |
105 | . $TESTSLIB/prepare.sh |
106 | + REBOOT |
107 | restore-each: | |
108 | . $TESTSLIB/restore-each.sh |
109 | + restore: | |
110 | + . $TESTSLIB/utilities.sh |
111 | + stop_after_first_reboot |
112 | + switch_netplan_to_networkd |
113 | + # Need to drop the state here as it includes the netplan config |
114 | + # which configures us to use NetworkManager as renderer. The |
115 | + # prepare script run for the next suite will regenerate it. |
116 | + rm -f /home/network-manager/snapd-state.tar.gz |
117 | + REBOOT |
118 | diff --git a/tests/full/dhcp-leases-are-moved/task.yaml b/tests/full/dhcp-leases-are-moved/task.yaml |
119 | new file mode 100644 |
120 | index 0000000..97aa644 |
121 | --- /dev/null |
122 | +++ b/tests/full/dhcp-leases-are-moved/task.yaml |
123 | @@ -0,0 +1,21 @@ |
124 | +summary: Verify that the DHCP leases are moved to the correct location |
125 | + |
126 | +execute: | |
127 | + # Now we have network-manager also with ethernet support |
128 | + test -e /run/NetworkManager/dhcp |
129 | + test -e /var/snap/network-manager/current/state/dhcp |
130 | + |
131 | + num_leases=`ls -1 /var/snap/network-manager/current/state/dhcp | wc -l` |
132 | + num_public_leases=`ls -1 /run/NetworkManager/dhcp | wc -l` |
133 | + test $num_leases -eq $num_public_leases |
134 | + |
135 | + # Create a new lease file and ensure it gets copied over |
136 | + test ! -e /run/NetworkManager/dhcp/temp.lease |
137 | + touch /var/snap/network-manager/current/state/dhcp/temp.lease |
138 | + sleep 2 |
139 | + test -e /run/NetworkManager/dhcp/temp.lease |
140 | + # Ensure that the lease is also removed from /run again when it |
141 | + # gets removed from SNAP_DATA |
142 | + rm /var/snap/network-manager/current/state/dhcp/temp.lease |
143 | + sleep 2 |
144 | + test ! -e /var/snap/network-manager/current/state/dhcp/temp.lease |
145 | diff --git a/tests/full/no-netplan-default-config/task.yaml b/tests/full/no-netplan-default-config/task.yaml |
146 | new file mode 100644 |
147 | index 0000000..7603969 |
148 | --- /dev/null |
149 | +++ b/tests/full/no-netplan-default-config/task.yaml |
150 | @@ -0,0 +1,41 @@ |
151 | +summary: Verify ethernet is auto-connected when no default netplan configuration exists |
152 | + |
153 | +prepare: | |
154 | + cp /etc/netplan/00-snapd-config.yaml /etc/netplan/00-snapd-config.yaml.orig |
155 | + |
156 | +restore: | |
157 | + mv /etc/netplan/00-snapd-config.yaml.orig /etc/netplan/00-snapd-config.yaml |
158 | + |
159 | +execute: | |
160 | + . $TESTSLIB/utilities.sh |
161 | + case "$SPREAD_REBOOT" in |
162 | + 0) |
163 | + # Remove all configuration files from netplan to get a system |
164 | + # without generated configuration files from netplan |
165 | + if [ -e /usr/lib/snapd/generate-network-conf ] ; then |
166 | + echo "" > /etc/netplan/00-snapd-config.yaml |
167 | + else |
168 | + rm /etc/netplan/00-snapd-config.yaml |
169 | + fi |
170 | + REBOOT |
171 | + ;; |
172 | + 1) |
173 | + # We should be automatically connected now and not via a configuration |
174 | + # generated from netplan |
175 | + wait_for_network_manager |
176 | + network-manager.nmcli d | grep 'eth0.*connected' |
177 | + networkctl status eth0 | grep 'State: n/a' |
178 | + network-manager.nmcli c show --active | grep eth0 | grep -v netplan |
179 | + |
180 | + # We should only have a single active configuration |
181 | + test `network-manager.nmcli -m multiline -f UUID c show --active | wc -l` -eq 1 |
182 | + |
183 | + # Verify that we can modify the automatically created connection |
184 | + connection=$(network-manager.nmcli -m multiline -f UUID c show --active | xargs | cut -d' ' -f 2) |
185 | + network-manager.nmcli c modify $connection 802-3-ethernet.wake-on-lan magic |
186 | + wol_value=$(network-manager.nmcli -f 802-3-ethernet.wake-on-lan c show $connection | xargs | cut -d':' -f 2) |
187 | + test "$wol_value" = " 64 (magic)" |
188 | + ;; |
189 | + *) |
190 | + ;; |
191 | + esac |
192 | diff --git a/tests/full/system-network-is-active/task.yaml b/tests/full/system-network-is-active/task.yaml |
193 | new file mode 100644 |
194 | index 0000000..f3b38d2 |
195 | --- /dev/null |
196 | +++ b/tests/full/system-network-is-active/task.yaml |
197 | @@ -0,0 +1,9 @@ |
198 | +summary: Ethernet network should be managed by NetworkManager |
199 | + |
200 | +execute: | |
201 | + . $TESTSLIB/utilities.sh |
202 | + # Verify NetworManager handles ethernet and marks it as connected |
203 | + test -e /etc/netplan/00-default-nm-renderer.yaml |
204 | + wait_for_network_manager |
205 | + network-manager.nmcli d | grep 'eth0.*connected' |
206 | + networkctl status eth0 | grep 'State: n/a' |
207 | diff --git a/tests/image/create-image.sh b/tests/image/create-image.sh |
208 | index 33c1a37..e3c36e0 100755 |
209 | --- a/tests/image/create-image.sh |
210 | +++ b/tests/image/create-image.sh |
211 | @@ -97,6 +97,14 @@ ln -sf /etc/systemd/system/devmode-firstboot.service \ |
212 | $tmp_mount/system-data/etc/systemd/system/multi-user.target.wants/devmode-firstboot.service |
213 | |
214 | mkdir $tmp_mount/system-data/var/lib/devmode-firstboot |
215 | +cat << EOF > $tmp_mount/system-data/var/lib/devmode-firstboot/00-snapd-config.yaml |
216 | +network: |
217 | + version: 2 |
218 | + ethernets: |
219 | + eth0: |
220 | + dhcp4: true |
221 | +EOF |
222 | + |
223 | cat << 'EOF' > $tmp_mount/system-data/var/lib/devmode-firstboot/run.sh |
224 | #!/bin/bash |
225 | |
226 | @@ -130,6 +138,8 @@ if [ -n "$(snap known system-user)" ]; then |
227 | snap create-user --known --sudoer |
228 | fi |
229 | |
230 | +cp /writable/system-data/var/lib/devmode-firstboot/00-snapd-config.yaml /writable/system-data/etc/netplan |
231 | + |
232 | # Enable console-conf again |
233 | rm /writable/system-data/var/lib/console-conf/complete |
234 | |
235 | diff --git a/tests/lib/prepare-all.sh b/tests/lib/prepare-all.sh |
236 | new file mode 100644 |
237 | index 0000000..208cefa |
238 | --- /dev/null |
239 | +++ b/tests/lib/prepare-all.sh |
240 | @@ -0,0 +1,25 @@ |
241 | +#!/bin/bash |
242 | + |
243 | +# We don't have to build a snap when we should use one from a |
244 | +# channel |
245 | +if [ -n "$SNAP_CHANNEL" ] ; then |
246 | + exit 0 |
247 | +fi |
248 | + |
249 | +# Setup classic snap and build the network-manager snap in there |
250 | +snap install --devmode --beta classic |
251 | +cat <<-EOF > /home/test/build-snap.sh |
252 | +#!/bin/sh |
253 | +set -ex |
254 | +apt update |
255 | +apt install -y --force-yes snapcraft |
256 | +cd /home/network-manager |
257 | +snapcraft clean |
258 | +snapcraft |
259 | +EOF |
260 | +chmod +x /home/test/build-snap.sh |
261 | +sudo classic /home/test/build-snap.sh |
262 | +snap remove classic |
263 | + |
264 | +# Make sure we have a snap build |
265 | +test -e /home/network-manager/network-manager_*_amd64.snap |
266 | diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh |
267 | index 0eb2dee..7df7c81 100644 |
268 | --- a/tests/lib/prepare.sh |
269 | +++ b/tests/lib/prepare.sh |
270 | @@ -1,16 +1,5 @@ |
271 | #!/bin/bash |
272 | |
273 | -if [ $SPREAD_REBOOT -ge 1 ] ; then |
274 | - # Give system a moment to settle |
275 | - sleep 2 |
276 | - |
277 | - # For debugging dump all snaps and connected slots/plugs |
278 | - snap list |
279 | - snap interfaces |
280 | - |
281 | - exit 0 |
282 | -fi |
283 | - |
284 | echo "Wait for firstboot change to be ready" |
285 | while ! snap changes | grep -q "Done"; do |
286 | snap changes || true |
287 | @@ -35,28 +24,19 @@ snap list | grep ^${kernel_name} | grep -E " [0-9]+\s+canonical" |
288 | # If we don't install network-manager here we get a system |
289 | # without any network connectivity after reboot. |
290 | if [ -n "$SNAP_CHANNEL" ] ; then |
291 | - snap install --$SNAP_CHANNEL network-manager |
292 | + # Don't reinstall if we have it installed already |
293 | + if ! snap list | grep network-manager ; then |
294 | + snap install --$SNAP_CHANNEL network-manager |
295 | + fi |
296 | else |
297 | - # Setup classic snap and build the network-manager snap in there |
298 | - snap install --devmode --beta classic |
299 | - cat <<-EOF > /home/test/build-snap.sh |
300 | - #!/bin/sh |
301 | - set -ex |
302 | - apt update |
303 | - apt install -y --force-yes snapcraft |
304 | - cd /home/network-manager |
305 | - snapcraft clean |
306 | - snapcraft |
307 | - snap install --dangerous network-manager_*_amd64.snap |
308 | + # Install prebuilt network-manager snap |
309 | + snap install --dangerous /home/network-manager/network-manager_*_amd64.snap |
310 | # As we have a snap which we build locally its unasserted and therefor |
311 | # we don't have any snap-declarations in place and need to manually |
312 | # connect all plugs. |
313 | snap connect network-manager:nmcli network-manager:service |
314 | snap connect network-manager:network-setup-observe |
315 | snap connect network-manager:ppp |
316 | - EOF |
317 | - chmod +x /home/test/build-snap.sh |
318 | - sudo classic /home/test/build-snap.sh |
319 | fi |
320 | |
321 | # Snapshot of the current snapd state for a later restore |
322 | @@ -66,6 +46,6 @@ if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ] ; then |
323 | systemctl start snapd.socket |
324 | fi |
325 | |
326 | -# We need to reboot the system in order to get NetworkManager |
327 | -# configured as the main network management service. |
328 | -REBOOT |
329 | +# For debugging dump all snaps and connected slots/plugs |
330 | +snap list |
331 | +snap interfaces |
332 | diff --git a/tests/lib/restore-each.sh b/tests/lib/restore-each.sh |
333 | index dd5c9f4..bd397e1 100644 |
334 | --- a/tests/lib/restore-each.sh |
335 | +++ b/tests/lib/restore-each.sh |
336 | @@ -18,11 +18,22 @@ done |
337 | # a fresh start for the next test |
338 | rm -rf /var/snap/network-manager/common/* |
339 | rm -rf /var/snap/network-manager/current/* |
340 | -systemctl restart snap.network-manager.networkmanager |
341 | +systemctl stop snap.network-manager.networkmanager |
342 | + |
343 | +# Drop any generated or modified netplan configuration files. The original |
344 | +# ones will be restored below. |
345 | +rm -f /etc/netplan/* |
346 | |
347 | # Ensure we have the same state for snapd as we had before |
348 | systemctl stop snapd.service snapd.socket |
349 | rm -rf /var/lib/snapd/* |
350 | $(cd / && tar xzf $SPREAD_PATH/snapd-state.tar.gz) |
351 | rm -rf /root/.snap |
352 | -systemctl start snapd.service snapd.socket |
353 | \ No newline at end of file |
354 | +systemctl start snapd.service snapd.socket |
355 | + |
356 | +# Make sure the original netplan configuration is applied and active |
357 | +netplan generate |
358 | +netplan apply |
359 | + |
360 | +# Bringup NetworkManager again now that the system is restored |
361 | +systemctl start snap.network-manager.networkmanager |
362 | diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh |
363 | index f4a38fe..8fc1435 100644 |
364 | --- a/tests/lib/utilities.sh |
365 | +++ b/tests/lib/utilities.sh |
366 | @@ -23,4 +23,10 @@ wait_for_network_manager() { |
367 | sleep 1 |
368 | done |
369 | sleep 1 |
370 | -} |
371 | \ No newline at end of file |
372 | +} |
373 | + |
374 | +stop_after_first_reboot() { |
375 | + if [ $SPREAD_REBOOT -eq 1 ] ; then |
376 | + exit 0 |
377 | + fi |
378 | +} |
379 | diff --git a/tests/main/dhcp-leases-are-moved/task.yaml b/tests/main/dhcp-leases-are-moved/task.yaml |
380 | deleted file mode 100644 |
381 | index fff2d6a..0000000 |
382 | --- a/tests/main/dhcp-leases-are-moved/task.yaml |
383 | +++ /dev/null |
384 | @@ -1,32 +0,0 @@ |
385 | -summary: Verify that the DHCP leases are moved to the correct location |
386 | - |
387 | -execute: | |
388 | - . $TESTSLIB/utilities.sh |
389 | - case "$SPREAD_REBOOT" in |
390 | - 0) |
391 | - switch_netplan_to_network_manager |
392 | - REBOOT |
393 | - ;; |
394 | - 1) |
395 | - # Now we have network-manager also with ethernet support |
396 | - test -e /run/NetworkManager/dhcp |
397 | - test -e /var/snap/network-manager/current/state/dhcp |
398 | - |
399 | - num_leases=`ls -1 /var/snap/network-manager/current/state/dhcp | wc -l` |
400 | - num_public_leases=`ls -1 /run/NetworkManager/dhcp | wc -l` |
401 | - test $num_leases -eq $num_public_leases |
402 | - |
403 | - # Create a new lease file and ensure it gets copied over |
404 | - test ! -e /run/NetworkManager/dhcp/temp.lease |
405 | - touch /var/snap/network-manager/current/state/dhcp/temp.lease |
406 | - sleep 2 |
407 | - test -e /run/NetworkManager/dhcp/temp.lease |
408 | - # Ensure that the lease is also removed from /run again when it |
409 | - # gets removed from SNAP_DATA |
410 | - rm /var/snap/network-manager/current/state/dhcp/temp.lease |
411 | - sleep 2 |
412 | - test ! -e /var/snap/network-manager/current/state/dhcp/temp.lease |
413 | - ;; |
414 | - *) |
415 | - ;; |
416 | - esac |
417 | diff --git a/tests/main/ethernet-managed-by-networkd/task.yaml b/tests/main/ethernet-managed-by-networkd/task.yaml |
418 | new file mode 100644 |
419 | index 0000000..22f2bf9 |
420 | --- /dev/null |
421 | +++ b/tests/main/ethernet-managed-by-networkd/task.yaml |
422 | @@ -0,0 +1,7 @@ |
423 | +summary: When not specific configuration is in place networkd manages ethernet |
424 | + |
425 | +execute: | |
426 | + . $TESTSLIB/utilities.sh |
427 | + networkctl | grep 'eth0.*routable' |
428 | + wait_for_network_manager |
429 | + network-manager.nmcli d | grep 'eth0.*unmanaged' |
430 | diff --git a/tests/main/no-netplan-default-config/task.yaml b/tests/main/no-netplan-default-config/task.yaml |
431 | deleted file mode 100644 |
432 | index ba7210d..0000000 |
433 | --- a/tests/main/no-netplan-default-config/task.yaml |
434 | +++ /dev/null |
435 | @@ -1,42 +0,0 @@ |
436 | -summary: Verify ethernet is auto-connected when no default netplan configuration exists |
437 | - |
438 | -prepare: | |
439 | - cp /etc/netplan/00-snapd-config.yaml /etc/netplan/00-snapd-config.yaml.orig |
440 | - |
441 | -restore: | |
442 | - mv /etc/netplan/00-snapd-config.yaml.orig /etc/netplan/00-snapd-config.yaml |
443 | - |
444 | -execute: | |
445 | - . $TESTSLIB/utilities.sh |
446 | - case "$SPREAD_REBOOT" in |
447 | - 0) |
448 | - # Remove all configuration files from netplan and network-manager |
449 | - # to simulate a fresh start and switch to NetworkManager backend |
450 | - if [ -e /usr/lib/snapd/generate-network-conf ] ; then |
451 | - echo "" > /etc/netplan/00-snapd-config.yaml |
452 | - else |
453 | - rm /etc/netplan/00-snapd-config.yaml |
454 | - fi |
455 | - switch_netplan_to_network_manager |
456 | - REBOOT |
457 | - ;; |
458 | - 1) |
459 | - # We should be automatically connected now and not via a configuration |
460 | - # generated from netplan |
461 | - wait_for_network_manager |
462 | - network-manager.nmcli d | grep 'eth0.*connected' |
463 | - networkctl status eth0 | grep 'State: n/a' |
464 | - network-manager.nmcli c show --active | grep eth0 | grep -v netplan |
465 | - |
466 | - # We should only have a single active configuration |
467 | - test `network-manager.nmcli -m multiline -f UUID c show --active | wc -l` -eq 1 |
468 | - |
469 | - # Verify that we can modify the automatically created connection |
470 | - connection=$(network-manager.nmcli -m multiline -f UUID c show --active | xargs | cut -d' ' -f 2) |
471 | - network-manager.nmcli c modify $connection 802-3-ethernet.wake-on-lan magic |
472 | - wol_value=$(network-manager.nmcli -f 802-3-ethernet.wake-on-lan c show $connection | xargs | cut -d':' -f 2) |
473 | - test "$wol_value" = " 64 (magic)" |
474 | - ;; |
475 | - *) |
476 | - ;; |
477 | - esac |
478 | diff --git a/tests/main/switch-netplan-renderer/task.yaml b/tests/main/switch-netplan-renderer/task.yaml |
479 | index 3679db4..ad7d605 100644 |
480 | --- a/tests/main/switch-netplan-renderer/task.yaml |
481 | +++ b/tests/main/switch-netplan-renderer/task.yaml |
482 | @@ -4,52 +4,34 @@ execute: | |
483 | . $TESTSLIB/utilities.sh |
484 | case "$SPREAD_REBOOT" in |
485 | 0) |
486 | - # On the first boot all ethernet ports are managed by networkd |
487 | + # networkd manages eth0 and NetworkManager does not |
488 | networkctl | grep 'eth0.*routable' |
489 | - wait_for_network_manager |
490 | network-manager.nmcli d | grep 'eth0.*unmanaged' |
491 | + |
492 | + # Now we switch back to the NetworkManager backend for netplan |
493 | switch_netplan_to_network_manager |
494 | + REBOOT |
495 | ;; |
496 | 1) |
497 | - # On second boot we use NetworkManager via netplan and make sure |
498 | - # we have eth0 connected and can access the internet |
499 | test -e /etc/netplan/00-default-nm-renderer.yaml |
500 | + |
501 | + # Give NetworkManager a bit to come up after the reboot |
502 | wait_for_network_manager |
503 | + |
504 | + # NetworkManager now controls eth0 and networkd does not |
505 | network-manager.nmcli d | grep 'eth0.*connected' |
506 | networkctl status eth0 | grep 'State: n/a' |
507 | |
508 | - # Now switch to the default netplan renderer and reboot the |
509 | - # device to check next that we come up with networkd managing |
510 | - # the ethernet port |
511 | + # And switch back to networkd |
512 | switch_netplan_to_networkd |
513 | REBOOT |
514 | ;; |
515 | 2) |
516 | - # Now on the third boot we verify that the ethernet port |
517 | - # is managed by networkd and NetworkManager ignores it |
518 | - test ! -e /etc/netplan/00-default-nm-renderer.yaml |
519 | + wait_for_network_manager |
520 | |
521 | - # We're ok with eth0 being marked as routable here |
522 | + # networkd manages eth0 and NetworkManager does not |
523 | networkctl | grep 'eth0.*routable' |
524 | - |
525 | - # Give NetworkManager a bit to come up after the reboot |
526 | - wait_for_network_manager |
527 | - # But network-manager should not use eth0 anymore |
528 | network-manager.nmcli d | grep 'eth0.*unmanaged' |
529 | - |
530 | - # Now we switch back to the NetworkManager backend for netplan |
531 | - echo "network:" > /etc/netplan/00-default-nm-renderer.yaml |
532 | - echo " renderer: NetworkManager" >> /etc/netplan/00-default-nm-renderer.yaml |
533 | - REBOOT |
534 | - ;; |
535 | - 3) |
536 | - # We should be back to NetworkManager taking control over |
537 | - # eth0 and networkd ignoring it. |
538 | - test -e /etc/netplan/00-default-nm-renderer.yaml |
539 | - # Give NetworkManager a bit to come up after the reboot |
540 | - wait_for_network_manager |
541 | - network-manager.nmcli d | grep 'eth0.*connected' |
542 | - networkctl status eth0 | grep 'State: n/a' |
543 | ;; |
544 | *) |
545 | ;; |
546 | diff --git a/tests/main/wifi-connect-secured-ap/task.yaml b/tests/main/wifi-connect-secured-ap/task.yaml |
547 | index eefd967..74394f9 100644 |
548 | --- a/tests/main/wifi-connect-secured-ap/task.yaml |
549 | +++ b/tests/main/wifi-connect-secured-ap/task.yaml |
550 | @@ -28,4 +28,4 @@ execute: | |
551 | |
552 | # Connect to the AP and ensure the connection was established |
553 | network-manager.nmcli d wifi connect $WIFI_SSID password $WIFI_PASSPHRASE |
554 | - network-manager.nmcli d | grep 'wlan1.*connected' |
555 | + network-manager.nmcli d | grep 'wlan0.*connected' |
PASSED: Continuous integration, rev:ddbb6ee20a8 cd23a4254916319 4d67d49b67502d /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 263/ /jenkins. canonical. com/system- enablement/ job/generic- update- snap-mp/ 165/console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 263/rebuild
https:/