[PATCH 19/19] mdadm/tests: disable selinux

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Sometimes systemd service fails because selinux. Disable selinux
during testing now. We can enable it in future when having a better
method.

Signed-off-by: Xiao Ni <xni@xxxxxxxxxx>
---
 test          |  3 +++
 tests/func.sh | 10 ++++++++++
 2 files changed, 13 insertions(+)

diff --git a/test b/test
index 4a88de58fdf5..47f53ad78b75 100755
--- a/test
+++ b/test
@@ -16,6 +16,8 @@ devlist=
 # For example, /dev/md0 is created, stops it, then assemble it, the
 # device node will be /dev/md127 (127 is choosed by mdadm autumatically)
 is_foreign="no"
+#disable selinux
+sys_selinux="Permissive"
 
 skipping_linear="no"
 skipping_multipath="no"
@@ -351,6 +353,7 @@ main() {
 		fi
 	done
 
+	restore_selinux
 	exit 0
 }
 
diff --git a/tests/func.sh b/tests/func.sh
index db55542d4011..b2e4d122aa7f 100644
--- a/tests/func.sh
+++ b/tests/func.sh
@@ -167,6 +167,15 @@ is_raid_foreign() {
 	fi
 }
 
+record_selinux() {
+	sys_selinux=`getenforce`
+	setenforce Permissive
+}
+
+restore_selinux() {
+	setenforce $sys_selinux
+}
+
 do_setup() {
 	trap cleanup 0 1 3 15
 	trap ctrl_c 2
@@ -247,6 +256,7 @@ do_setup() {
 	echo 0 > /sys/module/md_mod/parameters/start_ro
 	record_system_speed_limit
 	is_raid_foreign
+	record_selinux
 }
 
 # check various things
-- 
2.32.0 (Apple Git-132)





[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux