Skip to content

Commit a76598b

Browse files
committed
Update check with correct exit-code handling
Updates the check for inactive state having been preserved to expect a non-zero exit code - "systemctl is-active" actually returns 3 and the docs just say that if the service isn't active the return code is non-zero
1 parent ae202ed commit a76598b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/pytests/pkg/upgrade/test_systemd_permissions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def test_salt_systemd_inactive_preservation(
124124
test_cmd = f"systemctl is-active {test_item}"
125125
ret = salt_call_cli.run("--local", "cmd.run", test_cmd)
126126
test_active = ret.stdout.strip().split()[2].strip('"').strip()
127-
assert ret.returncode == 1
127+
assert ret.returncode != 0
128128
assert test_active == "inactive"
129129

130130

0 commit comments

Comments
 (0)