Skip to contentSkip to conversation

common: add CephFS support

PATCH Superseded David Disseldorp 2 participants 3 messages Nov 2, 2016 – Nov 3, 2016

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 common: add CephFS support

From: Joao Eduardo Luis <[email protected]>

Add basic CephFS support. No new CephFS specific tests are included, just basic enablement, with ./check now accepting a -ceph parameter.

---
 README        |  1 +
 check         |  2 ++
 common/config |  9 +++++++++
 common/rc     | 33 +++++++++++++++++++++++++++++++++
 4 files changed, 45 insertions(+)
README +1 -0
index bc2058d..b1cafe2 100644
@@ -126,6 +126,7 @@ Running tests:
       Running all the udf tests: ./check -udf -g udf
     - for running nfs tests: ./check -nfs [test(s)]
     - for running cifs/smb3 tests: ./check -cifs [test(s)]
+    - for running CephFS tests: ./check -ceph [test(s)]
     - To randomize test order: ./check -r [test(s)]
 
     
check +2 -0
index 69341d8..adc2347 100755
@@ -63,6 +63,7 @@ usage()
 check options
     -nfs                test NFS
     -cifs               test CIFS
+    -ceph               test CephFS
     -overlay		test overlay
     -tmpfs              test TMPFS
     -l			line mode diff
@@ -212,6 +213,7 @@ while [ $# -gt 0 ]; do
 	-cifs)		FSTYP=cifs ;;
 	-overlay)	FSTYP=overlay ;;
 	-tmpfs)		FSTYP=tmpfs ;;
+	-ceph)		FSTYP=ceph ;;
 
 	-g)	group=$2 ; shift ;
 		GROUP_LIST="$GROUP_LIST ${group//,/ }"
common/config +9 -0
index 168f46c..59638d6 100644
@@ -298,6 +298,9 @@ _mount_opts()
 	cifs)
 		export MOUNT_OPTIONS=$CIFS_MOUNT_OPTIONS
 		;;
+	ceph)
+		export MOUNT_OPTIONS=$CEPHFS_MOUNT_OPTIONS
+		;;
 	overlay)
 		export MOUNT_OPTIONS=$OVERLAY_MOUNT_OPTIONS
 		;;
@@ -335,6 +338,9 @@ _test_mount_opts()
 	cifs)
 		export TEST_FS_MOUNT_OPTS=$CIFS_MOUNT_OPTIONS
 		;;
+	ceph)
+		export TEST_FS_MOUNT_OPTS=$CEPHFS_MOUNT_OPTIONS
+		;;
 	*)
 		;;
 	esac
@@ -357,6 +363,9 @@ _mkfs_opts()
 	cifs)
 		export MKFS_OPTIONS=$CIFS_MKFS_OPTIONS
 		;;
+	ceph)
+		export MKFS_OPTIONS=$CEPHFS_MKFS_OPTIONS
+		;;
 	reiserfs)
 		export MKFS_OPTIONS="$REISERFS_MKFS_OPTIONS -q"
 		;;
common/rc +33 -0
index a84efe4..d057962 100644
@@ -147,6 +147,8 @@ case "$FSTYP" in
 	 ;;
     cifs)
 	 ;;
+    ceph)
+	 ;;
     overlay)
 	 ;;
     reiser4)
@@ -705,6 +707,9 @@ _test_mkfs()
     cifs)
 	# do nothing for cifs
 	;;
+    ceph)
+	# do nothing for ceph
+	;;
     overlay)
 	# do nothing for overlay
 	;;
@@ -791,6 +796,10 @@ _scratch_mkfs()
 	# avoid EEXIST caused by the leftover files created in previous runs
         _scratch_cleanup_files
 	;;
+    ceph)
+	# Don't re-create CephFS, just remove all files
+	_scratch_cleanup_files
+	;;
     overlay)
 	# unable to re-create overlay, remove all files in $SCRATCH_MNT to
 	# avoid EEXIST caused by the leftover files created in previous runs
@@ -1499,6 +1508,15 @@ _require_scratch_nocheck()
 			_notrun "this test requires a valid \$SCRATCH_MNT"
 		fi
 		;;
+        ceph)
+		echo $SCRATCH_DEV | grep -q ":/" > /dev/null 2>&1
+		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
+			_notrun "this test requires a valid \$SCRATCH_DEV"
+		fi
+		if [ ! -d "$SCRATCH_MNT" ]; then
+			_notrun "this test requires a valid \$SCRATCH_MNT"
+		fi
+		;;
 	cifs)
 		echo $SCRATCH_DEV | grep -q "//" > /dev/null 2>&1
 		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
