mirror of
https://github.com/pi-hole/pi-hole.git
synced 2026-04-24 19:00:19 +01:00
Fix black formatting
Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
@@ -15,14 +15,10 @@ def mock_selinux_config(state, host):
|
||||
# getenforce returns the running state of SELinux
|
||||
mock_command("getenforce", {"*": (state.capitalize(), "0")}, host)
|
||||
# create mock configuration with desired content
|
||||
host.run(
|
||||
"""
|
||||
host.run("""
|
||||
mkdir /etc/selinux
|
||||
echo "SELINUX={state}" > /etc/selinux/config
|
||||
""".format(
|
||||
state=state.lower()
|
||||
)
|
||||
)
|
||||
""".format(state=state.lower()))
|
||||
|
||||
|
||||
def test_selinux_enforcing_exit(host):
|
||||
@@ -30,12 +26,10 @@ def test_selinux_enforcing_exit(host):
|
||||
confirms installer prompts to exit when SELinux is Enforcing by default
|
||||
"""
|
||||
mock_selinux_config("enforcing", host)
|
||||
check_selinux = host.run(
|
||||
"""
|
||||
check_selinux = host.run("""
|
||||
source /opt/pihole/basic-install.sh
|
||||
checkSelinux
|
||||
"""
|
||||
)
|
||||
""")
|
||||
expected_stdout = cross_box + " Current SELinux: enforcing"
|
||||
assert expected_stdout in check_selinux.stdout
|
||||
expected_stdout = "SELinux Enforcing detected, exiting installer"
|
||||
@@ -48,12 +42,10 @@ def test_selinux_permissive(host):
|
||||
confirms installer continues when SELinux is Permissive
|
||||
"""
|
||||
mock_selinux_config("permissive", host)
|
||||
check_selinux = host.run(
|
||||
"""
|
||||
check_selinux = host.run("""
|
||||
source /opt/pihole/basic-install.sh
|
||||
checkSelinux
|
||||
"""
|
||||
)
|
||||
""")
|
||||
expected_stdout = tick_box + " Current SELinux: permissive"
|
||||
assert expected_stdout in check_selinux.stdout
|
||||
assert check_selinux.rc == 0
|
||||
@@ -64,12 +56,10 @@ def test_selinux_disabled(host):
|
||||
confirms installer continues when SELinux is Disabled
|
||||
"""
|
||||
mock_selinux_config("disabled", host)
|
||||
check_selinux = host.run(
|
||||
"""
|
||||
check_selinux = host.run("""
|
||||
source /opt/pihole/basic-install.sh
|
||||
checkSelinux
|
||||
"""
|
||||
)
|
||||
""")
|
||||
expected_stdout = tick_box + " Current SELinux: disabled"
|
||||
assert expected_stdout in check_selinux.stdout
|
||||
assert check_selinux.rc == 0
|
||||
|
||||
Reference in New Issue
Block a user