diff options
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | tests/create-and-run.sh | 15 |
2 files changed, 12 insertions, 7 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 95f9d3d..ec5bc48 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -28,7 +28,7 @@ release_test: script: - apt-get update - apt-get dist-upgrade --yes - - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm dpkg-dev + - apt-get --no-install-recommends --yes install curl e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm dpkg-dev - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh $(dpkg --print-architecture) "$RELEASE" arch_test: @@ -47,6 +47,6 @@ arch_test: - test -e /proc/sys/fs/binfmt_misc/status || mount -t binfmt_misc binfmt_misc /proc/sys/fs/binfmt_misc - apt-get update - apt-get dist-upgrade --yes - - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-system arch-test qemu-user-static file systemd dpkg-dev + - apt-get --no-install-recommends --yes install curl e2fsprogs genext2fs mmdebstrap openssh-client qemu-system arch-test qemu-user-static file systemd dpkg-dev debian-ports-archive-keyring - /lib/systemd/systemd-binfmt - PATH=$(pwd)/bin:$PATH ./tests/create-and-run.sh "$ARCHITECTURE" sid 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" & |