forked from canonical/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspread.yaml
327 lines (296 loc) · 10.7 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
project: snapd
environment:
GOPATH: /home/gopath
REUSE_PROJECT: "$(HOST: echo $REUSE_PROJECT)"
PROJECT_PATH: $GOPATH/src/github.com/snapcore/snapd
# /usr/lib/go-1.6/bin for trusty (needs to be last as we use
# a different go in gccgo tests)
PATH: $GOPATH/bin:/snap/bin:$PATH:/usr/lib/go-1.6/bin
TESTSLIB: $PROJECT_PATH/tests/lib
SNAPPY_TESTING: 1
SPREAD_STORE_USER: "$(HOST: echo $SPREAD_STORE_USER)"
SPREAD_STORE_PASSWORD: "$(HOST: echo $SPREAD_STORE_PASSWORD)"
LANG: "$(echo ${LANG:-C.UTF-8})"
LANGUAGE: "$(echo ${LANGUAGE:-en})"
# important to ensure adhoc and linode/qemu behave the same
SUDO_USER: ""
SUDO_UID: ""
TRUST_TEST_KEYS: "true"
MANAGED_DEVICE: "false"
CORE_CHANNEL: "$(HOST: echo ${SPREAD_CORE_CHANNEL:-edge})"
# slight abuse
GENERATE_14_04: "$(HOST: while [ `pwd` != / ] && [ ! -f spread.yaml ]; do cd ..; done && ./generate-packaging-dir ubuntu 14.04)"
backends:
linode:
key: "$(HOST: echo $SPREAD_LINODE_KEY)"
halt-timeout: 2h
systems:
- ubuntu-14.04-64:
kernel: GRUB 2
- ubuntu-16.04-64:
kernel: GRUB 2
workers: 2
- ubuntu-16.04-32:
kernel: GRUB 2
workers: 2
- ubuntu-core-16-64:
kernel: Direct Disk
image: ubuntu-16.04-64
# FIXME restore of ubuntu-core does not properly reset
# boot variables and key snaps to their pristine state.
- ubuntu-core-16-64-fixme:
kernel: Direct Disk
image: ubuntu-16.04-64
qemu:
environment:
APT_PROXY: "$(HOST: echo $APT_PROXY)"
systems:
- ubuntu-14.04-32:
username: ubuntu
password: ubuntu
- ubuntu-14.04-64:
username: ubuntu
password: ubuntu
- ubuntu-16.04-32:
username: ubuntu
password: ubuntu
- ubuntu-16.04-64:
username: ubuntu
password: ubuntu
- ubuntu-core-16-64:
image: ubuntu-16.04-64
username: ubuntu
password: ubuntu
- ubuntu-16.10-64:
username: ubuntu
password: ubuntu
- ubuntu-17.04-64:
username: ubuntu
password: ubuntu
autopkgtest:
type: adhoc
allocate: |
echo "Allocating ad-hoc $SPREAD_SYSTEM"
if [ -z "${ADT_ARTIFACTS}" ]; then
FATAL "adhoc only works inside autopkgtest"
exit 1
fi
echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/99-spread-users
ADDRESS localhost:22
discard: |
echo "Discarding ad-hoc $SPREAD_SYSTEM"
systems:
- ubuntu-16.04-amd64:
username: ubuntu
password: ubuntu
- ubuntu-16.04-i386:
username: ubuntu
password: ubuntu
- ubuntu-16.04-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-16.04-armhf:
username: ubuntu
password: ubuntu
- ubuntu-16.10-amd64:
username: ubuntu
password: ubuntu
- ubuntu-16.10-i386:
username: ubuntu
password: ubuntu
- ubuntu-16.10-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-16.10-armhf:
username: ubuntu
password: ubuntu
- ubuntu-17.04-amd64:
username: ubuntu
password: ubuntu
- ubuntu-17.04-i386:
username: ubuntu
password: ubuntu
- ubuntu-17.04-ppc64el:
username: ubuntu
password: ubuntu
- ubuntu-17.04-armhf:
username: ubuntu
password: ubuntu
external:
type: adhoc
environment:
SPREAD_EXTERNAL_ADDRESS: "$(HOST: echo ${SPREAD_EXTERNAL_ADDRESS:-localhost:8022})"
MANAGED_DEVICE: "true"
allocate: |
ADDRESS $SPREAD_EXTERNAL_ADDRESS
systems:
- ubuntu-core-16-64:
environment:
TRUST_TEST_KEYS: "false"
username: test
password: ubuntu
- ubuntu-core-16-arm-64:
username: test
password: ubuntu
- ubuntu-core-16-arm-32:
username: test
password: ubuntu
path: /home/gopath/src/github.com/snapcore/snapd
exclude:
- .git
prepare-each: |
# systemd on 14.04 does not know about --rotate
# or --vacuum-time.
# TODO: Find a way to clean out systemd logs on
# systemd 204.
if [[ "$SPREAD_SYSTEM" != ubuntu-14.04-* ]]; then
journalctl --rotate
sleep .1
journalctl --vacuum-time=1ms
fi
dmesg -c > /dev/null
debug-each: |
journalctl -u snapd
dmesg | grep DENIED || true
prepare: |
# this indicates that the server got reused, nothing to setup
[ "$REUSE_PROJECT" != 1 ] || exit 0
# check that we are not updating
. "$TESTSLIB/boot.sh"
if [ "$(bootenv snap_mode)" = "try" ]; then
echo "Ongoing reboot upgrade process, please try again when finished"
exit 1
fi
if [ "$SPREAD_BACKEND" = external ]; then
# build test binaries
if [ ! -f $GOPATH/bin/snapbuild ]; then
mkdir -p $GOPATH/bin
snap install --devmode --edge classic
classic "sudo apt update && apt install -y git golang-go build-essential"
classic "GOPATH=$GOPATH go get ../..${PROJECT_PATH}/tests/lib/snapbuild"
snap remove classic
fi
# stop and disable autorefresh
systemctl disable --now snapd.refresh.timer
exit 0
fi
if [ "$SPREAD_BACKEND" = qemu ]; then
# treat APT_PROXY as a location of apt-cacher-ng to use
if [ -d /etc/apt/apt.conf.d ] && [ -n "${APT_PROXY:-}" ]; then
printf 'Acquire::http::Proxy "%s";\n' "$APT_PROXY" > /etc/apt/apt.conf.d/99proxy
fi
fi
# 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-get update
# XXX: This seems to be required. Otherwise package build
# fails with unmet dependency on "build-essential:native"
apt-get install -y build-essential
apt-get install -y software-properties-common
if [[ "$SPREAD_SYSTEM" == ubuntu-14.04-* ]]; then
if [ ! -d debian-ubuntu-14.04 ]; then
echo "no debian-ubuntu-14.04/ directory "
echo "broken test setup"
exit 1
fi
# 14.04 has its own packaging
rm -rf debian
mv debian-ubuntu-14.04 debian
echo 'deb http://archive.ubuntu.com/ubuntu/ trusty-proposed main universe' >> /etc/apt/sources.list
apt-get update
add-apt-repository ppa:snappy-dev/image
apt-get update
apt-get install -y --install-recommends linux-generic-lts-xenial
apt-get install -y --force-yes apparmor libapparmor1 seccomp libseccomp2 systemd cgroup-lite util-linux
fi
apt-get purge -y snapd snap-confine ubuntu-core-launcher
apt-get update
# utilities
apt-get install -y curl devscripts expect gdebi-core jq rng-tools git
# in 16.04: apt build-dep -y ./
apt-get install -y $(gdebi --quiet --apt-line ./debian/control)
# update vendoring
if [ "$(which govendor)" = "" ]; then
rm -rf $GOPATH/src/github.com/kardianos/govendor
go get -u github.com/kardianos/govendor
fi
govendor sync
# increment version so upgrade can work, use "zzz" as version
# component to ensure that its higher than any "ubuntuN" version
# that might also be in the archive
dch -lzzz "testing build"
if ! id test >& /dev/null; then
# manually setting the UID and GID to 12345 because we need to
# know the numbers match for when we set up the user inside
# the all-snap, which has its own user & group database.
# Nothing special about 12345 beyond it being high enough it's
# unlikely to ever clash with anything, and easy to remember.
addgroup --quiet --gid 12345 test
adduser --quiet --uid 12345 --gid 12345 --disabled-password --gecos '' test
fi
owner=$( stat -c "%U:%G" /home/test )
if [ "$owner" != "test:test" ]; then
echo "expected /home/test to be test:test but it's $owner"
exit 1
fi
unset owner
echo 'test ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
chown test.test -R ..
su -l -c "cd $PWD && DEB_BUILD_OPTIONS='nocheck testkeys' dpkg-buildpackage -tc -b -Zgzip" test
# put our debs to a safe place
cp ../*.deb $GOPATH
# Build snapbuild.
apt-get install -y git
go get ./tests/lib/snapbuild
# Build fakestore.
go get ./tests/lib/fakestore/cmd/fakestore
# Build fakedevicesvc.
go get ./tests/lib/fakedevicesvc
restore: |
if [ "$SPREAD_BACKEND" = external ]; then
# start and enable autorefresh
systemctl enable --now snapd.refresh.timer
fi
suites:
tests/main/:
summary: Full-system tests for snapd
systems: [-ubuntu-core-16-64-fixme]
prepare: |
. $TESTSLIB/prepare.sh
if [[ "$SPREAD_SYSTEM" == ubuntu-core-16-* ]]; then
prepare_all_snap
else
prepare_classic
fi
restore: |
$TESTSLIB/reset.sh
if [[ "$SPREAD_SYSTEM" != ubuntu-core-16-* ]]; then
apt-get purge -y snapd snap-confine ubuntu-core-launcher
fi
restore-each: |
$TESTSLIB/reset.sh --reuse-core
tests/regression/:
summary: Regression tests for snapd
systems: [-ubuntu-core-16-64-fixme]
prepare: |
. $TESTSLIB/prepare.sh
if [[ "$SPREAD_SYSTEM" == ubuntu-core-16-* ]]; then
prepare_all_snap
else
prepare_classic
fi
restore: |
$TESTSLIB/reset.sh
if [[ "$SPREAD_SYSTEM" != ubuntu-core-16-* ]]; then
apt-get purge -y snapd snap-confine ubuntu-core-launcher
fi
restore-each: |
$TESTSLIB/reset.sh --reuse-core
tests/upgrade/:
summary: Tests for snapd upgrade
systems: [-ubuntu-core-16-64-fixme]
restore:
apt-get purge -y snapd snap-confine ubuntu-core-launcher
restore-each: |
$TESTSLIB/reset.sh