Merge ~morphis/snappy-hwe-snaps/+git/engineering-tests:reorganize-tests into ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master

Proposed by Simon Fels
Status: Merged
Approved by: Jim Hodapp
Approved revision: fd348c84be38346b9ea1f6198f93ae5f5129ddcc
Merged at revision: 0df00c14056af9c14241308ec85a294c93e97058
Proposed branch: ~morphis/snappy-hwe-snaps/+git/engineering-tests:reorganize-tests
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 2185 lines (+1024/-112)
23 files modified
bin/run-bluez-tests (+1/-1)
bin/run-modem-manager-tests (+1/-1)
bin/run-network-manager-tests (+1/-1)
bin/run-pulseaudio-tests (+1/-1)
bin/run-tpm-tests (+5/-0)
bin/run-wifi-ap-tests (+1/-1)
bin/run-wireless-tools-tests (+1/-1)
bluez/manage.py (+10/-0)
bluez/units/bluez.pxu (+155/-0)
dev/null (+0/-102)
modem-manager/manage.py (+10/-0)
modem-manager/units/modem-manager.pxu (+79/-0)
network-manager/manage.py (+10/-0)
network-manager/units/network-manager.pxu (+255/-0)
pulseaudio/manage.py (+10/-0)
pulseaudio/units/pulseaudio.pxu (+80/-0)
snapcraft.yaml (+28/-4)
tpm/manage.py (+10/-0)
tpm/units/tpm.pxu (+135/-0)
wifi-ap/manage.py (+10/-0)
wifi-ap/units/wifi-ap.pxu (+111/-0)
wireless-tools/manage.py (+10/-0)
wireless-tools/units/wireless-tools.pxu (+100/-0)
Reviewer Review Type Date Requested Status
Jim Hodapp (community) code Approve
System Enablement Bot continuous-integration Needs Fixing
Review via email: mp+312574@code.launchpad.net

Description of the change

Reorganize tests into separate functional providers.

This splits the existing test cases into different functional (per snap for now) providers to allow other QA snaps to easily reuse those.

This also fixes up a few syntax errors in the test cases which lead to not working tests which were introduced from former merge proposals.

To post a comment you must log in.
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 :

LGTM

review: Approve (code)
Revision history for this message
Simon Fels (morphis) wrote :

@Jim: can you top-approve?

