diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-09-14 11:12:42 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-09-14 11:39:08 +0200 |
commit | e2e003c4415f65c2755c24e8697a11f0f34f2f94 (patch) | |
tree | 3e7046eaac9c563b287004d035f82892a7dd6e0a | |
parent | d1e2c48b9b3965a5acb37c4f404c6d5691a26d3c (diff) | |
download | debvm-e2e003c4415f65c2755c24e8697a11f0f34f2f94.tar.gz |
tests/create-and-run.sh: choose ports mirror automatically
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rwxr-xr-x | tests/create-and-run.sh | 12 |
2 files changed, 8 insertions, 8 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5aa17d1..e555ae3 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -27,7 +27,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 debian-ports-archive-keyring + - 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 10b2eff..a46de06 100755 --- a/tests/create-and-run.sh +++ b/tests/create-and-run.sh @@ -21,13 +21,13 @@ trap cleanup EXIT INT TERM QUIT ssh-keygen -f "$SSH_KEYPATH" -N '' MIRROR= -case "$ARCHITECTURE" in +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. - armel) ARCHITECTURE=armel,armhf ;; - alpha|arc|hppa|hurd-i386|ia64|kfreebsd-amd64|kfreebsd-i386|m68k|powerpc|ppc64|riscv64|sh4|sparc64|x32) - MIRROR="deb [signed-by=/usr/share/keyrings/debian-ports-archive-keyring.gpg] http://deb.debian.org/debian-ports $RELEASE main" - ;; -esac + ARCHITECTURE=armel,armhf +fi case "$RELEASE" in jessie|stretch) MIRROR=http://archive.debian.org/debian |