Merge ~lorn-potter/snappy-hwe-snaps/+git/engineering-tests:nm into ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master

Proposed by Lorn Potter
Status: Merged
Approved by: Jim Hodapp
Approved revision: e8e193d8e683c8f03d0109f415602b10df44f7f5
Merged at revision: 1f9a0dc2622b9cceca56fcc0428e2c8810e22e75
Proposed branch: ~lorn-potter/snappy-hwe-snaps/+git/engineering-tests:nm
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 178 lines (+144/-0)
4 files modified
README.md (+1/-0)
bin/run-network-manager-tests (+5/-0)
snapcraft.yaml (+2/-0)
tests/units/network-manager.pxu (+136/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Needs Fixing
Jim Hodapp (community) Approve
Simon Fels Needs Fixing
Review via email: mp+306567@code.launchpad.net

Description of the change

Add network-manager tests

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
Simon Fels (morphis) wrote :

See comments inline

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

Please update README.md as appropriate for this test to fit in with the other ones.

review: Needs Fixing (code)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
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)
Revision history for this message
Jim Hodapp (jhodapp) wrote :

Make sure that "network manager", "network-manager" and "Network Manager" are all used consistently. Also see 1 change inline below.

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

2 more changes inline below

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
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/README.md b/README.md
2index b7048a4..7afbeaf 100644
3--- a/README.md
4+++ b/README.md
5@@ -34,6 +34,7 @@ categories related to the command's name.
6 $ /snap/bin/canonical-se-engineering-tests.modem-manager
7 $ /snap/bin/canonical-se-engineering-tests.wifi-ap
8 $ /snap/bin/canonical-se-engineering-tests.tpm1-2
9+ $ /snap/bin/canonical-se-engineering-tests.network-manager
10
11 ## How can I contribute new tests?
12
13diff --git a/bin/run-network-manager-tests b/bin/run-network-manager-tests
14new file mode 100755
15index 0000000..9d76ecb
16--- /dev/null
17+++ b/bin/run-network-manager-tests
18@@ -0,0 +1,5 @@
19+#!/bin/sh
20+export PATH="$PATH:$SNAP/usr/sbin"
21+exec python3 $(which plainbox) \
22+ run -i '2016.com.canonical.system-enablement::network_manager.*' \
23+ "$@"
24diff --git a/snapcraft.yaml b/snapcraft.yaml
25index 7c6eac9..9bd3dca 100644
26--- a/snapcraft.yaml
27+++ b/snapcraft.yaml
28@@ -20,6 +20,8 @@ apps:
29 command: bin/run-modem-manager-tests
30 tpm1-2:
31 command: bin/run-tpm1.2-tests
32+ network-manager:
33+ command: bin/run-network-manager-tests
34
35 parts:
36 common:
37diff --git a/tests/units/network-manager.pxu b/tests/units/network-manager.pxu
38new file mode 100644
39index 0000000..0ee7be3
40--- /dev/null
41+++ b/tests/units/network-manager.pxu
42@@ -0,0 +1,136 @@
43+# Copyright 2016 Canonical Ltd.
44+# All rights reserved.
45+#
46+# Written by:
47+# Lorn Potter <lorn.potter@canonical.com>
48+
49+unit: category
50+id: network_manager
51+_name: Network Manager
52+
53+id: network_manager/setup/ensure_interface_connection_setup
54+category_id: network_manager
55+_description: Ensure that the Network Manager interface is connected
56+plugin: manual
57+_steps:
58+ 1. Connect required network-manager slot/plug
59+ .
60+ $ sudo snap connect network-manager:nmcli network-manager:service
61+ .
62+_verification:
63+ Run the command:
64+ snap interfaces | grep network-manager
65+ Verify that you see the following when running snap interfaces:
66+ network-manager:service network-manager:nmcli
67+
68+id: network_manager/ethernet/unmanaged
69+category_id: network_manager
70+plugin: manual
71+depends: network_manager/setup/ensure_interface_connection_setup
72+_summary: Check if ethernet device is unmanaged.
73+_purpose:
74+ Check if the ethernet device is not managed by Network Manager.
75+_steps:
76+ 1. Execute the following command to retrieve the list of all detected connections.
77+ Note, the AP number is listed from the previous test:
78+ .
79+ $ /snap/bin/network-manager.nmcli d | grep en
80+_verification:
81+ The network device is listed as 'unmanaged', as an example:
82+ enxb827ebf6b919 ethernet unmanaged --
83+
84+id: network_manager/connections/get_all
85+category_id: network_manager
86+plugin: manual
87+depends: network_manager/setup/ensure_interface_connection_setup
88+_summary: All active AP configuration items are listed
89+_purpose:
90+ Check if the AP shows up as being recognized by Network Manager.
91+_steps:
92+ 1. Execute the following command to retrieve the list of all detected connections:
93+ .
94+ $ /snap/bin/network-manager.nmcli d wifi list
95+_verification:
96+ Your expected AP is shown in the output list for example:
97+ pool1 Infra 6 54 Mbit/s 75 *** WPA2
98+
99+id: network_manager/connections/agent
100+category_id: network_manager
101+plugin: manual
102+depends: network_manager/setup/ensure_interface_connection_setup
103+_summary: Register for secret agent
104+_purpose:
105+ Register for Network Manager's secret agent and verify status
106+_steps:
107+ 1. Execute the following command to register secret agent:
108+ .
109+ $ /snap/bin/network-manager.nmcli a
110+_verification:
111+ Output should be similiar to this:
112+ nmcli successfully registered as a Network Manager's secret agent.
113+ nmcli successfully registered as a polkit agent.
114+
115+id: network_manager/connections/connect
116+category_id: network_manager
117+plugin: manual
118+depends: network_manager/setup/ensure_interface_connection_setup
119+_summary: Connect to a listed AP
120+_purpose:
121+ Connect to a listed AP and verify connection status
122+_steps:
123+ 1. Execute the following commands to connect to a particular AP.
124+ .
125+ $ /snap/bin/network-manager.nmcli dev wifi con "yourssid" password "yourpassword"
126+ Note, replace yourssid with the ssid if the AP you will connect to, and replace yourpassword
127+ with the actual password/passphrase.
128+_verification:
129+ Verify that you have a AP connection by issuing this command:
130+ $ ifconfig | grep -A 2 wl
131+ .
132+ verifying that the interface has an IP address with output similiar to this:
133+ wlp5s0 Link encap:Ethernet HWaddr 70:77:81:33:92:6b
134+ inet addr:10.0.0.108 Bcast:10.0.0.255 Mask:255.255.255.0
135+ inet6 addr: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64 Scope:Global
136+
137+id: network_manager/connections/get_info
138+category_id: network_manager
139+plugin: manual
140+depends: network_manager/setup/ensure_interface_connection_setup
141+_summary: All AP information listed
142+_purpose:
143+ Check if the AP details can be listed.
144+_steps:
145+ 1. Execute the following command to retrieve the list of all detected connections.
146+ Note, the AP ssid is listed from the previous test:
147+ .
148+ $ /snap/bin/network-manager.nmcli -p -f general,ip4,ip6 c show <AP_SSID>
149+_verification:
150+ Your desired AP detail is listed and has ip4/ip6 address.
151+ ===============================================================================
152+ Activate connection details (1554e3b2-76e6-4adc-b986-215b7393f8d9)
153+ ===============================================================================
154+ GENERAL.NAME: pool1
155+ GENERAL.UUID: 1554e3b2-76e6-4adc-b986-215b7393f8d9
156+ GENERAL.DEVICES: wlp5s0
157+ GENERAL.STATE: activated
158+ GENERAL.DEFAULT: no
159+ GENERAL.DEFAULT6: no
160+ GENERAL.VPN: no
161+ GENERAL.ZONE: --
162+ GENERAL.DBUS-PATH: /org/freedesktop/NetworkManager/ActiveConnection/2
163+ GENERAL.CON-PATH: /org/freedesktop/NetworkManager/Settings/3
164+ GENERAL.SPEC-OBJECT: /org/freedesktop/NetworkManager/AccessPoint/0
165+ GENERAL.MASTER-PATH: --
166+ -------------------------------------------------------------------------------
167+ IP4.ADDRESS[1]: 10.0.0.108/24
168+ IP4.GATEWAY: 10.0.0.138
169+ IP4.DNS[1]: 10.0.0.138
170+ IP4.DOMAIN[1]: gateway
171+ -------------------------------------------------------------------------------
172+ IP6.ADDRESS[1]: 2001:8003:6501:2000:c1b3:3359:d2a3:f2d1/64
173+ IP6.ADDRESS[2]: 2001:8003:6501:2000:7277:81ff:fe33:926b/64
174+ IP6.ADDRESS[3]: fe80::7277:81ff:fe33:926b/64
175+ IP6.GATEWAY: fe80::e2b9:e5ff:fe5a:91b0
176+ IP6.DNS[1]: 2001:8003:6501:2000::1
177+ IP6.DOMAIN[1]: gateway
178+ -------------------------------------------------------------------------------

Subscribers

People subscribed via source and target branches

to all changes: