]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
config: add FSX_PROG variable
authorDarrick J. Wong <djwong@kernel.org>
Mon, 3 Feb 2025 22:00:32 +0000 (14:00 -0800)
committerZorro Lang <zlang@kernel.org>
Tue, 18 Feb 2025 04:42:40 +0000 (12:42 +0800)
Replace the open-coded $here/ltp/fsx and ./ltp/fsx variants with a
single variable.

Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
13 files changed:
common/config
common/fuzzy
common/rc
tests/generic/075
tests/generic/112
tests/generic/127
tests/generic/231
tests/generic/455
tests/generic/456
tests/generic/457
tests/generic/469
tests/generic/499
tests/generic/511

index ae9aa3f4b0b8fcb5169601c372a9f20bc2584b84..193b7af432dc2bd0803daf69d990e70d43782187 100644 (file)
@@ -131,6 +131,9 @@ export UMOUNT_PROG="$(type -P umount)"
 export FSSTRESS_PROG="$here/ltp/fsstress"
 [ ! -x $FSSTRESS_PROG ] && _fatal "fsstress not found or executable"
 
+export FSX_PROG="$here/ltp/fsx"
+[ ! -x $FSX_PROG ] && _fatal "fsx not found or executable"
+
 export PERL_PROG="$(type -P perl)"
 [ "$PERL_PROG" = "" ] && _fatal "perl not found"
 
