FDS/OS 1.0 fixes

This commit is contained in:
2026-09-23 03:12:45 +08:00
parent 8a4788fca8
commit 6bfcce8070
23 changed files with 403 additions and 40 deletions
+10
View File
@@ -39,6 +39,16 @@ def invoke(*command, ok=True):
result = subprocess.run([cli, '--session', str(session), *map(str, command)], capture_output=True, text=True, timeout=240)
log.write(repr(command) + '\n' + result.stdout + result.stderr)
log.flush()
if (result.returncode == 0) != ok and command and command[0] == 'guest':
# Preserve live service evidence before the finally block stops the VM.
# Do not retry or relax the failed command's acceptance condition.
diagnostics = subprocess.run([
cli, '--session', str(session), 'guest', '--', 'sh', '-c',
'cat /run/log/cartridged/current; s6-svstat /run/service/cartridged; '
'dmesg | tail -40',
], capture_output=True, text=True, timeout=60)
log.write('Failure diagnostics:\n' + diagnostics.stdout + diagnostics.stderr)
log.flush()
assert (result.returncode == 0) == ok, (command, result.returncode, result.stdout, result.stderr)
return result.stdout