All of lore.kernel.org
 help / color / mirror / Atom feed
* Support overlayfs testing.
@ 2014-11-15 20:41 Li Mengyang
  2014-12-01  5:08   ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Li Mengyang @ 2014-11-15 20:41 UTC (permalink / raw)
  To: xfs; +Cc: Erez Zadok, miklos


[-- Attachment #1.1: Type: text/plain, Size: 351 bytes --]

Hi,
 Recently people are proposing overlayfs for inclusion into the mainline, I
found it could be helpful if xfstests supports overlayfs testing. Here is
the patch and example configuration file for that. Thank you.

-- 
Regards,
Li
--------------------------------------
Mengyang Li / Computer Science, SUNYSB

6315047325/ li.mengyang@stonybrook.edu

[-- Attachment #1.2: Type: text/html, Size: 1385 bytes --]

[-- Attachment #2: 0001-overlayfs-Add-support-for-overlayfs.patch --]
[-- Type: text/x-patch, Size: 2143 bytes --]

From 4efafe0f4311bc9140a667370576fde24b84fecb Mon Sep 17 00:00:00 2001
From: Mengyang Li <li.mengyang@stonybrook.edu>
Date: Sat, 15 Nov 2014 10:53:41 -0500
Subject: [PATCH 1/1] overlayfs: Add support for overlayfs


Signed-off-by: Mengyang Li <li.mengyang@stonybrook.edu>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
---
 common/rc                |   21 +++++++++++++++++++++
 configs/overlayfs.config |   16 ++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 configs/overlayfs.config

diff --git a/common/rc b/common/rc
index d5e3aff..efa0fac 100644
--- a/common/rc
+++ b/common/rc
@@ -1133,6 +1133,24 @@ _require_test()
 		    _notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV"
 		fi
 		;;
+	overlayfs)
+		if [ -z "$OVLFS_LOWERDIR" -o ! -d "$OVLFS_LOWERDIR" ];
+		then
+		    _notrun "this test requires a valid \$OVLFS_LOWERDIR"
+		fi
+		if [ -z "$OVLFS_UPPERDIR" -o ! -d "$OVLFS_UPPERDIR" ];
+		then
+		    _notrun "this test requires a valid \$OVLFS_UPPERDIR"
+		fi
+		if [ -z "$OVLFS_WORKDIR" -o ! -d "$OVLFS_WORKDIR" ];
+		then
+		    _notrun "this test requires a valid \$OVLFS_WORKDIR"
+		fi
+		if [ -z "$TEST_DIR" -o ! -d "$TEST_DIR" ];
+		then
+		    _notrun "this test requires a valid \$TEST_DIR"
+		fi
+		;;
 	*)
 		 if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
 		 then
@@ -1947,6 +1965,9 @@ _check_test_fs()
     tmpfs)
 	# no way to check consistency for tmpfs
 	;;
+    overlayfs)
+	# no way to check consistency for overlayfs
+	;;
     *)
 	_check_generic_filesystem $TEST_DEV
 	;;
diff --git a/configs/overlayfs.config b/configs/overlayfs.config
new file mode 100644
index 0000000..42ef975
--- /dev/null
+++ b/configs/overlayfs.config
@@ -0,0 +1,16 @@
+# Example config for overlayfs
+# source me before run ./check
+
+export OVLFS_LOWERDIR=/mnt/ovllower
+export OVLFS_UPPERDIR=/mnt/ovlupper
+export OVLFS_WORKDIR=/mnt/workdir
+
+export TEST_DIR=/mnt/merged
+export TEST_DEV=/dev/loop0
+
+export TEST_FS_MOUNT_OPTS=-olowerdir=$OVLFS_LOWERDIR,\
+upperdir=$OVLFS_UPPERDIR,workdir=$OVLFS_WORKDIR
+
+unset SCRATCH_DEV
+unset SCRATCH_MNT
+export FSTYP=overlayfs
-- 
1.7.9.5


