forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
spread.yaml
92 lines (78 loc) · 2.89 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
89
90
91
92
project: snapd
environment:
REUSE_PROJECT: $(echo $REUSE_PROJECT)
PROJECT_PATH: /gopath/src/github.com/snapcore/snapd
GOPATH: /gopath
PATH: /gopath/bin:/snap/bin:$PATH
TESTSLIB: $[PROJECT_PATH]/tests/lib
backends:
linode:
key: $(echo $SPREAD_LINODE_KEY)
systems:
- ubuntu-16.04-64-grub
- ubuntu-16.04-32-grub
path: $[PROJECT_PATH]
exclude:
- .git
prepare: |
[ "$REUSE_PROJECT" != 1 ] || exit 0
# apt update is hanging on security.ubuntu.com with IPv6.
sysctl -w net.ipv6.conf.all.disable_ipv6=1
trap "sysctl -w net.ipv6.conf.all.disable_ipv6=0" EXIT
apt purge -y snapd || true
apt update
# utilities
apt install -y devscripts jq
apt build-dep -y ./
# increment version so upgrade can work
dch -i "testing build"
test -d /home/test || adduser --quiet --disabled-password --gecos '' test
chown test.test -R ..
sudo -i -u test /bin/sh -c "cd $PWD && DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -tc -b -Zgzip"
# Disable burst limit so resetting the state quickly doesn't create problems.
mkdir -p /etc/systemd/system/snapd.service.d
cat <<EOF > /etc/systemd/system/snapd.service.d/local.conf
[Unit]
StartLimitInterval=0
[Service]
Environment=SNAPD_DEBUG_HTTP=7
EOF
# Build snapbuild.
apt install -y git
go get ./tests/lib/snapbuild
suites:
tests/main/:
summary: Full-system tests for snapd
prepare: |
apt install -y ${SPREAD_PATH}/../snapd_*.deb
# Snapshot the state including core.
if [ ! -f $SPREAD_PATH/snapd-state.tar.gz ]; then
! snap list | grep core || exit 1
snap install hello-world
snap list | grep core
snap remove hello-world
rmdir /snap/hello-world # Should be done by snapd.
systemctl stop snapd
systemctl daemon-reload
mounts="$(systemctl list-unit-files | grep '^snap[-.].*\.mount' | cut -f1 -d ' ')"
services="$(systemctl list-unit-files | grep '^snap[-.].*\.service' | cut -f1 -d ' ')"
for unit in $services $mounts; do
systemctl stop $unit
done
tar czf $SPREAD_PATH/snapd-state.tar.gz /var/lib/snapd /snap /etc/systemd/system/snap-*core*.mount
systemctl daemon-reload # Workaround for http://paste.ubuntu.com/17735820/
for unit in $mounts $services; do
systemctl start $unit
done
fi
restore: |
$TESTSLIB/reset.sh
apt purge -y snapd || true
restore-each: |
$TESTSLIB/reset.sh --reuse-core
tests/upgrade/:
summary: Tests for snapd upgrade
restore:
apt purge -y snapd || true
restore-each: |
$TESTSLIB/reset.sh