swarm-archive vm test: check the no-key run died on the missing key, not is-active
This commit is contained in:
parent
e62915d5c4
commit
60af939514
1 changed files with 9 additions and 1 deletions
|
|
@ -376,7 +376,15 @@ pkgs.testers.runNixOSTest {
|
|||
|
||||
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.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}/")
|
||||
|
||||
with subtest("s3: the server starts once the store holds the key"):
|
||||
|
|
|
|||
Loading…
Reference in a new issue