Merge lp:~vila/ols-store-tests/snapd-staging into lp:ols-store-tests

Proposed by Vincent Ladeuil
Status: Work in progress
Proposed branch: lp:~vila/ols-store-tests/snapd-staging
Merge into: lp:ols-store-tests
Diff against target: 81 lines (+55/-2)
3 files modified
ols-vms.conf (+17/-2)
scripts/install-snapd-from-source (+31/-0)
scripts/test-built-snapd (+7/-0)
To merge this branch: bzr merge lp:~vila/ols-store-tests/snapd-staging
Reviewer Review Type Date Requested Status
Ubuntu One hackers Pending
Review via email: mp+320357@code.launchpad.net

Commit message

Define a snapd-staging vm to run snapd from source against staging.

Description of the change

Define a snapd-staging vm to run snapd from source against staging.

To post a comment you must log in.
27. By Vincent Ladeuil

Define a snapd-staging vm that can run snap from source against staging.

Inspired by Matt's document.

28. By Vincent Ladeuil

Make install from source part of the setup. Also add a smoke test matching the doc. Surface more parameters.

Unmerged revisions

28. By Vincent Ladeuil

Make install from source part of the setup. Also add a smoke test matching the doc. Surface more parameters.

27. By Vincent Ladeuil

Define a snapd-staging vm that can run snap from source against staging.

Inspired by Matt's document.

26. By Vincent Ladeuil

Isolate ols-store-tests definition.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ols-vms.conf'
2--- ols-vms.conf 2017-01-16 14:08:00 +0000
3+++ ols-vms.conf 2017-03-20 16:17:10 +0000
4@@ -1,11 +1,26 @@
5+[ols-store-tests]
6+vm.class = lxd
7+vm.release = xenial
8+vm.architecture = amd64
9+vm.update = True
10+vm.locale = en_US.UTF-8
11 tests.packages = python3-ols-tests, flake8, snapcraft, squashfs-tools, subunit, python-junitxml
12 store.packages = python3-progressbar, python3-xdg, python3-requests-toolbelt, python3-yaml, python3-pymacaroons
13 apt.sources = ppa:ubuntuone/ols-tests
14+vm.packages = {tests.packages}, {store.packages}, bzr
15
16-[ols-store-tests]
17+[snapd-staging]
18 vm.class = lxd
19 vm.release = xenial
20 vm.architecture = amd64
21 vm.update = True
22 vm.locale = en_US.UTF-8
23-vm.packages = {tests.packages}, {store.packages}, bzr
24+vm.packages = git, golang-go, squashfuse
25+# snapd needs to be built from sources to talk to test servers (including
26+# staging) if only to use specific assertions
27+vm.setup_scripts = scripts/install-snapd-from-source
28+snapd.source.url = https://github.com/snapcore/snapd
29+snapd.sources.path = ~/src/github.com/snapcore/snapd
30+snapd.branch = master
31+# `testkeys` switches in the staging trusted assertions
32+snapd.build.options = nocheck testkeys
33
34=== added directory 'scripts'
35=== added file 'scripts/install-snapd-from-source'
36--- scripts/install-snapd-from-source 1970-01-01 00:00:00 +0000
37+++ scripts/install-snapd-from-source 2017-03-20 16:17:10 +0000
38@@ -0,0 +1,31 @@
39+#!/bin/sh -ex
40+
41+# Point snapd to the staging store
42+if ! grep -q SNAPPY_USE_STAGING_STORE /etc/environment ; then
43+ # SNAPD_DEBUG_HTTP is a bitfield:
44+ # dump requests: 1, dump responses: 2, dump bodies: 4.
45+ cat <<EOF | sudo tee -a /etc/environment
46+SNAPPY_USE_STAGING_STORE=1
47+SNAPD_DEBUG=1
48+SNAPD_DEBUG_HTTP=3
49+EOF
50+fi
51+# We need the updated environment *now*
52+$(sed -e 's/^/export /' /etc/environment)
53+# Also update PATH as login shells do
54+export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
55+# Install snap from sources
56+SRC_DIR={snapd.sources.path}
57+rm -fr $SRC_DIR
58+git clone -b {snapd.branch} {snapd.source.url} $SRC_DIR
59+cd $SRC_DIR
60+# Install build dependencies
61+sudo apt-get build-dep -y ./
62+# Update source dependencies
63+export GOPATH=$HOME
64+go get -v github.com/kardianos/govendor
65+govendor sync
66+# Build snapd with test options
67+DEB_BUILD_OPTIONS='{snapd.build.options}' dpkg-buildpackage -tc -b
68+# Install the built packages
69+sudo apt-get install -y ../snapd*.deb ../snap-confine*.deb ../ubuntu-core-launcher*.deb
70
71=== added file 'scripts/test-built-snapd'
72--- scripts/test-built-snapd 1970-01-01 00:00:00 +0000
73+++ scripts/test-built-snapd 2017-03-20 16:17:10 +0000
74@@ -0,0 +1,7 @@
75+#!/bin/sh -ex
76+SRC_DIR={snapd.sources.path}
77+cd $SRC_DIR
78+sudo snap install core
79+sudo snap install hello-atomatt-1
80+sudo snap download hello-atomatt-1
81+grep staging hello-atomatt-1*.assert

Subscribers

People subscribed via source and target branches