Merge ~morphis/snappy-hwe-snaps/+git/network-manager:further-networking-tests into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
- Git
- lp:~morphis/snappy-hwe-snaps/+git/network-manager
- further-networking-tests
- Merge into master
Status: | Merged |
---|---|
Approved by: | Tony Espy |
Approved revision: | 0e6c3608847931186b623347874defe958a80378 |
Merged at revision: | 2bf6bd05df7800a977532c77e0a971a143304cda |
Proposed branch: | ~morphis/snappy-hwe-snaps/+git/network-manager:further-networking-tests |
Merge into: | ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master |
Diff against target: |
451 lines (+272/-21) 15 files modified
README.md (+18/-0) tests/full/correct-dns-setup/task.yaml (+47/-0) tests/full/dhcp-leases-are-moved/task.yaml (+5/-1) tests/full/immutable-netplan-config/task.yaml (+9/-0) tests/full/ipv6-address-assignment/task.yaml (+27/-0) tests/full/ipv6-router-advertisements/task.yaml (+70/-0) tests/full/no-netplan-default-config/task.yaml (+6/-6) tests/full/system-network-is-active/task.yaml (+1/-1) tests/lib/utilities.sh (+16/-2) tests/main/ethernet-managed-by-networkd/task.yaml (+1/-1) tests/main/installation/task.yaml (+1/-1) tests/main/set-hostname/task.yaml (+13/-0) tests/main/static-ip-configuration/task.yaml (+49/-0) tests/main/switch-netplan-renderer/task.yaml (+3/-3) tests/main/wifi-connect-secured-ap/task.yaml (+6/-6) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
System Enablement Bot | continuous-integration | Needs Fixing | |
Alfonso Sanchez-Beato | Approve | ||
Konrad Zapałowicz (community) | code | Approve | |
Tony Espy | Pending | ||
Review via email: mp+310631@code.launchpad.net |
Commit message
Description of the change
Implement more test cases for extended features
Things we now cover in our testing:
* static IP configuration
* immutable netplan configuration files (as in: verify that we can't change them)
* IPv6 static address assignment
* IPv6 router advertisements
* DNS setup for connections
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:ab941471b8e
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:e72fd5c6e58
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:e72fd5c6e58
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Konrad Zapałowicz (kzapalowicz) wrote : | # |
lgtm
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote : | # |
LGTM
Matteo Croce (teknoraver) : | # |
Simon Fels (morphis) : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:66c565b3b32
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Matteo Croce (teknoraver) : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:66c565b3b32
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Simon Fels (morphis) : | # |
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:c1c5b6c3e90
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:c1c5b6c3e90
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:0e6c3608847
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:0e6c3608847
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild:
https:/
Tony Espy (awe) wrote : | # |
Looks good to me.
There are a few sleeps that could probably be handled more gracefully, but let's leave as is for now...
System Enablement Bot (system-enablement-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:c1c5b6c3e90
https:/
Executed test runs:
FAILURE: https:/
None: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | diff --git a/README.md b/README.md |
2 | index dbaf69f..a8fec2f 100644 |
3 | --- a/README.md |
4 | +++ b/README.md |
5 | @@ -79,3 +79,21 @@ And if you want to run an entire suite |
6 | ``` |
7 | $ spread tests/main/ |
8 | ``` |
9 | + |
10 | +## Available test suites |
11 | + |
12 | +Currently we have two test suites |
13 | + |
14 | + * main |
15 | + * full |
16 | + |
17 | +The 'main' suite covers testing of network-manager when its installed on |
18 | +any Ubuntu Core device from the store without configuring the system |
19 | +further to allow NetworkManager to control also all ethernet connections. |
20 | + |
21 | +The 'full' suite configures netplan in the prepare part to use NetworkManager |
22 | +as default backend so that it becomes the only network connection |
23 | +management service in the system. |
24 | + |
25 | +Depending on the nature of a test case the right test suite should be |
26 | +picked. |
27 | diff --git a/tests/full/correct-dns-setup/task.yaml b/tests/full/correct-dns-setup/task.yaml |
28 | new file mode 100644 |
29 | index 0000000..9b6dfe0 |
30 | --- /dev/null |
31 | +++ b/tests/full/correct-dns-setup/task.yaml |
32 | @@ -0,0 +1,47 @@ |
33 | +summary: Verify correct DNS setup |
34 | + |
35 | +execute: | |
36 | + . $TESTSLIB/utilities.sh |
37 | + case $SPREAD_REBOOT in |
38 | + 0) |
39 | + # For correct timing if the device has just booted |
40 | + wait_for_network_manager |
41 | + |
42 | + # Precondition is a existing network connection |
43 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*connected' |
44 | + |
45 | + # We get a default nameserver from the gateway |
46 | + if [ "$SPREAD_BACKEND" = "qemu" ] ; then |
47 | + cat /etc/resolv.conf | grep 'nameserver 10.0.2.3' |
48 | + fi |
49 | + |
50 | + # Ensure we can resolve a hostname correctly; must give a |
51 | + # valid IP address |
52 | + address=`python3 -c 'import socket; print(socket.gethostbyname("ubuntu.com"))' 2> /dev/null || echo "invalid"` |
53 | + [ "$address" != "invalid" ] && [[ $address =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] |
54 | + |
55 | + # Now lets switch to a system where we have a configuration |
56 | + # for ethernet we can change |
57 | + rm /etc/netplan/00-snapd-config.yaml |
58 | + REBOOT |
59 | + ;; |
60 | + 1) |
61 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*connected' |
62 | + /snap/bin/network-manager.nmcli d | grep -v netplan |
63 | + |
64 | + connection=$(/snap/bin/network-manager.nmcli -m multiline -f UUID c show --active | awk '{print$2;exit}') |
65 | + /snap/bin/network-manager.nmcli c modify $connection ipv4.dns 8.8.8.8 |
66 | + # We need to bring up the connection again here to get the DNS |
67 | + # server really applied to the system. |
68 | + /snap/bin/network-manager.nmcli c up $connection |
69 | + |
70 | + # Give system a moment to settle |
71 | + sleep 1 |
72 | + |
73 | + grep 'nameserver 8.8.8.8' /etc/resolv.conf |
74 | + address=`python3 -c 'import socket; print(socket.gethostbyname("ubuntu.com"))' 2> /dev/null || echo "invalid"` |
75 | + [ "$address" != "invalid" ] && [[ $address =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] |
76 | + ;; |
77 | + *) |
78 | + ;; |
79 | + esac |
80 | diff --git a/tests/full/dhcp-leases-are-moved/task.yaml b/tests/full/dhcp-leases-are-moved/task.yaml |
81 | index 97aa644..1dc1914 100644 |
82 | --- a/tests/full/dhcp-leases-are-moved/task.yaml |
83 | +++ b/tests/full/dhcp-leases-are-moved/task.yaml |
84 | @@ -1,7 +1,11 @@ |
85 | summary: Verify that the DHCP leases are moved to the correct location |
86 | |
87 | execute: | |
88 | - # Now we have network-manager also with ethernet support |
89 | + . $TESTSLIB/utilities.sh |
90 | + |
91 | + wait_for_network_manager |
92 | + |
93 | + # We should have a single lease for eth0 at this point |
94 | test -e /run/NetworkManager/dhcp |
95 | test -e /var/snap/network-manager/current/state/dhcp |
96 | |
97 | diff --git a/tests/full/immutable-netplan-config/task.yaml b/tests/full/immutable-netplan-config/task.yaml |
98 | new file mode 100644 |
99 | index 0000000..52c2d61 |
100 | --- /dev/null |
101 | +++ b/tests/full/immutable-netplan-config/task.yaml |
102 | @@ -0,0 +1,9 @@ |
103 | +summary: Verify that netplan configuration files are immutable |
104 | + |
105 | +execute: | |
106 | + # Ensure we're using a configuration generated from netplan |
107 | + test -e /etc/netplan/00-snapd-config.yaml |
108 | + test -e /run/NetworkManager/system-connections/netplan-eth0 |
109 | + /snap/bin/network-manager.nmcli c | grep 'netplan.eth0.*eth0' |
110 | + # Try to change the DNS server used on this connection |
111 | + test ! `/snap/bin/network-manager.nmcli c modify netplan-eth0 ipv4.dns 8.8.8.8` |
112 | \ No newline at end of file |
113 | diff --git a/tests/full/ipv6-address-assignment/task.yaml b/tests/full/ipv6-address-assignment/task.yaml |
114 | new file mode 100644 |
115 | index 0000000..e36ef00 |
116 | --- /dev/null |
117 | +++ b/tests/full/ipv6-address-assignment/task.yaml |
118 | @@ -0,0 +1,27 @@ |
119 | +summary: Verify NetworkManager can assign a static IPv6 address to an interface |
120 | + |
121 | +restore: | |
122 | + # Ensure that the created virtual network interfaces are removed |
123 | + # in any case when we're done |
124 | + if [ -e /sys/class/net/veth0 ] ; then |
125 | + ip link delete veth0 |
126 | + fi |
127 | + |
128 | +execute: | |
129 | + . $TESTSLIB/utilities.sh |
130 | + |
131 | + # Ensure that we have IPv6 support enabled in the kernel |
132 | + test -e /proc/net/if_inet6 |
133 | + |
134 | + ip link add dev veth0 type veth peer name veth1 |
135 | + |
136 | + wait_for_network_manager |
137 | + |
138 | + connection=veth-ipv6 |
139 | + /snap/bin/network-manager.nmcli c add con-name $connection ifname veth0 type ethernet \ |
140 | + ip6 abbe::cafe |
141 | + /snap/bin/network-manager.nmcli c up $connection |
142 | + |
143 | + # Verify that NetworkManager assigned the correct IPv6 address |
144 | + # to the interface |
145 | + ifconfig veth0 | grep 'abbe::cafe/128' |
146 | diff --git a/tests/full/ipv6-router-advertisements/task.yaml b/tests/full/ipv6-router-advertisements/task.yaml |
147 | new file mode 100644 |
148 | index 0000000..4af402b |
149 | --- /dev/null |
150 | +++ b/tests/full/ipv6-router-advertisements/task.yaml |
151 | @@ -0,0 +1,70 @@ |
152 | +summary: Test IPv6 address assignment via router advertisements |
153 | + |
154 | +restore: | |
155 | + # Ensure that the created virtual network interfaces are removed |
156 | + # in any case when we're done |
157 | + if [ -e /sys/class/net/veth0 ] ; then |
158 | + ip link delete veth0 |
159 | + fi |
160 | + |
161 | +execute: | |
162 | + . $TESTSLIB/utilities.sh |
163 | + |
164 | + # Ensure that we have IPv6 support enabled in the kernel |
165 | + test -e /proc/net/if_inet6 |
166 | + |
167 | + snap install --devmode se-test-tools |
168 | + snap connect se-test-tools:home core |
169 | + snap connect se-test-tools:network-control core |
170 | + |
171 | + # Create virtual ethernet interface pair |
172 | + sudo ip link add dev veth0 type veth peer name veth1 |
173 | + |
174 | + # As the virtual ethernet devices don't get IPv6 setup |
175 | + # correctly by default we have to do this |
176 | + sudo sysctl -w net.ipv6.conf.veth0.disable_ipv6=0 |
177 | + sudo sysctl -w net.ipv6.conf.veth1.disable_ipv6=0 |
178 | + veth0_lla=$(mac_to_ipv6 `cat /sys/class/net/veth0/address`) |
179 | + veth1_lla=$(mac_to_ipv6 `cat /sys/class/net/veth1/address`) |
180 | + |
181 | + # The radvd daemon will send out router advertisements on veth1 |
182 | + # so that we can receive them on veth0 end |
183 | + cat <<-EOF > /home/test/radvd.conf |
184 | + interface veth1 { |
185 | + AdvSendAdvert on; |
186 | + prefix 2001:db8:1:2::/64 {}; |
187 | + }; |
188 | + EOF |
189 | + |
190 | + # To ensure that nobody touches veth1 we tell NetworkManager |
191 | + # explicitly to do that. |
192 | + /snap/bin/network-manager.nmcli d set veth1 managed no |
193 | + |
194 | + # Assign our link-local addresses |
195 | + if ! ip addr show dev veth0 | grep 'inet6.*scope link.*' ; then |
196 | + sudo ip addr add dev veth0 scope link $veth0_lla |
197 | + fi |
198 | + if ! ip addr show dev veth1 | grep 'inet6.*scope link.*' ; then |
199 | + sudo ip addr add dev veth1 scope link $veth1_lla |
200 | + fi |
201 | + |
202 | + # This will get our router advertisement daemon started and we |
203 | + # now configure NetworkManager |
204 | + sudo se-test-tools.radvd -C /home/test/radvd.conf -n -d 5 -m stderr -p /home/test/radvd.pid & |
205 | + |
206 | + # Give things a bit more time to settle |
207 | + sleep 10 |
208 | + ip addr show dev veth0 |
209 | + |
210 | + # At this point veth0 should have now a global IPv6 address |
211 | + # assigned via router advertisements |
212 | + ip addr show dev veth0 | grep 'inet6 2001:db8:1:2:.*/64 scope global' |
213 | + # but veth1 should not have any |
214 | + ip addr show dev veth1 | grep -v 'inet6.*scope global' |
215 | + |
216 | + # NetworkManager should report the same addresses for IPv6 |
217 | + /snap/bin/network-manager.nmcli d show veth0 | grep 'GENERAL.STATE.*connected' |
218 | + /snap/bin/network-manager.nmcli d show veth0 | grep 'IP6.ADDRESS.*2001:db8:1:2.*/64' |
219 | + |
220 | + # Stop the radvd daemon |
221 | + kill -TERM `cat /home/test/radvd.pid` |
222 | diff --git a/tests/full/no-netplan-default-config/task.yaml b/tests/full/no-netplan-default-config/task.yaml |
223 | index 7603969..c0d6934 100644 |
224 | --- a/tests/full/no-netplan-default-config/task.yaml |
225 | +++ b/tests/full/no-netplan-default-config/task.yaml |
226 | @@ -23,17 +23,17 @@ execute: | |
227 | # We should be automatically connected now and not via a configuration |
228 | # generated from netplan |
229 | wait_for_network_manager |
230 | - network-manager.nmcli d | grep 'eth0.*connected' |
231 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*connected' |
232 | networkctl status eth0 | grep 'State: n/a' |
233 | - network-manager.nmcli c show --active | grep eth0 | grep -v netplan |
234 | + /snap/bin/network-manager.nmcli c show --active | grep eth0 | grep -v netplan |
235 | |
236 | # We should only have a single active configuration |
237 | - test `network-manager.nmcli -m multiline -f UUID c show --active | wc -l` -eq 1 |
238 | + test `/snap/bin/network-manager.nmcli -m multiline -f UUID c show --active | wc -l` -eq 1 |
239 | |
240 | # Verify that we can modify the automatically created connection |
241 | - connection=$(network-manager.nmcli -m multiline -f UUID c show --active | xargs | cut -d' ' -f 2) |
242 | - network-manager.nmcli c modify $connection 802-3-ethernet.wake-on-lan magic |
243 | - wol_value=$(network-manager.nmcli -f 802-3-ethernet.wake-on-lan c show $connection | xargs | cut -d':' -f 2) |
244 | + connection=$(/snap/bin/network-manager.nmcli -m multiline -f UUID c show --active | awk '{print$2;exit}') |
245 | + /snap/bin/network-manager.nmcli c modify $connection 802-3-ethernet.wake-on-lan magic |
246 | + wol_value=$(/snap/bin/network-manager.nmcli -f 802-3-ethernet.wake-on-lan c show $connection | xargs | cut -d':' -f 2) |
247 | test "$wol_value" = " 64 (magic)" |
248 | ;; |
249 | *) |
250 | diff --git a/tests/full/system-network-is-active/task.yaml b/tests/full/system-network-is-active/task.yaml |
251 | index f3b38d2..ee29ef0 100644 |
252 | --- a/tests/full/system-network-is-active/task.yaml |
253 | +++ b/tests/full/system-network-is-active/task.yaml |
254 | @@ -5,5 +5,5 @@ execute: | |
255 | # Verify NetworManager handles ethernet and marks it as connected |
256 | test -e /etc/netplan/00-default-nm-renderer.yaml |
257 | wait_for_network_manager |
258 | - network-manager.nmcli d | grep 'eth0.*connected' |
259 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*connected' |
260 | networkctl status eth0 | grep 'State: n/a' |
261 | diff --git a/tests/lib/utilities.sh b/tests/lib/utilities.sh |
262 | index 8fc1435..000ef74 100644 |
263 | --- a/tests/lib/utilities.sh |
264 | +++ b/tests/lib/utilities.sh |
265 | @@ -18,15 +18,29 @@ switch_netplan_to_networkd() { |
266 | rm /etc/netplan/00-default-nm-renderer.yaml |
267 | } |
268 | |
269 | -wait_for_network_manager() { |
270 | - while ! systemctl status snap.network-manager.networkmanager ; do |
271 | +wait_for_systemd_service() { |
272 | + while ! systemctl status $1 ; do |
273 | sleep 1 |
274 | done |
275 | sleep 1 |
276 | } |
277 | |
278 | +wait_for_network_manager() { |
279 | + wait_for_systemd_service snap.network-manager.networkmanager |
280 | +} |
281 | + |
282 | stop_after_first_reboot() { |
283 | if [ $SPREAD_REBOOT -eq 1 ] ; then |
284 | exit 0 |
285 | fi |
286 | } |
287 | + |
288 | +mac_to_ipv6() { |
289 | + mac=$1 |
290 | + ipv6_address=fe80::$(printf %02x $((0x${mac%%:*} ^ 2))) |
291 | + mac=${mac#*:} |
292 | + ipv6_address=$ipv6_address${mac%:*:*:*}ff:fe |
293 | + mac=${mac#*:*:} |
294 | + ipv6_address=$ipv6_address${mac%:*}${mac##*:} |
295 | + echo $ipv6_address |
296 | +} |
297 | \ No newline at end of file |
298 | diff --git a/tests/main/ethernet-managed-by-networkd/task.yaml b/tests/main/ethernet-managed-by-networkd/task.yaml |
299 | index 22f2bf9..80e75cb 100644 |
300 | --- a/tests/main/ethernet-managed-by-networkd/task.yaml |
301 | +++ b/tests/main/ethernet-managed-by-networkd/task.yaml |
302 | @@ -4,4 +4,4 @@ execute: | |
303 | . $TESTSLIB/utilities.sh |
304 | networkctl | grep 'eth0.*routable' |
305 | wait_for_network_manager |
306 | - network-manager.nmcli d | grep 'eth0.*unmanaged' |
307 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*unmanaged' |
308 | diff --git a/tests/main/installation/task.yaml b/tests/main/installation/task.yaml |
309 | index 686b513..2f1fe97 100644 |
310 | --- a/tests/main/installation/task.yaml |
311 | +++ b/tests/main/installation/task.yaml |
312 | @@ -7,7 +7,7 @@ execute: | |
313 | wait_for_network_manager |
314 | |
315 | # .. and nmcli should be able to reach NetworkManager |
316 | - network-manager.nmcli g |
317 | + /snap/bin/network-manager.nmcli g |
318 | |
319 | # Ensure all necessary plugs/slots are connected |
320 | snap interfaces | grep -Pzq ":network-setup-observe +network-manager" |
321 | diff --git a/tests/main/set-hostname/task.yaml b/tests/main/set-hostname/task.yaml |
322 | new file mode 100644 |
323 | index 0000000..ddcabd9 |
324 | --- /dev/null |
325 | +++ b/tests/main/set-hostname/task.yaml |
326 | @@ -0,0 +1,13 @@ |
327 | +summary: Verify we can modify the hostname of the system |
328 | + |
329 | +execute: | |
330 | + # Print out current hostname for nm and hostnamed to have a reference |
331 | + # for debugging later. |
332 | + /snap/bin/network-manager.nmcli general hostname |
333 | + hostnamectl |
334 | + |
335 | + expected_hostname=foobar |
336 | + /snap/bin/network-manager.nmcli general hostname $expected_hostname |
337 | + test "`/snap/bin/network-manager.nmcli general hostname`" = "$expected_hostname" |
338 | + test "`hostnamectl status | grep Static`" = " Static hostname: $expected_hostname" |
339 | + test "`hostname`" = "$expected_hostname" |
340 | diff --git a/tests/main/static-ip-configuration/task.yaml b/tests/main/static-ip-configuration/task.yaml |
341 | new file mode 100644 |
342 | index 0000000..00031fc |
343 | --- /dev/null |
344 | +++ b/tests/main/static-ip-configuration/task.yaml |
345 | @@ -0,0 +1,49 @@ |
346 | +summary: Test static IP configuration |
347 | + |
348 | +restore: | |
349 | + # Ensure that the created virtual network interfaces are removed |
350 | + # in any case when we're done |
351 | + if [ -e /sys/class/net/veth0 ] ; then |
352 | + ip link delete veth0 |
353 | + fi |
354 | + |
355 | +execute: | |
356 | + . $TESTSLIB/utilities.sh |
357 | + |
358 | + ip link add dev veth0 type veth peer name veth1 |
359 | + |
360 | + wait_for_network_manager |
361 | + # NetworkManager should ignore the other side of our pipe so |
362 | + # that we can configure it statically. |
363 | + /snap/bin/network-manager.nmcli d set veth1 managed no |
364 | + ip addr add 10.0.1.1/24 dev veth1 |
365 | + |
366 | + connection=veth0-static |
367 | + /snap/bin/network-manager.nmcli c add con-name $connection type ethernet ifname veth0 \ |
368 | + ip4 10.0.1.2/24 |
369 | + /snap/bin/network-manager.nmcli c up $connection |
370 | + /snap/bin/network-manager.nmcli d | grep 'veth0.*connected' |
371 | + |
372 | + # Address should be correctly applied now |
373 | + expected_veth0_address="10.0.1.2/24" |
374 | + /snap/bin/network-manager.nmcli -m multiline -f IP4.ADDRESS c show veth0-static | grep $expected_veth0_address |
375 | + ip addr show dev veth0 | grep 'UP' |
376 | + ip addr show dev veth0 | grep $expected_veth0_address |
377 | + |
378 | + # Routing needs to be in place as well |
379 | + expected_veth0_route="10.0.1.0/24 dev veth0 proto kernel scope link src 10.0.1.2 metric 100" |
380 | + ip route | grep "$expected_veth0_route" |
381 | + |
382 | + # Disable connection and ensure IP configuration is removed |
383 | + /snap/bin/network-manager.nmcli c down $connection |
384 | + ip addr show dev veth0 | grep -v $expected_veth0_address |
385 | + ip route | grep -v "$expected_veth0_route" |
386 | + |
387 | + # Enabling network connection again and removing it should remove |
388 | + # the IP configuration too |
389 | + /snap/bin/network-manager.nmcli c up $connection |
390 | + ip addr show dev veth0 | grep $expected_veth0_address |
391 | + ip route | grep "$expected_veth0_route" |
392 | + /snap/bin/network-manager.nmcli c delete $connection |
393 | + ip addr show dev veth0 | grep -v $expected_veth0_address |
394 | + ip route | grep -v "$expected_veth0_route" |
395 | \ No newline at end of file |
396 | diff --git a/tests/main/switch-netplan-renderer/task.yaml b/tests/main/switch-netplan-renderer/task.yaml |
397 | index ad7d605..1c05b68 100644 |
398 | --- a/tests/main/switch-netplan-renderer/task.yaml |
399 | +++ b/tests/main/switch-netplan-renderer/task.yaml |
400 | @@ -6,7 +6,7 @@ execute: | |
401 | 0) |
402 | # networkd manages eth0 and NetworkManager does not |
403 | networkctl | grep 'eth0.*routable' |
404 | - network-manager.nmcli d | grep 'eth0.*unmanaged' |
405 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*unmanaged' |
406 | |
407 | # Now we switch back to the NetworkManager backend for netplan |
408 | switch_netplan_to_network_manager |
409 | @@ -19,7 +19,7 @@ execute: | |
410 | wait_for_network_manager |
411 | |
412 | # NetworkManager now controls eth0 and networkd does not |
413 | - network-manager.nmcli d | grep 'eth0.*connected' |
414 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*connected' |
415 | networkctl status eth0 | grep 'State: n/a' |
416 | |
417 | # And switch back to networkd |
418 | @@ -31,7 +31,7 @@ execute: | |
419 | |
420 | # networkd manages eth0 and NetworkManager does not |
421 | networkctl | grep 'eth0.*routable' |
422 | - network-manager.nmcli d | grep 'eth0.*unmanaged' |
423 | + /snap/bin/network-manager.nmcli d | grep 'eth0.*unmanaged' |
424 | ;; |
425 | *) |
426 | ;; |
427 | diff --git a/tests/main/wifi-connect-secured-ap/task.yaml b/tests/main/wifi-connect-secured-ap/task.yaml |
428 | index 74394f9..036f8de 100644 |
429 | --- a/tests/main/wifi-connect-secured-ap/task.yaml |
430 | +++ b/tests/main/wifi-connect-secured-ap/task.yaml |
431 | @@ -18,14 +18,14 @@ execute: | |
432 | wifi-ap.config set disabled 0 |
433 | systemctl restart snap.wifi-ap.backend |
434 | # AP needs a bit to appear and be visible for NetworkManager |
435 | - network-manager.nmcli d wifi rescan |
436 | - while ! network-manager.nmcli d wifi | grep Ubuntu ; do |
437 | - network-manager.nmcli d wifi rescan |
438 | + /snap/bin/network-manager.nmcli d wifi rescan |
439 | + while ! /snap/bin/network-manager.nmcli d wifi | grep Ubuntu ; do |
440 | + /snap/bin/network-manager.nmcli d wifi rescan |
441 | sleep 1 |
442 | done |
443 | |
444 | - network-manager.nmcli d wifi | grep $WIFI_SSID |
445 | + /snap/bin/network-manager.nmcli d wifi | grep $WIFI_SSID |
446 | |
447 | # Connect to the AP and ensure the connection was established |
448 | - network-manager.nmcli d wifi connect $WIFI_SSID password $WIFI_PASSPHRASE |
449 | - network-manager.nmcli d | grep 'wlan0.*connected' |
450 | + /snap/bin/network-manager.nmcli d wifi connect $WIFI_SSID password $WIFI_PASSPHRASE |
451 | + /snap/bin/network-manager.nmcli d | grep 'wlan0.*connected' |
PASSED: Continuous integration, rev:ab941471b8e 187c3d45921369f 70aad38676ec82 /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 279/ /jenkins. canonical. com/system- enablement/ job/generic- update- snap-mp/ 181/console
https:/
Executed test runs:
None: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- enablement/ job/generic- build-snap/ 279/rebuild
https:/