Skip to content

Commit af09d69

Browse files
committed
Consolidate code on a single 'expected_mode' variable.
1 parent 6c24984 commit af09d69

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

stackhpc_cloud_tests/host/test_selinux.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ def test_selinux(host):
2323
if host.system_info.distribution in {"debian", "ubuntu"}:
2424
pytest.skip(reason="SELinux is not supported on Debian or Ubuntu")
2525
# Desired state: enforcing, permissive or disabled
26-
expected_state = os.environ["SELINUX_STATE"]
27-
assert expected_state in {"enforcing", "permissive", "disabled"}
28-
expected_status = "disabled" if expected_state == "disabled" else "enabled"
29-
expected_mode = expected_state
26+
expected_mode = os.environ["SELINUX_STATE"]
27+
assert expected_mode in {"enforcing", "permissive", "disabled"}
28+
expected_status = "disabled" if expected_mode == "disabled" else "enabled"
3029
selinux = host.check_output("sestatus")
3130
selinux = selinux.splitlines()
3231
# Remove duplicate whitespace characters in output

0 commit comments

Comments
 (0)