| 1 | #!/bin/sh |
| 2 | set -eu |
| 3 | |
| 4 | IMAGE="${1:-registry.fedoraproject.org/fedora:latest}" |
| 5 | |
| 6 | podman run --interactive --rm --privileged -v "$(pwd):/src" -w /src "$IMAGE" <<EOF |
| 7 | set -eux |
| 8 | |
| 9 | # overlayfs does not support fanotify |
| 10 | mount -t tmpfs tmpfs /tmp |
| 11 | |
| 12 | if type apt >/dev/null 2>&1; then |
| 13 | apt-get update |
| 14 | DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc libc-dev make python3 btrfs-progs |
| 15 | else |
| 16 | dnf install -y gcc glibc-devel make python3 util-linux btrfs-progs |
| 17 | fi |
| 18 | |
| 19 | make |
| 20 | |
| 21 | python3 -m unittest -v || { |
| 22 | if [ -n "${DEBUG:-}" ]; then |
| 23 | echo "Tests failed; run this to debug: podman exec -itl bash" |
| 24 | sleep infinity |
| 25 | fi |
| 26 | exit 1 |
| 27 | } |
| 28 | EOF |