generic/050: fix xfsquota configuration failures
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 27 Nov 2019 16:34:57 +0000 (08:34 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 1 Dec 2019 03:35:27 +0000 (11:35 +0800)
The new 'xfsquota' configuration for generic/050 doesn't filter out
SCRATCH_MNT properly and seems to be missing an error message in the
golden output.  Fix both of these problems.

Fixes: e088479871 ("generic/050: Handle xfs quota special case with different output")
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/050
tests/generic/050.out.xfsquota

index cf2b93814267c22842600d5dc7cf5fd68e1cefa3..7eabc7a756976560e7fa8700defeeecac1bd1bd7 100755 (executable)
@@ -58,9 +58,11 @@ blockdev --setro $SCRATCH_DEV
 # Mount it, and make sure we can't write to it, and we can unmount it again
 #
 echo "mounting read-only block device:"
-_try_scratch_mount 2>&1 | _filter_ro_mount
-echo "touching file on read-only filesystem (should fail)"
-touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
+_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
+if [ "${PIPESTATUS[0]}" -eq 0 ]; then
+       echo "touching file on read-only filesystem (should fail)"
+       touch $SCRATCH_MNT/foo 2>&1 | _filter_scratch
+fi
 
 #
 # Apparently this used to be broken at some point:
@@ -92,7 +94,7 @@ blockdev --setro $SCRATCH_DEV
 # -o norecovery is used.
 #
 echo "mounting filesystem that needs recovery on a read-only device:"
-_try_scratch_mount 2>&1 | _filter_ro_mount
+_try_scratch_mount 2>&1 | _filter_ro_mount | _filter_scratch
 
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
@@ -103,7 +105,7 @@ _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
 # data recovery hack.
 #
 echo "mounting filesystem with -o norecovery on a read-only device:"
-_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount
+_try_scratch_mount -o norecovery 2>&1 | _filter_ro_mount | _filter_scratch
 echo "unmounting read-only filesystem"
 _scratch_unmount 2>&1 | _filter_scratch | _filter_ending_dot
 
index f204bd2fbe70c722a661a511c13ef124e0142ec6..35d7bd68bcd2e2d4d8748e4c78372483698250aa 100644 (file)
@@ -1,8 +1,7 @@
 QA output created by 050
 setting device read-only
 mounting read-only block device:
-mount: /mnt-scratch: permission denied
-touching file on read-only filesystem (should fail)
+mount: SCRATCH_MNT: permission denied
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 setting device read-write
@@ -17,7 +16,7 @@ mount: cannot mount device read-only
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 mounting filesystem with -o norecovery on a read-only device:
-mount: /mnt-scratch: permission denied
+mount: SCRATCH_MNT: permission denied
 unmounting read-only filesystem
 umount: SCRATCH_DEV: not mounted
 setting device read-write