diff --git a/tests/approval.sh b/tests/approval.sh index 5848823..7e9986a 100755 --- a/tests/approval.sh +++ b/tests/approval.sh @@ -21,6 +21,22 @@ cleanup() { "/var/lib/hyperhive/applied/${AGENT}" } +echo "=== precheck: hm1nd container is up ===" +if ! sudo machinectl status hm1nd >/dev/null 2>&1; then + echo " hm1nd is not running. Starting via systemd..." + sudo systemctl start "container@hm1nd.service" || { + echo "FAIL: could not start container@hm1nd.service." + echo " Did you 'nixos-rebuild switch' after declaring containers.hm1nd in your host config?" + exit 1 + } + # wait briefly for it to come up + for i in 1 2 3 4 5 6 7 8 9 10; do + sudo machinectl status hm1nd >/dev/null 2>&1 && break + sleep 0.5 + done +fi +echo " hm1nd is up ✓" + cleanup echo "=== spawn ${AGENT} ==="