test.sh (490 bytes)
1 #!/bin/sh 2 # test.sh WORKDIR BASE "COMPOSITORS" [encrypt|plain] 3 # Runs test-qemu.py on WORKDIR/waybase.img inside an Alpine container with KVM. 4 set -eu 5 here=$(cd "$(dirname "$0")" && pwd) 6 W=$(cd "$1" && pwd); shift 7 docker run --rm -i --device /dev/kvm -v "$here:/src:ro" -v "$W:/work" alpine:latest sh -c \ 8 'apk add -q qemu-system-x86_64 qemu-img ovmf python3 >/dev/null 2>&1 || command -v qemu-img >/dev/null 9 exec python3 -u /src/test-qemu.py /work/waybase.img /work "$@"' sh "$@"