diff options
author | Helmut Grohne <helmut@subdivi.de> | 2023-09-24 19:39:33 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2023-09-24 21:45:13 +0200 |
commit | c63eb6291986dd813a74e76fdccf06900669c957 (patch) | |
tree | c98832fe621676c27f3c3174e415ca1f130ea47d /tests | |
parent | 4252a8c46af88baf8949da84ab21e8f79585a2f4 (diff) | |
download | debvm-c63eb6291986dd813a74e76fdccf06900669c957.tar.gz |
make autopkgtest non-flaky
When passing an empty release to ./tests/create-and-run.sh, we now use
the host's apt sources and pinning. This is an additional gitlab-ci test
and replaces the previous autopkgtest involving unstable, which thus
becomes non-flaky.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/create-and-run.sh | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/create-and-run.sh b/tests/create-and-run.sh index 26fe4f7..1f164b9 100755 --- a/tests/create-and-run.sh +++ b/tests/create-and-run.sh @@ -21,7 +21,7 @@ trap cleanup EXIT INT TERM QUIT ssh-keygen -f "$SSH_KEYPATH" -N '' MIRROR= -if ! curl -s "http://deb.debian.org/debian/dists/$RELEASE/InRelease" | sed -n 's/^Architectures: //p' | grep -qw "$ARCHITECTURE"; then +if test -n "$RELEASE" && ! 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 @@ -33,9 +33,23 @@ case "$RELEASE" in MIRROR=http://archive.debian.org/debian ;; esac -set -- --architectures="$ARCHITECTURE" -test -n "$MIRROR" && set -- "$@" "$MIRROR" -debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" -- "$@" +set -- -- --architectures="$ARCHITECTURE" +if test -z "$RELEASE"; then + # The ordering of maybe-merged-usr and + # copy-host-apt-sources-and-preferences is unfortunately the wrong way + # round. Therefore, we make debvm-create skip it and pass it ourselves. + # The final empty string is the mirror specification. + set -- \ + --skip=usrmerge \ + "$@" \ + --hook-dir=/usr/share/mmdebstrap/hooks/copy-host-apt-sources-and-preferences \ + --hook-dir=/usr/share/mmdebstrap/hooks/file-mirror-automount \ + --hook-dir=/usr/share/mmdebstrap/hooks/maybe-merged-usr \ + "" +elif test -n "$MIRROR"; then + set -- "$@" "$MIRROR" +fi +debvm-create -k "$SSH_KEYPATH.pub" -o "$IMAGE" -r "$RELEASE" "$@" SSH_PORT=2222 timeout 300s debvm-run -s "$SSH_PORT" -i "$IMAGE" & |