diff mbox series

[v2,3/6] generic/317, afs: Allow for a filesystem not to honour the local uid/gid

Message ID 20230424141042.450535-4-dhowells@redhat.com (mailing list archive)
State New, archived
Headers show
Series xfstests: Add support for using xfstests to test AFS | expand

Commit Message

David Howells April 24, 2023, 2:10 p.m. UTC
Each AFS cell has it's own set of user IDs that is uses internally, in its
ACL system and in its protection management protocol.  The user ID used by
the fileserver is selected from the set belonging to the fileserver's cell
according to the authentication token associated with an RPC operation -
and this is set as a file's user ID when it is created.

This means that tests that expect to set a UID and see the same UID still
set afterwards will fail.

Add a "_require_use_local_uidgid" clause to indicate that a test expects
internal UID/GID information to be seen in the stat output and should be
skipped if AFS's case.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-afs@lists.infradead.org
---
 common/rc                    | 9 +++++++++
 doc/requirement-checking.txt | 8 ++++++++
 tests/generic/317            | 1 +
 3 files changed, 18 insertions(+)

Comments

Zorro Lang April 26, 2023, 2:40 p.m. UTC | #1
On Mon, Apr 24, 2023 at 03:10:39PM +0100, David Howells wrote:
> Each AFS cell has it's own set of user IDs that is uses internally, in its
> ACL system and in its protection management protocol.  The user ID used by
> the fileserver is selected from the set belonging to the fileserver's cell
> according to the authentication token associated with an RPC operation -
> and this is set as a file's user ID when it is created.
> 
> This means that tests that expect to set a UID and see the same UID still
> set afterwards will fail.
> 
> Add a "_require_use_local_uidgid" clause to indicate that a test expects
> internal UID/GID information to be seen in the stat output and should be
> skipped if AFS's case.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: linux-afs@lists.infradead.org
> ---

Make sense. Maybe not only AFS need this, but that's another story in other
patches. For this one:

Reviewed-by: Zorro Lang <zlang@redhat.com>

>  common/rc                    | 9 +++++++++
>  doc/requirement-checking.txt | 8 ++++++++
>  tests/generic/317            | 1 +
>  3 files changed, 18 insertions(+)
> 
> diff --git a/common/rc b/common/rc
> index 00c5fcfe..e0978a03 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -5106,6 +5106,15 @@ _require_sgid_inheritance()
>  	esac
>  }
>  
> +_require_use_local_uidgid()
> +{
> +	case $FSTYP in
> +	afs)
> +		_notrun "$FSTYP doesn't honour local uid and gid"
> +		;;
> +	esac
> +}
> +
>  init_rc
>  
>  ################################################################################
> diff --git a/doc/requirement-checking.txt b/doc/requirement-checking.txt
> index a3588ee9..f24ecf5c 100644
> --- a/doc/requirement-checking.txt
> +++ b/doc/requirement-checking.txt
> @@ -17,6 +17,7 @@ they have.  This is done with _require_<xxx> macros, which may take parameters.
>  	_require_chattr <letters>
>  	_require_exportfs
>  	_require_sgid_inheritance
> +	_require_use_local_uidgid
>  
>   (3) System call requirements.
>  
> @@ -104,6 +105,13 @@ _require_sgid_inheritance
>       of the SGID bit and the GID from a marked directory.  The test will be
>       skipped if not supported.
>  
> +_require_use_local_uidgid
> +
> +     The test requires that the $TEST_DEV filesystem sets the uid and gid of a
> +     newly created file to the creating process's fsuid and fsgid.  Remote
> +     filesystems, for example, may choose other settings or not even have these
> +     concepts available.  The test will be skipped if not supported.
> +
>  
>  ========================
>  SYSTEM CALL REQUIREMENTS
> diff --git a/tests/generic/317 b/tests/generic/317
> index 134d5e3f..39cccc8b 100755
> --- a/tests/generic/317
> +++ b/tests/generic/317
> @@ -38,6 +38,7 @@ _require_user
>  _require_ugid_map
>  _require_userns
>  _require_chown
> +_require_use_local_uidgid
>  qa_user_id=`id -u $qa_user`
>  
>  _filter_output()
>
David Howells April 26, 2023, 3:54 p.m. UTC | #2
Zorro Lang <zlang@redhat.com> wrote:

> Make sense. Maybe not only AFS need this, but that's another story in other
> patches

Yeah - it's something that network filesystems are likely to have to deal
with.

David
diff mbox series

Patch

diff --git a/common/rc b/common/rc
index 00c5fcfe..e0978a03 100644
--- a/common/rc
+++ b/common/rc
@@ -5106,6 +5106,15 @@  _require_sgid_inheritance()
 	esac
 }
 
+_require_use_local_uidgid()
+{
+	case $FSTYP in
+	afs)
+		_notrun "$FSTYP doesn't honour local uid and gid"
+		;;
+	esac
+}
+
 init_rc
 
 ################################################################################
diff --git a/doc/requirement-checking.txt b/doc/requirement-checking.txt
index a3588ee9..f24ecf5c 100644
--- a/doc/requirement-checking.txt
+++ b/doc/requirement-checking.txt
@@ -17,6 +17,7 @@  they have.  This is done with _require_<xxx> macros, which may take parameters.
 	_require_chattr <letters>
 	_require_exportfs
 	_require_sgid_inheritance
+	_require_use_local_uidgid
 
  (3) System call requirements.
 
@@ -104,6 +105,13 @@  _require_sgid_inheritance
      of the SGID bit and the GID from a marked directory.  The test will be
      skipped if not supported.
 
+_require_use_local_uidgid
+
+     The test requires that the $TEST_DEV filesystem sets the uid and gid of a
+     newly created file to the creating process's fsuid and fsgid.  Remote
+     filesystems, for example, may choose other settings or not even have these
+     concepts available.  The test will be skipped if not supported.
+
 
 ========================
 SYSTEM CALL REQUIREMENTS
diff --git a/tests/generic/317 b/tests/generic/317
index 134d5e3f..39cccc8b 100755
--- a/tests/generic/317
+++ b/tests/generic/317
@@ -38,6 +38,7 @@  _require_user
 _require_ugid_map
 _require_userns
 _require_chown
+_require_use_local_uidgid
 qa_user_id=`id -u $qa_user`
 
 _filter_output()