summaryrefslogtreecommitdiff
path: root/tests/create-and-run.sh
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-09-14 14:22:30 +0200
committerHelmut Grohne <helmut@subdivi.de>2023-09-14 14:22:30 +0200
commit88afd5041a1739be866f0b0de7814ff505507147 (patch)
treeb02aba7406fc3b594c1fbb6c2ec1babc9e5ae1a5 /tests/create-and-run.sh
parent370853674fd74d61f54a6fbf5aab4d7309580e75 (diff)
parentf62eaac14ce1a383d1c372acfb1cc284affd7fe8 (diff)
downloaddebvm-88afd5041a1739be866f0b0de7814ff505507147.tar.gz
Merge fix_ports into main
Diffstat (limited to 'tests/create-and-run.sh')
-rwxr-xr-xtests/create-and-run.sh15
1 files changed, 10 insertions, 5 deletions
diff --git a/tests/create-and-run.sh b/tests/create-and-run.sh
index 392a691..26fe4f7 100755
--- a/tests/create-and-run.sh
+++ b/tests/create-and-run.sh
@@ -20,17 +20,22 @@ cleanup() {
trap cleanup EXIT INT TERM QUIT
ssh-keygen -f "$SSH_KEYPATH" -N ''
-case "$ARCHITECTURE" in
- # Booting an armel kernel on qemu is next to impossible.
- armel) ARCHITECTURE=armel,armhf ;;
-esac
MIRROR=
+if ! curl -s "http://deb.debian.org/debian/dists/$RELEASE/InRelease" | sed -n 's/^Architectures: //p' | grep -qw "$ARCHITECTURE"; then
+ MIRROR="deb [signed-by=/usr/share/keyrings/debian-ports-archive-keyring.gpg] http://deb.debian.org/debian-ports $RELEASE main"
+fi
+if test "$ARCHITECTURE" = armel; then
+ # Booting an armel kernel on qemu is next to impossible.
+ ARCHITECTURE=armel,armhf
+fi
case "$RELEASE" in
jessie|stretch)
MIRROR=http://archive.debian.org/debian
;;
esac
-debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" -- --architectures="$ARCHITECTURE" $MIRROR
+set -- --architectures="$ARCHITECTURE"
+test -n "$MIRROR" && set -- "$@" "$MIRROR"
+debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" -- "$@"
SSH_PORT=2222
timeout 300s debvm-run -s "$SSH_PORT" -i "$IMAGE" &