From 32c5e054795e811420db84eb913e00ac3af8fc2b Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 6 Jul 2022 17:29:07 +1000 Subject: tests: Move distro image download to asset build makefile Rather than directly download distro images from the test scripts, handle all the downloads during the test asset build, then just clone them for the tests themselves. This avoids repeated downloads which can be very slow when debugging failing tests. Signed-off-by: David Gibson [sbrivio: Add OPENSUSE_IMGS to DOWNLOAD_ASSETS in Makefile, and note that xzcat doesn't take a -O option in test/distro/opensuse] Signed-off-by: Stefano Brivio --- test/distro/debian | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'test/distro/debian') diff --git a/test/distro/debian b/test/distro/debian index 9992b69..a7a0f98 100644 --- a/test/distro/debian +++ b/test/distro/debian @@ -12,7 +12,7 @@ # Author: Stefano Brivio temp PIDFILE -htools wget virt-edit guestfish head sed cat kill qemu-system-x86_64 qemu-system-aarch64 qemu-system-ppc64 +htools qemu-img virt-edit guestfish head sed cat kill qemu-system-x86_64 qemu-system-aarch64 qemu-system-ppc64 # Quick pasta test: send message from init to ns, and from ns to init def distro_quick_pasta_test @@ -45,7 +45,7 @@ hout GUEST_FILES ls -1 *.c *.h *.sh passt.1 qrap.1 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-8.11.0-openstack-amd64.qcow2 __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 @@ -76,7 +76,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-9-nocloud-amd64-daily-20200210-166.qcow2 __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/ @@ -100,7 +100,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-10-nocloud-amd64.qcow2 __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/ @@ -124,7 +124,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-10-generic-arm64.qcow2 __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 @@ -155,7 +155,8 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-10-generic-ppc64el.qcow2 __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 @@ -188,7 +189,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-11-nocloud-amd64.qcow2 __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/ @@ -210,7 +211,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-11-generic-arm64.qcow2 __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 @@ -239,7 +240,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-11-generic-ppc64el.qcow2 __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 @@ -270,7 +271,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-sid-nocloud-amd64-daily.qcow2 __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/ @@ -292,7 +293,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-sid-nocloud-arm64-daily.qcow2 __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/ @@ -313,7 +314,7 @@ 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 qemu-img create -f qcow2 -F qcow2 -b __BASEPATH__/debian-sid-nocloud-ppc64el-daily.qcow2 __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/ -- cgit v1.2.3