From c0a877ab3b049266042299a438d8d010ce3ce605 Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Mon, 17 Feb 2020 13:53:16 +1100 Subject: [PATCH] LU-13160 tests: fix sanity-hsm monitor setup On RHEL8, even we are using pdsh -R ssh, the ssh still waits for the remote cat process to finish. Use the subshell to avoid the time out. Lustre-change: https://review.whamcloud.com/37595 Lustre-commit: 6724d8ca58e9b8474a180b013a4723cbdd8900d9 Change-Id: Id5b8d492b5ce9a235da73448ade475ade145bbed Test-Parameters: trivial clientdistro=el8.1 testlist=sanity-hsm Signed-off-by: Li Dongyang Reviewed-by: Jian Yu Reviewed-by: James Nunez Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/37773 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/tests/sanity-hsm.sh | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/lustre/tests/sanity-hsm.sh b/lustre/tests/sanity-hsm.sh index c11440a..7c55db6 100755 --- a/lustre/tests/sanity-hsm.sh +++ b/lustre/tests/sanity-hsm.sh @@ -204,24 +204,17 @@ copytool_monitor_setup() { cmd="cat $test_dir/fifo > $test_dir/events &" cmd+=" echo \\\$! > $test_dir/monitor_pid" - 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 > /dev/null || - 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 + # This background subshell nonsense is required when pdsh/ssh decides + # to wait for the cat process to exit on the remote client + (do_node $agent "$cmd") & + export HSMTOOL_MONITOR_PDSH=$! + + # Slightly racy, but just making a best-effort to catch obvious + # problems. + sleep 1 + do_node $agent "stat $HSMTOOL_MONITOR_DIR/monitor_pid 2>&1 > /dev/null" + if [ $? != 0 ]; then + error "Failed to start copytool monitor on $agent" fi } -- 1.8.3.1