2025-12-09 05:31:55 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
echo "============================================================"
|
|
|
|
|
echo ">>> Running sanity test: verifying test containers start"
|
|
|
|
|
echo "============================================================"
|
|
|
|
|
|
|
|
|
|
for distro in $DISTROS; do
|
|
|
|
|
IMAGE="package-manager-test-$distro"
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "------------------------------------------------------------"
|
|
|
|
|
echo ">>> Testing container: $IMAGE"
|
|
|
|
|
echo "------------------------------------------------------------"
|
|
|
|
|
|
|
|
|
|
echo "[test-container] Running: docker run --rm --entrypoint pkgmgr $IMAGE --help"
|
|
|
|
|
echo
|
|
|
|
|
|
|
|
|
|
# Run the command and capture the output
|
|
|
|
|
if OUTPUT=$(docker run --rm \
|
|
|
|
|
-e PKGMGR_DEV=1 \
|
2025-12-10 20:07:41 +01:00
|
|
|
-v pkgmgr_nix_store_${distro}:/nix \
|
2025-12-09 05:31:55 +01:00
|
|
|
-v "$(pwd):/src" \
|
2025-12-10 20:07:41 +01:00
|
|
|
-v "pkgmgr_nix_cache_${distro}:/root/.cache/nix" \
|
2025-12-09 05:31:55 +01:00
|
|
|
"$IMAGE" 2>&1); then
|
|
|
|
|
echo "$OUTPUT"
|
|
|
|
|
echo
|
|
|
|
|
echo "[test-container] SUCCESS: $IMAGE responded to 'pkgmgr --help'"
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
echo "$OUTPUT"
|
|
|
|
|
echo
|
|
|
|
|
echo "[test-container] ERROR: $IMAGE failed to run 'pkgmgr --help'"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
echo
|
|
|
|
|
echo "============================================================"
|
|
|
|
|
echo ">>> All containers passed the sanity check"
|
|
|
|
|
echo "============================================================"
|