* [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs
@ 2020-02-13 0:04 Mauricio Faria de Oliveira
2020-02-13 9:57 ` Amir Goldstein
0 siblings, 1 reply; 3+ messages in thread
From: Mauricio Faria de Oliveira @ 2020-02-13 0:04 UTC (permalink / raw)
To: fstests
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs
2020-02-13 0:04 [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs Mauricio Faria de Oliveira
@ 2020-02-13 9:57 ` Amir Goldstein
2020-02-13 13:19 ` Mauricio Faria de Oliveira
0 siblings, 1 reply; 3+ messages in thread
From: Amir Goldstein @ 2020-02-13 9:57 UTC (permalink / raw)
To: Mauricio Faria de Oliveira; +Cc: fstests
On Thu, Feb 13, 2020 at 2:05 AM Mauricio Faria de Oliveira
<mfo@canonical.com> wrote:
>
> 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.)
Very nice!
Please update README.overlay.
FYI, I made a similar small change to enable testing of fuse.overlay
with unionmount-testsuite:
https://github.com/amir73il/unionmount-testsuite/commit/a72c274e0f5d6d05ad7c563fc7eff42356bffd15
Therefore:
1. Your changes could be useful for testing fuse.overlay with xfstests
2. You can just as easily test aufs with unionmount-testsuite -
The test coverage is mostly orthogonal to that of xfstests
(patches are welcome)
>
> 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
I'd be interested to know the stats for the overlay/* 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 $*`
I think it would be better to define (in common/config):
export OVL_FSTYP=${OVL_FSTYP:="overlay"}
And make sure to always mount -t $OVL_FSTYP
then you won't need to check if OVL_ALT_FSTYP is non empty.
and setting OVL_FSTYP to "fuse.overlay" should mostly work.
I did find 5 overlay tests that do mount -t overlay not via any
of the common helpers, so you'll need to handle those, possibly
with another common helper that supports middle layers:
tests/overlay/011
tests/overlay/035
tests/overlay/052
tests/overlay/053
tests/overlay/062
Thanks,
Amir.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs
2020-02-13 9:57 ` Amir Goldstein
@ 2020-02-13 13:19 ` Mauricio Faria de Oliveira
0 siblings, 0 replies; 3+ messages in thread
From: Mauricio Faria de Oliveira @ 2020-02-13 13:19 UTC (permalink / raw)
To: Amir Goldstein; +Cc: fstests
On Thu, Feb 13, 2020 at 6:57 AM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Thu, Feb 13, 2020 at 2:05 AM Mauricio Faria de Oliveira
> <mfo@canonical.com> wrote:
> >
> > 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.)
>
> Very nice!
> Please update README.overlay.
>
Hi Amir, thanks for reviewing!
Sure, will do in v2 with your other comments.
> FYI, I made a similar small change to enable testing of fuse.overlay
> with unionmount-testsuite:
> https://github.com/amir73il/unionmount-testsuite/commit/a72c274e0f5d6d05ad7c563fc7eff42356bffd15
> Therefore:
> 1. Your changes could be useful for testing fuse.overlay with xfstests
> 2. You can just as easily test aufs with unionmount-testsuite -
> The test coverage is mostly orthogonal to that of xfstests
> (patches are welcome)
Glad that you mentioned it; I didn't know about unionmount-testsuite yet.
Right, both points are easy to address. I'll work on the changes here.
> >
> > 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
>
> I'd be interested to know the stats for the overlay/* tests.
Out of the 71 tests in tests/overlay/*, 70 tests are listed in the log
(overlay/061 isn't, not sure why yet.)
Out of the 70 tests listed: 41 not run, 18 passed, 10 output mismatch,
1 expunged (overlay/019 hangs.)
If you're interested in the individual test results, just let me know
and I'll send the details as well.
>
> >
> > 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 $*`
>
> I think it would be better to define (in common/config):
>
> export OVL_FSTYP=${OVL_FSTYP:="overlay"}
>
> And make sure to always mount -t $OVL_FSTYP
> then you won't need to check if OVL_ALT_FSTYP is non empty.
> and setting OVL_FSTYP to "fuse.overlay" should mostly work.
>
Indeed, that's better.
> I did find 5 overlay tests that do mount -t overlay not via any
> of the common helpers, so you'll need to handle those, possibly
> with another common helper that supports middle layers:
> tests/overlay/011
> tests/overlay/035
> tests/overlay/052
> tests/overlay/053
> tests/overlay/062
Thanks for bringing that up, I didn't imagine to look at other mount calls.
I'll work on your suggestions and send out a v2 (and look at
unionmount-testsuite.)
Again, thanks for reviewing, and for the constructive feedback.
cheers,
>
> Thanks,
> Amir.
--
Mauricio Faria de Oliveira
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-02-13 13:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-13 0:04 [PATCH] common/overlay,rc: introduce OVL_ALT_FSTYP for testing aufs Mauricio Faria de Oliveira
2020-02-13 9:57 ` Amir Goldstein
2020-02-13 13:19 ` Mauricio Faria de Oliveira
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).