FDS/OS 1.0 fixes
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user