xfstests: handle filesystems without FIEMAP support
authorChristoph Hellwig <hch@lst.de>
Thu, 21 Oct 2010 19:12:04 +0000 (21:12 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 21 Oct 2010 19:12:04 +0000 (21:12 +0200)
Do a _notrun in 225 if we get EOPNOSUPP back from FIEMAP instead
of failing the test.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
225

diff --git a/225 b/225
index b5f53a70c09b2d5b54ddbbf88372cfe119fa7d05..6e879a4479d46972e23efabc0651e1aa7da448d8 100755 (executable)
--- a/225
+++ b/225
@@ -49,13 +49,26 @@ _supported_os Linux
 _setup_testdir
 
 fiemapfile=$TEST_DIR/fiemap.$$
+fiemaplog=$TEST_DIR/fiemap.$$.log
 
 [ -x $here/src/fiemap-tester ] || _notrun "fiemap-tester not built"
 
+_cleanup()
+{
+       rm -f $fiemapfile
+       rm -f $fiemaplog
+}
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
 echo "fiemap run without preallocation"
-$here/src/fiemap-tester -q -p 0 -r 200 $TEST_DIR/fiemapfile
+$here/src/fiemap-tester -q -p 0 -r 200 $fiemapfile 2>&1 | tee $fiemaplog
+
+if grep -q "Operation not supported" $fiemaplog; then
+      _notrun "FIEMAP not supported by this filesystem type: $FSTYP"
+fi
 
 rm -f $fiemapfile
+rm -f $fiemaplog
 rm -f $seq.full
 
 status=0