xfs
[Top] [All Lists]

Re: [PATCH 4/4] xfstests: handle filesystems without FIEMAP support

To: Alex Elder <aelder@xxxxxxx>
Subject: Re: [PATCH 4/4] xfstests: handle filesystems without FIEMAP support
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Thu, 21 Oct 2010 01:05:31 -0400
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>, xfs@xxxxxxxxxxx
In-reply-to: <1287596221.2284.97.camel@doink>
References: <20101015222820.GA3655@xxxxxxxxxxxxx> <20101015222924.GD3781@xxxxxxxxxxxxx> <1287596221.2284.97.camel@doink>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Oct 20, 2010 at 12:37:01PM -0500, Alex Elder wrote:
> Looks good, but I think if the operation is not
> supported you want to delete both "${fiemapfile}"
> and "${fiemaplog}".
> 
> While you're at it, make use of the "${fiemapfile}"
> variable in the fiemap-tester command...  (This
> appears to be a bug in the original test.)

Updated version below:

---
From: Christoph Hellwig <hch@xxxxxx>
Subject: [PATCH 4/4] xfstests: handle filesystems without FIEMAP support

Do a _notrun in 225 if we get EOPNOSUPP back from FIEMAP instead
of failing the test.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: xfstests-dev/225
===================================================================
--- xfstests-dev.orig/225       2010-10-21 05:00:30.000000000 +0000
+++ xfstests-dev/225    2010-10-21 05:00:38.000000000 +0000
@@ -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

<Prev in Thread] Current Thread [Next in Thread>