index 670d49cb54e12d1fb3fa8c852a4a2d9434b24d2e..702ebc4b9aed844cabdc99902338fe29b68913b2 100644 (file)
@@ -969,7 +969,7 @@ __stress_scrub_fsx_loop() {
        focus+=(-l $((600000 * LOAD_FACTOR)) )
 
        local args="$FSX_AVOID ${focus[@]} ${SCRATCH_MNT}/fsx.$seq"
-       echo "Running $here/ltp/fsx $args" >> $seqres.full
+       echo "Running $FSX_PROG $args" >> $seqres.full
 
        if [ -n "$remount_period" ]; then
                local mode="rw"
@@ -980,7 +980,7 @@ __stress_scrub_fsx_loop() {
                        test "$mode" = "rw" && __stress_scrub_clean_scratch && continue
 
                        duration=$(___stress_scrub_duration "$end" "$remount_period")
-                       $here/ltp/fsx $duration $args $rw_arg >> $seqres.full
+                       $FSX_PROG $duration $args $rw_arg >> $seqres.full
                        res=$?
                        echo "$mode fsx exits with $res at $(date)" >> $seqres.full
                        test "$res" -ne 0 && break
@@ -1007,7 +1007,7 @@ __stress_scrub_fsx_loop() {
                # Need to recheck running conditions if we cleared anything
                __stress_scrub_clean_scratch && continue
                duration=$(___stress_scrub_duration "$end" "$remount_period")
-               $here/ltp/fsx $duration $args >> $seqres.full
+               $FSX_PROG $duration $args >> $seqres.full
                res=$?
                echo "fsx exits with $res at $(date)" >> $seqres.full
                test "$res" -ne 0 && break
index b39da65d6c8725de970a6f72d6941eecc0e8aacf..20d07e70401f90fcd9e2bdefbc27abe7e1aa82c0 100644 (file)
--- a/common/rc
+++ b/common/rc
@@ -5050,7 +5050,7 @@ _get_page_size()
 
 _require_hugepage_fsx()
 {
-       $here/ltp/fsx -N 0 -h $TEST_DIR 2>&1 | grep -q 'MADV_COLLAPSE not supported' && \
+       $FSX_PROG -N 0 -h $TEST_DIR 2>&1 | grep -q 'MADV_COLLAPSE not supported' && \
                _notrun "fsx binary does not support MADV_COLLAPSE"
 }
 
@@ -5058,7 +5058,7 @@ _run_fsx()
 {
        echo "fsx $*"
        local args=`echo $@ | sed -e "s/ BSIZE / $bsize /g" -e "s/ PSIZE / $psize /g"`
-       set -- $here/ltp/fsx $args $FSX_AVOID $TEST_DIR/junk
+       set -- $FSX_PROG $args $FSX_AVOID $TEST_DIR/junk
        echo "$@" >>$seqres.full
        rm -f $TEST_DIR/junk
        "$@" 2>&1 | tee -a $seqres.full >$tmp.fsx
index 8db58e866d0d05bf31d9ea7065921157a4dffc0e..94a96e3341d3e781eb125b84cb866431a052024c 100755 (executable)
@@ -53,7 +53,7 @@ _do_test()
 
     # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
     cd $out
-    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
+    if ! $FSX_PROG $_param -P "$RESULT_DIR" $seq.$_n $FSX_AVOID &>/dev/null
     then
        echo "    fsx ($_param) failed, $? - compare $seqres.$_n.{good,bad,fsxlog}"
        mv $out/$seq.$_n $seqres.$_n.full
index 0084b555a7f5e8fdee5c00aef447053f497ba2cc..c171750055b1ee9c7bbe7e6e3e1fb14cce7fa002 100755 (executable)
@@ -53,7 +53,7 @@ _do_test()
 
     # This cd and use of -P gets full debug on "$RESULT_DIR" (not TEST_DEV)
     cd $out
-    if ! $here/ltp/fsx $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
+    if ! $FSX_PROG $_param -P "$RESULT_DIR" $FSX_AVOID $seq.$_n &>/dev/null
     then
        echo "    fsx ($_param) returned $? - see $seq.$_n.full"
        mv "$RESULT_DIR"/$seq.$_n.fsxlog $seqres.$_n.full
index 985c99cfb5bef7b26612a6d73dba04741e267b6e..fcd535b46075e231497d8ec9e88d65ab8af1c934 100755 (executable)
@@ -31,9 +31,9 @@ FSX_ARGS="-q -l $FSX_FILE_SIZE -o 65536 -S 191110531 -N 100000"
 _fsx_lite_nommap()
 {
     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
+    if ! $FSX_PROG $FSX_ARGS -L -R -W $FSX_AVOID $TEST_DIR/fsx_lite_nommap > $tmp.output 2>&1
     then
-        echo "ltp/fsx $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
+        echo "$FSX_PROG $FSX_ARGS -L -R -W $TEST_DIR/fsx_lite_nommap"
         cat $tmp.output
         return 1
     fi
@@ -44,9 +44,9 @@ _fsx_lite_nommap()
 _fsx_lite_mmap()
 {
     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
+    if ! $FSX_PROG $FSX_ARGS -L $FSX_AVOID $TEST_DIR/fsx_lite_mmap > $tmp.output 2>&1
     then
-       echo "ltp/fsx $FSX_ARGS -L fsx_lite_mmap"
+       echo "$FSX_PROG $FSX_ARGS -L fsx_lite_mmap"
        cat $tmp.output
        return 1
     fi
@@ -58,9 +58,9 @@ _fsx_std_nommap()
 {
        local fname="$TEST_DIR/$1"
 
-       if ! ltp/fsx $FSX_ARGS -R -W $FSX_AVOID $fname > $tmp.output 2>&1
+       if ! $FSX_PROG $FSX_ARGS -R -W $FSX_AVOID $fname > $tmp.output 2>&1
        then
-               echo "ltp/fsx $FSX_ARGS -R -W fsx_std_nommap"
+               echo "$FSX_PROG $FSX_ARGS -R -W fsx_std_nommap"
                cat $tmp.output
                return 1
        fi
@@ -72,9 +72,9 @@ _fsx_std_mmap()
 {
        local fname="$TEST_DIR/$1"
 
-       if ! ltp/fsx $FSX_ARGS $FSX_AVOID $fname > $tmp.output 2>&1
+       if ! $FSX_PROG $FSX_ARGS $FSX_AVOID $fname > $tmp.output 2>&1
        then
-               echo "ltp/fsx $FSX_ARGS fsx_std_mmap"
+               echo "$FSX_PROG $FSX_ARGS fsx_std_mmap"
                cat $tmp.output
                return 1
        fi
index 8dda926d875e8840ce06197553dc5a78ee207953..b598a5d568bdf60c54a6959fe363e23e046f1372 100755 (executable)
@@ -23,8 +23,8 @@ _fsx()
        echo "=== FSX Standard Mode, Memory Mapping, $tasks Tasks ==="
        for (( i = 1; i <= $tasks; i++ )); do
                SEED=$RANDOM
-               echo "ltp/fsx $FSX_ARGS -S $SEED $SCRATCH_MNT/fsx_file$i" >>$seqres.full
-               _su $qa_user -c "ltp/fsx $FSX_ARGS -S $SEED \
+               echo "$FSX_PROG $FSX_ARGS -S $SEED $SCRATCH_MNT/fsx_file$i" >>$seqres.full
+               _su $qa_user -c "$FSX_PROG $FSX_ARGS -S $SEED \
                        $FSX_AVOID $SCRATCH_MNT/fsx_file$i" >$tmp.output$i 2>&1 &
        done
 
index 31f84346daecdecb2d08285ee9088780a4243aab..a70da042f07a290202b7b34d9479c0caa5e7a1a1 100755 (executable)
@@ -79,7 +79,7 @@ FSX_OPTS="-N $NUM_OPS -d -P $SANITY_DIR -i $LOGWRITES_DMDEV"
 seeds=(0 0 0 0)
 # Run fsx for a while
 for j in `seq 0 $((NUM_FILES-1))`; do
-       run_check $here/ltp/fsx $FSX_OPTS $FSX_AVOID -S ${seeds[$j]} -j $j $SCRATCH_MNT/testfile$j &
+       run_check $FSX_PROG $FSX_OPTS $FSX_AVOID -S ${seeds[$j]} -j $j $SCRATCH_MNT/testfile$j &
 done
 wait
 
index 0123508ce15076cee39d42947f3f0301d07c7df3..32afa398f11ccc72310bf9bc87e64c315a6e0864 100755 (executable)
@@ -53,7 +53,7 @@ write 0x3e5ec 0x1a14 0x21446
 zero_range 0x20fac 0x6d9c 0x40000 keep_size
 mapwrite 0x216ad 0x274f 0x40000
 EOF
-run_check $here/ltp/fsx -d --replay-ops $fsxops $SCRATCH_MNT/testfile
+run_check $FSX_PROG -d --replay-ops $fsxops $SCRATCH_MNT/testfile
 
 _flakey_drop_and_remount
 _unmount_flakey
index defa73cfb5dfcd3ae0c8480b3c89e0dde526ac92..b59cad5672f40734202ca2c824389f6d2e704cd2 100755 (executable)
@@ -82,7 +82,7 @@ FSX_OPTS="-N $NUM_OPS -d -k -P $SANITY_DIR -i $LOGWRITES_DMDEV"
 for j in `seq 0 $((NUM_FILES-1))`; do
        # clone the clone from prev iteration which may have already mutated
        _cp_reflink $SCRATCH_MNT/testfile$((j-1)) $SCRATCH_MNT/testfile$j
-       run_check $here/ltp/fsx $FSX_OPTS $FSX_AVOID -S 0 -j $j $SCRATCH_MNT/testfile$j &
+       run_check $FSX_PROG $FSX_OPTS $FSX_AVOID -S 0 -j $j $SCRATCH_MNT/testfile$j &
 done
 wait
 
index 1352c3243f6df694aff9dbf70a8e2e28336394f8..f7718185b7114a6539f49cf478f349632eb9d112 100755 (executable)
@@ -35,7 +35,7 @@ _require_xfs_io_command "fzero"
 
 run_fsx()
 {
-       $here/ltp/fsx $2 --replay-ops $1 $file 2>&1 | tee -a $seqres.full >$tmp.fsx
+       $FSX_PROG $2 --replay-ops $1 $file 2>&1 | tee -a $seqres.full >$tmp.fsx
        if [ ${PIPESTATUS[0]} -ne 0 ]; then
                cat $tmp.fsx
                exit 1
index 9145c1c5dfdc7214bb6b47562b63e3a8f1da66b7..868413bad698eafe5386cfb1b22fca3b32a87a7c 100755 (executable)
@@ -35,7 +35,7 @@ ENDL
 
 victim=$SCRATCH_MNT/a
 touch $victim
-$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
+$FSX_PROG --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
 
 echo "Silence is golden"
 status=0
index 7c903fb0280d7f5f5ff6d1976b12bf7abb8c5e7a..66557ab9369059a19f0eda3b5cd1b6db2f84821c 100755 (executable)
@@ -32,7 +32,7 @@ ENDL
 
 victim=$SCRATCH_MNT/a
 touch $victim
-$here/ltp/fsx --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
+$FSX_PROG --replay-ops $tmp.fsxops $victim > $tmp.output 2>&1 || cat $tmp.output
 
 echo "Silence is golden"
 status=0