Watch
0
0
Fork
You've already forked hyperhive
0

swarm-archive vm test: check the no-key run died on the missing key, not is-active

This commit is contained in:
maia 2026-11-20 04:38:10 +01:00 • committed by mara
commit 60af939514

View file

@ -376,7 +376,15 @@ pkgs.testers.runNixOSTest {
with subtest("s3: without the key in the store the server does not start"): with subtest("s3: without the key in the store the server does not start"):
s3archive.wait_until_succeeds("journalctl -u swarm-archive | grep -q 'No value found'") s3archive.wait_until_succeeds("journalctl -u swarm-archive | grep -q 'No value found'")
s3archive.fail("systemctl is-active --quiet swarm-archive") # With no key the unit crash-loops (Restart=on-failure), and systemd
# reports a Type=simple unit as active for the moment between a start
# and the wrapper's exit. A one-shot `is-active` check can land in that
# window, so ask instead whether the last run died on the missing key:
# one `systemctl show` read, exit-code result and the wrapper's status 2.
s3archive.wait_until_succeeds(
"o=$(systemctl show -p Result,ExecMainStatus swarm-archive); "
"echo \"$o\" | grep -qx 'Result=exit-code' && echo \"$o\" | grep -qx 'ExecMainStatus=2'"
)
s3archive.fail(f"curl -sf --max-time 2 -o /dev/null {url}/") s3archive.fail(f"curl -sf --max-time 2 -o /dev/null {url}/")
with subtest("s3: the server starts once the store holds the key"): with subtest("s3: the server starts once the store holds the key"):