Whamcloud - gitweb
LU-4751 hsm: Fix sanity-hsm tests for non-mrsh $PDSH 87/9587/2
authorMichael MacDonald <michael.macdonald@intel.com>
Tue, 11 Mar 2014 04:37:14 +0000 (00:37 -0400)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 13 Mar 2014 04:45:06 +0000 (04:45 +0000)
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 <michael.macdonald@intel.com>
Change-Id: I35a57d26a3836cfd1bbb698d267a8fe9f31f86c8
Reviewed-on: http://review.whamcloud.com/9587
Tested-by: Jenkins
Reviewed-by: James Nunez <james.a.nunez@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/tests/sanity-hsm.sh

index 97fc46e..a2d9011 100755 (executable)
@@ -159,19 +159,25 @@ copytool_monitor_setup() {
        cmd="cat $test_dir/fifo > $test_dir/events &"
        cmd+=" echo \\\$! > $test_dir/monitor_pid"
 
        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() {
 }
 
 copytool_monitor_cleanup() {