overlayfs: rudimentary test support

Adding basic overlayfs support to fstests, it doesn't test anything
overlayfs specific, but runs existing tests on top of overlayfs. It's
following the path from Eric's patchset and Zab's review back in Mar.

A new fstype "overlay" is added, and TEST_DEV/SCRATCH_DEV are required
to be fs paths, and overlayfs is mounted at TEST_DIR/SCRATCH_MNT, so
tests can be run there.

To test overlayfs, setup config as something like the following

TEST_DEV=/mnt/ovl/test
TEST_DIR=/mnt/testarea/test
SCRATCH_DEV=/mnt/ovl/scratch
SCRATCH_MNT=/mnt/testarea/scratch

then run

./check -overlay -g auto

Signed-off-by: Eryu Guan <eguan@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
Eryu Guan
2015-12-21 18:07:47 +11:00
committed by Dave Chinner
parent 27d077ec0b
commit ed5d3c7166
3 changed files with 155 additions and 34 deletions
+12 -10
View File
@@ -53,13 +53,6 @@ timestamp=${TIMESTAMP:=false}
rm -f $tmp.list $tmp.tmp $tmp.grep $here/$iam.out $tmp.xlist
# we need common/config
if ! . ./common/config
then
echo "$iam: failed to source common/config"
exit 1
fi
SRC_GROUPS="generic shared"
export SRC_DIR="tests"
@@ -70,6 +63,7 @@ usage()
check options
-nfs test NFS
-cifs test CIFS
-overlay test overlay
-tmpfs test TMPFS
-l line mode diff
-udiff show unified diff (default)
@@ -207,9 +201,10 @@ while [ $# -gt 0 ]; do
case "$1" in
-\? | -h | --help) usage ;;
-nfs) FSTYP=nfs ;;
-cifs) FSTYP=cifs ;;
-tmpfs) FSTYP=tmpfs ;;
-nfs) FSTYP=nfs ;;
-cifs) FSTYP=cifs ;;
-overlay) FSTYP=overlay ;;
-tmpfs) FSTYP=tmpfs ;;
-g) group=$2 ; shift ;
GROUP_LIST="$GROUP_LIST ${group//,/ }"
@@ -260,6 +255,13 @@ while [ $# -gt 0 ]; do
shift
done
# we need common/config, source it after processing args, overlay needs FSTYP
# set before sourcing common/config
if ! . ./common/config; then
echo "$iam: failed to source common/config"
exit 1
fi
# Process tests from command line now.
if $have_test_arg; then
while [ $# -gt 0 ]; do