summaryrefslogtreecommitdiffstats
path: root/test/integration-test-wrapper.py
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-05 11:38:09 +0200
committerDaan De Meyer <daan.j.demeyer@gmail.com>2024-05-06 10:56:54 +0200
commitd91bb1cbf073f2777cd3eebd8ff39c58066bd5c1 (patch)
tree2853800ac9ef7a5788cf5f0eef20634ef3909566 /test/integration-test-wrapper.py
parenttest: Use MESON_TEST_ITERATION if available (diff)
downloadsystemd-d91bb1cbf073f2777cd3eebd8ff39c58066bd5c1.tar.xz
systemd-d91bb1cbf073f2777cd3eebd8ff39c58066bd5c1.zip
test: Always shutdown on test success in mkosi
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.
Diffstat (limited to 'test/integration-test-wrapper.py')
-rwxr-xr-xtest/integration-test-wrapper.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/integration-test-wrapper.py b/test/integration-test-wrapper.py
index 99ae43ac83..a32210c06f 100755
--- a/test/integration-test-wrapper.py
+++ b/test/integration-test-wrapper.py
@@ -59,6 +59,8 @@ def main():
[Unit]
After=multi-user.target network.target
Requires=multi-user.target
+ SuccessAction=exit
+ SuccessActionExitStatus=123
[Service]
StandardOutput=journal+console
@@ -85,8 +87,6 @@ def main():
dropin += textwrap.dedent(
"""
[Unit]
- SuccessAction=exit
- SuccessActionExitStatus=123
FailureAction=exit
"""
)
@@ -143,7 +143,7 @@ def main():
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',