Whamcloud - gitweb
Branch HEAD
authoryujian <yujian>
Mon, 13 Jul 2009 02:08:50 +0000 (02:08 +0000)
committeryujian <yujian>
Mon, 13 Jul 2009 02:08:50 +0000 (02:08 +0000)
b=19432
i=robert.read
i=grev

1) refresh Kerberos 5 TGT for mpirun user
2) move MPIRUN and MPI_USER from ncli.sh to local.sh
3) remove MPIBIN
4) redirect the stderr of "which mpirun" to /dev/null
5) run MPI_USER_{UID,GID} initialization only for MPI tests

lustre/tests/cfg/local.sh
lustre/tests/cfg/ncli.sh
lustre/tests/large-scale.sh
lustre/tests/parallel-scale.sh
lustre/tests/performance-sanity.sh
lustre/tests/test-framework.sh

index dceb554..4de5af8 100644 (file)
@@ -111,3 +111,6 @@ POWER_DOWN=${POWER_DOWN:-"powerman --off"}
 POWER_UP=${POWER_UP:-"powerman --on"}
 SLOW=${SLOW:-no}
 FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
 POWER_UP=${POWER_UP:-"powerman --on"}
 SLOW=${SLOW:-no}
 FAIL_ON_ERROR=${FAIL_ON_ERROR:-true}
+
+MPIRUN=$(which mpirun 2>/dev/null) || true
+MPI_USER=${MPI_USER:-mpiuser}
index a3fff9f..2bd0618 100644 (file)
@@ -11,11 +11,6 @@ init_clients_lists
 
 [ -n "$FUNCTIONS" ] && . $FUNCTIONS || true
 
 
 [ -n "$FUNCTIONS" ] && . $FUNCTIONS || true
 
-MPIBIN=${MPIBIN:-/testsuite/tests/`arch`/bin}
-export PATH=:$PATH:$MPIBIN
-MPIRUN=$(which mpirun) || true
-MPI_USER=${MPI_USER:-mpiuser}
-
 # for recovery scale tests
 # default boulder cluster iozone location
 export PATH=/opt/iozone/bin:$PATH
 # for recovery scale tests
 # default boulder cluster iozone location
 export PATH=/opt/iozone/bin:$PATH
index c3ecd82..b7e1800 100644 (file)
@@ -31,6 +31,10 @@ build_test_filter
 check_and_setup_lustre
 rm -rf $DIR/[df][0-9]*
 
 check_and_setup_lustre
 rm -rf $DIR/[df][0-9]*
 
+get_mpiuser_id $MPI_USER
+MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
+$GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
+
 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
 test_3a() {
 [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
 test_3a() {
index 4cfe52f..714ed9a 100644 (file)
@@ -84,6 +84,10 @@ wdisjoint_REP=${wdisjoint_REP:-10000}
 build_test_filter
 check_and_setup_lustre
 
 build_test_filter
 check_and_setup_lustre
 
+get_mpiuser_id $MPI_USER
+MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
+$GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
+
 print_opts () {
     local var
 
 print_opts () {
     local var
 
index 1846fd8..beabcc4 100644 (file)
@@ -22,6 +22,10 @@ ALWAYS_EXCEPT="1     2    $PERFORMANCE_SANITY_EXCEPT"
 
 build_test_filter
 
 
 build_test_filter
 
+get_mpiuser_id $MPI_USER
+MPI_RUNAS=${MPI_RUNAS:-"runas -u $MPI_USER_UID -g $MPI_USER_GID"}
+$GSS_KRB5 && refresh_krb5_tgt $MPI_USER_UID $MPI_USER_GID $MPI_RUNAS
+
 # single-IOR-rates
 test_1() {
     echo "Single client I/O performance as a percentage of raw"
 # single-IOR-rates
 test_1() {
     echo "Single client I/O performance as a percentage of raw"
index 690f14e..789663d 100644 (file)
@@ -2615,6 +2615,35 @@ check_runas_id() {
         add user $myRUNAS_UID:$myRUNAS_GID on these nodes."
 }
 
         add user $myRUNAS_UID:$myRUNAS_GID on these nodes."
 }
 
+# obtain the UID/GID for MPI_USER
+get_mpiuser_id() {
+    local mpi_user=$1
+
+    MPI_USER_UID=$(do_facet client "getent passwd $mpi_user | cut -d: -f3;
+exit \\\${PIPESTATUS[0]}") || error_exit "failed to get the UID for $mpi_user"
+
+    MPI_USER_GID=$(do_facet client "getent passwd $mpi_user | cut -d: -f4;
+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() {
 # Run multiop in the background, but wait for it to print
 # "PAUSING" to its stdout before returning from this function.
 multiop_bg_pause() {