Merge ~morphis/snappy-hwe-snaps/+git/wifi-ap:improve-debugging into ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master

Proposed by Simon Fels
Status: Merged
Approved by: Simon Fels
Approved revision: 2d059f12aa21de1c12364ce5d50bd5d83a1184c5
Merged at revision: 091d6c6ea0719719743b6cc254c17487e99f908b
Proposed branch: ~morphis/snappy-hwe-snaps/+git/wifi-ap:improve-debugging
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/wifi-ap:master
Diff against target: 73 lines (+12/-9)
3 files modified
bin/ap.sh (+9/-4)
bin/helper.sh (+0/-2)
tests/lib/prepare-all.sh (+3/-3)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve
Matteo Croce (community) Approve
Review via email: mp+313526@code.launchpad.net

Description of the change

Improve debugging and fix test run with locally build snap

 * Only show bash execution steps when debug mode is eanbled
 * Load mac80211_hwsim driver a bit earlier before the first test runs

To post a comment you must log in.
Revision history for this message
Matteo Croce (teknoraver) :
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
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/ap.sh b/bin/ap.sh
2index 27e3595..a21cfa1 100755
3--- a/bin/ap.sh
4+++ b/bin/ap.sh
5@@ -14,23 +14,28 @@
6 # You should have received a copy of the GNU General Public License
7 # along with this program. If not, see <http://www.gnu.org/licenses/>.
8
9-set -x
10-
11 if [ $(id -u) -ne 0 ] ; then
12 echo "ERROR: $0 needs to be executed as root!"
13 exit 1
14 fi
15
16 . $SNAP/bin/config-internal.sh
17-. $SNAP/bin/helper.sh
18
19-DEFAULT_ACCESS_POINT_INTERFACE="ap0"
20+if [ $DEBUG = "true" ]; then
21+ set -x
22+fi
23+
24+# Now after we have enabled debugging or not we can safely load
25+# all others necessary bits.
26+. $SNAP/bin/helper.sh
27
28 if [ $DISABLED = "true" ] ; then
29 echo "Not starting as WiFi AP is disabled"
30 exit 0
31 fi
32
33+DEFAULT_ACCESS_POINT_INTERFACE="ap0"
34+
35 # Make sure the configured WiFi interface is really available before
36 # doing anything.
37 if ! ifconfig $WIFI_INTERFACE ; then
38diff --git a/bin/helper.sh b/bin/helper.sh
39index f535325..147fe89 100644
40--- a/bin/helper.sh
41+++ b/bin/helper.sh
42@@ -14,8 +14,6 @@
43 # You should have received a copy of the GNU General Public License
44 # along with this program. If not, see <http://www.gnu.org/licenses/>.
45
46-set -x
47-
48 does_interface_exist() {
49 [ -d /sys/class/net/$1 ]
50 }
51diff --git a/tests/lib/prepare-all.sh b/tests/lib/prepare-all.sh
52index 52d622a..38380e2 100644
53--- a/tests/lib/prepare-all.sh
54+++ b/tests/lib/prepare-all.sh
55@@ -1,5 +1,8 @@
56 #!/bin/bash
57
58+# Simulate two WiFi radio network interfaces
59+modprobe mac80211_hwsim radios=2
60+
61 # We don't have to build a snap when we should use one from a
62 # channel
63 if [ -n "$SNAP_CHANNEL" ] ; then
64@@ -12,9 +15,6 @@ if [ -e /home/wifi-ap/wifi-ap_*_amd64.snap ] ; then
65 exit 0
66 fi
67
68-# Simulate two WiFi radio network interfaces
69-modprobe mac80211_hwsim radios=2
70-
71 # Setup classic snap and build the wifi-ap snap in there
72 snap install --devmode --beta classic
73 cat <<-EOF > /home/test/build-snap.sh

Subscribers

People subscribed via source and target branches

to all changes: