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

Subscribers

People subscribed via source and target branches