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

Subscribers

People subscribed via source and target branches

to all changes: