From: Mauricio Faria de Oliveira <mfo@canonical.com>
To: fstests@vger.kernel.org
Subject: [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs
Date: Wed, 12 Feb 2020 21:04:06 -0300 [thread overview]
Message-ID: <20200213000406.4966-1-mfo@canonical.com> (raw)
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
next reply other threads:[~2020-02-13 0:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-13 0:04 Mauricio Faria de Oliveira [this message]
2020-02-13 9:57 ` [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs Amir Goldstein
2020-02-13 13:19 ` Mauricio Faria de Oliveira
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200213000406.4966-1-mfo@canonical.com \
--to=mfo@canonical.com \
--cc=fstests@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).