[PATCH v2 5/5] common/overlay: silence some mount messages for fuse-overlayfs

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]



When mouting fuse-overlayfs there are some messages that make
the tests report failures due to output mismatch; ignore them:

  uid=unchanged
  uid=unchanged
  upperdir=/mnt/test/ovl-upper
  workdir=/mnt/test/ovl-work
  lowerdir=/mnt/test/ovl-lower
  mountpoint=/mnt/test/ovl-mnt

For other filesystem types (e.g., overlay and aufs) make sure to
only print non-null output, to avoid blank lines output mismatch.

And return the status of the mount command, not other commands.

Currently, running './check -overlay' tests (excluding generic/062)
the numbers for fuse-overlayfs on loop devices on v5.4-based Ubuntu
kernel with the fuse-overlayfs package from Ubuntu Eoan/19.10 are:

 - Ran: 530
 - Not run: 395
 - Failures: 29

And hopefully this helps with testing for fuse-overlayfs too.

Steps:

  $ export OVL_FSTYP=fuse.fuse-overlayfs
  $ export FSTYP=ext4
  $ export TEST_DEV=/dev/loop0
  $ export TEST_DIR=/mnt/test
  $ export SCRATCH_DEV=/dev/loop1
  $ export SCRATCH_MNT=/mnt/scratch

  $ sudo mkfs.$FSTYP -F $TEST_DEV
  $ sudo mkfs.$FSTYP -F $SCRATCH_DEV
  $ sudo mkdir $TEST_DIR $SCRATCH_MNT

  $ cat <<EOF >/tmp/exclude-tests
  generic/062
  EOF

  $ sudo -E ./check -overlay -E /tmp/exclude-tests

Signed-off-by: Mauricio Faria de Oliveira <mfo@xxxxxxxxxxxxx>
---
 common/overlay | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/common/overlay b/common/overlay
index a1076926c23f..27f3c08252ee 100644
--- a/common/overlay
+++ b/common/overlay
@@ -19,6 +19,8 @@ _overlay_mount_dirs()
 	local upperdir=$2
 	local workdir=$3
 	local options
+	local output
+	local rc
 	shift 3
 
 	options="-o lowerdir=$lowerdir -o upperdir=$upperdir -o workdir=$workdir"
@@ -26,7 +28,23 @@ _overlay_mount_dirs()
 		options="-o br=$upperdir=rw -o br=$lowerdir=ro"
 	fi
 
-	$MOUNT_PROG -t $OVL_FSTYP $options `_common_dev_mount_options $*`
+	options="$options `_common_dev_mount_options $*`"
+	output="`$MOUNT_PROG -t $OVL_FSTYP $options 2>&1`"
+	rc=$?
+
+	if [ "$OVL_FSTYP" = "fuse.fuse-overlayfs" ]; then
+		# Less verbosity to avoid output mismatch.
+		echo "$output" | grep -v \
+			-e "^uid=" \
+			-e "^upperdir=" \
+			-e "^lowerdir=" \
+			-e "^workdir=" \
+			-e "^mountpoint="
+	elif [ -n "$output" ]; then
+		echo "$output"
+	fi
+
+	return $rc
 }
 
 # Mount with same options/mnt/dev of scratch mount, but optionally
-- 
2.20.1




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux