Skip to contentSkip to conversation

xfstests-bld: improve overlayfs testing

PATCH In review Amir Goldstein 2 participants 4 messages Nov 6, 2016 – Nov 7, 2016

lore
Share & tools
lore
#0 lore raw

cover xfstests-bld: improve overlayfs testing

Hi Ted,

Following are the changes to xfstests-bld I have been using to test overlayfs.

xfstests master branch just got updated with several fixes to overlay/* tests. One overlayfs bug that was caught by generic/375 was fixed for 4.9-rc4 and one that was caught by generic/157 is queued on overlayfs-next branch.

With these changes to test-appliance, one can test drive overlayfs clone-up over xfs with reflink support. Xfs with reflink support was merged to 4.9-rc1 and relevant xfsprogs changes are queued on xfsprogs for-next branch. Overlayfs clone-up is queued on overlayfs-next branch.

Decided to have a little fun and send this one out to you also via github PR.

Thanks for setting up xfstests-bld.
It has been a great help in bringing up my test env.

Amir.

Amir Goldstein (2):
test-appliance: add xfs/reflink config
test-appliance: add support for overlayfs over xfs

 .../test-appliance/files/root/fs/overlay/config    | 44 ++++++++++++++++++----
 .../test-appliance/files/root/fs/xfs/cfg/reflink   |  3 ++
 kvm-xfstests/util/parse_cli                        |  2 +-
 3 files changed, 40 insertions(+), 9 deletions(-)
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/xfs/cfg/reflink
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/2 test-appliance: add xfs/reflink config

---
 kvm-xfstests/test-appliance/files/root/fs/xfs/cfg/reflink | 3 +++
 1 file changed, 3 insertions(+)
 create mode 100644 kvm-xfstests/test-appliance/files/root/fs/xfs/cfg/reflink
kvm-xfstests/test-appliance/files/root/fs/xfs/cfg/reflink new file +3 -0
new file mode 100644
index 0000000..f4e9ecb
@@ -0,0 +1,3 @@
+SIZE=small
+export XFS_MKFS_OPTIONS="-m rmapbt=1,reflink=1"
+TESTNAME="XFS reflink"
Signature · 1 line
2.7.4
#2 lore raw

PATCH 2/2 test-appliance: add support for overlayfs over xfs

In reply to Amir Goldstein

When PRIMARY_FSTYPE is set to xfs, format overlayfs underlying device as xfs with reflink support, because clone-up is so much nicer then copy-up.

This requires using the for-next (for 4.9) branch of xfsprogs.

---
 .../test-appliance/files/root/fs/overlay/config    | 44 ++++++++++++++++++----
 kvm-xfstests/util/parse_cli                        |  2 +-
 2 files changed, 37 insertions(+), 9 deletions(-)
kvm-xfstests/test-appliance/files/root/fs/overlay/config +36 -8
index 4420cfe..63ae06f 100644
@@ -4,18 +4,32 @@
 
 DEFAULT_MKFS_OPTIONS=""
 
+function __fsck()
+{
+	local dev="$1"
+
+	case "$FSTESTTYP" in
+	    ext4)
+		/sbin/e2fsck -fy "$dev"
+		;;
+	    xfs)
+		xfs_repair "$dev"
+		;;
+	esac
+}
+
 function check_filesystem()
 {
 	umount $SM_TST_DEV >& /dev/null
-	/sbin/e2fsck -fy "$SM_TST_DEV"
+	__fsck "$SM_TST_DEV"
 	ret="$?"
-	mount -t ext4 $SM_TST_DEV $SM_TST_MNT
+	mount -t $FSTESTTYP $SM_TST_DEV $SM_TST_MNT
 	echo e2fsck exited with status "$ret"
 
 	umount $SM_SCR_DEV >& /dev/null
-	/sbin/e2fsck -fy "$SM_SCR_DEV"
+	__fsck "$SM_SCR_DEV"
 	ret2="$?"
-	mount -t ext4 $SM_SCR_DEV $SM_SCR_MNT
+	mount -t $FSTESTTYP $SM_SCR_DEV $SM_SCR_MNT
 	echo e2fsck exited with status "$ret2"
 
 	if test "$ret" -eq 0 ; then
@@ -24,16 +38,30 @@ function check_filesystem()
 	return "$ret"
 }
 
+function __mkfs()
+{
+	local dev="$1"
+
+	case "$FSTESTTYP" in
+	    ext4)
+		/sbin/mke2fs -F -q -t ext4 "$dev"
+		;;
+	    xfs)
+		mkfs.xfs -f -m rmapbt=1,reflink=1 "$dev"
+		;;
+	esac
+}
+
 function format_filesystem()
 {
 	umount $SM_TST_DEV >& /dev/null
-	/sbin/mke2fs -F -q -t ext4 $SM_TST_DEV
-	mount -t ext4 $SM_TST_DEV $SM_TST_MNT
+	__mkfs $SM_TST_DEV
+	mount -t $FSTESTTYP $SM_TST_DEV $SM_TST_MNT
 	mkdir -p $SM_TST_MNT/ovl $SM_TST_MNT/testarea
 	      
 	umount $SM_SCR_DEV >& /dev/null
-	/sbin/mke2fs -F -q -t ext4 $SM_SCR_DEV
-	mount -t ext4 $SM_SCR_DEV $SM_SCR_MNT
+	__mkfs $SM_SCR_DEV
+	mount -t $FSTESTTYP $SM_SCR_DEV $SM_SCR_MNT
 	mkdir -p $SM_SCR_MNT/ovl $SM_SCR_MNT/testarea
 
 	return 0
kvm-xfstests/util/parse_cli +1 -1
index a170931..ea747be 100644
@@ -59,7 +59,7 @@ print_help ()
 validate_test_name()
 {
     case "$1" in
-	btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*) ;;
+	btrfs*|cifs*|ext4*|generic*|shared*|udf*|xfs*|overlay*) ;;
 	*)
 	    echo -e "Invalid test name: $1\n"
 	    print_help
Signature · 1 line
2.7.4
#3 lore raw
In reply to Amir Goldstein
Quoted 8 lines · Amir Goldstein

Hi Ted,

Following are the changes to xfstests-bld I have been using to test overlayfs.

xfstests master branch just got updated with several fixes to overlay/* tests. One overlayfs bug that was caught by generic/375 was fixed for 4.9-rc4 and one that was caught by generic/157 is queued on overlayfs-next branch.

Quoted 6 lines

With these changes to test-appliance, one can test drive overlayfs clone-up over xfs with reflink support. Xfs with reflink support was merged to 4.9-rc1 and relevant xfsprogs changes are queued on xfsprogs for-next branch. Overlayfs clone-up is queued on overlayfs-next branch.

Decided to have a little fun and send this one out to you also via github PR.

Thanks, merged.

Quoted 2 lines

Thanks for setting up xfstests-bld.
It has been a great help in bringing up my test env.

Great, I'm glad it's been useful for you!

- Ted