When we want to get an interactive shell in a test that fails because
of a race condition, we might need to run the test a few times with
--repeat before it fails. However, currently, when -i is used, the VM
needs to be shut down manually each time before the next run can start.
Let's always shut down the VM if the test succeeds so that --repeat can
be used with -i to run the test until it fails and then get an interactive
shell in the VM.
[Unit]
After=multi-user.target network.target
Requires=multi-user.target
+ SuccessAction=exit
+ SuccessActionExitStatus=123
[Service]
StandardOutput=journal+console
dropin += textwrap.dedent(
"""
[Unit]
- SuccessAction=exit
- SuccessActionExitStatus=123
FailureAction=exit
"""
)
result = subprocess.run(cmd)
# Return code 123 is the expected success code
- if result.returncode != (0 if sys.stderr.isatty() else 123):
+ if result.returncode != 123:
if result.returncode != 77 and journal_file:
cmd = [
'journalctl',