diff options
author | Jochen Sprickerhof <git@jochen.sprickerhof.de> | 2022-12-28 11:30:33 +0100 |
---|---|---|
committer | Jochen Sprickerhof <git@jochen.sprickerhof.de> | 2022-12-28 21:38:01 +0100 |
commit | 941815d86114ed21523b10d4c3fddeb5de4282de (patch) | |
tree | f50c542fb818a95e7f8fd78a30ad734ccd82d6bd /tests | |
parent | e08f30fe771d065a4cde8f58dd71b6d4a358004d (diff) | |
download | debvm-941815d86114ed21523b10d4c3fddeb5de4282de.tar.gz |
Test dist-upgrades
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/dist-upgrades.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/dist-upgrades.sh b/tests/dist-upgrades.sh new file mode 100755 index 0000000..01bcb59 --- /dev/null +++ b/tests/dist-upgrades.sh @@ -0,0 +1,48 @@ +#!/bin/sh +# Copyright 2022 Jochen Sprickerhof <debvm@jochen.sprickerhof.de> +# SPDX-License-Identifier: MIT +# +# apt install e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm + +set -x + +cleanup() { + rm -f ssh_id ssh_id.pub upgrade +} + +trap cleanup EXIT INT TERM QUIT + +cat > upgrade << "EOF" +#!/bin/sh + +set -ex + +export DEBIAN_FRONTEND=noninteractive + +sed -i "s/\([^ ]*\) \([^ ]*\) [^ ]* \(.*\)/\1 \2 $1 \3/" /etc/apt/sources.list +apt update +apt dist-upgrade -y + +test "$1" = stretch && apt install libnss-resolve + +apt autoremove --purge -y +apt clean +poweroff +EOF + +chmod +x upgrade +ssh-keygen -f ssh_id -N '' + +./debvm-create -k ssh_id.pub -r jessie -z 3 -- --customize-hook="copy-in upgrade /usr/local/bin" + +for RELEASE in stretch buster bullseye bookworm sid; do + timeout 15m ./debvm-run -s 2222 & + SSHOPT="-o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" + test "$RELEASE" = stretch && SSHOPT="${SSHOPT} -o PubkeyAcceptedKeyTypes=+ssh-rsa" + tests/try-ssh.sh "$SSHOPT -i ssh_id -p 2222 root@localhost" "upgrade $RELEASE" + wait +done + +timeout 5m ./debvm-run -s 2222 & +tests/try-ssh.sh "-o ConnectTimeout=5 -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -i ssh_id -p 2222 root@localhost" poweroff +wait |