aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEryu Guan <eguan@redhat.com>2017-11-14 16:56:00 +0800
committerEryu Guan <eguan@redhat.com>2017-11-26 15:38:55 +0800
commit40737eac013e03d7daa09dbf0de8887f14a23853 (patch)
tree483cd1d770e5e35529ecc76e6150cb4f7e875035
parent94d3a4f00cbd087bed36726fd29acf2f3e82944f (diff)
downloadxfstests-40737eac013e03d7daa09dbf0de8887f14a23853.tar.gz
overlay/036: filter busy mount message
util-linux v2.30 changed error message of a busy mount and caused overlay/036 to fail. e.g. - mount: <device> is already mounted or <mountpoint> busy + mount: <mountpoint>: <device> already mounted or mount point busy. Filter the mount output by a newly introduced _filter_busy_mount into a unified format. mount: device already mounted or mount point busy Reviewed-by: Amir Goldstein <amir73il@gmail.com> Signed-off-by: Eryu Guan <eguan@redhat.com>
-rw-r--r--common/filter12
-rwxr-xr-xtests/overlay/0364
-rw-r--r--tests/overlay/036.out4
3 files changed, 16 insertions, 4 deletions
diff --git a/common/filter b/common/filter
index 0d3875cc6c..a212c09aa1 100644
--- a/common/filter
+++ b/common/filter
@@ -423,6 +423,18 @@ _filter_error_mount()
sed -e "s/mount:\(.*failed:\)/mount:/" | _filter_ending_dot
}
+# Similar to _filter_error_mount, filter a busy mount output.
+# Turn both old (prior to util-linux v2.30) and new (v2.30 and later) format to
+# a simple one. e.g.
+# old: mount: <device> is already mounted or <mountpoint> busy
+# new: mount: <mountpoint>: <device> already mounted or mount point busy.
+# filtered: mount: device already mounted or mount point busy
+_filter_busy_mount()
+{
+ sed -e "s/.*: .* already mounted or .* busy/mount: device already mounted or mount point busy/" | \
+ _filter_ending_dot
+}
+
_filter_od()
{
BLOCK_SIZE=$(_get_block_size $SCRATCH_MNT)
diff --git a/tests/overlay/036 b/tests/overlay/036
index 544d4e4eaa..e0c13ae88c 100755
--- a/tests/overlay/036
+++ b/tests/overlay/036
@@ -103,12 +103,12 @@ _overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \
# Try to mount another overlay with the same upperdir
# with index=on - expect EBUSY
_overlay_mount_dirs $lowerdir2 $upperdir $workdir2 \
- overlay2 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch
+ overlay2 $SCRATCH_MNT -oindex=on 2>&1 | _filter_busy_mount
# Try to mount another overlay with the same workdir
# with index=on - expect EBUSY
_overlay_mount_dirs $lowerdir2 $upperdir2 $workdir \
- overlay3 $SCRATCH_MNT -oindex=on 2>&1 | _filter_scratch
+ overlay3 $SCRATCH_MNT -oindex=on 2>&1 | _filter_busy_mount
# success, all done
diff --git a/tests/overlay/036.out b/tests/overlay/036.out
index 51746114db..0d266f1b21 100644
--- a/tests/overlay/036.out
+++ b/tests/overlay/036.out
@@ -1,3 +1,3 @@
QA output created by 036
-mount: overlay2 is already mounted or SCRATCH_MNT busy
-mount: overlay3 is already mounted or SCRATCH_MNT busy
+mount: device already mounted or mount point busy
+mount: device already mounted or mount point busy