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

Proposed by Roberto Mier Escandon on 2017-07-12
Status: Merged
Approved by: Alfonso Sanchez-Beato on 2017-07-12
Approved revision: 47282ace1b8e98bd2f0229aa67e9a96d7bcda2bb
Merged at revision: 1cf16e6bd89337b83615cb35cc5d475eb6cccabe
Proposed branch: ~rmescandon/snappy-hwe-snaps/+git/engineering-tests:snapweb-plainbox
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 228 lines (+198/-0)
3 files modified
snapcraft.yaml (+6/-0)
snapweb/manage.py (+10/-0)
snapweb/units/snapweb.pxu (+182/-0)
Reviewer Review Type Date Requested Status
System Enablement Bot continuous-integration Approve on 2017-07-12
Alfonso Sanchez-Beato 2017-07-12 Approve on 2017-07-12
Konrad Zapałowicz (community) code Approve on 2017-07-12
Review via email: mp+327279@code.launchpad.net

Description of the change

Plainbox tests for snapweb

To post a comment you must log in.

LGTM, just one small nitpick.

review: Needs Fixing
Konrad Zapałowicz (kzapalowicz) wrote :

ack

review: Approve (code)
Roberto Mier Escandon (rmescandon) wrote :

Added the new line that Microsoft doesn't want to add by its own :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/snapcraft.yaml b/snapcraft.yaml
index a73c050..e5139e1 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -31,6 +31,8 @@ apps:
31 command: bin/run-wireless-tools-tests31 command: bin/run-wireless-tools-tests
32 pulseaudio:32 pulseaudio:
33 command: bin/run-pulseaudio-tests33 command: bin/run-pulseaudio-tests
34 snapweb:
35 command: bin/plainbox-wrapper run -i '2017.com.canonical.snapweb::snapweb.*'
34 upower:36 upower:
35 command: bin/plainbox-wrapper run -i '2016.com.canonical.upower::upower.*'37 command: bin/plainbox-wrapper run -i '2016.com.canonical.upower::upower.*'
36 udisks2:38 udisks2:
@@ -93,6 +95,10 @@ parts:
93 plugin: plainbox-provider95 plugin: plainbox-provider
94 source: ./wireless-tools96 source: ./wireless-tools
95 after: [plainbox-local]97 after: [plainbox-local]
98 snapweb:
99 plugin: plainbox-provider
100 source: ./snapweb
101 after: [plainbox-local]
96 upower:102 upower:
97 plugin: plainbox-provider103 plugin: plainbox-provider
98 source: ./upower104 source: ./upower
diff --git a/snapweb/manage.py b/snapweb/manage.py
99new file mode 100644105new file mode 100644
index 0000000..c554a18
--- /dev/null
+++ b/snapweb/manage.py
@@ -0,0 +1,10 @@
1#!/usr/bin/env python3
2from plainbox.provider_manager import setup, N_
3
4setup(
5 name='plainbox-provider-snapweb',
6 namespace='2017.com.canonical.snapweb',
7 version="1.0",
8 description=N_("Plainbox provider for the snapweb snap"),
9 gettext_domain="2017_com_canonical_snapweb",
10)
diff --git a/snapweb/units/snapweb.pxu b/snapweb/units/snapweb.pxu
0new file mode 10064411new file mode 100644
index 0000000..8f9e070
--- /dev/null
+++ b/snapweb/units/snapweb.pxu
@@ -0,0 +1,182 @@
1# Copyright 2017 Canonical Ltd.
2# All rights reserved.
3#
4# Written by:
5# Roberto Mier Escandon <roberto.escandon@canonical.com>
6
7unit: category
8id: snapweb
9_name: SnapWeb
10
11id: snapweb/setup/ensure_interface_connection_setup
12category_id: snapweb
13_description: Ensure that the snapweb interfaces are auto-connected
14plugin: manual
15_steps:
16 1. List the interfaces
17 .
18 $ snap interfaces snapweb
19 .
20_verification:
21 Verify that you see the following:
22 Slot Plug
23 :network snapweb
24 :network-bind snapweb
25 :snapd-control snapweb
26 :timeserver-control snapweb
27
28id: snapweb/setup/ensure-http-service-is-up
29category_id: snapweb
30_description: Ensure that the http interface is up and running
31plugin: manual
32depends: snapweb/setup/ensure_interface_connection_setup
33_steps:
34 1. Open a browser in same device and type in address bar:
35 .
36 http://localhost:4200
37 .
38_verification:
39 Verify that url is accessible and a warning is shown about web access is
40 not secure/private (depending on the browser)
41
42id: snapweb/setup/ensure-https-service-is-up
43category_id: snapweb
44_description: Ensure that the snapweb web interface is up and running
45plugin: manual
46depends: snapweb/setup/ensure-http-service-is-up
47_steps:
48 1. Open a browser in same device and type in address bar:
49 .
50 http://localhost:4200
51 .
52 2. After warning alert showing that web access is not secure/private,
53 proceed to access localhost. In some browsers it is needed to confirm
54 a security exception.
55_verification:
56 Verify that url is accessible and browser shows a page with title
57 'Access Control', requesting a Snapweb Access Token to continue.
58 Verify that url address is now https://localhost:4201/access-control
59
60id: snapweb/setup/ensure-web-service-is-accessible-from-lan
61category_id: snapweb
62_description: Ensure that the snapweb web interface is accessible from lan
63plugin: manual
64depends: snapweb/setup/ensure-https-service-is-up
65_steps:
66 1. Open a browser in other device connected to same LAN than the one
67 hosting snapweb and type in address bar:
68 .
69 http://[hostname]:4200
70 .
71 2. After warning alert showing that web access is not secure/private,
72 proceed to access localhost. In some browsers it is needed to confirm
73 a security exception.
74_verification:
75 Verify that url is accessible and browser shows a page with title
76 'Access Control', requesting a Snapweb Access Token to continue.
77 Verify that url address is now https://[hostname]:4201/access-control
78
79id: snapweb/setup/ensure-token-access
80category_id: snapweb
81_description: Ensure ui allows access when entered a valid token generated from cli
82plugin: manual
83depends: snapweb/setup/ensure-https-service-is-up
84_steps:
85 1. Reboot the device. This step is only needed to be done just after
86 first installation. If snap was previously installed and this is
87 an update, you can go to step 2.
88 2. Open a terminal in the device and type:
89 .
90 $ sudo snapweb.generate-token
91 .
92 3. Copy result token to clipboard
93 4. Access browser and type:
94 .
95 https://localhost:4201
96 .
97 5. Paste clipboard token into Snapweb Access Token textbox
98_verification:
99 Verify that access is allowed and installed apps list is shown
100
101id: snapweb/snaps/installed-snaps
102category_id: snapweb
103_description: Verify installed snaps list
104plugin: manual
105depends: snapweb/setup/ensure-token-access
106_steps:
107 1. Access browser and type:
108 .
109 https://localhost:4201
110 .
111 2. In a device terminal type:
112 .
113 $ snap list
114 .
115_verification:
116 Verify that the list of 'Apps installed' in browser is the same
117 as the list shown in terminal, except snapweb itself that should
118 be only shown in terminal list
119
120id: snapweb/snaps/installable-snaps
121category_id: snapweb
122_description: Verify that snaps can be installed and filtered
123plugin: manual
124depends: snapweb/setup/ensure-token-access
125_steps:
126 1. Access browser and type:
127 .
128 https://localhost:4201
129 .
130 2. Click on last entry on Apps installed section named 'Get more apps'
131 or click on 'Store' upper tab
132 3. Click on the links over snaps to filter them
133 4. Search for certain snap name in upper search box
134_verification:
135 Verify that at the beginning there is a list of snaps that can be installed,
136 everyone with its icon, version, author and a button with label 'Install'.
137 Verify that the list can be filtered by pressing links over
138 Verify you get results when searching for a snap that it's in the list of
139 installables
140
141id: snapweb/snaps/install-snap
142category_id: snapweb
143_description: Ensure that a snap can be installed using web ui
144plugin: manual
145depends: snapweb/setup/ensure-token-access
146_steps:
147 1. Access browser and type:
148 .
149 https://localhost:4201
150 .
151 2. Click on 'Install' button of any available snap
152 3. Wait for snap to be installed and open a terminal
153 4. Type in terminal:
154 .
155 $ snap list
156 .
157_verification:
158 Verify that the snap requested to be installed is there in the terminal resultant list
159 Verify that button in step 2 changes its label to 'Installing' while installing
160 Verify that button of the instaled snap has now 'Remove' in its label
161
162id: snapweb/snaps/remove-snap
163category_id: snapweb
164_description: Ensure that a snap can be removed using web ui
165plugin: manual
166depends: snapweb/snaps/install-snap
167_steps:
168 1. Access browser and type:
169 .
170 https://localhost:4201
171 .
172 2. Click on 'Remove' button of installed snap
173 3. Wait for snap to be removed and open a terminal
174 4. Type in terminal:
175 .
176 $ snap list
177 .
178_verification:
179 Verify that the snap requested to be removed is not in the terminal resultant list
180 Verify that button in step 2 changes its label to 'Removing' while installing
181 Verify that button of the removed snap has now 'Install' in its label
182

Subscribers

People subscribed via source and target branches