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 Escandon
Status: Merged
Approved by: Simon Fels
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
Alfonso Sanchez-Beato Approve
System Enablement Bot continuous-integration Approve
Konrad Zapałowicz (community) Approve
Review via email: mp+330071@code.launchpad.net

Description of the change

Serial vault plainbox tests

To post a comment you must log in.
Revision history for this message
Konrad Zapałowicz (kzapalowicz) wrote :

lgtm

review: Approve
Revision history for this message
System Enablement Bot (system-enablement-ci-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alfonso Sanchez-Beato (alfonsosanchezbeato) wrote :

LGTM

review: Approve
Revision history for this message
Maciej Kisielewski (kissiel) wrote :

+1

review: Approve

Preview Diff

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

Subscribers

People subscribed via source and target branches