Validate production extension history through durable daemon transactions

This commit is contained in:
Pavel Isaev 2026-11-09 12:06:03 +03:00
parent 9f4ed077c4
commit e0897bc11d

View file

@ -295,9 +295,24 @@ journalctl -u archipelagod.service -n 80 --no-pager
reboot()
command("tree --version; mc --version; htop --version; nano --version; " + marker_check)
command("archipelago self-check; archipelago status; "
"test \"$(wc -l < /usr/lib/archipelago/host-extensions)\" = 4; "
"test \"$(find /var/lib/archipelago/host-extensions/generations -name staged | wc -l)\" = 3; "
"test \"$(find /var/lib/archipelago/host-extensions/generations -name failure | wc -l)\" = 1", True)
"test \"$(wc -l < /usr/lib/archipelago/host-extensions)\" = 4", True)
if args.production_cli:
# The daemon owns durable history. An unknown catalog name is
# rejected before staging (deployment invariance checked above),
# so it must not require a legacy filesystem failure marker.
history_check = (
"import json,sys; d=json.load(sys.stdin); "
"assert not d['next_cursor'], 'Incomplete transaction history'; "
"stages=[r for r in d['transactions'] if r['Kind']=='stage']; "
"assert all(r['State']=='succeeded' for r in stages), stages; "
"outcomes=[r['Result'].get('outcome') for r in stages]; "
"assert outcomes.count('staged')==3, outcomes; "
"assert outcomes.count('no-change')==1, outcomes"
)
command("archipelago transaction list | python3 -c " + shlex.quote(history_check), True)
else:
command("test \"$(find /var/lib/archipelago/host-extensions/generations -name staged | wc -l)\" = 3; "
"test \"$(find /var/lib/archipelago/host-extensions/generations -name failure | wc -l)\" = 1", True)
if args.dkms:
command("archipelago extension add v4l2loopback-dkms; "
"! modinfo v4l2loopback; ! test -e /dev/video0", True)