From a89a63d22879014d1ac09a86d43b4e27940ac555 Mon Sep 17 00:00:00 2001 From: Michael MacDonald Date: Tue, 11 Mar 2014 00:37:14 -0400 Subject: [PATCH] LU-4751 hsm: Fix sanity-hsm tests for non-mrsh $PDSH The workaround for starting backgrounded copytool monitors via pdsh -Rmrsh is not compatible with non-mrsh values of $PDSH. This commit adds a branch such that the workaround is only used when required by the test cluster environment. Signed-off-by: Michael MacDonald Change-Id: I35a57d26a3836cfd1bbb698d267a8fe9f31f86c8 Reviewed-on: http://review.whamcloud.com/9587 Tested-by: Jenkins Reviewed-by: James Nunez Tested-by: Maloo Reviewed-by: Bob Glossman Reviewed-by: John L. Hammond Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- lustre/tests/sanity-hsm.sh | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index 97fc46e..a2d9011 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -159,19 +159,25 @@ copytool_monitor_setup() { cmd="cat $test_dir/fifo > $test_dir/events &" cmd+=" echo \\\$! > $test_dir/monitor_pid" - # This is required for pdsh -Rmrsh and its handling of remote shells. - # Regular ssh and pdsh -Rssh work fine without this backgrounded - # subshell nonsense. - (do_node $agent "$cmd") & - export HSMTOOL_MONITOR_PDSH=$! - - # Slightly racy, but just making a best-effort to catch obvious - # problems. If we get rid of the ridiculous backgrounded subshell, - # this check will need to be updated to just look at the returncode - # of do_node. - sleep 1 - ps -p $HSMTOOL_MONITOR_PDSH >&- || - error "Failed to start copytool monitor on $agent" + if [[ $PDSH == *Rmrsh* ]]; then + # This is required for pdsh -Rmrsh and its handling of remote + # shells. + # Regular ssh and pdsh -Rssh work fine without this + # backgrounded subshell nonsense. + (do_node $agent "$cmd") & + export HSMTOOL_MONITOR_PDSH=$! + + # Slightly racy, but just making a best-effort to catch obvious + # problems. + sleep 1 + ps -p $HSMTOOL_MONITOR_PDSH >&- || + error "Failed to start copytool monitor on $agent" + else + do_node $agent "$cmd" + if [ $? != 0 ]; then + error "Failed to start copytool monitor on $agent" + fi + fi } copytool_monitor_cleanup() { -- 1.8.3.1