The part of the fix for LU-5622
while (( SECONDS < end_wait )); do
sleep 2
do_nodesv $agents "pgrep -x $HSMTOOL_BASE"
if [ $? -ne 0 ]; then
echo "Copytool is stopped on $agents"
break
fi
echo "Copytool still running on $agents"
done
if do_nodesv $agents "pgrep -x $HSMTOOL_BASE"; then
error "Copytool failed to stop in ${TIMEOUT}s ..."
else
echo "Copytool has stopped in " \
"$((TIMEOUT - (end_wait - SECONDS)))s."
fi
causes failure in sanity-hsm.
sanity-hsm.sh has set -e option, so checks of return code can cause an error