Merge ~kzapalowicz/snappy-hwe-snaps/+git/engineering-tests:feature/plainbox-wireless-tools into ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master

Proposed by Konrad Zapałowicz
Status: Merged
Approved by: Jim Hodapp
Approved revision: de0ee3a3d22a3e635889639826676a0cd572c59a
Merged at revision: 9caa2f2f8f887ebb22ada9c87ad4281d52f06925
Proposed branch: ~kzapalowicz/snappy-hwe-snaps/+git/engineering-tests:feature/plainbox-wireless-tools
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 132 lines (+109/-0)
3 files modified
bin/run-wireless-tools-tests (+5/-0)
snapcraft.yaml (+2/-0)
tests/units/wireless-tools.pxu (+102/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Needs Fixing
Jim Hodapp (community) Approve
Matteo Croce (community) Approve
Simon Fels Approve
Review via email: mp+310541@code.launchpad.net

This proposal supersedes a proposal from 2016-11-10.

Commit message

Add plainbox tests for wireless-tools.rfkill

This commit adds plainbox tests for wireless-tools snap with focus
on testing the rfkill command from wireless-tools package. There
are four tests defined:
  - Make sure that it is possible to connect plugs and slots
  - Check if rfkill switches are listed
  - Check if it is possible to change state of the rfkill switch
  - Check if it is possible to receive event updates on the state of
    rfkill switches.

Description of the change

Add plainbox tests for wireless-tools focusing on rfkill

To post a comment you must log in.
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Simon Fels (morphis) wrote :

LGTM

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

Please make sure to update the README.md file to mention your wireless-tools-tests.

Just a couple of minor comments inline below.

review: Needs Fixing
Revision history for this message
Jim Hodapp (jhodapp) :
review: Needs Fixing
Revision history for this message
Jim Hodapp (jhodapp) wrote :

LGTM.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/bin/run-wireless-tools-tests b/bin/run-wireless-tools-tests
2new file mode 100755
3index 0000000..29cd139
4--- /dev/null
5+++ b/bin/run-wireless-tools-tests
6@@ -0,0 +1,5 @@
7+#!/bin/sh
8+export PATH="$PATH:$SNAP/usr/sbin"
9+exec python3 $(which plainbox) \
10+ run -i '2016.com.canonical.system-enablement::wireless-tools.*' \
11+ "$@"
12diff --git a/snapcraft.yaml b/snapcraft.yaml
13index a10b07a..079d6ec 100644
14--- a/snapcraft.yaml
15+++ b/snapcraft.yaml
16@@ -25,6 +25,8 @@ apps:
17 command: bin/run-tpm1.2-tests
18 wifi-ap:
19 command: bin/run-wifi-ap-tests
20+ wireless-tools:
21+ command: bin/run-wireless-tools-tests
22
23 parts:
24 common:
25diff --git a/tests/units/wireless-tools.pxu b/tests/units/wireless-tools.pxu
26new file mode 100644
27index 0000000..3c59f13
28--- /dev/null
29+++ b/tests/units/wireless-tools.pxu
30@@ -0,0 +1,102 @@
31+# Copyright 2016 Canonical Ltd.
32+# All rights reserved.
33+#
34+# Written by:
35+# Konrad Zapalowicz <konrad.zapalowicz@canonical.com>
36+
37+unit: category
38+id:wireless-tools
39+_name: Wireless Tools
40+
41+id: wireless-tools/setup/ensure_interface_connection_setup
42+category_id: wireless-tools
43+_description: Ensure that wireless_tools interfaces are connected
44+plugin: manual
45+_steps:
46+ 1. Connect required wireless-tools slots/plugs
47+ .
48+ $ sudo snap connect wireless-tools:network-control :network-control
49+ .
50+_verification:
51+ Verify that you see the following when running snap interfaces:
52+ :network wireless-tools
53+ :network-bind wireless-tools
54+ :network-control wireless-tools
55+
56+id: wireless-tools/rfkill/list
57+category_id:wireless-tools
58+plugin: manual
59+depends: wireless-tools/setup/ensure_interface_connection_setup
60+_summary: The RF kill switches are listed
61+_purpose: Check if all RF kill switches that are available on the HW are listed.
62+_steps:
63+ 1. Execute the following command to retrieve the list of all RF kill switches:
64+ .
65+ $ /snap/bin/wireless-tools.rfkill list
66+ .
67+_verification:
68+ Your expected RF kill switche(s) is/are shown in the output such as:
69+ <id>: <name>: <description>
70+ Soft blocked: <yes|no>
71+ Hard blocked: <yes|no>
72+
73+ For example:
74+ 1: phy0: Wireless LAN
75+ Soft blocked: no
76+ Hard blocked: no
77+ 2: hci0: Bluetooth
78+ Soft blocked: yes
79+ Hard blocked: no
80+
81+id: wireless-tools/rfkill/change_state
82+category_id:wireless-tools
83+plugin: manual
84+depends: wireless-tools/rfkill/list
85+_summary: It is possible to change the state of RF kill
86+_purpose: Check if it is possible to change a state of the RF kill switch
87+_steps:
88+ 1. Execute the following commands first to list the available RF kill switches
89+ .
90+ $ /snap/bin/wireles-tools.rfkill list
91+ .
92+ 2. Change the state of the selected RF kill switch using the id obtained in
93+ the previous step. Note that the action: block or unblock shall be selected
94+ based on the initial state of the RF kill switch: blocked yes or no.
95+ .
96+ $ /snap/bin/wireless-tools.rfkill [un]block <id>
97+ .
98+_verification:
99+ There shall be no output on the standard output however there shall be a
100+ change of state visible when listing the RF kill switches.
101+ .
102+ $ /snap/bin/wireless_tools.rfkill list
103+ .
104+
105+id: wireless_tools/rfkill/capture_event
106+category_id: wireless-tools
107+plugin: manual
108+depends: wireless-tools/rfkill/list
109+_summary: It is possible to see the events related to RF kill switch(es)
110+_purpose: Check if it is possible to capture the event notifications
111+_steps:
112+ 1. Execute the following command to enter the capture-events mode
113+ .
114+ $ /snap/bin/wireless_tools.rfkill event
115+ .
116+ 2. Change the state of the RF kill switch using a hardware button if
117+ available.
118+_verification:
119+ The command executed in the step 1 shall block and display the current state
120+ of the RF kill switches in a following form:
121+ <timestamp>: idx <id> type <type id> op <op id> soft <0|1> hard <0|1>
122+ Pressing the hardware RF kill switch should be printed in the following
123+ form as in the above. For example:
124+ 1478774281.491635: idx 0 type 2 op 0 soft 0 hard 0
125+ 1478774281.491762: idx 1 type 1 op 0 soft 0 hard 0
126+ 1478774281.491776: idx 2 type 2 op 0 soft 1 hard 0
127+ 1478774301.905695: idx 2 type 2 op 2 soft 0 hard 0
128+ 1478774307.837112: idx 0 type 2 op 2 soft 1 hard 0
129+ 1478774310.817935: idx 2 type 2 op 2 soft 1 hard 0
130+ 1478774310.818989: idx 2 type 2 op 1 soft 1 hard 0
131+
132+

Subscribers

People subscribed via source and target branches