[PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs

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



Recently looking for an aufs test suite. The author clarified that
'There is no public test suite specific to aufs.' [1] at this time,
and it looks like 'xfstests/tests/generic' should be enough [1, 2],
and is clearly an improvement in terms of publicly available tests.

Thus, building on top of the existing infrastructure for overlay,
just introduce OVL_ALT_FSTYP that can be set to "aufs" to use it.
(using overlay's upperdir as rw-branch and lowerdir as ro-branch).

This is indeed a workaround^W simple change that does the job vs.
creating a new FSTYP "aufs" and mechanically changing the number
of places that check for "overlay" to just handle "aufs" as well.
(so the effort is still small as aufs has no specific tests now.)

Currently, running the generic + overlay (i.e., ./check -overlay)
tests (and excluding a few [3] which either hang or keep looping)
the numbers for aufs on loop devices on v5.4-based Ubuntu kernel
show a relatively good starting base in terms of exercising code:

  - Ran: 645 tests
  - Not run: 483 tests
  - Failures: 21 tests

So, hopefully this may be a starting point as an aufs test suite.

[1] https://sourceforge.net/p/aufs/mailman/message/36918721/
[2] https://sourceforge.net/p/aufs/mailman/message/36918932/
[3] Steps:

  $ export OVL_ALT_FSTYP=aufs
  $ 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/013
  generic/070
  generic/075
  generic/112
  generic/127
  generic/461
  generic/476
  generic/522
  generic/530
  overlay/019
  EOF

  $ sudo -E ./check -overlay -E /tmp/exclude-tests
---
 common/overlay | 6 ++++++
 common/rc      | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/common/overlay b/common/overlay
index 65c639e9c6d8..3b3351ed040e 100644
--- a/common/overlay
+++ b/common/overlay
@@ -20,6 +20,12 @@ _overlay_mount_dirs()
 	local workdir=$3
 	shift 3
 
+	if [ -n "$OVL_ALT_FSTYP" -a "$OVL_ALT_FSTYP" = "aufs" ]; then
+		$MOUNT_PROG -t aufs -o br=$upperdir=rw:$lowerdir=ro \
+			`_common_dev_mount_options $*`
+		return $?
+	fi
+
 	$MOUNT_PROG -t overlay -o lowerdir=$lowerdir -o upperdir=$upperdir \
 		    -o workdir=$workdir `_common_dev_mount_options $*`
 }
diff --git a/common/rc b/common/rc
index b4a77a2187f4..976afb66015d 100644
--- a/common/rc
+++ b/common/rc
@@ -1471,6 +1471,10 @@ _check_mounted_on()
 		return 2 # 2 = mounted on wrong mnt
 	fi
 
+	if [ -n "$type" -a "$type" = "overlay" -a -n "$OVL_ALT_FSTYP" ]; then
+		type="$OVL_ALT_FSTYP"
+	fi
+
 	if [ -n "$type" -a "`_fs_type $dev`" != "$type" ]; then
 		echo "$devname=$dev is mounted but not a type $type filesystem"
 		# raw $DF_PROG cannot handle NFS/CIFS/overlay correctly
-- 
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