Whamcloud - gitweb
Allow GSS password to be passed to the test-framework in $GSS_PASS.
authorbrian <brian>
Fri, 10 Jun 2005 23:23:57 +0000 (23:23 +0000)
committerbrian <brian>
Fri, 10 Jun 2005 23:23:57 +0000 (23:23 +0000)
lustre/tests/krb5_env.sh
lustre/tests/krb5_refresh_cache.sh

index fdd81d3..f20815b 100755 (executable)
@@ -71,7 +71,35 @@ prepare_krb5_cache() {
     fi
 
     echo "***** refresh Kerberos V5 TGT for uid $UID *****"
-    $KRB5DIR/bin/kinit
+    if [ -z "$GSS_PASS" ]; then
+        $KRB5DIR/bin/kinit
+    else
+        expect <<EOF
+set timeout 30 
+
+log_user 1 
+
+set spawnid [spawn /bin/bash]
+send "export PS1=\"user@host $ \" \r"
+expect {
+    timeout {puts "timeout" ;exit 1}
+    "user@host $ "
+}
+
+send "$KRB5DIR/bin/kinit\r"
+{
+    timeout {puts "timeout" ;exit 1}
+    "Password for "
+
+send "$GSS_PASS\r"
+expect {
+    timeout {puts "timeout" ;exit 1}
+    "user@host $ "
+}
+
+exit 0
+EOF
+    fi
     ret=$?
     return $ret
 }
index 2adfadc..2c16067 100755 (executable)
@@ -24,6 +24,34 @@ if [ $UID -eq 0 ]; then
 fi
 
 echo "***** refresh Kerberos V5 TGT for uid $UID *****"
-$KRB5DIR/bin/kinit
+if [ -z "$GSS_PASS" ]; then
+    $KRB5DIR/bin/kinit
+else
+    expect <<EOF
+set timeout 30 
+
+log_user 1 
+
+set spawnid [spawn /bin/bash]
+send "export PS1=\"user@host $ \" \r"
+expect {
+    timeout {puts "timeout" ;exit 1}
+    "user@host $ "
+}
+
+send "$KRB5DIR/bin/kinit\r"
+{
+    timeout {puts "timeout" ;exit 1}
+    "Password for "
+
+send "$GSS_PASS\r"
+expect {
+    timeout {puts "timeout" ;exit 1}
+    "user@host $ "
+}
+
+exit 0
+EOF
+fi
 ret=$?
 exit $ret