Skip to content

Commit

Permalink
tests: Work around podman run ignoring exit code 125
Browse files Browse the repository at this point in the history
meson commonly exits with code 125, but `podman run` silently ignores
that particular value. Rewrite all non-successful error codes to 1 to
work around this.

This has hidden failing builds for a while already.

See containers/podman#11540
  • Loading branch information
martinpitt committed Sep 12, 2021
1 parent 5e82960 commit dfb3e5e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/run-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ else
fi

$RUNC run --interactive ${OPTS:-} --volume `pwd`:/source:ro ${1:-docker.io/alpine} /bin/sh <<EOF
# avoid meson exit code 125; https://github.com/containers/podman/issues/11540
trap '[ \$? -eq 0 ] || exit 1' EXIT
# install build dependencies
apk add --no-cache meson gcc musl-dev glib-dev eudev-dev libpcap-dev make vala linux-headers xz usbutils ${EXTRA_PACKAGES:-}
Expand Down
3 changes: 3 additions & 0 deletions tests/run-apt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ fi
$RUNC run --interactive ${OPTS:-} --volume `pwd`:/source${MOUNT_MODE:-} ${1:-docker.io/amd64/ubuntu:rolling} /bin/sh << EOF
set -ex
# avoid meson exit code 125; https://github.com/containers/podman/issues/11540
trap '[ \$? -eq 0 ] || exit 1' EXIT
# go-faster apt
echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/90nolanguages
Expand Down
4 changes: 4 additions & 0 deletions tests/run-dnf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ fi

$RUNC run --interactive ${RUNC_OPTIONS:-} ${OPTS:-} --volume `pwd`:/source:ro ${1:-registry.fedoraproject.org/fedora} /bin/sh << EOF
set -eu
# avoid meson exit code 125; https://github.com/containers/podman/issues/11540
trap '[ \$? -eq 0 ] || exit 1' EXIT
dnf -y update
if grep -q ID=.*centos /etc/os-release; then
Expand Down
3 changes: 3 additions & 0 deletions tests/run-nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ fi

# sandboxing requires privileged container; https://github.com/NixOS/docker#limitations
$RUNC run --interactive ${DEBUG:+--tty} --privileged --volume `pwd`:/source:ro ${1:-docker.io/nixos/nix} /bin/sh <<EOF
# avoid meson exit code 125; https://github.com/containers/podman/issues/11540
trap '[ \$? -eq 0 ] || exit 1' EXIT
sed -i '/sandbox/ s/false/true/' /etc/nix/nix.conf
cat <<EOG > /tmp/default.nix
Expand Down

0 comments on commit dfb3e5e

Please sign in to comment.