#!/usr/bin/env bash # Integration test of deploy/files/add-disk.sh with real loop disks in a throwaway privileged container (needs Docker). # tests/installer/run-add-disk.sh [image] default ubuntu:24.04 # Nothing on this machine is changed (the container is removed afterwards). set -euo pipefail IMAGE="${1:-ubuntu:24.04}" cd "$(dirname "$0")/../.." ROOT="$(pwd)" if command -v cygpath >/dev/null 2>&1; then FILES="$(cygpath -w "$ROOT/deploy/files")"; TESTS="$(cygpath -w "$ROOT/tests/installer")" else FILES="$ROOT/deploy/files"; TESTS="$ROOT/tests/installer" fi # the scripts are read from /t/files and the test from /t/test.sh (file:// URLs stand in for the server) MSYS_NO_PATHCONV=1 docker run --rm --privileged \ -v "$FILES:/t/files:ro" -v "$TESTS/add-disk-test.sh:/t/test.sh:ro" "$IMAGE" bash /t/test.sh