Whamcloud - gitweb
LU-288 adjust PATH order in test framework
authorBobi Jam <bobijam@whamcloud.com>
Tue, 10 May 2011 07:07:05 +0000 (15:07 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 4 Jun 2011 00:20:26 +0000 (17:20 -0700)
* Test scripts use lustre build tree binaries other than installed ones.
* Bind mount mount.lustre in the lustre build tree other than copying to /sbin/

Change-Id: I32468fa608b32a7ef097db531cdd45b68088af50
Signed-off-by: Bobi Jam <bobijam@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/525
Tested-by: Hudson
Reviewed-by: Lai Siyao <laisiyao@whamcloud.com>
Reviewed-by: Prakash Surya <surya1@llnl.gov>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/tests/test-framework.sh

index 6fbddd6..9325aba 100644 (file)
@@ -141,16 +141,16 @@ init_test_env() {
     fi
     export HOSTNAME=${HOSTNAME:-`hostname`}
     if ! echo $PATH | grep -q $LUSTRE/utils; then
     fi
     export HOSTNAME=${HOSTNAME:-`hostname`}
     if ! echo $PATH | grep -q $LUSTRE/utils; then
-        export PATH=$PATH:$LUSTRE/utils
+        export PATH=$LUSTRE/utils:$PATH
     fi
     if ! echo $PATH | grep -q $LUSTRE/utils/gss; then
     fi
     if ! echo $PATH | grep -q $LUSTRE/utils/gss; then
-        export PATH=$PATH:$LUSTRE/utils/gss
+        export PATH=$LUSTRE/utils/gss:$PATH
     fi
     if ! echo $PATH | grep -q $LUSTRE/tests; then
         export PATH=$LUSTRE/tests:$PATH
     fi
     if ! echo $PATH | grep -q $LUSTRE/../lustre-iokit/sgpdd-survey; then
     fi
     if ! echo $PATH | grep -q $LUSTRE/tests; then
         export PATH=$LUSTRE/tests:$PATH
     fi
     if ! echo $PATH | grep -q $LUSTRE/../lustre-iokit/sgpdd-survey; then
-        export PATH=$PATH:$LUSTRE/../lustre-iokit/sgpdd-survey
+        export PATH=$LUSTRE/../lustre-iokit/sgpdd-survey:$PATH
     fi
     export LST=${LST:-"$LUSTRE/../lnet/utils/lst"}
     [ ! -f "$LST" ] && export LST=$(which lst)
     fi
     export LST=${LST:-"$LUSTRE/../lnet/utils/lst"}
     [ ! -f "$LST" ] && export LST=$(which lst)
@@ -165,7 +165,7 @@ init_test_env() {
         export PATH=$LUSTRE/tests/racer:$PATH:
     fi
     if ! echo $PATH | grep -q $LUSTRE/tests/mpi; then
         export PATH=$LUSTRE/tests/racer:$PATH:
     fi
     if ! echo $PATH | grep -q $LUSTRE/tests/mpi; then
-        export PATH=$PATH:$LUSTRE/tests/mpi
+        export PATH=$LUSTRE/tests/mpi:$PATH
     fi
     export RSYNC_RSH=${RSYNC_RSH:-rsh}
     export LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
     fi
     export RSYNC_RSH=${RSYNC_RSH:-rsh}
     export LCTL=${LCTL:-"$LUSTRE/utils/lctl"}
@@ -380,7 +380,10 @@ load_modules_local() {
     $LCTL modules > $OGDB/ogdb-$HOSTNAME
 
     # 'mount' doesn't look in $PATH, just sbin
     $LCTL modules > $OGDB/ogdb-$HOSTNAME
 
     # 'mount' doesn't look in $PATH, just sbin
-    [ -f $LUSTRE/utils/mount.lustre ] && cp $LUSTRE/utils/mount.lustre /sbin/. || true
+    local bindmount=$(mount | grep "/sbin/mount.lustre")
+    if [ -f $LUSTRE/utils/mount.lustre ] && [ "x$bindmount" == "x" ]; then
+           mount --bind $LUSTRE/utils/mount.lustre /sbin/mount.lustre || true
+    fi
 }
 
 load_modules () {
 }
 
 load_modules () {
@@ -422,6 +425,8 @@ unload_modules() {
         fi
     fi
 
         fi
     fi
 
+    umount /sbin/mount.lustre
+
     check_mem_leak || return 254
 
     echo "modules unloaded."
     check_mem_leak || return 254
 
     echo "modules unloaded."