[-- Attachment #3: Type: text/plain, Size: 121 bytes --]

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: Support overlayfs testing.
  2014-11-15 20:41 Support overlayfs testing Li Mengyang
@ 2014-12-01  5:08   ` Dave Chinner
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2014-12-01  5:08 UTC (permalink / raw)
  To: Li Mengyang; +Cc: xfs, Erez Zadok, miklos, fstests

[cc fstests@vger.kernel.org]

On Sat, Nov 15, 2014 at 03:41:39PM -0500, Li Mengyang wrote:
> Hi,
>  Recently people are proposing overlayfs for inclusion into the mainline, I
> found it could be helpful if xfstests supports overlayfs testing. Here is
> the patch and example configuration file for that. Thank you.

Sorry, I missed this in all the other stuff going paston the xfs
list. In future, can you send patches to xfstests to
fstests@vger.kernel.org?

> diff --git a/common/rc b/common/rc
> index d5e3aff..efa0fac 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1133,6 +1133,24 @@ _require_test()
>  		    _notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV"
>  		fi
>  		;;
> +	overlayfs)
> +		if [ -z "$OVLFS_LOWERDIR" -o ! -d "$OVLFS_LOWERDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_LOWERDIR"
> +		fi
> +		if [ -z "$OVLFS_UPPERDIR" -o ! -d "$OVLFS_UPPERDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_UPPERDIR"
> +		fi
> +		if [ -z "$OVLFS_WORKDIR" -o ! -d "$OVLFS_WORKDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_WORKDIR"
> +		fi

Why do these varibles need to be declared and checked by the test
harness? They are purely mount option fields, and so if they don't
exist mount will fail, right?

Indeed, if you're going to start validating such variables, then
you'd need to check they don't point at the same directory, etc.
i.e. I don't think this actually belongs here....

> +		if [ -z "$TEST_DIR" -o ! -d "$TEST_DIR" ];
> +		then
> +		    _notrun "this test requires a valid \$TEST_DIR"
> +		fi

Why would you not test for $TEST_DEV, too?

> +		;;
>  	*)
>  		 if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
>  		 then
> @@ -1947,6 +1965,9 @@ _check_test_fs()
>      tmpfs)
>  	# no way to check consistency for tmpfs
>  	;;
> +    overlayfs)
> +	# no way to check consistency for overlayfs
> +	;;
>      *)
>  	_check_generic_filesystem $TEST_DEV
>  	;;
> diff --git a/configs/overlayfs.config b/configs/overlayfs.config
> new file mode 100644
> index 0000000..42ef975
> --- /dev/null
> +++ b/configs/overlayfs.config
> @@ -0,0 +1,16 @@
> +# Example config for overlayfs
> +# source me before run ./check
> +
> +export OVLFS_LOWERDIR=/mnt/ovllower
> +export OVLFS_UPPERDIR=/mnt/ovlupper
> +export OVLFS_WORKDIR=/mnt/workdir
> +
> +export TEST_DIR=/mnt/merged
> +export TEST_DEV=/dev/loop0

Slightly confused.  I'm trying to understand what the TEST_DEV has
to do with the overlayfs mount. Understand that I know *nothing*
about how overlayfs should be set up, and neither will most people
who want to add a FSTYP=overlayfs to their config section to test
that overlayfs works on the filesystem they develop/maintain.

I think that the "How to set up overlayfs" needs to be documented in
the README file, not left as an exercise for the reader to reverse
engineer what a template is supposed to do.  i.e. if I want to test
overlayfs on XFS and I already have /dev/vda as an XFS filesystem,
exactly what do I do need to do to make xfstests work?

> +export TEST_FS_MOUNT_OPTS=-olowerdir=$OVLFS_LOWERDIR,\
> +upperdir=$OVLFS_UPPERDIR,workdir=$OVLFS_WORKDIR
> +
> +unset SCRATCH_DEV
> +unset SCRATCH_MNT

No need to unset variables you don't need, nor is there any need to
export them - the test harness will export them as appropriate

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Support overlayfs testing.
@ 2014-12-01  5:08   ` Dave Chinner
  0 siblings, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2014-12-01  5:08 UTC (permalink / raw)
  To: Li Mengyang; +Cc: miklos, fstests, Erez Zadok, xfs

[cc fstests@vger.kernel.org]

On Sat, Nov 15, 2014 at 03:41:39PM -0500, Li Mengyang wrote:
> Hi,
>  Recently people are proposing overlayfs for inclusion into the mainline, I
> found it could be helpful if xfstests supports overlayfs testing. Here is
> the patch and example configuration file for that. Thank you.

Sorry, I missed this in all the other stuff going paston the xfs
list. In future, can you send patches to xfstests to
fstests@vger.kernel.org?

> diff --git a/common/rc b/common/rc
> index d5e3aff..efa0fac 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1133,6 +1133,24 @@ _require_test()
>  		    _notrun "this test requires a valid \$TEST_DIR and unique $TEST_DEV"
>  		fi
>  		;;
> +	overlayfs)
> +		if [ -z "$OVLFS_LOWERDIR" -o ! -d "$OVLFS_LOWERDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_LOWERDIR"
> +		fi
> +		if [ -z "$OVLFS_UPPERDIR" -o ! -d "$OVLFS_UPPERDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_UPPERDIR"
> +		fi
> +		if [ -z "$OVLFS_WORKDIR" -o ! -d "$OVLFS_WORKDIR" ];
> +		then
> +		    _notrun "this test requires a valid \$OVLFS_WORKDIR"
> +		fi

Why do these varibles need to be declared and checked by the test
harness? They are purely mount option fields, and so if they don't
exist mount will fail, right?

Indeed, if you're going to start validating such variables, then
you'd need to check they don't point at the same directory, etc.
i.e. I don't think this actually belongs here....

> +		if [ -z "$TEST_DIR" -o ! -d "$TEST_DIR" ];
> +		then
> +		    _notrun "this test requires a valid \$TEST_DIR"
> +		fi

Why would you not test for $TEST_DEV, too?

> +		;;
>  	*)
>  		 if [ -z "$TEST_DEV" -o "`_is_block_dev $TEST_DEV`" = "" ]
>  		 then
> @@ -1947,6 +1965,9 @@ _check_test_fs()
>      tmpfs)
>  	# no way to check consistency for tmpfs
>  	;;
> +    overlayfs)
> +	# no way to check consistency for overlayfs
> +	;;
>      *)
>  	_check_generic_filesystem $TEST_DEV
>  	;;
> diff --git a/configs/overlayfs.config b/configs/overlayfs.config
> new file mode 100644
> index 0000000..42ef975
> --- /dev/null
> +++ b/configs/overlayfs.config
> @@ -0,0 +1,16 @@
> +# Example config for overlayfs
> +# source me before run ./check
> +
> +export OVLFS_LOWERDIR=/mnt/ovllower
> +export OVLFS_UPPERDIR=/mnt/ovlupper
> +export OVLFS_WORKDIR=/mnt/workdir
> +
> +export TEST_DIR=/mnt/merged
> +export TEST_DEV=/dev/loop0

Slightly confused.  I'm trying to understand what the TEST_DEV has
to do with the overlayfs mount. Understand that I know *nothing*
about how overlayfs should be set up, and neither will most people
who want to add a FSTYP=overlayfs to their config section to test
that overlayfs works on the filesystem they develop/maintain.

I think that the "How to set up overlayfs" needs to be documented in
the README file, not left as an exercise for the reader to reverse
engineer what a template is supposed to do.  i.e. if I want to test
overlayfs on XFS and I already have /dev/vda as an XFS filesystem,
exactly what do I do need to do to make xfstests work?

> +export TEST_FS_MOUNT_OPTS=-olowerdir=$OVLFS_LOWERDIR,\
> +upperdir=$OVLFS_UPPERDIR,workdir=$OVLFS_WORKDIR
> +
> +unset SCRATCH_DEV
> +unset SCRATCH_MNT

No need to unset variables you don't need, nor is there any need to
export them - the test harness will export them as appropriate

Cheers,

Dave.

-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-12-01  5:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-15 20:41 Support overlayfs testing Li Mengyang
2014-12-01  5:08 ` Dave Chinner
2014-12-01  5:08   ` Dave Chinner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.