From: yujian Date: Mon, 13 Jul 2009 02:08:50 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_220~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=984482f865fc1cc3c7ecdd10b521bd479ce11688;ds=sidebyside Branch HEAD 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 --- diff --git a/lustre/tests/cfg/local.sh b/lustre/tests/cfg/local.sh index dceb554..4de5af8 100644 --- a/lustre/tests/cfg/local.sh +++ b/lustre/tests/cfg/local.sh @@ -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} + +MPIRUN=$(which mpirun 2>/dev/null) || true +MPI_USER=${MPI_USER:-mpiuser} diff --git a/lustre/tests/cfg/ncli.sh b/lustre/tests/cfg/ncli.sh index a3fff9f..2bd0618 100644 --- a/lustre/tests/cfg/ncli.sh +++ b/lustre/tests/cfg/ncli.sh @@ -11,11 +11,6 @@ init_clients_lists [ -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 diff --git a/lustre/tests/large-scale.sh b/lustre/tests/large-scale.sh index c3ecd82..b7e1800 100644 --- a/lustre/tests/large-scale.sh +++ b/lustre/tests/large-scale.sh @@ -31,6 +31,10 @@ build_test_filter 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() { diff --git a/lustre/tests/parallel-scale.sh b/lustre/tests/parallel-scale.sh index 4cfe52f..714ed9a 100644 --- a/lustre/tests/parallel-scale.sh +++ b/lustre/tests/parallel-scale.sh @@ -84,6 +84,10 @@ wdisjoint_REP=${wdisjoint_REP:-10000} 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 diff --git a/lustre/tests/performance-sanity.sh b/lustre/tests/performance-sanity.sh index 1846fd8..beabcc4 100644 --- a/lustre/tests/performance-sanity.sh +++ b/lustre/tests/performance-sanity.sh @@ -22,6 +22,10 @@ ALWAYS_EXCEPT="1 2 $PERFORMANCE_SANITY_EXCEPT" 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" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 690f14e..789663d 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -2615,6 +2615,35 @@ check_runas_id() { 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() {