From 4ea9aead5cab96ed9454facdb6d22bdfe514a09b Mon Sep 17 00:00:00 2001 From: Sergey Orlov Date: Wed, 18 Sep 2019 11:43:47 +0200 Subject: [PATCH] ipatests: refactoring: use library function to check if selinux is enabled Reviewed-By: Florence Blanc-Renaud --- ipatests/test_integration/test_smb.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ipatests/test_integration/test_smb.py b/ipatests/test_integration/test_smb.py index fa9d34054..52cdbcda7 100644 --- a/ipatests/test_integration/test_smb.py +++ b/ipatests/test_integration/test_smb.py @@ -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])