]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
generic/127: reduce runtime
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 20:59:47 +0000 (07:59 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:10:34 +0000 (22:10 +0800)
...
generic/127 684
...

This takes a long time to run because it runs 6 individual
invocations of fsx sequentially. Make them run concurrently
as they can operate on separate files.

...
generic/127 168
...

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/127
tests/generic/127.out

index c8984f2730feab64ae1878b5c6c0bc70377a1a10..985c99cfb5bef7b26612a6d73dba04741e267b6e 100755 (executable)
@@ -16,7 +16,10 @@ _begin_fstest rw auto
 # Override the default cleanup function.
 _cleanup()
 {
-    rm -f $tmp.output
+       [ -n "$fsx_pids" ] && kill $fsx_pids 2> /dev/null
+       wait
+       cd /
+       rm -f $tmp.*
 }
 
 # Import common functions.
@@ -27,7 +30,6 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
 
 _fsx_lite_nommap()
 {
-    echo "=== FSX Light Mode, No Memory Mapping ==="
     dd if=/dev/zero of=$TEST_DIR/fsx_lite_nommap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
     if ! ltp/fsx $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
     then
@@ -41,7 +43,6 @@ _fsx_lite_nommap()
 
 _fsx_lite_mmap()
 {
-    echo "=== FSX Light Mode, Memory Mapping ==="
     dd if=/dev/zero of=$TEST_DIR/fsx_lite_mmap bs=${FSX_FILE_SIZE} count=1 > /dev/null 2>&1
     if ! ltp/fsx $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
     then
@@ -55,42 +56,56 @@ _fsx_lite_mmap()
 
 _fsx_std_nommap()
 {
-    echo "=== FSX Standard Mode, No Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $TEST_DIR/fsx_std_nommap > $tmp.output 2>&1
-    then
-        echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
-        cat $tmp.output
-        return 1
-    fi
-    cat $tmp.output
-    return 0
+       local fname="$TEST_DIR/$1"
+
+       if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $fname > $tmp.output 2>&1
+       then
+               echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
+               cat $tmp.output
+               return 1
+       fi
+       cat $tmp.output
+       return 0
 }
 
 _fsx_std_mmap()
 {
-    echo "=== FSX Standard Mode, Memory Mapping ==="
-    if ! ltp/fsx $FSX_ARGS $FSX_AVOID $TEST_DIR/fsx_std_mmap > $tmp.output 2>&1
-    then
-       echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
+       local fname="$TEST_DIR/$1"
+
+       if ! ltp/fsx $FSX_ARGS $FSX_AVOID $fname > $tmp.output 2>&1
+       then
+               echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
+               cat $tmp.output
+               return 1
+       fi
        cat $tmp.output
-       return 1
-    fi
-    cat $tmp.output
-    return 0
+       return 0
 }
 
 _require_test
 
-_fsx_lite_nommap || exit
-_fsx_lite_mmap || exit
+_fsx_lite_nommap &
+fsx_pids=$!
 
-_fsx_std_nommap || exit
-_fsx_std_mmap || exit
+_fsx_lite_mmap &
+fsx_pids="$! $fsx_pids"
+
+_fsx_std_nommap fsx_std_nommap &
+fsx_pids="$! $fsx_pids"
+
+_fsx_std_mmap fsx_std_mmap &
+fsx_pids="$! $fsx_pids"
 
 #flush cache after write
 FSX_ARGS="-f $FSX_ARGS"
-_fsx_std_nommap || exit
-_fsx_std_mmap || exit
+_fsx_std_nommap fsx_std_nommap_flush &
+fsx_pids="$! $fsx_pids"
+
+_fsx_std_mmap fsx_std_mmap_flush &
+fsx_pids="$! $fsx_pids"
+
+wait $fsx_pids
+unset fsx_pids
 
 status=0
 _cleanup
index 9459dc89740a4a03a8fdcf5722d80ddacf91a12e..99fb0fddc9f647e7b12e198a815e7b94a94945af 100644 (file)
@@ -1,13 +1,7 @@
 QA output created by 127
-=== FSX Light Mode, No Memory Mapping ===
 All 100000 operations completed A-OK!
-=== FSX Light Mode, Memory Mapping ===
 All 100000 operations completed A-OK!
-=== FSX Standard Mode, No Memory Mapping ===
 All 100000 operations completed A-OK!
-=== FSX Standard Mode, Memory Mapping ===
 All 100000 operations completed A-OK!
-=== FSX Standard Mode, No Memory Mapping ===
 All 100000 operations completed A-OK!
-=== FSX Standard Mode, Memory Mapping ===
 All 100000 operations completed A-OK!