Merge ~rmescandon/snappy-hwe-snaps/+git/engineering-tests:serial-vault-ones into ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master

Proposed by Roberto Mier Escandón  on 2017-09-01
Status: Merged
Approved by: Simon Fels on 2017-09-06
Approved revision: ec12899b2fa2d9f63d69231746e8522d79fa0785
Merged at revision: 9d7d0c053546177f8a776b77efa943f20c4f391e
Proposed branch: ~rmescandon/snappy-hwe-snaps/+git/engineering-tests:serial-vault-ones
Merge into: ~snappy-hwe-team/snappy-hwe-snaps/+git/engineering-tests:master
Diff against target: 157 lines (+140/-0)
2 files modified
com.canonical.se:engineering-tests/units/serial-vault/serial-vault.pxu (+138/-0)
snapcraft.yaml (+2/-0)
Reviewer Review Type Date Requested Status
Maciej Kisielewski (community) Approve on 2017-09-01
Alfonso Sanchez-Beato Approve on 2017-09-01
System Enablement Bot continuous-integration Approve on 2017-09-01
Konrad Zapałowicz (community) 2017-09-01 Approve on 2017-09-01
Review via email: mp+330071@code.launchpad.net

Description of the change

Serial vault plainbox tests

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/com.canonical.se:engineering-tests/units/serial-vault/serial-vault.pxu b/com.canonical.se:engineering-tests/units/serial-vault/serial-vault.pxu
2new file mode 100644
3index 0000000..ab1bea1
4--- /dev/null
5+++ b/com.canonical.se:engineering-tests/units/serial-vault/serial-vault.pxu
6@@ -0,0 +1,138 @@
7+# Copyright 2017 Canonical Ltd.
8+# All rights reserved.
9+#
10+# Written by:
11+# Roberto Mier Escandon <roberto.escandon@canonical.com>
12+
13+unit: category
14+id: serial_vault
15+_name: Serial Vault
16+
17+id: serial_vault/setup/ensure_interface_connection_setup
18+category_id: serial_vault
19+_description: Ensure that the serial-vault interface is auto-connected
20+plugin: manual
21+_steps:
22+ 1. List the interfaces
23+ .
24+ $ snap interfaces | serial-vault-server
25+ .
26+_verification:
27+ Verify that you see the following:
28+ :network serial-vault-server
29+ :network-bind serial-vault-server
30+
31+id: serial_vault/setup/config
32+category_id: serial_vault
33+_description: Ensure that the serial-vault can access database
34+plugin: manual
35+depends: serial_vault/setup/ensure_interface_connection_setup
36+_steps:
37+ 1. Create settings.yaml with proper content ot access database
38+ .
39+ $ cat <<-EOF > settings.yaml
40+ title: "Serial Vault"
41+ logo: "/static/images/logo-ubuntu-white.svg"
42+ mode: signing
43+ docRoot: "."
44+ driver: "postgres"
45+ datasource: "dbname=serialvault sslmode=disable"
46+ keystore: "database"
47+ keystoreSecret: "secret code to encrypt the auth-key hash"
48+ csrfAuthKey: "2E6ZYnVYUfDLRLV/ne8M6v1jyB/376BL9ORnN3Kgb04uSFalr2ygReVsOt0PaGEIRuID10TePBje5xdjIOEjQQ=="
49+ urlHost: "serial-vault"
50+ urlScheme: http
51+ enableUserAuth: True
52+ EOF
53+ .
54+ 2. Apply config
55+ .
56+ $ cat settings.yaml | sudo serial-vault-server.config
57+ .
58+ 3. Restart service
59+ .
60+ $ sudo systemctl restart snap.serial-vault-server.serial-vault.service
61+ .
62+ 4. Check journal
63+ .
64+ $ sudo journalctl
65+ .
66+_verification:
67+ Verify that you see in journal last page (Alt+G) that database has been created/updated and service is up and running, like this:
68+ Created the 'keypair' table.
69+ Created the 'model' table.
70+ Created the 'settings' table.
71+ Created the 'signinglog' table.
72+ Created the 'nonce' table.
73+ Created the 'account' table.
74+ Updated the 'model' table.
75+ Updated the 'keypair' table.
76+ Created the 'openid nonce' table.
77+ Created the 'userinfo' table.
78+ Created the 'account-user link' table.
79+ Updated the 'userinfo' table.
80+ Starting service on port :8080
81+
82+id: serial_vault/operation/ensure-commands-can-be-run
83+category_id: serial_vault
84+_description: Ensure that the serial vault admin commands can be run
85+plugin: manual
86+depends: serial_vault/setup/config
87+_steps:
88+ 1. Try to run admin
89+ .
90+ $ serial-vault-server.admin
91+ .
92+ 2. Try to run config
93+ .
94+ $ serial-vault-server.config
95+ .
96+_verification:
97+ Verify that each step ends showing up the help
98+
99+id: serial_vault/operation/add_superuser
100+category_id: serial_vault
101+_description: Ensure admin tool can add a superuser
102+plugin: manual
103+depends: serial_vault/operation/ensure-commands-can-be-run
104+_steps:
105+ 1. Add a user from console
106+ .
107+ $ serial-vault-server.admin user add theuser -n TheName -r superuser -e theemail@email.com
108+ .
109+ 2. List users
110+ .
111+ $ serial-vault-server.admin user list
112+ .
113+_verification:
114+ Verify that just created user is in users list with superuser role
115+
116+id: serial_vault/operation/cache_account
117+category_id: serial_vault
118+_description: Ensure admin tool can fetch store cached account assertions
119+plugin: manual
120+depends: serial_vault/operation/ensure-commands-can-be-run
121+_steps:
122+ 1. Fetch cached accounts from the store
123+ .
124+ $ serial-vault-server.admin account cache
125+ .
126+ 2. List users
127+ .
128+ $ serial-vault-server.admin user list
129+ .
130+_verification:
131+ Verify that just created user is in users list with superuser role
132+
133+id: serial_vault/operation/verify_api_is_reachable
134+category_id: serial_vault
135+_description: Ensure signing service can be reached
136+plugin: manual
137+depends: serial_vault/operation/ensure-commands-can-be-run
138+_steps:
139+ 1. Request service version
140+ .
141+ $ wget http://localhost:8080/v1/version
142+ .
143+_verification:
144+ Verify that the response content is {"version":"1.6.0"}
145diff --git a/snapcraft.yaml b/snapcraft.yaml
146index 7b13d68..a48c2c8 100644
147--- a/snapcraft.yaml
148+++ b/snapcraft.yaml
149@@ -45,6 +45,8 @@ apps:
150 command: bin/plainbox-wrapper run -i '2017.com.canonical.se::captive_redirect.*'
151 wpa-supplicant:
152 command: bin/plainbox-wrapper run -i '2017.com.canonical.se::wpa_supplicant.*'
153+ serial-vault:
154+ command: bin/plainbox-wrapper run -i '2017.com.canonical.se::serial_vault.*'
155
156 parts:
157 common:

Subscribers

People subscribed via source and target branches