aboutgitcodebugslistschat
path: root/test/distro/debian
blob: f748dea2c5de9848247a9305a48d249578a4e912 (plain) (blame)
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
328
329
330
331
332
333
334
335
336
337
# SPDX-License-Identifier: AGPL-3.0-or-later
#
# PASST - Plug A Simple Socket Transport
#  for qemu/UNIX domain socket mode
#
# PASTA - Pack A Subtle Tap Abstraction
#  for network namespace/tap device mode
#
# test/distro/debian - Debian builds, get packages via passt, test pasta
#
# Copyright (c) 2021 Red Hat GmbH
# Author: Stefano Brivio <sbrivio@redhat.com>

temp	PIDFILE
htools	wget virt-edit guestfish head sed cat kill qemu-system-aarch64 qemu-system-ppc64le

# Quick pasta test: send message from init to ns, and from ns to init
def	distro_quick_pasta_test
host	export SHELL="/bin/dash"
host	dash
host	(nc -w1 -6 -l -p 10000 > /tmp/init_msg; echo "from_init" | nc -q0 ::1 9999) &
hostb	./pasta
sleep	1
host	nc -w1 -6 -l -p 9999 > /tmp/ns_msg &
sleep	2
host	echo "from_ns" | nc -q0 ::1 10000
sleep	2
host	echo
sleep	1
hout	NS_MSG cat /tmp/ns_msg
check	[ __NS_MSG__ = "from_init" ]
hostb	exit
host	echo
hout	INIT_MSG cat /tmp/init_msg
check	[ __INIT_MSG__ = "from_ns" ]
endef

# Start passt, set common variables
hostb	./passt -P __PIDFILE__ &
sleep	1
host	echo
hout	GUEST_FILES ls -1 *.c *.h *.sh Makefile | tr '\n' ' '; echo


test	Debian GNU/Linux 8 (jessie), amd64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/OpenStack/archive/8.11.0/debian-8.11.0-openstack-amd64.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /lib/systemd/system/serial-getty@.service
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-config
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-final
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none -drive file=__IMG__,if=virtio -net socket,fd=5 -net nic,model=virtio
host	PS1='$ '
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Wno-missing-field-initializers -Wno-missing-braces -Wno-type-limits" make

# TODO: pasta test skipped for the moment: clone() as called by NS_CALL hangs
# with wrapper provided by glibc 2.19, probably wrong argument order.

hint
sleep	1

# PIDFILE is cleaned up when the next test starts, read it now
hout	PID cat __PIDFILE__


test	Debian GNU/Linux 9 (stretch, oldoldstable), amd64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/stretch/daily/20200210-166/debian-9-nocloud-amd64-daily-20200210-166.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /lib/systemd/system/serial-getty@.service
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
host	PS1='$ '
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

host	sysctl -w kernel.unprivileged_userns_clone=1
distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux 10 (buster, oldstable), amd64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/buster/latest/debian-10-nocloud-amd64.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /lib/systemd/system/serial-getty@.service
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
host	PS1='$ '
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

host	sysctl -w kernel.unprivileged_userns_clone=1
distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux 10 (buster, oldstable), aarch64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-arm64.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-config.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-config
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-final
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
host	PS1='$ '
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

host	sysctl -w kernel.unprivileged_userns_clone=1
distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux 10 (buster, oldstable), ppc64le

temp	IMG
host	wget https://cloud.debian.org/images/cloud/buster/latest/debian-10-generic-ppc64el.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-config.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-config
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-final
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-ppc64le -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
host	PS1='$ '
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

host	sysctl -w kernel.unprivileged_userns_clone=1
distro_quick_pasta_test

hint
sleep	1
hostb	reset


test	Debian GNU/Linux 11 (bullseye, stable), amd64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-nocloud-amd64.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /lib/systemd/system/serial-getty@.service
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux 11 (bullseye, stable), aarch64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-arm64.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-config.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-config
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-final
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux 11 (bullseye, stable), ppc64le

temp	IMG
host	wget https://cloud.debian.org/images/cloud/bullseye/latest/debian-11-generic-ppc64el.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-config.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-init-local.service
host	guestfish --rw -a __IMG__ -i rm /usr/lib/systemd/system/cloud-final.service
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-config
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-final
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init
host	guestfish --rw -a __IMG__ -i rm /etc/init.d/cloud-init-local
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-ppc64le -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1
hostb	reset


test	Debian GNU/Linux sid (experimental), amd64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-nocloud-amd64-daily.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	guestfish --rw -a __IMG__ -i rm /lib/systemd/system/serial-getty@.service
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 kvm -M pc -m 1024 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux sid (experimental), aarch64

temp	IMG
host	wget https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-nocloud-arm64-daily.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-aarch64 -m 2048 -cpu cortex-a57 -smp 2 -M virt -bios /usr/share/qemu-efi-aarch64/QEMU_EFI.fd -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1


test	Debian GNU/Linux sid (experimental), ppc64le

temp	IMG
host	wget https://cloud.debian.org/images/cloud/sid/daily/latest/debian-sid-nocloud-ppc64el-daily.qcow2 -O __IMG__
host	virt-edit -a __IMG__ /etc/systemd/system/getty.target.wants/getty@tty1.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 ttyS0 $TERM/g'
host	virt-edit -a __IMG__ /usr/lib/systemd/system/serial-getty@.service -e 's/ExecStart=.*/ExecStart=\/sbin\/agetty --autologin root -8 --keep-baud 115200,38400,9600 %I $TERM/g'
host	guestfish --rw -a __IMG__ -i copy-in __GUEST_FILES__ /root/

host	./qrap 5 qemu-system-ppc64le -m 2048 -smp 2 -nographic -serial stdio -nodefaults -no-reboot -nographic -vga none __IMG__ -net socket,fd=5 -net nic,model=virtio
sleep	2
host	apt-get update
host	apt-get -y install make gcc netcat-openbsd

host	make clean
host	CFLAGS="-Werror" make

distro_quick_pasta_test

hint
sleep	1
hostb	reset


sleep	1
host	kill __PID__