Revision history for this message
Simon Fels (morphis) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/run-bluez-tests b/bin/run-bluez-tests
2index 459c80d..fa2d908 100755
3--- a/bin/run-bluez-tests
4+++ b/bin/run-bluez-tests
5@@ -1,5 +1,5 @@
6 #!/bin/sh
7 export PATH="$PATH:$SNAP/usr/sbin"
8 exec python3 $(which plainbox) \
9- run -i '2016.com.canonical.system-enablement::bluez.*' \
10+ run -i '2016.com.canonical.bluez::bluez.*' \
11 "$@"
12diff --git a/bin/run-modem-manager-tests b/bin/run-modem-manager-tests
13index c2d5832..02fea4b 100755
14--- a/bin/run-modem-manager-tests
15+++ b/bin/run-modem-manager-tests
16@@ -1,5 +1,5 @@
17 #!/bin/sh
18 export PATH="$PATH:$SNAP/usr/sbin"
19 exec python3 $(which plainbox) \
20- run -i '2016.com.canonical.system-enablement::modem_manager.*' \
21+ run -i '2016.com.canonical.modem-manager::modem_manager.*' \
22 "$@"
23diff --git a/bin/run-network-manager-tests b/bin/run-network-manager-tests
24index 9d76ecb..7f90af1 100755
25--- a/bin/run-network-manager-tests
26+++ b/bin/run-network-manager-tests
27@@ -1,5 +1,5 @@
28 #!/bin/sh
29 export PATH="$PATH:$SNAP/usr/sbin"
30 exec python3 $(which plainbox) \
31- run -i '2016.com.canonical.system-enablement::network_manager.*' \
32+ run -i '2016.com.canonical.network-manager::network_manager.*' \
33 "$@"
34diff --git a/bin/run-pulseaudio-tests b/bin/run-pulseaudio-tests
35index 40036f5..4e0b088 100755
36--- a/bin/run-pulseaudio-tests
37+++ b/bin/run-pulseaudio-tests
38@@ -1,5 +1,5 @@
39 #!/bin/sh
40 export PATH="$PATH:$SNAP/usr/sbin"
41 exec python3 $(which plainbox) \
42- run -i '2016.com.canonical.system-enablement::pulseaudio.*' \
43+ run -i '2016.com.canonical.pulseaudio::pulseaudio.*' \
44 "$@"
45diff --git a/bin/run-tpm-tests b/bin/run-tpm-tests
46new file mode 100755
47index 0000000..ea48ca1
48--- /dev/null
49+++ b/bin/run-tpm-tests
50@@ -0,0 +1,5 @@
51+#!/bin/sh
52+export PATH="$PATH:$SNAP/usr/sbin"
53+exec python3 $(which plainbox) \
54+ run -i '2016.com.canonical.tpm::tpm.*' \
55+ "$@"
56diff --git a/bin/run-tpm1.2-tests b/bin/run-tpm1.2-tests
57deleted file mode 100755
58index afdfd53..0000000
59--- a/bin/run-tpm1.2-tests
60+++ /dev/null
61@@ -1,5 +0,0 @@
62-#!/bin/sh
63-export PATH="$PATH:$SNAP/usr/sbin"
64-exec python3 $(which plainbox) \
65- run -i '2016.com.canonical.system-enablement::tpm1.2.*' \
66- "$@"
67diff --git a/bin/run-wifi-ap-tests b/bin/run-wifi-ap-tests
68index 010fed7..0d7dce0 100755
69--- a/bin/run-wifi-ap-tests
70+++ b/bin/run-wifi-ap-tests
71@@ -1,5 +1,5 @@
72 #!/bin/sh
73 export PATH="$PATH:$SNAP/usr/sbin"
74 exec python3 $(which plainbox) \
75- run -i '2016.com.canonical.system-enablement::wifi_ap.*' \
76+ run -i '2016.com.canonical.wifi-ap::wifi_ap.*' \
77 "$@"
78diff --git a/bin/run-wireless-tools-tests b/bin/run-wireless-tools-tests
79index 29cd139..69f5769 100755
80--- a/bin/run-wireless-tools-tests
81+++ b/bin/run-wireless-tools-tests
82@@ -1,5 +1,5 @@
83 #!/bin/sh
84 export PATH="$PATH:$SNAP/usr/sbin"
85 exec python3 $(which plainbox) \
86- run -i '2016.com.canonical.system-enablement::wireless-tools.*' \
87+ run -i '2016.com.canonical.wireless-tools::wireless-tools.*' \
88 "$@"
89diff --git a/bluez/manage.py b/bluez/manage.py
90new file mode 100755
91index 0000000..78b0dbd
92--- /dev/null
93+++ b/bluez/manage.py
94@@ -0,0 +1,10 @@
95+#!/usr/bin/env python3
96+from plainbox.provider_manager import setup, N_
97+
98+setup(
99+ name='plainbox-provider-bluez',
100+ namespace='2016.com.canonical.bluez',
101+ version="1.0",
102+ description=N_("Plainbox provider for the BlueZ snap"),
103+ gettext_domain="2016_com_canonical_bluez",
104+)
105diff --git a/bluez/units/bluez.pxu b/bluez/units/bluez.pxu
106new file mode 100644
107index 0000000..682bb31
108--- /dev/null
109+++ b/bluez/units/bluez.pxu
110@@ -0,0 +1,155 @@
111+# Copyright 2016 Canonical Ltd.
112+# All rights reserved.
113+#
114+# Written by:
115+# Jim Hodapp <jim.hodapp@canonical.com>
116+
117+unit: category
118+id: bluez
119+_name: Bluez
120+
121+id: bluez/setup/ensure_interface_connection_setup
122+category_id: bluez
123+_description: Ensure that the bluez interface is connected
124+plugin: manual
125+_steps:
126+ 1. Connect required bluez slot/plug
127+ .
128+ $ sudo snap connect bluez:client bluez:service
129+ .
130+_verification:
131+ Verify that you see the following when running snap interfaces bluez:
132+ bluez:service bluez:client
133+
134+id: bluez/scan/get_all
135+category_id: bluez
136+plugin: manual
137+depends: bluez/setup/ensure_interface_connection_setup
138+_summary: All Bluetooth devices in range are listed
139+_purpose:
140+ Check if all powered on devices that are within range as listed.
141+_steps:
142+ 1. Execute the following command to retrieve the list of all Bluetooth devices:
143+ .
144+ $ /snap/bin/bluez.bluetoothctl
145+ [bluetooth]# scan on
146+ .
147+_verification:
148+ Your expected Bluetooth device(s) is/are shown in the output list such as:
149+ [NEW] Device 04:52:C7:0D:0C:03 QC 35s
150+
151+id: bluez/connection/pair_and_connect
152+category_id: bluez
153+plugin: manual
154+depends: bluez/setup/ensure_interface_connection_setup
155+_summary: A Bluetooth device of choice is paired and connected
156+_purpose:
157+ Check if your Bluetooth device of choice can be paired to the host system.
158+_steps:
159+ 1. Execute the following command to pair and connect your device to the host
160+ system using the address listed in the previous scan test:
161+ .
162+ [bluetooth]# pair <device_address>
163+ [bluetooth]# connect <device_address>
164+ .
165+_verification:
166+ You should see output similar to the following:
167+ Attempting to pair with 04:52:C7:0D:0C:03
168+ [CHG] Device 04:52:C7:0D:0C:03 Connected: yes
169+ [CHG] Device 04:52:C7:0D:0C:03 Modalias: bluetooth:v009Ep400Cd0106
170+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00000000-deca-fade-deca-deafdecacaff
171+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
172+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
173+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
174+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
175+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
176+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
177+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
178+ [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: yes
179+ [CHG] Device 04:52:C7:0D:0C:03 Paired: yes
180+ Pairing successful
181+ [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: no
182+ [CHG] Device 04:52:C7:0D:0C:03 Connected: no
183+ Attempting to connect to 04:52:C7:0D:0C:03
184+ [CHG] Device 04:52:C7:0D:0C:03 Connected: yes
185+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00000000-deca-fade-deca-deafdecacaff
186+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
187+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
188+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
189+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
190+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
191+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
192+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000112f-0000-1000-8000-00805f9b34fb
193+ [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
194+ Connection successful
195+ [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: yes
196+
197+id: bluez/audio/a2dp_ubuntu_classic
198+category_id: bluez
199+plugin: manual
200+depends: bluez/connection/pair_and_connect
201+_summary: Stream audio to Bluetooth headset
202+_purpose:
203+ Verify that you can stream music to a Bluetooth headset via A2DP on Ubuntu
204+ Classic. Note: Skip this test if not running Ubuntu Classic.
205+_steps:
206+ 1. Follow the previous tests to list, pair and connect your headset.
207+ Navigate to the Sound panel in System Settings, select your headset device
208+ in the Output tab, and make sure that Mode is set to A2DP. Then press the
209+ Test Sound button and test each speaker.
210+_verification:
211+ Verify that you can hear the test sound "Front left", "Front right" in each
212+ speaker respectively.
213+
214+id: bluez/audio/a2dp_disconnect
215+category_id: bluez
216+plugin: manual
217+depends: bluez/audio/a2dp_ubuntu_classic
218+_summary: Disconnect Bluetooth headset
219+_purpose:
220+ Verify that you can disconnect Bluetooth headset while streaming and audio
221+ playback switches back to the device's primary speaker.
222+_steps:
223+ 1. Follow the previous tests to start streaming audio to the headset via
224+ A2DP. Then execute the following command to disconnect the headset from
225+ active A2DP streaming:
226+ .
227+ [<device_name>]# disconnect <device_address>
228+_verification:
229+ Verify that you see output similar to the following:
230+ Attempting to disconnect from 04:52:C7:0D:0C:03
231+ [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: no
232+ Successful disconnected
233+ [CHG] Device 04:52:C7:0D:0C:03 Connected: no
234+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Key: 0x0110
235+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x40
236+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x0c
237+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x02
238+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x41
239+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x00
240+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x61
241+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x71
242+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0xcd
243+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x92
244+ [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x6c
245+
246+id: bluez/connection/pair_and_connect_hid
247+category_id: bluez
248+plugin: manual
249+depends: bluez/setup/ensure_interface_connection_setup
250+_summary: A Bluetooth HID device (e.g. keyboard, mouse) is connected and paired
251+_purpose:
252+ Check if your Bluetooth HID device of choice (e.g. keyboard, mouse) can be
253+ paired to the host system.
254+_steps:
255+ 1. Execute the following command to pair and connect your HID device to the
256+ host system:
257+ .
258+ [bluetooth]# scan on
259+ [bluetooth]# pair <device_address>
260+ [bluetooth]# connect <device_address>
261+ .
262+_verification:
263+ Open a text editor and make sure you can type text from the HID keyboard
264+ into the text box. If testing a mouse, ensure that the cursor moves when
265+ moving your HID mouse.
266diff --git a/modem-manager/manage.py b/modem-manager/manage.py
267new file mode 100755
268index 0000000..8570bb9
269--- /dev/null
270+++ b/modem-manager/manage.py
271@@ -0,0 +1,10 @@
272+#!/usr/bin/env python3
273+from plainbox.provider_manager import setup, N_
274+
275+setup(
276+ name='plainbox-provider-modem-manager',
277+ namespace='2016.com.canonical.modem-manager',
278+ version="1.0",
279+ description=N_("Plainbox provider for the ModemManager snap"),
280+ gettext_domain="2016_com_canonical_modem_manager",
281+)
282diff --git a/modem-manager/units/modem-manager.pxu b/modem-manager/units/modem-manager.pxu
283new file mode 100644
284index 0000000..02da607
285--- /dev/null
286+++ b/modem-manager/units/modem-manager.pxu
287@@ -0,0 +1,79 @@
288+# Copyright 2016 Canonical Ltd.
289+# All rights reserved.
290+#
291+# Written by:
292+# Jim Hodapp <jim.hodapp@canonical.com>
293+
294+unit: category
295+id: modem_manager
296+_name: Modem Manager
297+
298+id: modem_manager/setup/ensure_interface_connection_setup
299+category_id: modem_manager
300+_description: Ensure that the modem-manager interface is connected
301+plugin: manual
302+_steps:
303+ 1. Connect required modem-manager slot/plug
304+ .
305+ $ sudo snap connect modem-manager:mmcli modem-manager:service
306+ $ sudo snap connect network-manager:nmcli network-manager:service
307+ $ sudo snap connect network-manager:modem-manager modem-manager:service
308+ $ sudo snap connect network-manager:ppp ubuntu-core:ppp
309+ .
310+_verification:
311+ Verify that you see the following when running snap interfaces:
312+ modem-manager:service modem-manager:mmcli,network-manager:modem-manager
313+ network-manager:service network-manager:nmcli
314+ :ppp network-manager
315+
316+id: modem_manager/modems/get_all
317+category_id: modem_manager
318+plugin: manual
319+depends: modem_manager/setup/ensure_interface_connection_setup
320+_summary: All active modem configuration items are listed
321+_purpose:
322+ Check if the modem shows up as being recognized by modem-manager.
323+_steps:
324+ 1. Execute the following command to retrieve the list of all detected modems:
325+ .
326+ $ /snap/bin/modem-manager.mmcli -L
327+_verification:
328+ Your expected modem is shown in the output list.
329+
330+id: modem_manager/modems/get_info
331+category_id: modem_manager
332+plugin: manual
333+depends: modem_manager/setup/ensure_interface_connection_setup
334+_summary: All modem information listed
335+_purpose:
336+ Check if the modem details can be listed.
337+_steps:
338+ 1. Execute the following command to retrieve the list of all detected modems.
339+ Note, the modem number is listed from the previous test:
340+ .
341+ $ /snap/bin/modem-manager.mmcli -m <modem_number>
342+_verification:
343+ Your desired modem detail is listed.
344+
345+id: modem_manager/modems/connect
346+category_id: modem_manager
347+plugin: manual
348+depends: modem_manager/setup/ensure_interface_connection_setup
349+_summary: Connect to a listed modem
350+_purpose:
351+ Connect to a listed modem and verify connection status
352+_steps:
353+ 1. Execute the following commands to connect to a particular modem.
354+ Note, replace <interface> with something like "ttyACM3" (look in /dev).
355+ You may also find it as the primary port when issuing the command:
356+ /snap/bin/network-manager.nmcli -m <modem_number>
357+ Also, replace <op_apn> by looking up the APN string for your cell provider
358+ at http://www.apn-settings.com (e.g. "fast.t-mobile.com" for T-Mobile 4G).
359+ Finally, not that "gsmconn" is an arbitrary connection name and can be set
360+ to anything that makes sense for the connection type.
361+ .
362+ $ /snap/bin/network-manager.nmcli c add type gsm ifname <interface> con-name
363+ gsmconn apn <op_apn>
364+ $ /snap/bin/network-manager.nmcli r wwan on
365+_verification:
366+ Verify that you have a modem connection by pinging www.ubuntu.com.
367diff --git a/network-manager/manage.py b/network-manager/manage.py
368new file mode 100755
369index 0000000..86969f2
370--- /dev/null
371+++ b/network-manager/manage.py
372@@ -0,0 +1,10 @@
373+#!/usr/bin/env python3
374+from plainbox.provider_manager import setup, N_
375+
376+setup(
377+ name='plainbox-provider-network-manager',
378+ namespace='2016.com.canonical.network-manager',
379+ version="1.0",
380+ description=N_("Plainbox provider for the NetworkManager snap"),
381+ gettext_domain="2016_com_canonical_network_manager",
382+)
383diff --git a/network-manager/units/network-manager.pxu b/network-manager/units/network-manager.pxu
384new file mode 100644
385index 0000000..6921aa7
386--- /dev/null
387+++ b/network-manager/units/network-manager.pxu
388@@ -0,0 +1,255 @@
389+# Copyright 2016 Canonical Ltd.
390+# All rights reserved.
391+#
392+# Written by:
393+# Lorn Potter <lorn.potter@canonical.com>
394+# Simon Fels <simon.fels@canonical.com>
395+
396+unit: category
397+id: network_manager
398+_name: Network Manager
399+
400+id: network_manager/ethernet/all_ports_detected
401+category_id: network_manager
402+plugin: manual
403+_summary: NetworkManager should detect all available ethernet ports
404+_purpose:
405+ NetworkManager should detect all available ethernet ports by default
406+ on a system and list them as usable devices.
407+_steps:
408+ 1. List all available ethernet ports
409+ $ ifconfig -a | grep -E '$eth'
410+ $ ifconfig -a | grep -E '$en'
411+ 2. List all ethernet ports NetworkManager knows about
412+ $ network-manager.nmcli d
413+_verification:
414+ Both steps should show the same list of ethernet network interfaces.
415+
416+id: network_manager/ethernet/auto_connected
417+category_id: network_manager
418+plugin: manual
419+_summary: NetworkManager should auto-connect any ethernet port with a link
420+_purpose:
421+ When a cable is plugged into an ethernet port NetworkManager should try
422+ to automatically connect the port.
423+ .
424+ NOTE: This test assumes that the cable you plug into the port is connected
425+ to a network which offers a DHCP server.
426+_steps:
427+ 1. Ensure that there is no connection for the port you want to use for
428+ testing. Using a serial console to perform this test is recommended.
429+ 2. Drop any existing connections listed by
430+ $ network-manager.nmcli c show
431+ which are meant for the ethernet port of the device with
432+ $ network-manager.nmcli c delete <UUID>
433+ 3. Plug the cable into the ethernet port.
434+_verification:
435+ The ethernet port should be automatically connected by NetworkManager. This
436+ can be verified with
437+ $ network-manager.nmcli d | grep <ethernet device name>
438+ eth0 ethernet connected <connection name>
439+ Please note that the <connection name> can be different as its
440+ automatically selected by NetworkManager. It can be "Wired Connection 1"
441+ for example.
442+
443+id: network_manager/ethernet/auto_connect_existing_connection
444+category_id: network_manager
445+plugin: manual
446+_summary: Cable plug/unplug should give an existing connection
447+_purpose:
448+ When a cable is unplugged and plugged again the ethernet port should
449+ be automatically reconnected.
450+_steps:
451+ 1. Check if the ethernet port is currently connected
452+ $ network-manager.nmcli d
453+ 2. Unplug the cable from the ethernet port and check the connection
454+ $ network-manager.nmcli d
455+ 3. Plug the cable again and check the connection status.
456+_verification:
457+ Before the cable is unplugged the ethernet port should be marked
458+ as connected. Once the cable is removed the connection status
459+ should switch to unconnected. When plugged back in, it should be marked
460+ again as connected.
461+
462+id: network_manager/ethernet/unmanaged
463+category_id: network_manager
464+plugin: manual
465+depends: network_manager/setup/ensure_interface_connection_setup
466+_summary: Check if ethernet device is unmanaged.
467+_purpose:
468+ Check if the ethernet device is not managed by Network Manager.
469+ .
470+ NOTE: This only applies to device where ethernet is not managed by
471+ NetworkManager. Check if /etc/netplan/00-default-nm-renderer.yaml
472+ exists. If it does not, then NetworkManager doesn't touch any
473+ ethernet connection.
474+_steps:
475+ 1. Execute the following command to retrieve the list of all detected connections.
476+ Note, the AP number is listed from the previous test:
477+ .
478+ $ /snap/bin/network-manager.nmcli d | grep en
479+_verification:
480+ The network device is listed as 'unmanaged', as an example:
481+ enxb827ebf6b919 ethernet unmanaged --
482+
483+id: network_manager/connections/get_all
484+category_id: network_manager
485+plugin: manual
486+depends: network_manager/setup/ensure_interface_connection_setup
487+_summary: All active AP configuration items are listed
488+_purpose:
489+ Check if the AP shows up as being recognized by Network Manager.
490+_steps:
491+ 1. Execute the following command to retrieve the list of all detected connections:
492+ .
493+ $ /snap/bin/network-manager.nmcli d wifi list
494+_verification:
495+ Your expected AP is shown in the output list for example:
496+ pool1 Infra 6 54 Mbit/s 75 *** WPA2
497+
498+id: network_manager/connections/agent
499+category_id: network_manager
500+plugin: manual
501+depends: network_manager/setup/ensure_interface_connection_setup
502+_summary: Register for secret agent
503+_purpose:
504+ Register for Network Manager's secret agent and verify status
505+_steps:
506+ 1. Execute the following command to register secret agent:
507+ .
508+ $ /snap/bin/network-manager.nmcli a
509+_verification:
510+ Output should be similiar to this:
511+ nmcli successfully registered as a Network Manager's secret agent.
512+ nmcli successfully registered as a polkit agent.
513+
514+id: network_manager/connections/connect
515+category_id: network_manager
516+plugin: manual
517+depends: network_manager/setup/ensure_interface_connection_setup
518+_summary: Connect to a listed AP
519+_purpose:
520+ Connect to a listed AP and verify connection status
521+_steps:
522+ 1. Execute the following commands to connect to a particular AP.
523+ .
524+ $ /snap/bin/network-manager.nmcli dev wifi con "yourssid" password "yourpassword"
525+ Note, replace yourssid with the ssid if the AP you will connect to, and replace yourpassword
526+ with the actual password/passphrase.
527+_verification:
528+ Verify that you have a AP connection by issuing this command:
529+ $ ifconfig | grep -A 2 wl
530+ .
531+ verifying that the interface has an IP address with output similiar to this:
532+ wlp5s0 Link encap:Ethernet HWaddr 70:77:81:33:92:6b
533+ inet addr:10.0.0.108 Bcast:10.0.0.255 Mask:255.255.255.0
534+ inet6 addr: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64 Scope:Global
535+
536+id: network_manager/connections/get_info
537+category_id: network_manager
538+plugin: manual
539+depends: network_manager/setup/ensure_interface_connection_setup
540+_summary: All AP information listed
541+_purpose:
542+ Check if the AP details can be listed.
543+_steps:
544+ 1. Execute the following command to retrieve the list of all detected connections.
545+ Note, the AP ssid is listed from the previous test:
546+ .
547+ $ /snap/bin/network-manager.nmcli -p -f general,ip4,ip6 c show <AP_SSID>
548+_verification:
549+ Your desired AP detail is listed and has ip4/ip6 address.
550+ ===============================================================================
551+ Activate connection details (1554e3b2-76e6-4adc-b986-215b7393f8d9)
552+ ===============================================================================
553+ GENERAL.NAME: pool1
554+ GENERAL.UUID: 1554e3b2-76e6-4adc-b986-215b7393f8d9
555+ GENERAL.DEVICES: wlp5s0
556+ GENERAL.STATE: activated
557+ GENERAL.DEFAULT: no
558+ GENERAL.DEFAULT6: no
559+ GENERAL.VPN: no
560+ GENERAL.ZONE: --
561+ GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2
562+ GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/3
563+ GENERAL.SPEC-OBJECT: /org/freedesktop/NetworkManager/AccessPoint/0
564+ GENERAL.MASTER-PATH: --
565+ -------------------------------------------------------------------------------
566+ IP4.ADDRESS[1]: 10.0.0.108/24
567+ IP4.GATEWAY: 10.0.0.138
568+ IP4.DNS[1]: 10.0.0.138
569+ IP4.DOMAIN[1]: gateway
570+ -------------------------------------------------------------------------------
571+ IP6.ADDRESS[1]: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64
572+ IP6.ADDRESS[2]: 2001:8003:6501:2000:7277:81ff:fe33:926b/64
573+ IP6.ADDRESS[3]: fe80::7277:81ff:fe33:926b/64
574+ IP6.GATEWAY: fe80::e2b9:e5ff:fe5a:91b0
575+ IP6.DNS[1]: 2001:8003:6501:2000::1
576+ IP6.DOMAIN[1]: gateway
577+ -------------------------------------------------------------------------------
578+
579+id: network_manager/ethernet/uses_global_wol
580+category_id: network_manager
581+plugin: manual
582+_summary: Ethernet connections are using global wake-on-lan setting
583+_purpose:
584+ Check if an ethernet connection created by NetworkManager automatically uses the
585+ global default for wake-on-lan.
586+ .
587+ NOTE: This requires a system which is configured to not use netplan to
588+ generate connections for NetworkManager. On such a system an ethernet
589+ connection will always have wake-on-lan disabled as netplan does this
590+ by default if not explicitly stated in the netplan configuration.
591+_steps:
592+ 1. Find connection UUID for the ethernet port
593+ $ network-manager.nmcli c show | grep eth0
594+ 2. Verify the connection uses the global wake-on-lan setting
595+ $ network-manager.nmcli -m multiline -f 802-3-ethernet.wake-on-lan c show <UUID>
596+_verification:
597+ The output should look like this:
598+ .
599+ 802-3-ethernet.wake-on-lan: 1 (default)
600+
601+id: network_manager/ethernet/has_wol_enabled_by_default
602+category_id: network_manager
603+plugin: manual
604+_summary: Ethernet port has wake-on-lan enabled by default
605+_purpose:
606+ Check if the actual ethernet device has wake-on-lan correctly enabled when
607+ its connection is maintained by NetworkManager.
608+_steps:
609+ 1. Install the se-test-tools snap
610+ $ snap install --devmode --edge se-test-tools
611+ 2. Check the ethernet port for the wake-on-lan setting (eth0 in this case)
612+ $ sudo se-test-tools.ethtool eth0
613+_verification:
614+ The output should be similar to this:
615+ Settings for eth0:
616+ [...]
617+ Supports Wake-on: pumbg
618+ Wake-on: g
619+ [...]
620+ .
621+ The relevant line is the "Wake-on:" one. It should have the value "g"
622+ set which marks the port as waking up on the magic packet.
623+
624+id: network_manager/ethernet/wakes_up_with_wol
625+category_id: network_manager
626+plugin: manual
627+_summary: Wake on LAN configured by NetworkManager can wake up the device
628+_purpose:
629+ Check that another system can wake up from S5 the SUT using the connected ethernet port.
630+_steps:
631+ 1. Ensure there is an ethernet cable attached to one of the ports and it's configured via
632+ NetworkManager. Check with
633+ $ network-manager.nmcli d | grep eth0
634+ 2. Note the MAC address of the the eth0 port
635+ $ ifconfig eth0
636+ 3. Power off the system by running
637+ $ sudo poweroff
638+ 4. From another computer on the same network run the following command:
639+ $ wakeonlan {mac}
640+ If wakeonlan tool is not installed run:
641+ $ sudo apt install wakeonlan
642+_verification:
643+ Did the SUT wake up from S5?
644diff --git a/pulseaudio/manage.py b/pulseaudio/manage.py
645new file mode 100755
646index 0000000..5e7f5ce
647--- /dev/null
648+++ b/pulseaudio/manage.py
649@@ -0,0 +1,10 @@
650+#!/usr/bin/env python3
651+from plainbox.provider_manager import setup, N_
652+
653+setup(
654+ name='plainbox-provider-pulseaudio',
655+ namespace='2016.com.canonical.pulseaudio',
656+ version="1.0",
657+ description=N_("Plainbox provider for the PulseAudio snap"),
658+ gettext_domain="2016_com_canonical_pulseaudio",
659+)
660diff --git a/pulseaudio/units/pulseaudio.pxu b/pulseaudio/units/pulseaudio.pxu
661new file mode 100644
662index 0000000..3b304e7
663--- /dev/null
664+++ b/pulseaudio/units/pulseaudio.pxu
665@@ -0,0 +1,80 @@
666+# Copyright 2016 Canonical Ltd.
667+# All rights reserved.
668+#
669+# Written by:
670+# Konrad Zapalowicz <konrad.zapalowicz@canonical.com>
671+
672+unit: category
673+id: pulseaudio
674+_name: PulseAudio
675+
676+id: pulseaudio/setup/ensure_interface_connection_setup
677+category_id: pulseaudio
678+_description: Ensure that the pulseaudio interface is auto-connected
679+plugin: manual
680+_steps:
681+ 1. List the interfaces
682+ .
683+ $ snap interfaces
684+ .
685+_verification:
686+ Verify that you see the following:
687+ pulseaudio:service pulseaudio:client
688+
689+id: pulseaudio/pactl/ensure-modules-are-listed
690+category_id: pulseaudio
691+_description: Ensure that the correct modules are loaded
692+plugin: manual
693+depends: pulseaudio/setup/ensure_interface_connection_setup
694+_steps:
695+ 1. List the loaded modules
696+ .
697+ $ pactl list short
698+ .
699+_verification:
700+ Verify that you see output similar to following:
701+ 0 module-device-restore
702+ 1 module-stream-restore
703+ 2 module-card-restore
704+ 3 module-augment-properties
705+ 4 module-switch-on-port-available
706+ 5 module-udev-detect
707+ ...
708+ 80 protocol-native.c pactl
709+ 0 alsa_card.pci-0000_00_1b.0 module-alsa-card.c
710+ .
711+ Verify that amongs the other the following modules are listed:
712+ module-device-restore
713+ module-stream-restore
714+ module-card-restore
715+ module-switch-on-port-available
716+ module-rescue-streams
717+ module-always-sink
718+
719+id: pulseaudio/parecord/ensure-audio-can-be-recorded
720+category_id: pulseaudio
721+_description: Ensure that it is possible to record audio
722+plugin: manual
723+depends: pulseaudio/setup/ensure_interface_connection_setup
724+_steps:
725+ 1. Record an audio .wav file
726+ .
727+ $ parecord ~/record.wav
728+ .
729+_verification:
730+ Verify that the record.wav file has been created and it's size is
731+ greater than zero. Verify that the recorded file can be played and
732+ it is possible to hear the audio.
733+
734+id: pulseaudio/paplay/ensure-audio-can-be-played
735+category_id: pulseaudio
736+_description: Ensure that it is possible to play auio files
737+plugin: manual
738+depends: pulseaudio/setup/ensure_interface_connection_setup
739+_steps:
740+ 1. Play an audio .wav file
741+ .
742+ $ paplay ~/file.wav
743+ .
744+_verification:
745+ Verify that the audio is hearable through the speakers.
746diff --git a/snapcraft.yaml b/snapcraft.yaml
747index af4f8c5..f7599e4 100644
748--- a/snapcraft.yaml
749+++ b/snapcraft.yaml
750@@ -21,8 +21,8 @@ apps:
751 command: bin/run-network-manager-tests
752 modem-manager:
753 command: bin/run-modem-manager-tests
754- tpm1-2:
755- command: bin/run-tpm1.2-tests
756+ tpm:
757+ command: bin/run-tpm-tests
758 wifi-ap:
759 command: bin/run-wifi-ap-tests
760 wireless-tools:
761@@ -47,9 +47,33 @@ parts:
762 - libxslt1-dev
763 - zlib1g-dev
764 - build-essential
765- se-plainbox-provider:
766+ bluez:
767+ plugin: plainbox-provider
768+ source: ./bluez
769+ after: [plainbox-local]
770+ modem-manager:
771+ plugin: plainbox-provider
772+ source: ./modem-manager
773+ after: [plainbox-local]
774+ network-manager:
775+ plugin: plainbox-provider
776+ source: ./network-manager
777+ after: [plainbox-local]
778+ pulseaudio:
779+ plugin: plainbox-provider
780+ source: ./pulseaudio
781+ after: [plainbox-local]
782+ tpm:
783+ plugin: plainbox-provider
784+ source: ./tpm
785+ after: [plainbox-local]
786+ wifi-ap:
787+ plugin: plainbox-provider
788+ source: ./wifi-ap
789+ after: [plainbox-local]
790+ wireless-tools:
791 plugin: plainbox-provider
792- source: ./tests
793+ source: ./wireless-tools
794 after: [plainbox-local]
795 launchers:
796 plugin: dump
797diff --git a/tests/manage.py b/tests/manage.py
798deleted file mode 100755
799index d60bca0..0000000
800--- a/tests/manage.py
801+++ /dev/null
802@@ -1,11 +0,0 @@
803-#!/usr/bin/env python3
804-from plainbox.provider_manager import setup, N_
805-
806-
807-setup(
808- name='plainbox-provider-system-enablement',
809- namespace='2016.com.canonical.system-enablement',
810- version="1.0",
811- description=N_("Plainbox provider for the System Enablement team"),
812- gettext_domain="2016_com_canonical_system_enablement",
813-)
814diff --git a/tests/units/bluez.pxu b/tests/units/bluez.pxu
815deleted file mode 100644
816index 682bb31..0000000
817--- a/tests/units/bluez.pxu
818+++ /dev/null
819@@ -1,155 +0,0 @@
820-# Copyright 2016 Canonical Ltd.
821-# All rights reserved.
822-#
823-# Written by:
824-# Jim Hodapp <jim.hodapp@canonical.com>
825-
826-unit: category
827-id: bluez
828-_name: Bluez
829-
830-id: bluez/setup/ensure_interface_connection_setup
831-category_id: bluez
832-_description: Ensure that the bluez interface is connected
833-plugin: manual
834-_steps:
835- 1. Connect required bluez slot/plug
836- .
837- $ sudo snap connect bluez:client bluez:service
838- .
839-_verification:
840- Verify that you see the following when running snap interfaces bluez:
841- bluez:service bluez:client
842-
843-id: bluez/scan/get_all
844-category_id: bluez
845-plugin: manual
846-depends: bluez/setup/ensure_interface_connection_setup
847-_summary: All Bluetooth devices in range are listed
848-_purpose:
849- Check if all powered on devices that are within range as listed.
850-_steps:
851- 1. Execute the following command to retrieve the list of all Bluetooth devices:
852- .
853- $ /snap/bin/bluez.bluetoothctl
854- [bluetooth]# scan on
855- .
856-_verification:
857- Your expected Bluetooth device(s) is/are shown in the output list such as:
858- [NEW] Device 04:52:C7:0D:0C:03 QC 35s
859-
860-id: bluez/connection/pair_and_connect
861-category_id: bluez
862-plugin: manual
863-depends: bluez/setup/ensure_interface_connection_setup
864-_summary: A Bluetooth device of choice is paired and connected
865-_purpose:
866- Check if your Bluetooth device of choice can be paired to the host system.
867-_steps:
868- 1. Execute the following command to pair and connect your device to the host
869- system using the address listed in the previous scan test:
870- .
871- [bluetooth]# pair <device_address>
872- [bluetooth]# connect <device_address>
873- .
874-_verification:
875- You should see output similar to the following:
876- Attempting to pair with 04:52:C7:0D:0C:03
877- [CHG] Device 04:52:C7:0D:0C:03 Connected: yes
878- [CHG] Device 04:52:C7:0D:0C:03 Modalias: bluetooth:v009Ep400Cd0106
879- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00000000-deca-fade-deca-deafdecacaff
880- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
881- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
882- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
883- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
884- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
885- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
886- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
887- [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: yes
888- [CHG] Device 04:52:C7:0D:0C:03 Paired: yes
889- Pairing successful
890- [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: no
891- [CHG] Device 04:52:C7:0D:0C:03 Connected: no
892- Attempting to connect to 04:52:C7:0D:0C:03
893- [CHG] Device 04:52:C7:0D:0C:03 Connected: yes
894- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00000000-deca-fade-deca-deafdecacaff
895- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001101-0000-1000-8000-00805f9b34fb
896- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001108-0000-1000-8000-00805f9b34fb
897- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110b-0000-1000-8000-00805f9b34fb
898- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110c-0000-1000-8000-00805f9b34fb
899- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000110e-0000-1000-8000-00805f9b34fb
900- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000111e-0000-1000-8000-00805f9b34fb
901- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 0000112f-0000-1000-8000-00805f9b34fb
902- [CHG] Device 04:52:C7:0D:0C:03 UUIDs: 00001200-0000-1000-8000-00805f9b34fb
903- Connection successful
904- [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: yes
905-
906-id: bluez/audio/a2dp_ubuntu_classic
907-category_id: bluez
908-plugin: manual
909-depends: bluez/connection/pair_and_connect
910-_summary: Stream audio to Bluetooth headset
911-_purpose:
912- Verify that you can stream music to a Bluetooth headset via A2DP on Ubuntu
913- Classic. Note: Skip this test if not running Ubuntu Classic.
914-_steps:
915- 1. Follow the previous tests to list, pair and connect your headset.
916- Navigate to the Sound panel in System Settings, select your headset device
917- in the Output tab, and make sure that Mode is set to A2DP. Then press the
918- Test Sound button and test each speaker.
919-_verification:
920- Verify that you can hear the test sound "Front left", "Front right" in each
921- speaker respectively.
922-
923-id: bluez/audio/a2dp_disconnect
924-category_id: bluez
925-plugin: manual
926-depends: bluez/audio/a2dp_ubuntu_classic
927-_summary: Disconnect Bluetooth headset
928-_purpose:
929- Verify that you can disconnect Bluetooth headset while streaming and audio
930- playback switches back to the device's primary speaker.
931-_steps:
932- 1. Follow the previous tests to start streaming audio to the headset via
933- A2DP. Then execute the following command to disconnect the headset from
934- active A2DP streaming:
935- .
936- [<device_name>]# disconnect <device_address>
937-_verification:
938- Verify that you see output similar to the following:
939- Attempting to disconnect from 04:52:C7:0D:0C:03
940- [CHG] Device 04:52:C7:0D:0C:03 ServicesResolved: no
941- Successful disconnected
942- [CHG] Device 04:52:C7:0D:0C:03 Connected: no
943- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Key: 0x0110
944- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x40
945- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x0c
946- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x02
947- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x41
948- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x00
949- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x61
950- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x71
951- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0xcd
952- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x92
953- [CHG] Device 04:52:C7:0D:0C:03 ManufacturerData Value: 0x6c
954-
955-id: bluez/connection/pair_and_connect_hid
956-category_id: bluez
957-plugin: manual
958-depends: bluez/setup/ensure_interface_connection_setup
959-_summary: A Bluetooth HID device (e.g. keyboard, mouse) is connected and paired
960-_purpose:
961- Check if your Bluetooth HID device of choice (e.g. keyboard, mouse) can be
962- paired to the host system.
963-_steps:
964- 1. Execute the following command to pair and connect your HID device to the
965- host system:
966- .
967- [bluetooth]# scan on
968- [bluetooth]# pair <device_address>
969- [bluetooth]# connect <device_address>
970- .
971-_verification:
972- Open a text editor and make sure you can type text from the HID keyboard
973- into the text box. If testing a mouse, ensure that the cursor moves when
974- moving your HID mouse.
975diff --git a/tests/units/modem-manager.pxu b/tests/units/modem-manager.pxu
976deleted file mode 100644
977index 02da607..0000000
978--- a/tests/units/modem-manager.pxu
979+++ /dev/null
980@@ -1,79 +0,0 @@
981-# Copyright 2016 Canonical Ltd.
982-# All rights reserved.
983-#
984-# Written by:
985-# Jim Hodapp <jim.hodapp@canonical.com>
986-
987-unit: category
988-id: modem_manager
989-_name: Modem Manager
990-
991-id: modem_manager/setup/ensure_interface_connection_setup
992-category_id: modem_manager
993-_description: Ensure that the modem-manager interface is connected
994-plugin: manual
995-_steps:
996- 1. Connect required modem-manager slot/plug
997- .
998- $ sudo snap connect modem-manager:mmcli modem-manager:service
999- $ sudo snap connect network-manager:nmcli network-manager:service
1000- $ sudo snap connect network-manager:modem-manager modem-manager:service
1001- $ sudo snap connect network-manager:ppp ubuntu-core:ppp
1002- .
1003-_verification:
1004- Verify that you see the following when running snap interfaces:
1005- modem-manager:service modem-manager:mmcli,network-manager:modem-manager
1006- network-manager:service network-manager:nmcli
1007- :ppp network-manager
1008-
1009-id: modem_manager/modems/get_all
1010-category_id: modem_manager
1011-plugin: manual
1012-depends: modem_manager/setup/ensure_interface_connection_setup
1013-_summary: All active modem configuration items are listed
1014-_purpose:
1015- Check if the modem shows up as being recognized by modem-manager.
1016-_steps:
1017- 1. Execute the following command to retrieve the list of all detected modems:
1018- .
1019- $ /snap/bin/modem-manager.mmcli -L
1020-_verification:
1021- Your expected modem is shown in the output list.
1022-
1023-id: modem_manager/modems/get_info
1024-category_id: modem_manager
1025-plugin: manual
1026-depends: modem_manager/setup/ensure_interface_connection_setup
1027-_summary: All modem information listed
1028-_purpose:
1029- Check if the modem details can be listed.
1030-_steps:
1031- 1. Execute the following command to retrieve the list of all detected modems.
1032- Note, the modem number is listed from the previous test:
1033- .
1034- $ /snap/bin/modem-manager.mmcli -m <modem_number>
1035-_verification:
1036- Your desired modem detail is listed.
1037-
1038-id: modem_manager/modems/connect
1039-category_id: modem_manager
1040-plugin: manual
1041-depends: modem_manager/setup/ensure_interface_connection_setup
1042-_summary: Connect to a listed modem
1043-_purpose:
1044- Connect to a listed modem and verify connection status
1045-_steps:
1046- 1. Execute the following commands to connect to a particular modem.
1047- Note, replace <interface> with something like "ttyACM3" (look in /dev).
1048- You may also find it as the primary port when issuing the command:
1049- /snap/bin/network-manager.nmcli -m <modem_number>
1050- Also, replace <op_apn> by looking up the APN string for your cell provider
1051- at http://www.apn-settings.com (e.g. "fast.t-mobile.com" for T-Mobile 4G).
1052- Finally, not that "gsmconn" is an arbitrary connection name and can be set
1053- to anything that makes sense for the connection type.
1054- .
1055- $ /snap/bin/network-manager.nmcli c add type gsm ifname <interface> con-name
1056- gsmconn apn <op_apn>
1057- $ /snap/bin/network-manager.nmcli r wwan on
1058-_verification:
1059- Verify that you have a modem connection by pinging www.ubuntu.com.
1060diff --git a/tests/units/network-manager.pxu b/tests/units/network-manager.pxu
1061deleted file mode 100644
1062index 6921aa7..0000000
1063--- a/tests/units/network-manager.pxu
1064+++ /dev/null
1065@@ -1,255 +0,0 @@
1066-# Copyright 2016 Canonical Ltd.
1067-# All rights reserved.
1068-#
1069-# Written by:
1070-# Lorn Potter <lorn.potter@canonical.com>
1071-# Simon Fels <simon.fels@canonical.com>
1072-
1073-unit: category
1074-id: network_manager
1075-_name: Network Manager
1076-
1077-id: network_manager/ethernet/all_ports_detected
1078-category_id: network_manager
1079-plugin: manual
1080-_summary: NetworkManager should detect all available ethernet ports
1081-_purpose:
1082- NetworkManager should detect all available ethernet ports by default
1083- on a system and list them as usable devices.
1084-_steps:
1085- 1. List all available ethernet ports
1086- $ ifconfig -a | grep -E '$eth'
1087- $ ifconfig -a | grep -E '$en'
1088- 2. List all ethernet ports NetworkManager knows about
1089- $ network-manager.nmcli d
1090-_verification:
1091- Both steps should show the same list of ethernet network interfaces.
1092-
1093-id: network_manager/ethernet/auto_connected
1094-category_id: network_manager
1095-plugin: manual
1096-_summary: NetworkManager should auto-connect any ethernet port with a link
1097-_purpose:
1098- When a cable is plugged into an ethernet port NetworkManager should try
1099- to automatically connect the port.
1100- .
1101- NOTE: This test assumes that the cable you plug into the port is connected
1102- to a network which offers a DHCP server.
1103-_steps:
1104- 1. Ensure that there is no connection for the port you want to use for
1105- testing. Using a serial console to perform this test is recommended.
1106- 2. Drop any existing connections listed by
1107- $ network-manager.nmcli c show
1108- which are meant for the ethernet port of the device with
1109- $ network-manager.nmcli c delete <UUID>
1110- 3. Plug the cable into the ethernet port.
1111-_verification:
1112- The ethernet port should be automatically connected by NetworkManager. This
1113- can be verified with
1114- $ network-manager.nmcli d | grep <ethernet device name>
1115- eth0 ethernet connected <connection name>
1116- Please note that the <connection name> can be different as its
1117- automatically selected by NetworkManager. It can be "Wired Connection 1"
1118- for example.
1119-
1120-id: network_manager/ethernet/auto_connect_existing_connection
1121-category_id: network_manager
1122-plugin: manual
1123-_summary: Cable plug/unplug should give an existing connection
1124-_purpose:
1125- When a cable is unplugged and plugged again the ethernet port should
1126- be automatically reconnected.
1127-_steps:
1128- 1. Check if the ethernet port is currently connected
1129- $ network-manager.nmcli d
1130- 2. Unplug the cable from the ethernet port and check the connection
1131- $ network-manager.nmcli d
1132- 3. Plug the cable again and check the connection status.
1133-_verification:
1134- Before the cable is unplugged the ethernet port should be marked
1135- as connected. Once the cable is removed the connection status
1136- should switch to unconnected. When plugged back in, it should be marked
1137- again as connected.
1138-
1139-id: network_manager/ethernet/unmanaged
1140-category_id: network_manager
1141-plugin: manual
1142-depends: network_manager/setup/ensure_interface_connection_setup
1143-_summary: Check if ethernet device is unmanaged.
1144-_purpose:
1145- Check if the ethernet device is not managed by Network Manager.
1146- .
1147- NOTE: This only applies to device where ethernet is not managed by
1148- NetworkManager. Check if /etc/netplan/00-default-nm-renderer.yaml
1149- exists. If it does not, then NetworkManager doesn't touch any
1150- ethernet connection.
1151-_steps:
1152- 1. Execute the following command to retrieve the list of all detected connections.
1153- Note, the AP number is listed from the previous test:
1154- .
1155- $ /snap/bin/network-manager.nmcli d | grep en
1156-_verification:
1157- The network device is listed as 'unmanaged', as an example:
1158- enxb827ebf6b919 ethernet unmanaged --
1159-
1160-id: network_manager/connections/get_all
1161-category_id: network_manager
1162-plugin: manual
1163-depends: network_manager/setup/ensure_interface_connection_setup
1164-_summary: All active AP configuration items are listed
1165-_purpose:
1166- Check if the AP shows up as being recognized by Network Manager.
1167-_steps:
1168- 1. Execute the following command to retrieve the list of all detected connections:
1169- .
1170- $ /snap/bin/network-manager.nmcli d wifi list
1171-_verification:
1172- Your expected AP is shown in the output list for example:
1173- pool1 Infra 6 54 Mbit/s 75 *** WPA2
1174-
1175-id: network_manager/connections/agent
1176-category_id: network_manager
1177-plugin: manual
1178-depends: network_manager/setup/ensure_interface_connection_setup
1179-_summary: Register for secret agent
1180-_purpose:
1181- Register for Network Manager's secret agent and verify status
1182-_steps:
1183- 1. Execute the following command to register secret agent:
1184- .
1185- $ /snap/bin/network-manager.nmcli a
1186-_verification:
1187- Output should be similiar to this:
1188- nmcli successfully registered as a Network Manager's secret agent.
1189- nmcli successfully registered as a polkit agent.
1190-
1191-id: network_manager/connections/connect
1192-category_id: network_manager
1193-plugin: manual
1194-depends: network_manager/setup/ensure_interface_connection_setup
1195-_summary: Connect to a listed AP
1196-_purpose:
1197- Connect to a listed AP and verify connection status
1198-_steps:
1199- 1. Execute the following commands to connect to a particular AP.
1200- .
1201- $ /snap/bin/network-manager.nmcli dev wifi con "yourssid" password "yourpassword"
1202- Note, replace yourssid with the ssid if the AP you will connect to, and replace yourpassword
1203- with the actual password/passphrase.
1204-_verification:
1205- Verify that you have a AP connection by issuing this command:
1206- $ ifconfig | grep -A 2 wl
1207- .
1208- verifying that the interface has an IP address with output similiar to this:
1209- wlp5s0 Link encap:Ethernet HWaddr 70:77:81:33:92:6b
1210- inet addr:10.0.0.108 Bcast:10.0.0.255 Mask:255.255.255.0
1211- inet6 addr: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64 Scope:Global
1212-
1213-id: network_manager/connections/get_info
1214-category_id: network_manager
1215-plugin: manual
1216-depends: network_manager/setup/ensure_interface_connection_setup
1217-_summary: All AP information listed
1218-_purpose:
1219- Check if the AP details can be listed.
1220-_steps:
1221- 1. Execute the following command to retrieve the list of all detected connections.
1222- Note, the AP ssid is listed from the previous test:
1223- .
1224- $ /snap/bin/network-manager.nmcli -p -f general,ip4,ip6 c show <AP_SSID>
1225-_verification:
1226- Your desired AP detail is listed and has ip4/ip6 address.
1227- ===============================================================================
1228- Activate connection details (1554e3b2-76e6-4adc-b986-215b7393f8d9)
1229- ===============================================================================
1230- GENERAL.NAME: pool1
1231- GENERAL.UUID: 1554e3b2-76e6-4adc-b986-215b7393f8d9
1232- GENERAL.DEVICES: wlp5s0
1233- GENERAL.STATE: activated
1234- GENERAL.DEFAULT: no
1235- GENERAL.DEFAULT6: no
1236- GENERAL.VPN: no
1237- GENERAL.ZONE: --
1238- GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2
1239- GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/3
1240- GENERAL.SPEC-OBJECT: /org/freedesktop/NetworkManager/AccessPoint/0
1241- GENERAL.MASTER-PATH: --
1242- -------------------------------------------------------------------------------
1243- IP4.ADDRESS[1]: 10.0.0.108/24
1244- IP4.GATEWAY: 10.0.0.138
1245- IP4.DNS[1]: 10.0.0.138
1246- IP4.DOMAIN[1]: gateway
1247- -------------------------------------------------------------------------------
1248- IP6.ADDRESS[1]: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64
1249- IP6.ADDRESS[2]: 2001:8003:6501:2000:7277:81ff:fe33:926b/64
1250- IP6.ADDRESS[3]: fe80::7277:81ff:fe33:926b/64
1251- IP6.GATEWAY: fe80::e2b9:e5ff:fe5a:91b0
1252- IP6.DNS[1]: 2001:8003:6501:2000::1
1253- IP6.DOMAIN[1]: gateway
1254- -------------------------------------------------------------------------------
1255-
1256-id: network_manager/ethernet/uses_global_wol
1257-category_id: network_manager
1258-plugin: manual
1259-_summary: Ethernet connections are using global wake-on-lan setting
1260-_purpose:
1261- Check if an ethernet connection created by NetworkManager automatically uses the
1262- global default for wake-on-lan.
1263- .
1264- NOTE: This requires a system which is configured to not use netplan to
1265- generate connections for NetworkManager. On such a system an ethernet
1266- connection will always have wake-on-lan disabled as netplan does this
1267- by default if not explicitly stated in the netplan configuration.
1268-_steps:
1269- 1. Find connection UUID for the ethernet port
1270- $ network-manager.nmcli c show | grep eth0
1271- 2. Verify the connection uses the global wake-on-lan setting
1272- $ network-manager.nmcli -m multiline -f 802-3-ethernet.wake-on-lan c show <UUID>
1273-_verification:
1274- The output should look like this:
1275- .
1276- 802-3-ethernet.wake-on-lan: 1 (default)
1277-
1278-id: network_manager/ethernet/has_wol_enabled_by_default
1279-category_id: network_manager
1280-plugin: manual
1281-_summary: Ethernet port has wake-on-lan enabled by default
1282-_purpose:
1283- Check if the actual ethernet device has wake-on-lan correctly enabled when
1284- its connection is maintained by NetworkManager.
1285-_steps:
1286- 1. Install the se-test-tools snap
1287- $ snap install --devmode --edge se-test-tools
1288- 2. Check the ethernet port for the wake-on-lan setting (eth0 in this case)
1289- $ sudo se-test-tools.ethtool eth0
1290-_verification:
1291- The output should be similar to this:
1292- Settings for eth0:
1293- [...]
1294- Supports Wake-on: pumbg
1295- Wake-on: g
1296- [...]
1297- .
1298- The relevant line is the "Wake-on:" one. It should have the value "g"
1299- set which marks the port as waking up on the magic packet.
1300-
1301-id: network_manager/ethernet/wakes_up_with_wol
1302-category_id: network_manager
1303-plugin: manual
1304-_summary: Wake on LAN configured by NetworkManager can wake up the device
1305-_purpose:
1306- Check that another system can wake up from S5 the SUT using the connected ethernet port.
1307-_steps:
1308- 1. Ensure there is an ethernet cable attached to one of the ports and it's configured via
1309- NetworkManager. Check with
1310- $ network-manager.nmcli d | grep eth0
1311- 2. Note the MAC address of the the eth0 port
1312- $ ifconfig eth0
1313- 3. Power off the system by running
1314- $ sudo poweroff
1315- 4. From another computer on the same network run the following command:
1316- $ wakeonlan {mac}
1317- If wakeonlan tool is not installed run:
1318- $ sudo apt install wakeonlan
1319-_verification:
1320- Did the SUT wake up from S5?
1321diff --git a/tests/units/pulseaudio.pxu b/tests/units/pulseaudio.pxu
1322deleted file mode 100644
1323index aeb81ab..0000000
1324--- a/tests/units/pulseaudio.pxu
1325+++ /dev/null
1326@@ -1,80 +0,0 @@
1327-# Copyright 2016 Canonical Ltd.
1328-# All rights reserved.
1329-#
1330-# Written by:
1331-# Konrad Zapalowicz <konrad.zapalowicz@canonical.com>
1332-
1333-unit: category
1334-id: pulseaudio
1335-_name: PulseAudio
1336-
1337-id: pulseaudio/setup/ensure_interface_connection_setup
1338-category_id: pulseaudio
1339-_description: Ensure that the pulseaudio interface is auto-connected
1340-plugin: manual
1341-_steps:
1342- 1. List the interfaces
1343- .
1344- $ snap interfaces
1345- .
1346-_verification:
1347- Verify that you see the following:
1348- pulseaudio:service pulseaudio:client
1349-
1350-id: pulseaudio/pactl/ensure-modules-are-listed
1351-category_id: pulseaudio
1352-_description: Ensure that the correct modules are loaded
1353-plugin: manual
1354-depends: pulseaudio/setup/ensure_interface_connection_setup
1355-_steps:
1356- 1. List the loaded modules
1357- .
1358- $ pactl list short
1359- .
1360-_verification:
1361- Verify that you see output similar to following:
1362- 0 module-device-restore
1363- 1 module-stream-restore
1364- 2 module-card-restore
1365- 3 module-augment-properties
1366- 4 module-switch-on-port-available
1367- 5 module-udev-detect
1368- ...
1369- 80 protocol-native.c pactl
1370- 0 alsa_card.pci-0000_00_1b.0 module-alsa-card.c
1371-
1372- Verify that amongs the other the following modules are listed:
1373- module-device-restore
1374- module-stream-restore
1375- module-card-restore
1376- module-switch-on-port-available
1377- module-rescue-streams
1378- module-always-sink
1379-
1380-id: pulseaudio/parecord/ensure-audio-can-be-recorded
1381-category_id: pulseaudio
1382-_description: Ensure that it is possible to record audio
1383-plugin: manual
1384-depends: pulseaudio/setup/ensure_interface_connection_setup
1385-_steps:
1386- 1. Record an audio .wav file
1387- .
1388- $ parecord ~/record.wav
1389- .
1390-_verification:
1391- Verify that the record.wav file has been created and it's size is
1392- greater than zero. Verify that the recorded file can be played and
1393- it is possible to hear the audio.
1394-
1395-id: pulseaudio/paplay/ensure-audio-can-be-played
1396-category_id: pulseaudio
1397-_description: Ensure that it is possible to play auio files
1398-plugin: manual
1399-depends: pulseaudio/setup/ensure_interface_connection_setup
1400-_steps:
1401- 1. Play an audio .wav file
1402- .
1403- $ paplay ~/file.wav
1404- .
1405-_verification:
1406- Verify that the audio is hearable through the speakers.
1407diff --git a/tests/units/tpm1.2.pxu b/tests/units/tpm1.2.pxu
1408deleted file mode 100644
1409index c5c18b8..0000000
1410--- a/tests/units/tpm1.2.pxu
1411+++ /dev/null
1412@@ -1,136 +0,0 @@
1413-# Copyright 2016 Canonical Ltd.
1414-# All rights reserved.
1415-#
1416-# Written by:
1417-# Scott Sweeny <scott.sweeny@canonical.com>
1418-
1419-unit: category
1420-id: tpm1.2
1421-_name: TPM 1.2
1422-
1423-id: tpm1.2/setup/ensure_interface_connection_setup
1424-category_id: tpm1.2
1425-_description: Ensure that the tpm1.2 interfaces are connected
1426-plugin: manual
1427-_steps:
1428- 1. Connect required tpm1.2 slots/plugs
1429- .
1430- $ sudo snap connect tpm:network ubuntu-core:network
1431- $ sudo snap connect tpm:network-bind ubuntu-core:network-bind
1432- $ sudo snap connect tpm:tpm ubuntu-core:tpm
1433- .
1434-_verification:
1435- Verify that you see the following when running snap interfaces:
1436- :network tpm
1437- :network-bind tpm
1438- :tpm tpm
1439-
1440-id: tpm1.2/setup/get_version
1441-category_id: tpm1.2
1442-plugin: manual
1443-depends: tpm1.2/setup/ensure_interface_connection_setup
1444-_summary: Can get version information from the TPM chip
1445-_purpose:
1446- Check that basic communication with the TPM chip is working and that version
1447- information can be retrieved with the expected command.
1448-_steps:
1449- 1. Execute the following command to show the TPM version:
1450- .
1451- $ /snap/bin/tpm.version
1452-_verification:
1453- Output is similar to below with all fields showing data:
1454- .
1455- �z TPM 1.2 Version Info:
1456- Chip Version: 1.2.5.81
1457- Spec Level: 2
1458- Errata Revision: 3
1459- TPM Vendor ID: WEC
1460- Vendor Specific data: 0000
1461- TPM Version: 01010000
1462- Manufacturer Info: 57454300
1463-
1464-id: tpm1.2/setup/self_test
1465-category_id: tpm1.2
1466-plugin: manual
1467-depends: tpm1.2/setup/ensure_interface_connection_setup
1468-_summary: TPM self test runs successfully
1469-_purpose:
1470- Check that the TPM self test runs successfully and returns no errors.
1471-_steps:
1472- 1. Execute the following command to run the TPM self test:
1473- .
1474- $ /snap/bin/tpm.selftest
1475-_verification:
1476- Output is similar to below (actual values are not important) and no
1477- error messages are shown:
1478- .
1479- TPM Test Results:
1480- ff010205 51ffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
1481- ffffffff ffffffff ffffffff ffff0000 00000000 00000000 00000000 00000000
1482- 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000
1483-
1484-
1485-id: tpm1.2/configuration/take_ownership
1486-category_id: tpm1.2
1487-plugin: manual
1488-depends: tpm1.2/setup/ensure_interface_connection_setup
1489-_summary: Taking ownership of the device is possible
1490-_purpose:
1491- Check that you are able to take ownership of the device using TPM commands.
1492-_steps:
1493- 1.Execute the following command to take ownership of the TPM chip:
1494- .
1495- $ /snap/bin/tpm.takeownership
1496- .
1497-_verification:
1498- Verify that you are prompted for both the owner key and the SRK (storage
1499- root key) and that no errors are returned.
1500- .
1501- NOTE: This command will only work if it has not been run before. You can
1502- reset the TPM with:
1503- .
1504- $ /snap/bin/tpm.clear
1505- .
1506- Which will invalidate all existing keys and passwords and disable the chip.
1507- Once this is done you must re-enable the TPM from the device's BIOS before
1508- it can be used.
1509-
1510-id: tpm1.2/crypto/show_public_key
1511-category_id: tpm1.2
1512-plugin: manual
1513-depends: tpm1.2/setup/ensure_interface_connection_setup
1514-_summary: Showing the public endorsement key succeeds
1515-_purpose:
1516- Check to make sure that the endorsement key pair exists and the public key
1517- can be queried.
1518-_steps:
1519- 1. Execute the following command to see the public key:
1520- .
1521- $ /snap/bin/tpm.getpubek
1522- .
1523- You may see an error similar to:
1524- .
1525- Tspi_TPM_GetPubEndorsementKey failed: 0x00000008 - layer=tpm, code=0008 (8), The TPM target command has been disabled
1526- .
1527- This can be safely ignored as long as the public key data is displayed.
1528-_verification:
1529- Verify that the public key data is shown, for example:
1530- .
1531- Public Endorsement Key:
1532- Version: 01010000
1533- Usage: 0x0002 (Unknown)
1534- Flags: 0x00000000 (!VOLATILE, !MIGRATABLE, !REDIRECTION)
1535- AuthUsage: 0x00 (Never)
1536- Algorithm: 0x00000020 (Unknown)
1537- Encryption Scheme: 0x00000012 (Unknown)
1538- Signature Scheme: 0x00000010 (Unknown)
1539- Public Key:
1540- 8b59fad6 83514128 d56e2aa0 5eef7cff ad23c90d 0dd9b1e2 31ef093d 72d947d8
1541- e02fbe3a 3c235ff0 9c487973 40a28c9b 8b83aaaf dc1254ad 31a95410 811742e5
1542- 92c16823 6f663413 f7067d3a 9af09ccc 12944a13 51d32980 59a98740 4008ab0c
1543- 07b7d93b 9393691c 8ae7d84c 5fd4fcef 147934f1 09326225 d5d1b652 ab3e12ee
1544- fbd1cfba b18abedc de2215cb 97006b92 839fd9a4 3158bc8f 028fe516 550905b3
1545- e3eef1e1 9f8dd3ab 331cbe62 d32ce937 0c11ad41 1d2e50f3 c69c7cde cd0bf564
1546- 4b7b16f8 0885dc66 d4411aba a824c1f1 ea8aa743 5c62fad7 e9540b85 5c0dc7af
1547- 3c1615ae 56af18e4 770aa107 06ef274b 202e2e3e d4c280d8 5ca9e886 9d889e31
1548-
1549diff --git a/tests/units/wifi-ap.pxu b/tests/units/wifi-ap.pxu
1550deleted file mode 100644
1551index 78ee075..0000000
1552--- a/tests/units/wifi-ap.pxu
1553+++ /dev/null
1554@@ -1,111 +0,0 @@
1555-# Copyright 2016 Canonical Ltd.
1556-# All rights reserved.
1557-#
1558-# Written by:
1559-# Jim Hodapp <jim.hodapp@canonical.com>
1560-# Simon Fels <simon.fels@canonical.com>
1561-
1562-unit: category
1563-id: wifi_ap
1564-_name: WiFi Access Point
1565-
1566-id: wifi_ap/setup/ensure_interface_connection_setup
1567-category_id: wifi_ap
1568-_description: Ensure that the wifi_ap interfaces are connected
1569-plugin: manual
1570-_steps:
1571- 1. Connect required wifi_ap slots/plugs
1572- .
1573- $ sudo snap connect wifi-ap:firewall-control ubuntu-core:firewall-control
1574- $ sudo snap connect wifi-ap:network-control ubuntu-core:network-control
1575-
1576- For snaps on Classic:
1577- $ sudo snap connect wifi-ap:network-manager ubuntu-core:network-manager
1578-
1579- For full-snap based system (note that you need to install first
1580- network-manager snap in this case):
1581- $ sudo snap install network-manager
1582- $ sudo snap connect wifi-ap:network-manager network-manager:service
1583- .
1584-_verification:
1585- Verify that you see the following when running snap interfaces:
1586- :network-bind wifi-ap
1587- :network-control wifi-ap
1588-
1589- For snaps on Classic:
1590- :network-manager wifi-ap
1591-
1592- For full-snap based system:
1593- network-manager:service wifi-ap:network-manager
1594-
1595-id: wifi_ap/configuration/get_all
1596-category_id: wifi_ap
1597-plugin: manual
1598-depends: wifi_ap/setup/ensure_interface_connection_setup
1599-_summary: All WiFi AP configuration items are listed
1600-_purpose:
1601- Check if the configuration of the WiFi AP can be listed
1602- with the expected command.
1603-_steps:
1604- 1. Execute the following command to retrieve all configuration items:
1605- .
1606- $ /snap/bin/wifi-ap.config get
1607-_verification:
1608- All available configuration items are listed as output.
1609-
1610-id: wifi_ap/configuration/set_any
1611-category_id: wifi_ap
1612-plugin: manual
1613-depends: wifi_ap/setup/ensure_interface_connection_setup
1614-_summary: Setting any configuration key is possible
1615-_purpose:
1616- Check if any configuration key can be set via the
1617- configuration system of the snap.
1618-_steps:
1619- 1. Retrieve the current value of a specific configuration item
1620- e.g. 'wifi.interface'.
1621- .
1622- $ /snap/bin/wifi-ap.config get wifi.interface
1623- .
1624- 2. Set a new value for the same configuration item
1625- .
1626- $ sudo /snap/bin/wifi-ap.config set wifi.interface wlan1
1627- .
1628- 3. Retrieve the current value of the same configuration item
1629- for comparison.
1630- .
1631- $ /snap/bin/wifi-ap.config get wifi.interface
1632-_verification:
1633- Verify that the new value for the configuration is not the same
1634- as before the 'set' operation and is now the the value specified
1635- in step 2.
1636-
1637-id: wifi_ap/connect/enable_ap
1638-category_id: wifi_ap
1639-plugin: manual
1640-depends: wifi_ap/setup/ensure_interface_connection_setup
1641-_summary: Enabling the AP succeeds
1642-_purpose:
1643- Check to make sure the AP can be enabled.
1644-_steps:
1645- 1. Look up and set the wifi interface to the proper name
1646- e.g. from default wlan0 to enp0s3
1647- .
1648- $ ifconfig
1649- $ /snap/bin/wifi-ap.config set wifi.interface <interface_name>
1650- .
1651- 2. Enable the AP with the default configuration for other key values
1652- .
1653- $ sudo /snap/bin/wifi-ap.config set disabled 0
1654- .
1655- 3. Restart the wifi-ap systemd service to complete the enabling
1656- .
1657- $ sudo systemctl restart snap.wifi-ap.backend
1658- .
1659- 4. Verify that the AP is enabled by looking at the key/value pair
1660- .
1661- $ /snap/bin/wifi-ap.config get disabled
1662-_verification:
1663- Verify that the new value for the disabled is set to 0. Also verify that a
1664- different machine such as a phone or a laptop can connect to the AP using
1665- SSID of "Ubuntu" and no security type.
1666diff --git a/tests/units/wireless-tools.pxu b/tests/units/wireless-tools.pxu
1667deleted file mode 100644
1668index 3c59f13..0000000
1669--- a/tests/units/wireless-tools.pxu
1670+++ /dev/null
1671@@ -1,102 +0,0 @@
1672-# Copyright 2016 Canonical Ltd.
1673-# All rights reserved.
1674-#
1675-# Written by:
1676-# Konrad Zapalowicz <konrad.zapalowicz@canonical.com>
1677-
1678-unit: category
1679-id:wireless-tools
1680-_name: Wireless Tools
1681-
1682-id: wireless-tools/setup/ensure_interface_connection_setup
1683-category_id: wireless-tools
1684-_description: Ensure that wireless_tools interfaces are connected
1685-plugin: manual
1686-_steps:
1687- 1. Connect required wireless-tools slots/plugs
1688- .
1689- $ sudo snap connect wireless-tools:network-control :network-control
1690- .
1691-_verification:
1692- Verify that you see the following when running snap interfaces:
1693- :network wireless-tools
1694- :network-bind wireless-tools
1695- :network-control wireless-tools
1696-
1697-id: wireless-tools/rfkill/list
1698-category_id:wireless-tools
1699-plugin: manual
1700-depends: wireless-tools/setup/ensure_interface_connection_setup
1701-_summary: The RF kill switches are listed
1702-_purpose: Check if all RF kill switches that are available on the HW are listed.
1703-_steps:
1704- 1. Execute the following command to retrieve the list of all RF kill switches:
1705- .
1706- $ /snap/bin/wireless-tools.rfkill list
1707- .
1708-_verification:
1709- Your expected RF kill switche(s) is/are shown in the output such as:
1710- <id>: <name>: <description>
1711- Soft blocked: <yes|no>
1712- Hard blocked: <yes|no>
1713-
1714- For example:
1715- 1: phy0: Wireless LAN
1716- Soft blocked: no
1717- Hard blocked: no
1718- 2: hci0: Bluetooth
1719- Soft blocked: yes
1720- Hard blocked: no
1721-
1722-id: wireless-tools/rfkill/change_state
1723-category_id:wireless-tools
1724-plugin: manual
1725-depends: wireless-tools/rfkill/list
1726-_summary: It is possible to change the state of RF kill
1727-_purpose: Check if it is possible to change a state of the RF kill switch
1728-_steps:
1729- 1. Execute the following commands first to list the available RF kill switches
1730- .
1731- $ /snap/bin/wireles-tools.rfkill list
1732- .
1733- 2. Change the state of the selected RF kill switch using the id obtained in
1734- the previous step. Note that the action: block or unblock shall be selected
1735- based on the initial state of the RF kill switch: blocked yes or no.
1736- .
1737- $ /snap/bin/wireless-tools.rfkill [un]block <id>
1738- .
1739-_verification:
1740- There shall be no output on the standard output however there shall be a
1741- change of state visible when listing the RF kill switches.
1742- .
1743- $ /snap/bin/wireless_tools.rfkill list
1744- .
1745-
1746-id: wireless_tools/rfkill/capture_event
1747-category_id: wireless-tools
1748-plugin: manual
1749-depends: wireless-tools/rfkill/list
1750-_summary: It is possible to see the events related to RF kill switch(es)
1751-_purpose: Check if it is possible to capture the event notifications
1752-_steps:
1753- 1. Execute the following command to enter the capture-events mode
1754- .
1755- $ /snap/bin/wireless_tools.rfkill event
1756- .
1757- 2. Change the state of the RF kill switch using a hardware button if
1758- available.
1759-_verification:
1760- The command executed in the step 1 shall block and display the current state
1761- of the RF kill switches in a following form:
1762- <timestamp>: idx <id> type <type id> op <op id> soft <0|1> hard <0|1>
1763- Pressing the hardware RF kill switch should be printed in the following
1764- form as in the above. For example:
1765- 1478774281.491635: idx 0 type 2 op 0 soft 0 hard 0
1766- 1478774281.491762: idx 1 type 1 op 0 soft 0 hard 0
1767- 1478774281.491776: idx 2 type 2 op 0 soft 1 hard 0
1768- 1478774301.905695: idx 2 type 2 op 2 soft 0 hard 0
1769- 1478774307.837112: idx 0 type 2 op 2 soft 1 hard 0
1770- 1478774310.817935: idx 2 type 2 op 2 soft 1 hard 0
1771- 1478774310.818989: idx 2 type 2 op 1 soft 1 hard 0
1772-
1773-
1774diff --git a/tpm/manage.py b/tpm/manage.py
1775new file mode 100755
1776index 0000000..7135842
1777--- /dev/null
1778+++ b/tpm/manage.py
1779@@ -0,0 +1,10 @@
1780+#!/usr/bin/env python3
1781+from plainbox.provider_manager import setup, N_
1782+
1783+setup(
1784+ name='plainbox-provider-tpm',
1785+ namespace='2016.com.canonical.tpm',
1786+ version="1.0",
1787+ description=N_("Plainbox provider for the TPM snap"),
1788+ gettext_domain="2016_com_canonical_tpm",
1789+)
1790diff --git a/tpm/units/tpm.pxu b/tpm/units/tpm.pxu
1791new file mode 100644
1792index 0000000..cbbf256
1793--- /dev/null
1794+++ b/tpm/units/tpm.pxu
1795@@ -0,0 +1,135 @@
1796+# Copyright 2016 Canonical Ltd.
1797+# All rights reserved.
1798+#
1799+# Written by:
1800+# Scott Sweeny <scott.sweeny@canonical.com>
1801+
1802+unit: category
1803+id: tpm1.2
1804+_name: TPM 1.2
1805+
1806+id: tpm1.2/setup/ensure_interface_connection_setup
1807+category_id: tpm1.2
1808+_description: Ensure that the tpm1.2 interfaces are connected
1809+plugin: manual
1810+_steps:
1811+ 1. Connect required tpm1.2 slots/plugs
1812+ .
1813+ $ sudo snap connect tpm:network ubuntu-core:network
1814+ $ sudo snap connect tpm:network-bind ubuntu-core:network-bind
1815+ $ sudo snap connect tpm:tpm ubuntu-core:tpm
1816+ .
1817+_verification:
1818+ Verify that you see the following when running snap interfaces:
1819+ :network tpm
1820+ :network-bind tpm
1821+ :tpm tpm
1822+
1823+id: tpm1.2/setup/get_version
1824+category_id: tpm1.2
1825+plugin: manual
1826+depends: tpm1.2/setup/ensure_interface_connection_setup
1827+_summary: Can get version information from the TPM chip
1828+_purpose:
1829+ Check that basic communication with the TPM chip is working and that version
1830+ information can be retrieved with the expected command.
1831+_steps:
1832+ 1. Execute the following command to show the TPM version:
1833+ .
1834+ $ /snap/bin/tpm.version
1835+_verification:
1836+ Output is similar to below with all fields showing data:
1837+ .
1838+ TPM 1.2 Version Info:
1839+ Chip Version: 1.2.5.81
1840+ Spec Level: 2
1841+ Errata Revision: 3
1842+ TPM Vendor ID: WEC
1843+ Vendor Specific data: 0000
1844+ TPM Version: 01010000
1845+ Manufacturer Info: 57454300
1846+
1847+id: tpm1.2/setup/self_test
1848+category_id: tpm1.2
1849+plugin: manual
1850+depends: tpm1.2/setup/ensure_interface_connection_setup
1851+_summary: TPM self test runs successfully
1852+_purpose:
1853+ Check that the TPM self test runs successfully and returns no errors.
1854+_steps:
1855+ 1. Execute the following command to run the TPM self test:
1856+ .
1857+ $ /snap/bin/tpm.selftest
1858+_verification:
1859+ Output is similar to below (actual values are not important) and no
1860+ error messages are shown:
1861+ .
1862+ TPM Test Results:
1863+ ff010205 51ffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
1864+ ffffffff ffffffff ffffffff ffff0000 00000000 00000000 00000000 00000000
1865+ 00000000 00000000 00000000 00000000 00000000 00000000 00000000 0000
1866+
1867+
1868+id: tpm1.2/configuration/take_ownership
1869+category_id: tpm1.2
1870+plugin: manual
1871+depends: tpm1.2/setup/ensure_interface_connection_setup
1872+_summary: Taking ownership of the device is possible
1873+_purpose:
1874+ Check that you are able to take ownership of the device using TPM commands.
1875+_steps:
1876+ 1.Execute the following command to take ownership of the TPM chip:
1877+ .
1878+ $ /snap/bin/tpm.takeownership
1879+ .
1880+_verification:
1881+ Verify that you are prompted for both the owner key and the SRK (storage
1882+ root key) and that no errors are returned.
1883+ .
1884+ NOTE: This command will only work if it has not been run before. You can
1885+ reset the TPM with:
1886+ .
1887+ $ /snap/bin/tpm.clear
1888+ .
1889+ Which will invalidate all existing keys and passwords and disable the chip.
1890+ Once this is done you must re-enable the TPM from the device's BIOS before
1891+ it can be used.
1892+
1893+id: tpm1.2/crypto/show_public_key
1894+category_id: tpm1.2
1895+plugin: manual
1896+depends: tpm1.2/setup/ensure_interface_connection_setup
1897+_summary: Showing the public endorsement key succeeds
1898+_purpose:
1899+ Check to make sure that the endorsement key pair exists and the public key
1900+ can be queried.
1901+_steps:
1902+ 1. Execute the following command to see the public key:
1903+ .
1904+ $ /snap/bin/tpm.getpubek
1905+ .
1906+ You may see an error similar to:
1907+ .
1908+ Tspi_TPM_GetPubEndorsementKey failed: 0x00000008 - layer=tpm, code=0008 (8), The TPM target command has been disabled
1909+ .
1910+ This can be safely ignored as long as the public key data is displayed.
1911+_verification:
1912+ Verify that the public key data is shown, for example:
1913+ .
1914+ Public Endorsement Key:
1915+ Version: 01010000
1916+ Usage: 0x0002 (Unknown)
1917+ Flags: 0x00000000 (!VOLATILE, !MIGRATABLE, !REDIRECTION)
1918+ AuthUsage: 0x00 (Never)
1919+ Algorithm: 0x00000020 (Unknown)
1920+ Encryption Scheme: 0x00000012 (Unknown)
1921+ Signature Scheme: 0x00000010 (Unknown)
1922+ Public Key:
1923+ 8b59fad6 83514128 d56e2aa0 5eef7cff ad23c90d 0dd9b1e2 31ef093d 72d947d8
1924+ e02fbe3a 3c235ff0 9c487973 40a28c9b 8b83aaaf dc1254ad 31a95410 811742e5
1925+ 92c16823 6f663413 f7067d3a 9af09ccc 12944a13 51d32980 59a98740 4008ab0c
1926+ 07b7d93b 9393691c 8ae7d84c 5fd4fcef 147934f1 09326225 d5d1b652 ab3e12ee
1927+ fbd1cfba b18abedc de2215cb 97006b92 839fd9a4 3158bc8f 028fe516 550905b3
1928+ e3eef1e1 9f8dd3ab 331cbe62 d32ce937 0c11ad41 1d2e50f3 c69c7cde cd0bf564
1929+ 4b7b16f8 0885dc66 d4411aba a824c1f1 ea8aa743 5c62fad7 e9540b85 5c0dc7af
1930+ 3c1615ae 56af18e4 770aa107 06ef274b 202e2e3e d4c280d8 5ca9e886 9d889e31
1931diff --git a/wifi-ap/manage.py b/wifi-ap/manage.py
1932new file mode 100755
1933index 0000000..824585c
1934--- /dev/null
1935+++ b/wifi-ap/manage.py
1936@@ -0,0 +1,10 @@
1937+#!/usr/bin/env python3
1938+from plainbox.provider_manager import setup, N_
1939+
1940+setup(
1941+ name='plainbox-provider-wifi-ap',
1942+ namespace='2016.com.canonical.wifi-ap',
1943+ version="1.0",
1944+ description=N_("Plainbox provider for the WiFi AP snap"),
1945+ gettext_domain="2016_com_canonical_wifi_ap",
1946+)
1947diff --git a/wifi-ap/units/wifi-ap.pxu b/wifi-ap/units/wifi-ap.pxu
1948new file mode 100644
1949index 0000000..ae198ef
1950--- /dev/null
1951+++ b/wifi-ap/units/wifi-ap.pxu
1952@@ -0,0 +1,111 @@
1953+# Copyright 2016 Canonical Ltd.
1954+# All rights reserved.
1955+#
1956+# Written by:
1957+# Jim Hodapp <jim.hodapp@canonical.com>
1958+# Simon Fels <simon.fels@canonical.com>
1959+
1960+unit: category
1961+id: wifi_ap
1962+_name: WiFi Access Point
1963+
1964+id: wifi_ap/setup/ensure_interface_connection_setup
1965+category_id: wifi_ap
1966+_description: Ensure that the wifi_ap interfaces are connected
1967+plugin: manual
1968+_steps:
1969+ 1. Connect required wifi_ap slots/plugs
1970+ .
1971+ $ sudo snap connect wifi-ap:firewall-control ubuntu-core:firewall-control
1972+ $ sudo snap connect wifi-ap:network-control ubuntu-core:network-control
1973+ .
1974+ For snaps on Classic:
1975+ $ sudo snap connect wifi-ap:network-manager ubuntu-core:network-manager
1976+ .
1977+ For full-snap based system (note that you need to install first
1978+ network-manager snap in this case):
1979+ $ sudo snap install network-manager
1980+ $ sudo snap connect wifi-ap:network-manager network-manager:service
1981+ .
1982+_verification:
1983+ Verify that you see the following when running snap interfaces:
1984+ :network-bind wifi-ap
1985+ :network-control wifi-ap
1986+ .
1987+ For snaps on Classic:
1988+ :network-manager wifi-ap
1989+ .
1990+ For full-snap based system:
1991+ network-manager:service wifi-ap:network-manager
1992+
1993+id: wifi_ap/configuration/get_all
1994+category_id: wifi_ap
1995+plugin: manual
1996+depends: wifi_ap/setup/ensure_interface_connection_setup
1997+_summary: All WiFi AP configuration items are listed
1998+_purpose:
1999+ Check if the configuration of the WiFi AP can be listed
2000+ with the expected command.
2001+_steps:
2002+ 1. Execute the following command to retrieve all configuration items:
2003+ .
2004+ $ /snap/bin/wifi-ap.config get
2005+_verification:
2006+ All available configuration items are listed as output.
2007+
2008+id: wifi_ap/configuration/set_any
2009+category_id: wifi_ap
2010+plugin: manual
2011+depends: wifi_ap/setup/ensure_interface_connection_setup
2012+_summary: Setting any configuration key is possible
2013+_purpose:
2014+ Check if any configuration key can be set via the
2015+ configuration system of the snap.
2016+_steps:
2017+ 1. Retrieve the current value of a specific configuration item
2018+ e.g. 'wifi.interface'.
2019+ .
2020+ $ /snap/bin/wifi-ap.config get wifi.interface
2021+ .
2022+ 2. Set a new value for the same configuration item
2023+ .
2024+ $ sudo /snap/bin/wifi-ap.config set wifi.interface wlan1
2025+ .
2026+ 3. Retrieve the current value of the same configuration item
2027+ for comparison.
2028+ .
2029+ $ /snap/bin/wifi-ap.config get wifi.interface
2030+_verification:
2031+ Verify that the new value for the configuration is not the same
2032+ as before the 'set' operation and is now the the value specified
2033+ in step 2.
2034+
2035+id: wifi_ap/connect/enable_ap
2036+category_id: wifi_ap
2037+plugin: manual
2038+depends: wifi_ap/setup/ensure_interface_connection_setup
2039+_summary: Enabling the AP succeeds
2040+_purpose:
2041+ Check to make sure the AP can be enabled.
2042+_steps:
2043+ 1. Look up and set the wifi interface to the proper name
2044+ e.g. from default wlan0 to enp0s3
2045+ .
2046+ $ ifconfig
2047+ $ /snap/bin/wifi-ap.config set wifi.interface <interface_name>
2048+ .
2049+ 2. Enable the AP with the default configuration for other key values
2050+ .
2051+ $ sudo /snap/bin/wifi-ap.config set disabled 0
2052+ .
2053+ 3. Restart the wifi-ap systemd service to complete the enabling
2054+ .
2055+ $ sudo systemctl restart snap.wifi-ap.backend
2056+ .
2057+ 4. Verify that the AP is enabled by looking at the key/value pair
2058+ .
2059+ $ /snap/bin/wifi-ap.config get disabled
2060+_verification:
2061+ Verify that the new value for the disabled is set to 0. Also verify that a
2062+ different machine such as a phone or a laptop can connect to the AP using
2063+ SSID of "Ubuntu" and no security type.
2064diff --git a/wireless-tools/manage.py b/wireless-tools/manage.py
2065new file mode 100755
2066index 0000000..93a5a14
2067--- /dev/null
2068+++ b/wireless-tools/manage.py
2069@@ -0,0 +1,10 @@
2070+#!/usr/bin/env python3
2071+from plainbox.provider_manager import setup, N_
2072+
2073+setup(
2074+ name='plainbox-provider-wireless-tools',
2075+ namespace='2016.com.canonical.wireless-tools',
2076+ version="1.0",
2077+ description=N_("Plainbox provider for the Wireless tools snap"),
2078+ gettext_domain="2016_com_canonical_wireless_tools",
2079+)
2080diff --git a/wireless-tools/units/wireless-tools.pxu b/wireless-tools/units/wireless-tools.pxu
2081new file mode 100644
2082index 0000000..39c070e
2083--- /dev/null
2084+++ b/wireless-tools/units/wireless-tools.pxu
2085@@ -0,0 +1,100 @@
2086+# Copyright 2016 Canonical Ltd.
2087+# All rights reserved.
2088+#
2089+# Written by:
2090+# Konrad Zapalowicz <konrad.zapalowicz@canonical.com>
2091+
2092+unit: category
2093+id:wireless-tools
2094+_name: Wireless Tools
2095+
2096+id: wireless-tools/setup/ensure_interface_connection_setup
2097+category_id: wireless-tools
2098+_description: Ensure that wireless_tools interfaces are connected
2099+plugin: manual
2100+_steps:
2101+ 1. Connect required wireless-tools slots/plugs
2102+ .
2103+ $ sudo snap connect wireless-tools:network-control :network-control
2104+ .
2105+_verification:
2106+ Verify that you see the following when running snap interfaces:
2107+ :network wireless-tools
2108+ :network-bind wireless-tools
2109+ :network-control wireless-tools
2110+
2111+id: wireless-tools/rfkill/list
2112+category_id:wireless-tools
2113+plugin: manual
2114+depends: wireless-tools/setup/ensure_interface_connection_setup
2115+_summary: The RF kill switches are listed
2116+_purpose: Check if all RF kill switches that are available on the HW are listed.
2117+_steps:
2118+ 1. Execute the following command to retrieve the list of all RF kill switches:
2119+ .
2120+ $ /snap/bin/wireless-tools.rfkill list
2121+ .
2122+_verification:
2123+ Your expected RF kill switche(s) is/are shown in the output such as:
2124+ <id>: <name>: <description>
2125+ Soft blocked: <yes|no>
2126+ Hard blocked: <yes|no>
2127+ .
2128+ For example:
2129+ 1: phy0: Wireless LAN
2130+ Soft blocked: no
2131+ Hard blocked: no
2132+ 2: hci0: Bluetooth
2133+ Soft blocked: yes
2134+ Hard blocked: no
2135+
2136+id: wireless-tools/rfkill/change_state
2137+category_id:wireless-tools
2138+plugin: manual
2139+depends: wireless-tools/rfkill/list
2140+_summary: It is possible to change the state of RF kill
2141+_purpose: Check if it is possible to change a state of the RF kill switch
2142+_steps:
2143+ 1. Execute the following commands first to list the available RF kill switches
2144+ .
2145+ $ /snap/bin/wireles-tools.rfkill list
2146+ .
2147+ 2. Change the state of the selected RF kill switch using the id obtained in
2148+ the previous step. Note that the action: block or unblock shall be selected
2149+ based on the initial state of the RF kill switch: blocked yes or no.
2150+ .
2151+ $ /snap/bin/wireless-tools.rfkill [un]block <id>
2152+ .
2153+_verification:
2154+ There shall be no output on the standard output however there shall be a
2155+ change of state visible when listing the RF kill switches.
2156+ .
2157+ $ /snap/bin/wireless_tools.rfkill list
2158+ .
2159+
2160+id: wireless_tools/rfkill/capture_event
2161+category_id: wireless-tools
2162+plugin: manual
2163+depends: wireless-tools/rfkill/list
2164+_summary: It is possible to see the events related to RF kill switch(es)
2165+_purpose: Check if it is possible to capture the event notifications
2166+_steps:
2167+ 1. Execute the following command to enter the capture-events mode
2168+ .
2169+ $ /snap/bin/wireless_tools.rfkill event
2170+ .
2171+ 2. Change the state of the RF kill switch using a hardware button if
2172+ available.
2173+_verification:
2174+ The command executed in the step 1 shall block and display the current state
2175+ of the RF kill switches in a following form:
2176+ <timestamp>: idx <id> type <type id> op <op id> soft <0|1> hard <0|1>
2177+ Pressing the hardware RF kill switch should be printed in the following
2178+ form as in the above. For example:
2179+ 1478774281.491635: idx 0 type 2 op 0 soft 0 hard 0
2180+ 1478774281.491762: idx 1 type 1 op 0 soft 0 hard 0
2181+ 1478774281.491776: idx 2 type 2 op 0 soft 1 hard 0
2182+ 1478774301.905695: idx 2 type 2 op 2 soft 0 hard 0
2183+ 1478774307.837112: idx 0 type 2 op 2 soft 1 hard 0
2184+ 1478774310.817935: idx 2 type 2 op 2 soft 1 hard 0
2185+ 1478774310.818989: idx 2 type 2 op 1 soft 1 hard 0

Subscribers

People subscribed via source and target branches

to all changes: