From b4b83ef5b34f5959bc69679fb8bafd64b77360a5 Mon Sep 17 00:00:00 2001 From: Sebastien Buisson Date: Mon, 11 Mar 2024 09:27:15 +0100 Subject: [PATCH] LU-17631 tests: move refresh_krb5_tgt() to test-framework.sh 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 Change-Id: I26c5aaf653d332666a08e315425e1befe8cad2b2 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/54347 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Li Xi Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/tests/sanity-krb5.sh | 18 ------------------ lustre/tests/test-framework.sh | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lustre/tests/sanity-krb5.sh b/lustre/tests/sanity-krb5.sh index c0418b2..f92ee45 100755 --- a/lustre/tests/sanity-krb5.sh +++ b/lustre/tests/sanity-krb5.sh @@ -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}') diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 3da6e6d..7ecec66 100755 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -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() { -- 1.8.3.1