forked from canonical/docker-snap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spread.yaml
88 lines (79 loc) · 3.08 KB
/
spread.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#
# Copyright (C) 2015, 2016 Canonical Ltd
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
project: docker
environment:
PROJECT_PATH: /home/docker
TESTSLIB: $PROJECT_PATH/spread/lib
SNAP_NAME: docker
# Allow the host to pass the channel to use for the test rim
SNAP_CHANNEL: $(HOST:echo $SNAP_CHANNEL)
backends:
uvt-kvm:
type: adhoc
allocate: |
VM_NAME=docker-snap-spread-kvm-$SPREAD_SYSTEM
if [ ! -z $(uvt-kvm list | grep $VM_NAME) ]; then
FATAL "uvt-kvm machine with domain $VM_NAME already exists, please destroy before continuing"
fi
# configure the script to contain the password in it - the environment variables here
# won't be available inside the VM when the script runs
SCRIPT_DIR=$(mktemp -d)
sed "s/SPREAD_PASSWORD/$SPREAD_PASSWORD/" spread/lib/setup-root-ssh-uvt.sh.in > $SCRIPT_DIR/setup-root-ssh-uvt.sh
if [ ! -f $SCRIPT_DIR/setup-root-ssh-uvt.sh ]; then
FATAL "failed to generate setup script"
fi
case $SPREAD_SYSTEM in
ubuntu-18.04)
RELEASE=bionic;;
ubuntu-16.04)
RELEASE=xenial;;
*)
FATAL "unsupported uvt-kvm release: $SPREAD_SYSTEM";;
esac
# TODO: fix this for non-amd64 systems
uvt-simplestreams-libvirt sync arch=amd64 release=$RELEASE
uvt-kvm create $VM_NAME release=$RELEASE --run-script-once $SCRIPT_DIR/setup-root-ssh-uvt.sh
# remove the script so we don't leave it lying around with the password in it
rm $SCRIPT_DIR/setup-root-ssh-uvt.sh
# wait for the machine to come alive
uvt-kvm wait $VM_NAME
# now get the address
ADDRESS $(uvt-kvm ip $VM_NAME)
discard: |
trap '' 2
uvt-kvm destroy docker-snap-spread-kvm-$SPREAD_SYSTEM
trap
systems:
- ubuntu-18.04
- ubuntu-16.04
# Put this somewhere where we have read-write access
path: /home/docker
exclude:
- .git
prepare: |
. $TESTSLIB/prepare-all.sh
# Fetching the image from dockerhub is time-consuming under some conditions,
# e.g network poor/unstable.
kill-timeout: 30m
suites:
spread/main/:
summary: Full-system tests for the docker snap
systems:
- ubuntu-18.04
- ubuntu-16.04
prepare: |
. $TESTSLIB/prepare.sh
restore-each: |
. $TESTSLIB/restore-each.sh