mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
ipatests: refactoring: use library function to check if selinux is enabled
Reviewed-By: Florence Blanc-Renaud <flo@redhat.com>
This commit is contained in:
@@ -97,9 +97,7 @@ class TestSMB(IntegrationTest):
|
||||
smbserver.run_command(['mkdir', share_path])
|
||||
smbserver.run_command(['chmod', '777', share_path])
|
||||
# apply selinux context only if selinux is enabled
|
||||
res = smbserver.run_command('selinuxenabled', ok_returncode=(0, 1))
|
||||
selinux_enabled = res.returncode == 0
|
||||
if selinux_enabled:
|
||||
if tasks.is_selinux_enabled(smbserver):
|
||||
smbserver.run_command(['chcon', '-t', 'samba_share_t', share_path])
|
||||
smbconf_save_file = tasks.create_temp_file(smbserver)
|
||||
smbserver.run_command(['cp', paths.SMB_CONF, smbconf_save_file])
|
||||
|
||||
Reference in New Issue
Block a user