Whamcloud - gitweb
LU-8465 e2fsck: fix f_multithread_ok test 68/40068/2
authorAndreas Dilger <adilger@whamcloud.com>
Sun, 27 Sep 2020 17:26:42 +0000 (11:26 -0600)
committerWang Shilong <wshilong@whamcloud.com>
Mon, 28 Sep 2020 00:10:16 +0000 (00:10 +0000)
Don't use $OUT for both the input amd output of a pipeline,
as the output file is truncated befor the input is read.

Fix the handling in the failure case to generate the
*.failed file, and print the actual $test_name instead
of "test_name".

Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I66513a0422a0e70fd7a887b215e3a4e6c9c250e5
Reviewed-on: https://review.whamcloud.com/40068
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
tests/f_multithread_ok/script

index 4010881..c62c93c 100644 (file)
@@ -5,15 +5,15 @@ SKIP_CLEANUP="true"
 
 . $cmd_dir/run_e2fsck
 
-cat $OUT1 | grep -v Thread > $OUT1
-rm -f $test_name.ok $test_name.failed
-cmp -s $OUT1 $EXP1
+grep -v Thread $OUT1 > $OUT1.tmp
+cmp -s $OUT1.tmp $EXP1
 status1=$?
 if [ "$status1" -eq 0 ]; then
        echo "$test_name: $test_description: ok"
        touch $test_name.ok
 else
-       echo "test_name: $test_description: failed"
+       echo "$test_name: $test_description: failed"
+       cmp $OUT1.tmp $EXP1 > $test_name.failed
 fi
 
 unset IMAGE FSCK_OPT SECOND_FSCK_OPT OUT1 OUT2 EXP1 EXP2