Test Kerberos environnement is sane before trying to launch
sanity-krb5 tests.
Test-Parameters: trivial kerberos=true testlist=sanity-krb5
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I1675ba7db8c62687c69359a15cc931b5dfd40018
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52068
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
GSS=true
GSS_KRB5=true
+check_krb_env() {
+ which klist || skip "Kerberos env not setup"
+ which kinit || skip "Kerberos env not setup"
+}
+
prepare_krb5_creds() {
echo prepare krb5 cred
echo RUNAS=$RUNAS
$RUNAS krb5_login.sh || exit 1
}
+check_krb_env
prepare_krb5_creds
# we want double mount
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}')
exit \\\${PIPESTATUS[0]}") || error_exit "failed to get the GID for $mpi_user"
}
-# 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() {