diff mbox series

[blktests,2/3] tests/srp: Remove /etc/multipath.conf after a test has finished

Message ID 20180815203728.19521-3-bart.vanassche@wdc.com (mailing list archive)
State New, archived
Headers show
Series Add NVMeOF multipath tests | expand

Commit Message

Bart Van Assche Aug. 15, 2018, 8:37 p.m. UTC
Instead of removing /etc/multipath.conf before a test starts, remove it
after a test has finished. This change is needed to let the nvmeof-mp
tests run after the srp tests have been run.

Signed-off-by: Bart Van Assche <bart.vanassche@wdc.com>
---
 tests/srp/rc | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/tests/srp/rc b/tests/srp/rc
index 7484b9513252..e93eaab996f4 100755
--- a/tests/srp/rc
+++ b/tests/srp/rc
@@ -103,12 +103,6 @@  group_requires() {
 		SKIP_REASON="/etc/multipath.conf already exists"
 		return 1
 	fi
-	if [ ! -e /etc/multipath.conf ]; then
-		(
-			srcdir=$PWD
-			cd /etc && ln -s "$srcdir/tests/srp/multipath.conf" .
-		)
-	fi
 }
 
 # Log out, set dm and SCSI use_blk_mq parameters and log in. $1: device mapper
@@ -1202,6 +1196,7 @@  shutdown_client() {
 # Undo setup()
 teardown() {
 	killall -9 multipathd >&/dev/null
+	rm -f /etc/multipath.conf
 	stop_target
 	unload_null_blk
 }
@@ -1236,6 +1231,12 @@  setup() {
 
 	configure_null_blk
 
+	if [ ! -e /etc/multipath.conf ]; then
+		(
+			srcdir=$PWD
+			cd /etc && ln -s "$srcdir/tests/srp/multipath.conf" .
+		)
+	fi
 	multipathd
 
 	# Load the I/O scheduler kernel modules