- Replace shared Nix volumes with distro-specific volumes (pkgmgr_nix_store_<distro>, pkgmgr_nix_cache_<distro>) - Prevent incompatible profile manifest versions between Ubuntu and Debian - Update all test scripts (unit, integration, container, e2e) - Remove unused global Nix volume variables from Makefile - Improve consistency of test-e2e.sh formatting and environment handling - Add Git safe.directory configuration for mounted /src to avoid ownership warnings
42 lines
1.3 KiB
Bash
Executable File
42 lines
1.3 KiB
Bash
Executable File
#!/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 \
|
|
-v pkgmgr_nix_store_${distro}:/nix \
|
|
-v "$(pwd):/src" \
|
|
-v "pkgmgr_nix_cache_${distro}:/root/.cache/nix" \
|
|
"$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 "============================================================"
|