From 6ec3c84c0ca3f43d09272ffa6d656c1ed72067cb Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Fri, 7 Jun 2019 15:33:01 +0200 Subject: [PATCH] ipatests: fix test_backup_and_restore.py::TestBackupAndRestore The test test_backup_and_restore.py::TestBackupAndRestore test_full_backup_and_restore_with_selinux_booleans_off requires SELinux to be enabled because it's using getsebool command. Skip the test if SELinux is disabled. Fixes: https://pagure.io/freeipa/issue/7970 Reviewed-By: Tibor Dudlak Reviewed-By: Rob Crittenden --- ipatests/test_integration/test_backup_and_restore.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipatests/test_integration/test_backup_and_restore.py b/ipatests/test_integration/test_backup_and_restore.py index 7f04d7abb..1a9fda102 100644 --- a/ipatests/test_integration/test_backup_and_restore.py +++ b/ipatests/test_integration/test_backup_and_restore.py @@ -27,6 +27,7 @@ import pytest from ipaplatform.constants import constants from ipaplatform.paths import paths +from ipaplatform.tasks import tasks as platformtasks from ipapython.dn import DN from ipapython import ipautil from ipatests.test_integration.base import IntegrationTest @@ -227,6 +228,9 @@ class TestBackupAndRestore(IntegrationTest): finally: self.master.run_command(['userdel', 'ipatest_user1']) + @pytest.mark.skipif( + not platformtasks.is_selinux_enabled(), + reason="Test needs SELinux enabled") def test_full_backup_and_restore_with_selinux_booleans_off(self): """regression test for https://fedorahosted.org/freeipa/ticket/4157""" with restore_checker(self.master):