Whamcloud - gitweb
LU-16947 tests: On error correctly kill multiop 89/51589/2
authorArshad Hussain <arshad.hussain@aeoncomputing.com>
Thu, 6 Jul 2023 10:25:04 +0000 (15:55 +0530)
committerOleg Drokin <green@whamcloud.com>
Thu, 27 Jul 2023 07:21:09 +0000 (07:21 +0000)
multiop_bg_pause under test-framework starts multiop
in background and waits for signal if "_" option is
provided. On 'verbose' mode the PAUSING string is
printed on console which is checked and if not found
error is reported by multiop_bg_pause function.

On error, it is required to kill the existing running
multiop binary and if not done will eventually timeout
and not exit the test.

Currently on error multiop_bg_pause function incorrectly
sends signal to wrong PID. This patch fixes this issue.

Test-Parameters: trivial testlist=replay-single mdscount=2 mdtcount=4
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Change-Id: I3fb505302615512a891725e7339a6f0238c2cdab
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51589
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/test-framework.sh

index d68eb37..59a6a96 100755 (executable)
@@ -7691,6 +7691,7 @@ multiop_bg_pause() {
 
        echo "$MULTIOP_PROG $FILE v$ARGS"
        $MULTIOP_PROG $FILE v$ARGS > $TMPPIPE &
+       local pid=$!
 
        echo "TMPPIPE=${TMPPIPE}"
        read -t 60 multiop_output < $TMPPIPE
@@ -7701,7 +7702,7 @@ multiop_bg_pause() {
        rm -f $TMPPIPE
        if [ "$multiop_output" != "PAUSING" ]; then
                echo "Incorrect multiop output: $multiop_output"
-               kill -9 $PID
+               kill -9 $pid
                return 1
        fi