tests/approval.sh: precheck + auto-start hm1nd
This commit is contained in:
parent
a751e544be
commit
e533154655
1 changed files with 16 additions and 0 deletions
|
|
@ -21,6 +21,22 @@ cleanup() {
|
||||||
"/var/lib/hyperhive/applied/${AGENT}"
|
"/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
|
cleanup
|
||||||
|
|
||||||
echo "=== spawn ${AGENT} ==="
|
echo "=== spawn ${AGENT} ==="
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue