]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
generic/094: fix test ignoring failures
authorFilipe Manana <fdmanana@suse.com>
Thu, 29 May 2025 11:33:13 +0000 (12:33 +0100)
committerZorro Lang <zlang@kernel.org>
Fri, 6 Jun 2025 01:55:44 +0000 (09:55 +0800)
The test is ignoring failures completely:

1) If mounting the scratch device fails it redirects both stdout and
   stderr to /dev/null, so it gets unnoticed and the test runs against
   a different fs than expected (in my test environment $SCRATCH_MNT
   points to a directory in an ext4 fs for example but I want to test
   btrfs);

2) We are redirecting the stdout and stderr of fiemap-tester to the
   $seqres.full file, so if it fails it gets completely unnoticed and
   the test succeeds.

For the first issue fix this by not even using the scratch filesystem and
use instead the test filesystem, since the test creates a 2M file which
is small enough.

For the second issue simply don't redirect the stdout and stderr, so that
if the test program fails it causes a mismatch with the golden output,
making the test fail.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/generic/094

index c82efced5816fdc78cb55ea53407ca2ac440940e..6ae417c30d411096630bfd2fe4d562b3bca1666d 100755 (executable)
@@ -9,18 +9,22 @@
 . ./common/preamble
 _begin_fstest auto quick prealloc fiemap
 
+_cleanup()
+{
+       cd /
+       rm -fr $tmp.*
+       rm -f $fiemapfile
+}
+
 # Import common functions.
 . ./common/filter
 
-_require_scratch
+_require_test
 _require_odirect
 _require_xfs_io_command "fiemap"
 _require_xfs_io_command "falloc"
 
-_scratch_mkfs > /dev/null 2>&1
-_scratch_mount > /dev/null 2>&1
-
-fiemapfile=$SCRATCH_MNT/$seq.fiemap
+fiemapfile=$TEST_DIR/$seq.fiemap
 
 _require_test_program "fiemap-tester"
 
@@ -29,12 +33,10 @@ seed=`date +%s`
 echo "using seed $seed" >> $seqres.full
 
 echo "fiemap run with sync"
-$here/src/fiemap-tester -q -S -s $seed -r 200 $fiemapfile 2>&1 | \
-       tee -a $seqres.full
+$here/src/fiemap-tester -q -S -s $seed -r 200 $fiemapfile
 
 echo "fiemap run without sync"
-$here/src/fiemap-tester -q -s $seed -r 200 $fiemapfile 2>&1 | \
-       tee -a $seqres.full
+$here/src/fiemap-tester -q -s $seed -r 200 $fiemapfile
 
 status=0
 exit