All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: fstests@vger.kernel.org
Cc: dhowells@redhat.com, linux-afs@lists.infradead.org
Subject: [PATCH 1/9] Add AFS support
Date: Tue, 25 May 2021 14:33:55 +0100	[thread overview]
Message-ID: <162194963567.4011860.18154245673640393670.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <162194962878.4011860.5561077785368723619.stgit@warthog.procyon.org.uk>

Add support for the AFS filesystem.  AFS is a network filesystem and there
are a number of features it doesn't support.

 - No mkfs.  (Kind of.  An AFS volume server can be asked to create a new
   volume, but that's probably best left to AFS-specific test suites.
   Further, a volume would need to be destroyed before another of the same
   name could be created; it's not simply a matter of overwriting the old
   one as it is on a blockdev with a block-based filesystem.)

 - No fsck.  (Kind of - the server can be asked to salvage a volume, but it
   may involve taking the server offline).

 - No richacls.  AFS has its own ACL system.

 - No atimes.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
---

 build/rpm/xfstests.spec.in |    2 +-
 check                      |    2 ++
 common/config              |   12 +++++++++++-
 common/rc                  |   42 +++++++++++++++++++++++++++++++++++++-----
 4 files changed, 51 insertions(+), 7 deletions(-)

diff --git a/build/rpm/xfstests.spec.in b/build/rpm/xfstests.spec.in
index e0f7c5f9..3dce41ef 100644
--- a/build/rpm/xfstests.spec.in
+++ b/build/rpm/xfstests.spec.in
@@ -17,7 +17,7 @@ Group: System Environment/Base
 
 %description
 The XFS regression test suite.  Also includes some support for
-acl, attr, udf, and nfs testing.  Contains around 200 specific tests
+acl, attr, udf, nfs and afs testing.  Contains around 200 specific tests
 for userspace & kernelspace.
 
 %prep
diff --git a/check b/check
index ba192042..90abdbbd 100755
--- a/check
+++ b/check
@@ -56,6 +56,7 @@ usage()
 
 check options
     -nfs		test NFS
+    -afs		test AFS
     -glusterfs		test GlusterFS
     -cifs		test CIFS
     -9p			test 9p
@@ -278,6 +279,7 @@ while [ $# -gt 0 ]; do
 	-\? | -h | --help) usage ;;
 
 	-nfs)		FSTYP=nfs ;;
+	-afs)		FSTYP=afs ;;
 	-glusterfs)	FSTYP=glusterfs ;;
 	-cifs)		FSTYP=cifs ;;
 	-9p)		FSTYP=9p ;;
diff --git a/common/config b/common/config
index 1a269349..f0536b87 100644
--- a/common/config
+++ b/common/config
@@ -259,6 +259,7 @@ export BTRFS_CONVERT_PROG=$(type -P btrfs-convert)
 export BTRFS_TUNE_PROG=$(type -P btrfstune)
 export XFS_FSR_PROG=$(type -P xfs_fsr)
 export MKFS_NFS_PROG="false"
+export MKFS_AFS_PROG="false"
 export MKFS_CIFS_PROG="false"
 export MKFS_OVERLAY_PROG="false"
 export MKFS_REISER4_PROG=$(type -P mkfs.reiser4)
@@ -308,6 +309,9 @@ _mount_opts()
 	nfs)
 		export MOUNT_OPTIONS=$NFS_MOUNT_OPTIONS
 		;;
+	afs)
+		export MOUNT_OPTIONS=$AFS_MOUNT_OPTIONS
+		;;
 	cifs)
 		export MOUNT_OPTIONS=$CIFS_MOUNT_OPTIONS
 		;;
@@ -366,6 +370,9 @@ _test_mount_opts()
 	nfs)
 		export TEST_FS_MOUNT_OPTS=$NFS_MOUNT_OPTIONS
 		;;
+	afs)
+		export TEST_FS_MOUNT_OPTS=$AFS_MOUNT_OPTIONS
+		;;
 	glusterfs)
 		export TEST_FS_MOUNT_OPTS=$GLUSTERFS_MOUNT_OPTIONS
 		;;
@@ -392,6 +399,9 @@ _mkfs_opts()
 	nfs)
 		export MKFS_OPTIONS=$NFS_MKFS_OPTIONS
 		;;
+	afs)
+		export MKFS_OPTIONS=$AFS_MKFS_OPTIONS
+		;;
 	cifs)
 		export MKFS_OPTIONS=$CIFS_MKFS_OPTIONS
 		;;
@@ -492,7 +502,7 @@ _check_device()
 	fi
 
 	case "$FSTYP" in
-	9p|tmpfs|virtiofs)
+	9p|afs|tmpfs|virtiofs)
 		# 9p and virtiofs mount tags are just plain strings, so anything is allowed
 		# tmpfs doesn't use mount source, ignore
 		;;
diff --git a/common/rc b/common/rc
index b18cf61e..f24d0e87 100644
--- a/common/rc
+++ b/common/rc
@@ -123,6 +123,8 @@ case "$FSTYP" in
     nfs)
 	 . ./common/nfs
 	 ;;
+    afs)
+	 ;;
     cifs)
 	 ;;
     9p)
@@ -637,6 +639,9 @@ _test_mkfs()
     nfs*)
 	# do nothing for nfs
 	;;
+    afs*)
+	# do nothing for afs
+	;;
     cifs)
 	# do nothing for cifs
 	;;
