Skip to contentSkip to conversation

xfs/005: filter _scratch_mount output to match golden image

PATCH In review Eryu Guan 2 participants 2 messages May 23, 2014

lore
Share & tools
lore

Eryu Guan

author
#0 lore raw

PATCH v2 1/1 xfs/005: filter _scratch_mount output to match golden image

Failure message of mount has been changed since util-linux v2.21, to something like:

mount: mount /dev/sda5 on /mnt/scratch failed: Structure needs cleaning

Filter the output to match the golden image for newer mount binary so that both old and new version of mount work correctly.

---
v2: filter the mount error message instead of changing the golden image

 tests/xfs/005 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tests/xfs/005 +6 -1
index 94157c4..509ac61 100755
@@ -40,6 +40,11 @@ _cleanup()
     rm -f $tmp.*
 }
 
+filter_mount()
+{
+	sed -e "s/mount .* failed: //"
+}
+
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -59,7 +64,7 @@ _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
 $XFS_IO_PROG -c "pwrite 224 4" $SCRATCH_DEV | _filter_xfs_io
 
 # should FAIL, the crc is bad; golden output contains mount failure
-_scratch_mount
+_scratch_mount 2>&1 | filter_mount
 
 # success, all done
 status=0
Signature · 1 line
1.9.0
Reviewed-by on v2 1/1
#1 lore raw
Quoted 12 lines · Eryu Guan

Failure message of mount has been changed since util-linux v2.21, to something like:

mount: mount /dev/sda5 on /mnt/scratch failed: Structure needs cleaning

Filter the output to match the golden image for newer mount binary so that both old and new version of mount work correctly.

---
v2: filter the mount error message instead of changing the golden image

Works for me on 2.24.2.

Quoted 35 lines
 tests/xfs/005 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
tests/xfs/005 +6 -1
index 94157c4..509ac61 100755
@@ -40,6 +40,11 @@ _cleanup()
     rm -f $tmp.*
 }
 
+filter_mount()
+{
+	sed -e "s/mount .* failed: //"
+}
+
 # get standard environment, filters and checks
 . ./common/rc
 . ./common/filter
@@ -59,7 +64,7 @@ _scratch_mkfs_xfs -m crc=1 >> $seqres.full 2>&1 || _fail "mkfs failed"
 $XFS_IO_PROG -c "pwrite 224 4" $SCRATCH_DEV | _filter_xfs_io
 
 # should FAIL, the crc is bad; golden output contains mount failure
-_scratch_mount
+_scratch_mount 2>&1 | filter_mount
 
 # success, all done
 status=0
Signature · 6 lines
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html