[Ocfs2-test-devel] [PATCH 9/9] lvb_torture: failed when pcmk is used as cluster stack

Eric Ren zren at suse.com
Fri Jun 17 02:13:04 PDT 2016


This test case failed with "pcmk" stack. Output errors
like:
"rank 1: /dlm/ has no write permission."
"rank 1: o2dlm_initialize failed: -1485330936".

Signed-off-by: Eric Ren <zren at suse.com>
---
 programs/lvb_torture/lvb_torture.c     |  5 +++++
 programs/python_common/multiple_run.sh | 12 ++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/programs/lvb_torture/lvb_torture.c b/programs/lvb_torture/lvb_torture.c
index 1459849..688d0d9 100644
--- a/programs/lvb_torture/lvb_torture.c
+++ b/programs/lvb_torture/lvb_torture.c
@@ -311,6 +311,11 @@ int parse_opts(int argc, char **argv)
 			break;
 		case 'd':
 			dlmfs_path = strdup(optarg);
+			/* "pcmk" is used as cluster stack if "NULL"
+			 * is passed here
+			 * */
+			if (strcmp(dlmfs_path, "NULL") == 0)
+			    dlmfs_path = NULL;
 			break;
 		case 'i':
 			max_iter = atoll(optarg);
diff --git a/programs/python_common/multiple_run.sh b/programs/python_common/multiple_run.sh
index e2e9e3b..e66eb63 100755
--- a/programs/python_common/multiple_run.sh
+++ b/programs/python_common/multiple_run.sh
@@ -31,6 +31,7 @@ DD=`which dd`
 GREP=`which grep`
 AWK=`which awk`
 ECHO="`which echo` -e"
+O2CLUSTER="`which o2cluster`"
 
 SUDO="`which sudo` -u root"
 IFCONFIG_BIN="`which ifconfig`"
@@ -405,6 +406,7 @@ run_lvb_torture_test()
         local logfile=${logdir}/lvb_torture_${DATE}.log
         local workplace=${MOUNT_POINT}
 	local testfile=${workplace}/lvb_torture_test_file
+	local dlmfs_path="/dlm"
 
 	${MKDIR_BIN} -p ${logdir}
 	${CHMOD_BIN} -R 777 ${logdir}
@@ -434,9 +436,15 @@ ${DEVICE} ${FEATURES} ${JOURNALSIZE} ${BLOCKS}
 	local UUID="`${DEBUGFS_BIN} -R stats ${DEVICE} |grep UUID|cut -d: -f 2`"
 	local LOCK="`${DEBUGFS_BIN} -R 'encode lvb_torture_test_file' ${DEVICE}`"
 
-	LogMsg "Run lvb_torture, CMD: ${BINDIR}/run_lvb_torture.py -d /dlm/ -i 60000 \
+	#dlmfs_path should be "NULL" if cluster stack is "pcmk"
+	local stack="`${SUDO} ${O2CLUSTER} -r | ${AWK} -F',' '{printf $1}'`"
+	if [ "$stack" = "pcmk" ];then
+		dlmfs_path="NULL"
+	fi
+
+	LogMsg "Run lvb_torture, CMD: ${BINDIR}/run_lvb_torture.py -d ${dlmfs_path} -i 60000 \
 -H ${DEVICE} -l ${logfile} -n ${NODE_LIST} "${UUID}" "${LOCK}""
-	${SUDO} ${BINDIR}/run_lvb_torture.py -d /dlm/ -c 60000 -i ${INTERFACE} -l \
+	${SUDO} ${BINDIR}/run_lvb_torture.py -d ${dlmfs_path} -c 60000 -i ${INTERFACE} -l \
 ${logfile} -n ${NODE_LIST} "${UUID}" "${LOCK}" >> ${LOGFILE} 2>&1
 	LogRC $?
 
-- 
2.6.6




More information about the Ocfs2-test-devel mailing list