xfstests: add filter to 200 accommodate changed mount output
authorEric Sandeen <sandeen@redhat.com>
Sun, 6 Oct 2013 21:28:01 +0000 (21:28 +0000)
committerRich Johnston <rjohnston@sgi.com>
Wed, 16 Oct 2013 20:18:35 +0000 (15:18 -0500)
The mount binary changed its output w.r.t. red-only devices, and
stopped referring to a "block device."

This broke at least test xfs/200; add a common filter to remove
the "block device" from older mount binary output, and change
the 200.out file to match.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
common/filter
tests/xfs/200
tests/xfs/200.out

index 4eeabb08397468916fd331d36808e62f500b42c1..e9cb09aa4f74868443a9b8e7f1c832a347ffec4f 100644 (file)
@@ -296,5 +296,12 @@ _filter_fstrim()
        egrep -o "[0-9]+ bytes" | $AWK_PROG '{print $1}'
 }
 
+# Older mount output referred to "block device" when mounting RO devices
+# It's gone in newer versions
+_filter_ro_mount() {
+       sed -e "s/mount: block device//g" \
+           -e "s/mount: cannot mount block device/mount: cannot mount/g"
+}
+
 # make sure this script returns success
 /bin/true
index a3b7274ef07a17a867a8c44350f429e6852101db..f573481fd9bf11f83610286d11506b7079a06f2d 100755 (executable)
@@ -93,7 +93,7 @@ blockdev --setro $SCRATCH_DEV
 # -o norecovery is used.
 #
 echo "mounting filesystem that needs recovery on a read-only device:"
-_scratch_mount 2>&1 | _filter_scratch
+_scratch_mount 2>&1 | _filter_scratch | _filter_ro_mount
 
 echo "unmounting read-only filesystem"
 umount $SCRATCH_MNT 2>&1 | _filter_scratch
@@ -104,7 +104,7 @@ umount $SCRATCH_MNT 2>&1 | _filter_scratch
 # data recovery hack.
 #
 echo "mounting filesystem with -o norecovery on a read-only device:"
-_scratch_mount -o norecovery 2>&1 | _filter_scratch
+_scratch_mount -o norecovery 2>&1 | _filter_scratch | _filter_ro_mount
 
 echo "unmounting read-only filesystem"
 umount $SCRATCH_MNT 2>&1 | _filter_scratch
@@ -117,7 +117,7 @@ blockdev --setrw $SCRATCH_DEV
 # the underlying device is not write protected.
 #
 echo "mounting filesystem that needs recovery with -o ro:"
-_scratch_mount -o ro 2>&1 | _filter_scratch
+_scratch_mount -o ro 2>&1 | _filter_scratch 
 
 # success, all done
 echo "*** done"
index 174838c1946f2930ae6edcedb1a129828776d887..40f91633884a4317c7b2e86418d3d34730702a57 100644 (file)
@@ -1,7 +1,7 @@
 QA output created by 200
 setting device read-only
 mounting read-only block device:
-mount: block device SCRATCH_DEV is write-protected, mounting read-only
+mount: SCRATCH_DEV is write-protected, mounting read-only
 touching file on read-only filesystem (should fail)
 touch: cannot touch 'SCRATCH_MNT/foo': Read-only file system
 unmounting read-only filesystem
@@ -12,12 +12,12 @@ going down:
 unmounting shutdown filesystem:
 setting device read-only
 mounting filesystem that needs recovery on a read-only device:
-mount: block device SCRATCH_DEV is write-protected, mounting read-only
-mount: cannot mount block device SCRATCH_DEV read-only
+mount: SCRATCH_DEV is write-protected, mounting read-only
+mount: cannot mount SCRATCH_DEV read-only
 unmounting read-only filesystem
 umount: SCRATCH_MNT: not mounted
 mounting filesystem with -o norecovery on a read-only device:
-mount: block device SCRATCH_DEV is write-protected, mounting read-only
+mount: SCRATCH_DEV is write-protected, mounting read-only
 unmounting read-only filesystem
 setting device read-write
 mounting filesystem that needs recovery with -o ro: