Whamcloud - gitweb
LU-17631 tests: move refresh_krb5_tgt() to test-framework.sh 47/54347/2
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 11 Mar 2024 08:27:15 +0000 (09:27 +0100)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Jan 2025 22:03:57 +0000 (22:03 +0000)
refresh_krb5_tgt() is used in multiple test scripts, so move it to
test-framework.sh.

Test-Parameters: trivial kerberos=true testlist=sanity-krb5
Fixes: 478df60923 ("LU-17050 tests: test Kerberos env in sanity-krb5")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I26c5aaf653d332666a08e315425e1befe8cad2b2
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54347
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Li Xi <lixi@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/tests/sanity-krb5.sh
lustre/tests/test-framework.sh

index c0418b2..f92ee45 100755 (executable)
@@ -124,24 +124,6 @@ error_dbench()
        error $err_str
 }
 
-# obtain and cache Kerberos ticket-granting ticket
-refresh_krb5_tgt() {
-       local myRUNAS_UID=$1
-       local myRUNAS_GID=$2
-       shift 2
-       local myRUNAS=$@
-       if [ -z "$myRUNAS" ]; then
-               error_exit "myRUNAS command must be specified for refresh_krb5_tgt"
-       fi
-
-       CLIENTS=${CLIENTS:-$HOSTNAME}
-       do_nodes $CLIENTS "set -x
-if ! $myRUNAS krb5_login.sh; then
-    echo "Failed to refresh Krb5 TGT for UID/GID $myRUNAS_UID/$myRUNAS_GID."
-    exit 1
-fi"
-}
-
 restore_krb5_cred() {
        local keys=$(keyctl show | awk '$6 ~ "^lgssc:" {print $1}')
 
index 3da6e6d..7ecec66 100755 (executable)
@@ -8333,6 +8333,24 @@ get_mpiuser_id() {
        fi
 }
 
+# obtain and cache Kerberos ticket-granting ticket
+refresh_krb5_tgt() {
+       local myRUNAS_UID=$1
+       local myRUNAS_GID=$2
+       shift 2
+       local myRUNAS=$@
+       if [ -z "$myRUNAS" ]; then
+               error_exit "myRUNAS command must be specified for refresh_krb5_tgt"
+       fi
+
+       CLIENTS=${CLIENTS:-$HOSTNAME}
+       do_nodes $CLIENTS "set -x
+if ! $myRUNAS krb5_login.sh; then
+    echo "Failed to refresh Krb5 TGT for UID/GID $myRUNAS_UID/$myRUNAS_GID."
+    exit 1
+fi"
+}
+
 # Run multiop in the background, but wait for it to print
 # "PAUSING" to its stdout before returning from this function.
 multiop_bg_pause() {