@@ -1584,6 +1602,15 @@ _require_test()
 			_notrun "this test requires a valid \$TEST_DIR"
 		fi
 		;;
+	ceph)
+		echo $TEST_DEV | grep -q ":/" > /dev/null 2>&1
+		if [ -z "$TEST_DEV" -o "$?" != "0" ]; then
+			_notrun "this test requires a valid \$TEST_DEV"
+		fi
+		if [ ! -d "$TEST_DIR" ]; then
+		     _notrun "this test requires a valid \$TEST_DIR"
+		fi
+		;;
 	cifs)
 		echo $TEST_DEV | grep -q "//" > /dev/null 2>&1
 		if [ -z "$TEST_DEV" -o "$?" != "0" ]; then
@@ -2658,6 +2685,9 @@ _check_test_fs()
     cifs)
 	# no way to check consistency for cifs
 	;;
+    ceph)
+	# no way to check consistency for CephFS
+	;;
     overlay)
 	# no way to check consistency for overlay
 	;;
@@ -2702,6 +2732,9 @@ _check_scratch_fs()
     cifs)
 	# Don't know how to check a CIFS filesystem, yet.
 	;;
+    ceph)
+	# no way to check consistency for CephFS
+	;;
     overlay)
 	# no way to check consistency for overlay
 	;;
Signature · 1 line
2.10.0
#1 lore raw
Quoted 4 lines · David Disseldorp

From: Joao Eduardo Luis <[email protected]>

Add basic CephFS support. No new CephFS specific tests are included, just basic enablement, with ./check now accepting a -ceph parameter.

We don't add command line parameters to specify the filesystem anymore if we can avoid it (they are legacy options, really). Specifying FSTYP=ceph in the environment or config file should be sufficient to do they right thing - does this work for ceph?

common/rc _require_scratch_nocheck() · line 1519

Quoted 13 lines
common/rc +9 -0
@@ -1499,6 +1508,15 @@ _require_scratch_nocheck()
 			_notrun "this test requires a valid \$SCRATCH_MNT"
 		fi
 		;;
+        ceph)
+		echo $SCRATCH_DEV | grep -q ":/" > /dev/null 2>&1
+		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
+			_notrun "this test requires a valid \$SCRATCH_DEV"
+		fi
+		if [ ! -d "$SCRATCH_MNT" ]; then
+			_notrun "this test requires a valid \$SCRATCH_MNT"
+		fi
+		;;

This is the same check as for nfs*). Can you make those common?

Quoted 6 lines
common/rc +0 -0
 	cifs)
 		echo $SCRATCH_DEV | grep -q "//" > /dev/null 2>&1
 		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
@@ -1584,6 +1602,15 @@ _require_test()
 			_notrun "this test requires a valid \$TEST_DIR"
 		fi

common/rc _require_test() · line 1613

Quoted 10 lines
common/rc +9 -0
 		;;
+	ceph)
+		echo $TEST_DEV | grep -q ":/" > /dev/null 2>&1
+		if [ -z "$TEST_DEV" -o "$?" != "0" ]; then
+			_notrun "this test requires a valid \$TEST_DEV"
+		fi
+		if [ ! -d "$TEST_DIR" ]; then
+		     _notrun "this test requires a valid \$TEST_DIR"
+		fi
+		;;

Same.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#2 lore raw
Quoted 10 lines · Dave Chinner
Quoted 4 lines · David Disseldorp

From: Joao Eduardo Luis <[email protected]>

Add basic CephFS support. No new CephFS specific tests are included, just basic enablement, with ./check now accepting a -ceph parameter.

We don't add command line parameters to specify the filesystem anymore if we can avoid it (they are legacy options, really). Specifying FSTYP=ceph in the environment or config file should be sufficient to do they right thing - does this work for ceph?

Yes, seems to work okay for me.

Quoted 16 lines
Quoted 4 lines
common/rc +0 -0
@@ -1499,6 +1508,15 @@ _require_scratch_nocheck()
 			_notrun "this test requires a valid \$SCRATCH_MNT"
 		fi

common/rc _require_scratch_nocheck() · line 1519

Quoted 10 lines
common/rc +9 -0
 		;;
+        ceph)
+		echo $SCRATCH_DEV | grep -q ":/" > /dev/null 2>&1
+		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
+			_notrun "this test requires a valid \$SCRATCH_DEV"
+		fi
+		if [ ! -d "$SCRATCH_MNT" ]; then
+			_notrun "this test requires a valid \$SCRATCH_MNT"
+		fi
+		;;  

This is the same check as for nfs*). Can you make those common?

Sure, will fix and resend. Thanks for the feedback Dave.

Cheers, David