Merge ~morphis/snappy-hwe-snaps/+git/wifi-ap:f/support-spread-on-hw into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Simon Fels
Status: Needs review
Proposed branch: ~morphis/snappy-hwe-snaps/+git/wifi-ap:f/support-spread-on-hw
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 594 lines (+223/-104)
23 files modified
.gitignore (+6/-0)
dev/null (+0/-69)
run-tests.sh (+8/-7)
spread.yaml (+18/-0)
tests/lib/prepare-all.sh (+15/-2)
tests/lib/prepare.sh (+26/-24)
tests/lib/restore-all.sh (+9/-0)
tests/lib/restore-each.sh (+7/-0)
tests/main/background-process-control/task.yaml (+4/-1)
tests/main/conf-wizard-auto-at-boot/task.yaml (+3/-0)
tests/main/conf-wizard-auto-can-be-blocked/task.yaml (+3/-0)
tests/main/conf-wizard-auto-nodefaultip/task.yaml (+3/-0)
tests/main/conf-wizard-auto-noip/task.yaml (+3/-0)
tests/main/conf-wizard-auto-nowifi/task.yaml (+3/-0)
tests/main/conf-wizard-auto/task.yaml (+3/-0)
tests/main/conf-wizard-disabled-from-gadget/task.yaml (+3/-0)
tests/main/configuration-changes/task.yaml (+3/-0)
tests/main/default-conf-brings-up-ap/task.yaml (+3/-0)
tests/main/default-configuration/tasks.yaml (+3/-0)
tests/main/documentation-builds/task.yaml (+6/-0)
tests/main/socket-plug/task.yaml (+3/-0)
tests/main/stress-ap/task.yaml (+88/-0)
tests/main/utf8-ssid/task.yaml (+3/-1)
Reviewer Review Type Date Requested Status
Matteo Croce (community) Approve
System Enablement Bot continuous-integration Needs Fixing
Review via email: mp+319046@code.launchpad.net

Description of the change

Allow running our stress test on real hardware

This is based on recent changes to tests-extras which allow us now executing all white-listed tests via something like this:

$ ./run-tests.sh \
  --spread-system=hw-ubuntu-core-16 \
  --external-address=192.168.178.36 \
  --external-user=admin \
  --external-password=admin \
  --spread-filter=tests/main/stress-ap \
  --debug

This relies on having a second WiFi network device available on the specified external system. Name of network device can be specified via the two parameters in spread.yaml

To post a comment you must log in.
Revision history for this message
Matteo Croce (teknoraver) :
review: Needs Fixing
71e58bc... by Simon Fels

Respect review comments

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Matteo Croce (teknoraver) :
review: Needs Fixing
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Matteo Croce (teknoraver) :
review: Approve

Unmerged commits

71e58bc... by Simon Fels

Respect review comments

c036235... by Simon Fels

Add .gitignore file

1b7bc1c... by Simon Fels

