Merge ~rmescandon/snappy-hwe-snaps/+git/engineering-tests:wifi-connect-tests into ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master

Proposed by Roberto Mier Escandon
Status: Merged
Approved by: Konrad Zapałowicz
Approved revision: 2bc4a0e94ad735dda8f50a8b95f3b422ef4901b9
Merged at revision: c3790f7c979d4f12c636bf0b6e9e30a462a44c7c
Proposed branch: ~rmescandon/snappy-hwe-snaps/+git/engineering-tests:wifi-connect-tests
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 311 lines (+237/-5)
4 files modified
README.md (+17/-3)
snapcraft.yaml (+8/-2)
wifi-connect/manage.py (+10/-0)
wifi-connect/units/wifi.connect.pxu (+202/-0)
Reviewer Review Type Date Requested Status
Konrad Zapałowicz (community) lgtm Approve
Alfonso Sanchez-Beato Approve
System Enablement Bot continuous-integration Approve
Review via email: mp+325647@code.launchpad.net

Description of the change

Added manual tests for wifi-connect

To post a comment you must log in.
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

I've also updated README.md file with what i think are projects already available but not reflected there. Correct me if I'm wrong

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

Small changes in wording needed.

review: Needs Fixing (code)
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

Grammar fixes
updated tests where $SNAP_COMMON/sockets/control is now $SNAP_COMMON/control path

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)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

Looks very complete, I have just a couple of comments.

Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Roberto Mier Escandon (rmescandon) wrote :

Commented back

Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM, but please open a bug for netplan.

review: Approve
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

ack