@@ -680,6 +685,9 @@ _mkfs_dev()
     nfs*)
 	# do nothing for nfs
 	;;
+    afs*)
+	# do nothing for afs
+	;;
     9p)
 	# do nothing for 9p
 	;;
@@ -722,7 +730,7 @@ _mkfs_dev()
     rm -f $tmp.mkfserr $tmp.mkfsstd
 }
 
-# remove all files in $SCRATCH_MNT, useful when testing on NFS/CIFS
+# remove all files in $SCRATCH_MNT, useful when testing on NFS/AFS/CIFS
 _scratch_cleanup_files()
 {
 	case $FSTYP in
@@ -750,7 +758,7 @@ _scratch_mkfs()
 	local mkfs_status
 
 	case $FSTYP in
-	nfs*|cifs|ceph|overlay|glusterfs|pvfs2|9p|virtiofs)
+	nfs*|afs|cifs|ceph|overlay|glusterfs|pvfs2|9p|virtiofs)
 		# unable to re-create this fstyp, just remove all files in
 		# $SCRATCH_MNT to avoid EEXIST caused by the leftover files
 		# created in previous runs
@@ -1501,7 +1509,7 @@ _check_mounted_on()
 
 	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
+		# raw $DF_PROG cannot handle NFS/AFS/CIFS/overlay correctly
 		_df_device $dev
 		return 3 # 3 = mounted as wrong type
 	fi
@@ -1540,6 +1548,15 @@ _require_scratch_nocheck()
 			_notrun "this test requires a valid \$SCRATCH_MNT"
 		fi
 		;;
+	afs)
+		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
+		;;
 	pvfs2)
 		echo $SCRATCH_DEV | grep -q "://" > /dev/null 2>&1
 		if [ -z "$SCRATCH_DEV" -o "$?" != "0" ]; then
@@ -1696,6 +1713,15 @@ _require_test()
 			_notrun "this test requires a valid \$TEST_DIR"
 		fi
 		;;
+	afs)
+		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
@@ -2748,7 +2774,7 @@ _scratch_mkfs_richacl()
 		;;
 	ext4)   _scratch_mkfs -O richacl
 		;;
-	nfs*|cifs|overlay)
+	nfs*|afs|cifs|overlay)
 		_scratch_mkfs
 		;;
 	esac
@@ -2972,6 +2998,9 @@ _check_test_fs()
     nfs)
 	# no way to check consistency for nfs
 	;;
+    afs)
+	# no way to check consistency for afs
+	;;
     cifs)
 	# no way to check consistency for cifs
 	;;
@@ -3033,6 +3062,9 @@ _check_scratch_fs()
     nfs*)
 	# Don't know how to check an NFS filesystem, yet.
 	;;
+    afs*)
+	# Don't know how to check an AFS filesystem, yet.
+	;;
     cifs)
 	# Don't know how to check a CIFS filesystem, yet.
 	;;
@@ -3737,7 +3769,7 @@ _require_atime()
 {
 	_exclude_scratch_mount_option "noatime"
 	case $FSTYP in
-	nfs|cifs|virtiofs)
+	nfs|afs|cifs|virtiofs)
 		_notrun "atime related mount options have no effect on $FSTYP"
 		;;
 	esac



  reply	other threads:[~2021-05-25 13:34 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-25 13:33 [PATCH 0/9] Add support for using xfstests to test AFS David Howells
2021-05-25 13:33 ` David Howells [this message]
2021-05-25 13:34 ` [PATCH 2/9] generic/294, afs: Allow for mknod subtest failing if mknod not supported David Howells
2021-05-25 16:09   ` Darrick J. Wong
2021-05-25 16:19   ` David Howells
2021-05-25 16:26     ` Darrick J. Wong
2021-05-30 12:49   ` Eryu Guan
2021-06-01 14:31   ` David Howells
2021-06-06 11:58     ` Eryu Guan
2021-05-25 13:34 ` [PATCH 3/9] generic/314, afs: Allow for a filesystem that doesn't honour SGID inheritance David Howells
2021-05-25 16:10   ` Darrick J. Wong
2021-05-25 13:34 ` [PATCH 4/9] generic/317, afs: Allow for a filesystem not to honour the local uid/gid David Howells
2021-05-25 16:17   ` Darrick J. Wong
2021-05-25 16:41   ` David Howells
2021-05-25 13:34 ` [PATCH 5/9] generic/123, generic/128, afs: Allow for an fs that does its own perm management David Howells
2021-05-25 16:19   ` Darrick J. Wong
2021-05-25 16:44   ` David Howells
2021-05-25 16:51     ` Darrick J. Wong
2021-05-25 13:34 ` [PATCH 6/9] Add the ability to require O_TMPFILE to be supported for a test David Howells
2021-05-25 16:19   ` Darrick J. Wong
2021-05-30 12:54   ` Eryu Guan
2021-05-25 13:34 ` [PATCH 7/9] afs: Indicate the minimum DIO alignment is 1 David Howells
2021-05-25 13:34 ` [PATCH 8/9] generic/465: Fix handling of DIO alignment < sizeof(long) David Howells
2021-05-25 16:25   ` Darrick J. Wong
2021-05-25 16:46   ` David Howells
2021-05-25 13:34 ` [PATCH 9/9] Fix other posix_memalign() alignment issues David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=162194963567.4011860.18154245673640393670.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=fstests@vger.kernel.org \
    --cc=linux-afs@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.