Allow running our stress test on real hardware

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.gitignore b/.gitignore
2new file mode 100644
3index 0000000..2aaa3a0
4--- /dev/null
5+++ b/.gitignore
6@@ -0,0 +1,6 @@
7+parts
8+stage
9+prime
10+
11+.spread*
12+.tests-extras
13diff --git a/run-tests.sh b/run-tests.sh
14index 0b0679d..54f23f7 100755
15--- a/run-tests.sh
16+++ b/run-tests.sh
17@@ -32,12 +32,12 @@ tests-extras repository and execute the run-tests.sh script from
18 there passing arguments as-is.
19
20 optional arguments:
21- --help Show this help message and exit
22- --channel Select another channel to build the base image from (default: stable)
23- --snap Extra snap to install
24- --debug Enable verbose debugging output
25- --test-from-channel Pull network-manager snap from the specified channel instead of building it from source
26- --force-new-image Force generating a new image used for testing
27+ --help Show this help message and exit
28+ --channel=<channel> Select another channel to build the base image from (default: $channel)
29+ --snap=<name> Extra snap to install
30+ --debug Enable verbose debugging output
31+ --test-from-channel=<channel> Pull snap from the specified channel instead of building it from source
32+ --force-new-image Force generating a new image used for testing
33 EOF
34 }
35
36@@ -67,7 +67,7 @@ restore_and_update_tests_extras() {
37 # hidden directory which is re-used since then.
38
39 # Display help w/o fetching anything and exit
40-[ "$1" = "--help" ] && show_help
41+[ ! -d "$TESTS_EXTRAS_PATH" ] && [ "$1" = "--help" ] && show_help
42
43 if [ -d "$TESTS_EXTRAS_PATH" ]; then
44 restore_and_update_tests_extras
45@@ -75,5 +75,6 @@ else
46 clone_tests_extras
47 fi
48
49+
50 echo "INFO: Executing tests runner"
51 cd $TESTS_EXTRAS_PATH && ./tests-runner.sh "$@"
52diff --git a/spread.yaml b/spread.yaml
53index 4bea33a..9a2c2f3 100644
54--- a/spread.yaml
55+++ b/spread.yaml
56@@ -22,6 +22,10 @@ environment:
57 SNAP_NAME: wifi-ap
58 # Allow the host to pass the channel to use for the test rim
59 SNAP_CHANNEL: $(HOST:echo $SNAP_CHANNEL)
60+ # Set these to different names when you run the tests on hardware where
61+ # you need to use different interfaces.
62+ HW_WLAN0_NAME: wlan0
63+ HW_WLAN1_NAME: wlan1
64
65 backends:
66 qemu:
67@@ -29,6 +33,16 @@ backends:
68 - ubuntu-core-16:
69 username: test
70 password: test
71+ external:
72+ type: adhoc
73+ environment:
74+ SPREAD_EXTERNAL_ADDRESS: "$(HOST: echo ${SPREAD_EXTERNAL_ADDRESS:-localhost:8022})"
75+ allocate: |
76+ ADDRESS $SPREAD_EXTERNAL_ADDRESS
77+ systems:
78+ - hw-ubuntu-core-16:
79+ username: $(HOST:echo $SPREAD_EXTERNAL_USER)
80+ password: $(HOST:echo $SPREAD_EXTERNAL_PASSWORD)
81
82 # Put this somewhere where we have read-write access
83 path: /home/wifi-ap
84@@ -39,6 +53,9 @@ exclude:
85 prepare: |
86 . $TESTSLIB/prepare-all.sh
87
88+restore: |
89+ . $TESTSLIB/restore-all.sh
90+
91 prepare-each: |
92 # Cleanup logs so we can just dump what has happened in the debug-each
93 # step below after a test case ran.
94@@ -58,6 +75,7 @@ suites:
95 summary: Full-system tests for the wifi-ap snap
96 systems:
97 - ubuntu-core-16
98+ - hw-ubuntu-core-16
99 prepare: |
100 . $TESTSLIB/prepare.sh
101 restore-each: |
102diff --git a/tests/lib/prepare-all.sh b/tests/lib/prepare-all.sh
103index 38380e2..49be914 100644
104--- a/tests/lib/prepare-all.sh
105+++ b/tests/lib/prepare-all.sh
106@@ -1,7 +1,20 @@
107 #!/bin/bash
108
109-# Simulate two WiFi radio network interfaces
110-modprobe mac80211_hwsim radios=2
111+if [ "$SPREAD_SYSTEM" = "ubuntu-core-16" ]; then
112+ # Simulate two WiFi radio network interfaces
113+ modprobe mac80211_hwsim radios=2
114+elif [ "$SPREAD_SYSTEM" = "hw-ubuntu-core-16" ]; then
115+ if ! snap list | grep -q wifi-ap; then
116+ echo "ERROR: wifi-ap snap is not installed. You need to manually install"
117+ echo " the version you want to test."
118+ exit 1
119+ fi
120+ systemctl stop snap.wifi-ap.management-service
121+ tar czf $SPREAD_PATH/wifi-ap-state.tar.gz /var/snap/wifi-ap/current /var/snap/wifi-ap/common
122+ rm -rf /var/snap/wifi-ap/current/* /var/snap/wifi-ap/common/*
123+ systemctl start snap.wifi-ap.management-service
124+ exit 0
125+fi
126
127 # We don't have to build a snap when we should use one from a
128 # channel
129diff --git a/tests/lib/prepare.sh b/tests/lib/prepare.sh
130index d4b7020..19e6b83 100644
131--- a/tests/lib/prepare.sh
132+++ b/tests/lib/prepare.sh
133@@ -2,34 +2,36 @@
134
135 . $TESTSLIB/utilities.sh
136
137-echo "Wait for firstboot change to be ready"
138-while ! snap changes | grep -q "Done"; do
139- snap changes || true
140- snap change 1 || true
141- sleep 1
142-done
143+if [ "$SPREAD_SYSTEM" = "ubuntu-core-16" ]; then
144+ echo "Wait for firstboot change to be ready"
145+ while ! snap changes | grep -q "Done"; do
146+ snap changes || true
147+ snap change 1 || true
148+ sleep 1
149+ done
150
151-echo "Ensure fundamental snaps are still present"
152-. $TESTSLIB/snap-names.sh
153-for name in $gadget_name $kernel_name $core_name; do
154- if ! snap list | grep -q $name ; then
155- echo "Not all fundamental snaps are available, all-snap image not valid"
156- echo "Currently installed snaps:"
157- snap list
158- exit 1
159- fi
160-done
161+ echo "Ensure fundamental snaps are still present"
162+ . $TESTSLIB/snap-names.sh
163+ for name in $gadget_name $kernel_name $core_name; do
164+ if ! snap list | grep -q $name ; then
165+ echo "Not all fundamental snaps are available, all-snap image not valid"
166+ echo "Currently installed snaps:"
167+ snap list
168+ exit 1
169+ fi
170+ done
171
172-echo "Kernel has a store revision"
173-snap list | grep ^${kernel_name} | grep -E " [0-9]+\s+canonical"
174+ echo "Kernel has a store revision"
175+ snap list | grep ^${kernel_name} | grep -E " [0-9]+\s+canonical"
176
177-install_snap_under_test
178+ install_snap_under_test
179
180-# Snapshot of the current snapd state for a later restore
181-if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ] ; then
182- systemctl stop snapd.service snapd.socket
183- tar czf $SPREAD_PATH/snapd-state.tar.gz /var/lib/snapd /etc/netplan
184- systemctl start snapd.socket
185+ # Snapshot of the current snapd state for a later restore
186+ if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ] ; then
187+ systemctl stop snapd.service snapd.socket
188+ tar czf $SPREAD_PATH/snapd-state.tar.gz /var/lib/snapd /etc/netplan
189+ systemctl start snapd.socket
190+ fi
191 fi
192
193 # For debugging dump all snaps and connected slots/plugs
194diff --git a/tests/lib/restore-all.sh b/tests/lib/restore-all.sh
195new file mode 100644
196index 0000000..5c371ef
197--- /dev/null
198+++ b/tests/lib/restore-all.sh
199@@ -0,0 +1,9 @@
200+#!/bin/bash
201+
202+if [ "$SPREAD_SYSTEM" = "hw-ubuntu-core-16" ]; then
203+ if [ -e $SPREAD_PATH/wifi-ap-state.tar.gz ]; then
204+ systemctl stop snap.wifi-ap.management-service || true
205+ tar xzf $SPREAD_PATH/wifi-ap-state.tar.gz -C /
206+ systemctl start snap.wifi-ap.management-service
207+ fi
208+fi
209diff --git a/tests/lib/restore-each.sh b/tests/lib/restore-each.sh
210index fa474b4..324b4d6 100644
211--- a/tests/lib/restore-each.sh
212+++ b/tests/lib/restore-each.sh
213@@ -3,6 +3,13 @@
214 . $TESTSLIB/snap-names.sh
215 . $TESTSLIB/utilities.sh
216
217+if [ "$SPREAD_SYSTEM" = "hw-ubuntu-core-16" ]; then
218+ systemctl stop snap.wifi-ap.management-service || true
219+ rm -rf /var/snap/wifi-ap/current/* /var/snap/wifi-ap/common/*
220+ systemctl start snap.wifi-ap.management-service
221+ exit 0
222+fi
223+
224 # Remove all snaps not being the core, gadget, kernel or snap we're testing
225 for snap in /snap/*; do
226 snap="${snap:6}"
227diff --git a/tests/main/background-process-control/task.yaml b/tests/main/background-process-control/task.yaml
228index 58dd047..070aadf 100644
229--- a/tests/main/background-process-control/task.yaml
230+++ b/tests/main/background-process-control/task.yaml
231@@ -1,5 +1,8 @@
232 summary: Test correct service behavior to ensure the background AP process is running
233
234+systems:
235+ - -hw-ubuntu-core-16
236+
237 prepare: |
238 # We need some tools for scanning etc.
239 snap install wireless-tools
240@@ -24,7 +27,7 @@ execute: |
241
242 # Restart should get us back into the same state we were in before
243 /snap/bin/wifi-ap.status restart-ap
244- # Restart needs some time
245+ # Restart needs some time
246 sleep 5
247 /snap/bin/wifi-ap.status | grep "ap.active: true"
248 /snap/bin/wireless-tools.iw dev wlan1 scan | grep 'SSID: Ubuntu'
249diff --git a/tests/main/conf-wizard-auto-at-boot/task.yaml b/tests/main/conf-wizard-auto-at-boot/task.yaml
250index b042097..01d8ddb 100644
251--- a/tests/main/conf-wizard-auto-at-boot/task.yaml
252+++ b/tests/main/conf-wizard-auto-at-boot/task.yaml
253@@ -1,5 +1,8 @@
254 summary: Verify that the automatic wizard works
255
256+systems:
257+ - -hw-ubuntu-core-16
258+
259 execute: |
260 # Check that we get good default values
261 test "$(/snap/bin/wifi-ap.config get disabled)" = false
262diff --git a/tests/main/conf-wizard-auto-can-be-blocked/task.yaml b/tests/main/conf-wizard-auto-can-be-blocked/task.yaml
263index ecacd6f..4f921a0 100644
264--- a/tests/main/conf-wizard-auto-can-be-blocked/task.yaml
265+++ b/tests/main/conf-wizard-auto-can-be-blocked/task.yaml
266@@ -1,5 +1,8 @@
267 summary: Verify the automatic wizard running on service startup can be blocked with a configuration option
268
269+systems:
270+ - -hw-ubuntu-core-16
271+
272 environment:
273 SNAP_COMMON: /var/snap/wifi-ap/common
274 SNAP_DATA: /var/snap/wifi-ap/current
275diff --git a/tests/main/conf-wizard-auto-nodefaultip/task.yaml b/tests/main/conf-wizard-auto-nodefaultip/task.yaml
276index 8be2f75..81c168c 100644
277--- a/tests/main/conf-wizard-auto-nodefaultip/task.yaml
278+++ b/tests/main/conf-wizard-auto-nodefaultip/task.yaml
279@@ -1,5 +1,8 @@
280 summary: Verify that the wizard is able to find an unused IP
281
282+systems:
283+ - -hw-ubuntu-core-16
284+
285 prepare: |
286 # Dummy interface to assign an IP to
287 modprobe dummy
288diff --git a/tests/main/conf-wizard-auto-noip/task.yaml b/tests/main/conf-wizard-auto-noip/task.yaml
289index 10822e1..e557c19 100644
290--- a/tests/main/conf-wizard-auto-noip/task.yaml
291+++ b/tests/main/conf-wizard-auto-noip/task.yaml
292@@ -1,5 +1,8 @@
293 summary: Verify that wizard fails when all private subnets are busy
294
295+systems:
296+ - -hw-ubuntu-core-16
297+
298 prepare: |
299 # Dummy interface to assign an IP to
300 modprobe dummy
301diff --git a/tests/main/conf-wizard-auto-nowifi/task.yaml b/tests/main/conf-wizard-auto-nowifi/task.yaml
302index ce89798..71e0190 100644
303--- a/tests/main/conf-wizard-auto-nowifi/task.yaml
304+++ b/tests/main/conf-wizard-auto-nowifi/task.yaml
305@@ -1,5 +1,8 @@
306 summary: Verify that wizard fails when there are no WiFi devices
307
308+systems:
309+ - -hw-ubuntu-core-16
310+
311 prepare: |
312 rmmod mac80211_hwsim
313
314diff --git a/tests/main/conf-wizard-auto/task.yaml b/tests/main/conf-wizard-auto/task.yaml
315index ae6219c..0b1f8cf 100644
316--- a/tests/main/conf-wizard-auto/task.yaml
317+++ b/tests/main/conf-wizard-auto/task.yaml
318@@ -1,5 +1,8 @@
319 summary: Verify that the automatic wizard works
320
321+systems:
322+ - -hw-ubuntu-core-16
323+
324 execute: |
325 # The automatic wizard was already started
326
327diff --git a/tests/main/conf-wizard-disabled-from-gadget/task.yaml b/tests/main/conf-wizard-disabled-from-gadget/task.yaml
328index 227ecfb..caf7f84 100644
329--- a/tests/main/conf-wizard-disabled-from-gadget/task.yaml
330+++ b/tests/main/conf-wizard-disabled-from-gadget/task.yaml
331@@ -1,5 +1,8 @@
332 summary: Verify the wizard can be disabled by default from a gadget snap
333
334+systems:
335+ - -hw-ubuntu-core-16
336+
337 # FIXME: This test needs to stay manual until a snap is in edge which
338 # contains a configure hook. Otherwise the snap installation will
339 # always fail.
340diff --git a/tests/main/configuration-changes/task.yaml b/tests/main/configuration-changes/task.yaml
341index 1800102..056580e 100644
342--- a/tests/main/configuration-changes/task.yaml
343+++ b/tests/main/configuration-changes/task.yaml
344@@ -1,5 +1,8 @@
345 summary: Test that we can change the configuration
346
347+systems:
348+ - -hw-ubuntu-core-16
349+
350 execute: |
351 test "`/snap/bin/wifi-ap.config get wifi.interface`" = wlan0
352 /snap/bin/wifi-ap.config set wifi.interface=wlan1
353diff --git a/tests/main/default-conf-brings-up-ap/task.yaml b/tests/main/default-conf-brings-up-ap/task.yaml
354index 6777c8d..b57850e 100644
355--- a/tests/main/default-conf-brings-up-ap/task.yaml
356+++ b/tests/main/default-conf-brings-up-ap/task.yaml
357@@ -1,5 +1,8 @@
358 summary: Verify that the default configuration is able to spawn up an AP
359
360+systems:
361+ - -hw-ubuntu-core-16
362+
363 execute: |
364 . $TESTSLIB/utilities.sh
365
366diff --git a/tests/main/default-configuration/tasks.yaml b/tests/main/default-configuration/tasks.yaml
367index d6c1cba..67f9cb4 100644
368--- a/tests/main/default-configuration/tasks.yaml
369+++ b/tests/main/default-configuration/tasks.yaml
370@@ -1,5 +1,8 @@
371 summary: Verify snap has correct default configuration
372
373+systems:
374+ - -hw-ubuntu-core-16
375+
376 execute: |
377 test `/snap/bin/wifi-ap.config get debug` = false
378 test `/snap/bin/wifi-ap.config get disabled` = true
379diff --git a/tests/main/documentation-builds/task.yaml b/tests/main/documentation-builds/task.yaml
380index e746465..8780a98 100644
381--- a/tests/main/documentation-builds/task.yaml
382+++ b/tests/main/documentation-builds/task.yaml
383@@ -1,5 +1,11 @@
384 summary: Verify the project documentation is building without errors
385
386+systems:
387+ - -hw-ubuntu-core-16
388+
389+systems:
390+ - -hw-ubuntu-core-16
391+
392 execute: |
393 # Need to install in devmode as otherwise the snap can't access our project
394 # home which is outside of the home directory of our current user.
395diff --git a/tests/main/socket-plug/task.yaml b/tests/main/socket-plug/task.yaml
396index 8306aaf..e18d0db 100644
397--- a/tests/main/socket-plug/task.yaml
398+++ b/tests/main/socket-plug/task.yaml
399@@ -1,5 +1,8 @@
400 summary: Verify that the exported content interface does work
401
402+systems:
403+ - -hw-ubuntu-core-16
404+
405 execute: |
406 # The automatic wizard was already started
407
408diff --git a/tests/main/stress-ap-status-control/task.yaml b/tests/main/stress-ap-status-control/task.yaml
409deleted file mode 100644
410index 89ded92..0000000
411--- a/tests/main/stress-ap-status-control/task.yaml
412+++ /dev/null
413@@ -1,69 +0,0 @@
414-summary: Stress test for the AP status control API
415-
416-environment:
417- RESTART_ITERATIONS: 15
418- SCAN_ITERATIONS: 10
419-
420-prepare: |
421- # We need some tools for scanning etc.
422- snap install wireless-tools
423- snap connect wireless-tools:network-control core
424-
425-execute: |
426- # Bring up the access point first
427- /snap/bin/wifi-ap.config set disabled=false
428- until /snap/bin/wifi-ap.status | grep "ap.active: true" ; do
429- sleep 0.5
430- done
431-
432- # Scan for networks on the other side of the WiFi network
433- # and ensure the network is available.
434- ifconfig wlan1 up
435- n=0
436- found_ap=0
437- while [ $n -lt $SCAN_ITERATIONS ] ; do
438- if /snap/bin/wireless-tools.iw dev wlan1 scan | grep 'SSID: Ubuntu'; then
439- found_ap=1
440- break
441- fi
442- sleep 0.5
443- let n=n+1
444- done
445- test $found_ap -eq 1
446-
447- # We will restart the AP a huge number of times again and again
448- # and expect that the AP afterwards comes back up normally and
449- # we can still search and connect to it.
450- n=0
451- while [ $n -lt $RESTART_ITERATIONS ] ; do
452- /snap/bin/wifi-ap.status restart-ap
453- sleep 0.5
454- let n=n+1
455- done
456-
457- # Wait for AP to be marked as active again
458- until /snap/bin/wifi-ap.status | fgrep "ap.active: true" ; do
459- sleep 0.5
460- done
461-
462- # The AP should be still available in our scan result
463- n=0
464- found_ap=0
465- while [ $n -lt $SCAN_ITERATIONS ] ; do
466- if /snap/bin/wireless-tools.iw dev wlan1 scan | grep 'SSID: Ubuntu'; then
467- found_ap=1
468- break
469- fi
470- sleep 0.5
471- let n=n+1
472- done
473- test $found_ap -eq 1
474-
475- # Verify we can associate with the AP
476- sudo /snap/bin/wireless-tools.iw wlan1 connect Ubuntu
477- sudo /snap/bin/wireless-tools.iw dev wlan1 link | grep 'SSID: Ubuntu'
478-
479- # We should only have one hostapd and one dnsmasq process at this time
480- # (we have to ignore the grep'ing process as otherwise we get a count of 2)
481- test `pgrep -c hostapd` -eq 1
482- test `pgrep -c dnsmasq` -eq 1
483diff --git a/tests/main/stress-ap/task.yaml b/tests/main/stress-ap/task.yaml
484new file mode 100644
485index 0000000..4b667b8
486--- /dev/null
487+++ b/tests/main/stress-ap/task.yaml
488@@ -0,0 +1,88 @@
489+summary: Stress test for the WiFi AP
490+
491+environment:
492+ RESTART_ITERATIONS: 30
493+ SCAN_ITERATIONS: 15
494+ AP_NAME: "StressUbuntuAP"
495+
496+prepare: |
497+ # We need some tools for scanning etc.
498+ snap install wireless-tools
499+ snap connect wireless-tools:network-control core
500+
501+execute: |
502+ # Bring up the access point first
503+ /snap/bin/wifi-ap.config set \
504+ wifi.interface=$HW_WLAN0_NAME \
505+ wifi.ssid=$AP_NAME \
506+ disabled=false
507+
508+ until /snap/bin/wifi-ap.status | grep "ap.active: true" ; do
509+ sleep 0.5
510+ done
511+
512+ scan_command() {
513+ if [ -e /snap/bin/nmcli ]; then
514+ /snap/bin/nmcli d wifi rescan
515+ /snap/bin/nmcli d wifi list ifname $1
516+ return
517+ fi
518+ /snap/bin/wireless-tools.iw dev $1 scan
519+ }
520+
521+ # Scan for networks on the other side of the WiFi network
522+ # and ensure the network is available.
523+ ifconfig $HW_WLAN1_NAME up
524+ n=0
525+ found_ap=0
526+ while [ $n -lt $SCAN_ITERATIONS ] ; do
527+ if scan_command $HW_WLAN1_NAME | grep $AP_NAME; then
528+ found_ap=1
529+ break
530+ fi
531+ sleep 0.5
532+ let n=n+1
533+ done
534+ test $found_ap -eq 1
535+
536+ # We will restart the AP a huge number of times again and again
537+ # and expect that the AP afterwards comes back up normally and
538+ # we can still search and connect to it.
539+ n=0
540+ while [ $n -lt $RESTART_ITERATIONS ] ; do
541+ /snap/bin/wifi-ap.status restart-ap
542+ sleep 0.5
543+ let n=n+1
544+ done
545+
546+ # Wait for AP to be marked as active again
547+ until /snap/bin/wifi-ap.status | fgrep "ap.active: true" ; do
548+ sleep 0.5
549+ done
550+
551+ # The AP should be still available in our scan result
552+ n=0
553+ found_ap=0
554+ while [ $n -lt $SCAN_ITERATIONS ] ; do
555+ if scan_command $HW_WLAN1_NAME | grep $AP_NAME; then
556+ found_ap=1
557+ break
558+ fi
559+ sleep 0.5
560+ let n=n+1
561+ done
562+ test $found_ap -eq 1
563+
564+ if [ -e /snap/bin/nmcli ]; then
565+ /snap/bin/nmcli d wifi connect $AP_NAME ifname $HW_WLAN1_NAME
566+ /snap/bin/nmcli d | grep "$HW_WLAN1_NAME.*connected"
567+ else
568+ # Verify we can associate with the AP
569+ sudo /snap/bin/wireless-tools.iw $HW_WLAN1_NAME connect $AP_NAME
570+ sudo /snap/bin/wireless-tools.iw dev $HW_WLAN1_NAME link | grep $AP_NAME
571+ fi
572+
573+ # We should only have one hostapd and one dnsmasq process at this time
574+ # (we have to ignore the grep'ing process as otherwise we get a count of 2)
575+ test `pgrep -c hostapd` -eq 1
576+ test `pgrep -c dnsmasq` -eq 1
577diff --git a/tests/main/utf8-ssid/task.yaml b/tests/main/utf8-ssid/task.yaml
578index 9b6faa6..1c2759d 100644
579--- a/tests/main/utf8-ssid/task.yaml
580+++ b/tests/main/utf8-ssid/task.yaml
581@@ -1,5 +1,8 @@
582 summary: Verify that the AP can accept an UTF8 SSID
583
584+systems:
585+ - -hw-ubuntu-core-16
586+
587 environment:
588 SCAN_ITERATIONS: 15
589
590@@ -45,4 +48,3 @@ execute: |
591 # Verify we can associate with the AP
592 /snap/bin/wireless-tools.iw wlan1 connect 'Ubuntu👍'
593 /snap/bin/wireless-tools.iw dev wlan1 link | fgrep 'SSID: Ubuntu\xf0\x9f\x91\x8d'
594-

Subscribers

People subscribed via source and target branches

to all changes: