Merge ~morphis/snappy-hwe-snaps/+git/network-manager:f/powercycle-wifi-for-each-test into ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master

Proposed by Simon Fels
Status: Needs review
Proposed branch: ~morphis/snappy-hwe-snaps/+git/network-manager:f/powercycle-wifi-for-each-test
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/network-manager:master
Diff against target: 31 lines (+14/-0)
2 files modified
spread.yaml (+2/-0)
tests/lib/prepare-each.sh (+12/-0)
Reviewer Review Type Date Requested Status
Jim Hodapp (community) Needs Fixing
System Enablement Bot continuous-integration Needs Fixing
Alfonso Sanchez-Beato Approve
Review via email: mp+320625@code.launchpad.net

Description of the change

Powercycle WiFi interfaces before each test run

To post a comment you must log in.
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

See below

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
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

One minor change.

review: Needs Fixing

Unmerged commits

2c047bf... by Simon Fels

Powercycle WiFi interfaces before each test run

This will ensure that the interfaces we have around for our test
cases are correctly reset and don't have any scan results pending
which could lead to problems with follow up test cases.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/spread.yaml b/spread.yaml
2index 83abb24..0a88734 100644
3--- a/spread.yaml
4+++ b/spread.yaml
5@@ -76,6 +76,8 @@ suites:
6 switch_netplan_to_network_manager
7 . $TESTSLIB/prepare.sh
8 REBOOT
9+ prepare-each: |
10+ . $TESTSLIB/prepare-each.h
11 restore-each: |
12 . $TESTSLIB/restore-each.sh
13 restore: |
14diff --git a/tests/lib/prepare-each.sh b/tests/lib/prepare-each.sh
15new file mode 100644
16index 0000000..116707e
17--- /dev/null
18+++ b/tests/lib/prepare-each.sh
19@@ -0,0 +1,12 @@
20+#!/bin/sh
21+. $TESTSLIB/utilities.sh
22+
23+# Powercycle both interface to get them back into a sane state before
24+# we install the wifi-ap snap
25+snap install --devmode wireless-tools
26+for d in wlan0 wlan1 ; do
27+ phy=$(iw dev $d info | awk '/wiphy/{print $2}')
28+ /snap/bin/wireless-tools.rfkill block $phy
29+ /snap/bin/wireless-tools.rfkill unblock $phy
30+done
31+snap remove wireless-tools

Subscribers

People subscribed via source and target branches