review: Approve (lgtm)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README.md b/README.md
2index 84799b1..5ab766a 100644
3--- a/README.md
4+++ b/README.md
5@@ -9,11 +9,19 @@ the snaps produced by the System Enablement team at Canonical.
6
7 It currently covers test cases for the following snaps
8
9+ * alsa-utils
10 * bluez
11+ * captive-redirect
12 * modem-manager
13 * network-manager
14+ * pulse-audio
15 * tpm1.2
16+ * udisks2
17+ * upower
18 * wifi-ap
19+ * wifi-connect
20+ * wireless-tools
21+ * wpa-supplicant
22
23 ## How can I run the tests?
24
25@@ -35,13 +43,19 @@ can use to run all available test cases. The first command
26 runs all of the tests and the other ones run individual test
27 categories related to the command's name.
28
29- $ /snap/bin/canonical-se-engineering-tests.run
30+ $ /snap/bin/canonical-se-engineering-tests.alsa-utils
31 $ /snap/bin/canonical-se-engineering-tests.bluez
32+ $ /snap/bin/canonical-se-engineering-tests.media-hub
33 $ /snap/bin/canonical-se-engineering-tests.modem-manager
34 $ /snap/bin/canonical-se-engineering-tests.network-manager
35- $ /snap/bin/canonical-se-engineering-tests.tpm1-2
36+ $ /snap/bin/canonical-se-engineering-tests.plainbox
37+ $ /snap/bin/canonical-se-engineering-tests.pulseaudio
38+ $ /snap/bin/canonical-se-engineering-tests.tpm
39+ $ /snap/bin/canonical-se-engineering-tests.udisks2
40+ $ /snap/bin/canonical-se-engineering-tests.upower
41 $ /snap/bin/canonical-se-engineering-tests.wifi-ap
42- $ /snap/bin/canonical-se-engineering-tests.media-hub
43+ $ /snap/bin/canonical-se-engineering-tests.wifi-connect
44+ $ /snap/bin/canonical-se-engineering-tests.wireless-tools
45
46 ## How can I contribute new tests?
47
48diff --git a/snapcraft.yaml b/snapcraft.yaml
49index 488f9b2..a73c050 100644
50--- a/snapcraft.yaml
51+++ b/snapcraft.yaml
52@@ -25,6 +25,8 @@ apps:
53 command: bin/run-tpm-tests
54 wifi-ap:
55 command: bin/run-wifi-ap-tests
56+ wifi-connect:
57+ command: bin/plainbox-wrapper run -i '2017.com.canonical.wifi-connect::wifi-connect.*'
58 wireless-tools:
59 command: bin/run-wireless-tools-tests
60 pulseaudio:
61@@ -46,7 +48,7 @@ parts:
62 common:
63 plugin: dump
64 source: .
65- snap:
66+ prime:
67 - COPYING
68 plainbox-local:
69 plugin: python
70@@ -83,6 +85,10 @@ parts:
71 plugin: plainbox-provider
72 source: ./wifi-ap
73 after: [plainbox-local]
74+ wifi-connect:
75+ plugin: plainbox-provider
76+ source: ./wifi-connect
77+ after: [plainbox-local]
78 wireless-tools:
79 plugin: plainbox-provider
80 source: ./wireless-tools
81@@ -116,5 +122,5 @@ parts:
82 launchers:
83 plugin: dump
84 source: .
85- snap:
86+ prime:
87 - bin/
88diff --git a/wifi-connect/manage.py b/wifi-connect/manage.py
89new file mode 100755
90index 0000000..f0884de
91--- /dev/null
92+++ b/wifi-connect/manage.py
93@@ -0,0 +1,10 @@
94+#!/usr/bin/env python3
95+from plainbox.provider_manager import setup, N_
96+
97+setup(
98+ name='plainbox-provider-wifi-connect',
99+ namespace='2017.com.canonical.wifi-connect',
100+ version="1.0",
101+ description=N_("Plainbox provider for the WiFi connect snap"),
102+ gettext_domain="2017_com_canonical_wifi_connect",
103+)
104diff --git a/wifi-connect/units/wifi.connect.pxu b/wifi-connect/units/wifi.connect.pxu
105new file mode 100644
106index 0000000..78fce85
107--- /dev/null
108+++ b/wifi-connect/units/wifi.connect.pxu
109@@ -0,0 +1,202 @@
110+# Copyright 2017 Canonical Ltd.
111+# All rights reserved.
112+#
113+# Written by:
114+# Roberto Mier Escandon <roberto.escandon@canonical.com>
115+
116+unit: category
117+id: wifi-connect
118+_name: WiFi Connect
119+
120+id: wifi-connect/setup/ensure_interface_connection_setup
121+category_id: wifi-connect
122+_description: Ensure that the wifi-connect interfaces are connected
123+plugin: manual
124+_steps:
125+ 0. If the wifi-connect snap is already installed remove it via
126+ .
127+ $ snap remove wifi-connect
128+ .
129+ 1. Network Manager setup
130+ .
131+ For snaps on Classic:
132+ NetworkManager is part of the base Ubuntu Desktop system
133+ and does not need to be installed again.
134+ .
135+ For an Ubuntu Core system you have to install
136+ the NetworkManager snap from the Ubuntu store.
137+ $ snap install network-manager
138+ .
139+ 2. Wifi AP setup
140+ .
141+ You have to install Wifi AP snap.
142+ $ snap install wifi-ap
143+ .
144+ 3. Install now the wifi-connect snap via
145+ .
146+ $ snap install wifi-connect
147+ .
148+ 4. Connect wifi-connect interfaces
149+ .
150+ $ snap connect wifi-connect:control wifi-ap:control
151+ $ snap connect wifi-connect:network core:network
152+ $ snap connect wifi-connect:network-bind core:network-bind
153+ .
154+ For snaps on Classic you have to connect:
155+ $ snap connect wifi-connect:network-manager core:network-manager
156+ .
157+ For an Ubuntu Core system you have to connect:
158+ $ snap connect wifi-connect:network-manager network-manager:service
159+ .
160+_verification:
161+ Verify that you see the following when running snap interfaces:
162+ :firewall-control wifi-ap
163+ :network-control wifi-ap
164+ :network wifi-ap,wifi-connect
165+ :network-bind wifi-ap,wifi-connect
166+ wifi-ap:control wifi-connect
167+ .
168+ For snaps on Classic:
169+ :network-manager wifi-ap,wifi-connect
170+ .
171+ For full-snap based system:
172+ network-manager:service wifi-ap:network-manager,wifi-connect:network-manager
173+
174+id: wifi-connect/configuration/network_manager_does_not_control_network_before_reboot
175+category_id: wifi-connect
176+plugin: manual
177+depends: wifi-connect/setup/ensure_interface_connection_setup
178+_summary: NetworkManager does not control all networking before rebooting
179+_purpose:
180+ Check if netplan is configured for NetworkManager to control networking
181+_steps:
182+ 0. Backup existing /etc/netplan/00-snapd-config.yaml file
183+ .
184+ $ mv /etc/netplan/00-snapd-config.yaml ~/
185+ .
186+ 1. Create a new netplan config file named /etc/netplan/00-default-nm-renderer.yaml
187+ .
188+ $ echo -e "network:\n renderer: NetworkManager" > /etc/netplan/00-default-nm-renderer.yaml
189+ .
190+ 2. See current managed devices by NetworkManager:
191+ .
192+ $ nmcli d
193+ .
194+_verification:
195+ Verify that wireless device (wlan0 by default) STATE column value does not equals to 'connected' or 'disconnected'
196+
197+id: wifi-connect/configuration/network_manager_controls_network_after_reboot
198+category_id: wifi-connect
199+plugin: manual
200+depends: wifi-connect/configuration/network_manager_does_not_control_network_before_reboot
201+_summary: NetworkManager controls network after configure netplan file and reboot
202+_steps:
203+ 0. Reboot the device
204+ .
205+ $ sudo reboot
206+ .
207+ 1. When the device finished booting, check nm status with the following command:
208+ .
209+ $ nmcli d
210+ .
211+_verification:
212+ Verify that wireless device (wlan0 by default) STATE column value does NOT equals to 'unmanaged'.
213+ If it is connected to external Wi-Fi, it should be displayed in green with 'connected' state, and
214+ if it is not connected to external Wi-Fi, it should be shown in red iwth 'disconnected' state
215+
216+id: wifi-connect/configuration/content_interface_is_plugged_after_reboot
217+category_id: wifi-connect
218+plugin: manual
219+depends: wifi-connect/configuration/network_manager_controls_network_after_reboot
220+_summary: Check that wifi-ap control interface is connected and working
221+_steps:
222+ 0. Enter in snap runtime environment
223+ .
224+ $ snap run --shell wifi-connect.wifi-connect
225+ .
226+ 1. List $SNAP_COMMON content
227+ .
228+ $ ls /var/snap/wifi-connect/common
229+ .
230+_verification:
231+ Check that exists /var/snap/wifi-connect/common/control
232+
233+id: wifi-connect/configuration/set_AP_ssid_and_passphrase
234+category_id: wifi-connect
235+plugin: manual
236+depends: wifi-connect/configuration/content_interface_is_plugged_after_reboot
237+_summary: Verify it is possible changing wifi-ap access point ssid and passphrase params
238+_steps:
239+ 0. Set wifi-ap AP ssid
240+ .
241+ $ wifi-connect ssid MYSSID
242+ .
243+ 1. Set wifi-ap AP passphrase
244+ .
245+ $ wifi-connect passphrase MYPASSPHRASE
246+ .
247+ 2. Display config
248+ .
249+ $ wifi-connect show-ap
250+ .
251+_verification:
252+ Verify into returning values exist:
253+ wifi.ssid: MYSSID
254+ wifi.security-passphrase: MYPASSPHRASE
255+
256+id: wifi-connect/configuration/set_portal_password
257+category_id: wifi-connect
258+plugin: manual
259+depends: wifi-connect/configuration/content_interface_is_plugged_after_reboot
260+_summary: Verify portal password change
261+_steps:
262+ 0. Set portal password
263+ .
264+ $ wifi-connect set-portal-password WHATEVER
265+ .
266+_verification:
267+ Verify result of set-portal-password operation is a hash of 60 chars starting with '$2a$08$' string
268+
269+id: wifi-connect/connect/local_AP_is_up
270+category_id: wifi-connect
271+plugin: manual
272+depends: wifi-connect/configuration/network_manager_controls_network_after_reboot
273+_summary: Verify management portal is up, running and has got some ssids
274+_steps:
275+ 0. From another device different from the one where wifi-connect is deployed:
276+ .
277+ Search available Wi-Fi access points
278+ .
279+_verification:
280+ Check that an SSID is available named MYSSID (or the one set when configured). Verify you can
281+ connect to that access point by introducing MYPASSPHRASE password
282+
283+id: wifi-connect/connect/can_connect_to_external_wifi
284+category_id: wifi-connect
285+plugin: manual
286+depends: wifi-connect/connect/local_AP_is_up
287+_summary: Management portal shows available access points and can connect to them
288+_steps:
289+ 0. From another device different from the one where wifi-connect is deployed, once connected to local AP
290+ .
291+ Open browser and access http://10.0.60.1:8080
292+ .
293+_verification:
294+ Verify a list of available external networks are shown. Verify you can access any of them by setting
295+ the related passphrase and clicking connect button.
296+ You should ssh device where wifi-connect is and see if 'nmcli d' command shows device is connected to
297+ selected external Wi-Fi
298+
299+id: wifi-connect/connect/can_get_back_to_management_mode
300+category_id: wifi-connect
301+plugin: manual
302+depends: wifi-connect/connect/can_connect_to_external_wifi
303+_summary: It is possible to bring back local AP and management portal
304+_steps:
305+ 0. From another device different from the one where wifi-connect is deployed, once connected to external Wi-Fi
306+ .
307+ Open browser and access http://<device_ip>:8080 (or http://<device_hostname>.local:8080 in case browser device supports avahi)
308+ .
309+_verification:
310+ Check that a web is shown with a button to return back to management mode. Press button and after passed around a minute
311+ verify same steps as the ones in id=wifi-connect/connect/can_connect_to_external_wifi

Subscribers

People subscribed via source and target branches