Whamcloud - gitweb
- landing b_fid.
[fs/lustre-release.git] / lustre / tests / cobd_test.sh
index 08b9de8..68da2b5 100644 (file)
@@ -1,5 +1,4 @@
-#export PATH=`dirname $0`/../utils:/r/sbin/:/r/usr/bin/:$PATH
-export PATH=./../utils:/r/sbin/:/r/usr/bin/:$PATH
+export PATH="$PATH:./../utils:/r/sbin:/r/usr/bin"
 
 LCTL=${LCTL:-"lctl"}
 TMP=${TMP:-"/tmp"}
@@ -9,11 +8,11 @@ MNTPATH=${MNTPATH:-"/mnt/lustre"}
 TARCMD=${TARCMD:-"tar"}
 UNTARCMD=${UNTARCMD:-"tar -zxvf"}
 CPCMD=${CPCMD:-"cp -f"}
-CACHEMDS=${CACHEMDS:-$TMP/mds1-uml}
-REALMDS=${REALMDS:-$TMP/mds2-uml}
+CACHEMDS=${CACHEMDS:-$TMP/mds1-`hostname`}
+REALMDS=${REALMDS:-$TMP/mds3-`hostname`}
 
-CACHEOST=${CACHEOST:-$TMP/ost1-uml}
-REALOST=${REALOST:-$TMP/ost2-uml}
+CACHEOST=${CACHEOST:-$TMP/ost1-`hostname`}
+REALOST=${REALOST:-$TMP/ost3-`hostname`}
 
 MDS_CMOBD_INDEX=${MDS_CMOBD_INDEX:-12}
 OST_CMOBD_INDEX=${OST_CMOBD_INDEX:-14}
@@ -22,8 +21,8 @@ MDS_COBD_INDEX=${MDS_COBD_INDEX:-22}
 OST_COBD_INDEX=${OST_COBD_INDEX:-19}
 
 
-if ! [ -e "$TMP/$TARBALL" ]; then
-       echo "$TARBALL did not exist, please give a tar ball for test in your $TMP"
+if ! [ -e "$TARBALL" ]; then
+       echo "$TARBALL does not exist"
 fi
 
 show_filesystem() {
@@ -61,14 +60,12 @@ EOF
 }
 
 cobd_cache_on() {
-
 ${LCTL} << EOF
 device $OST_COBD_INDEX
 cache_on
 device $MDS_COBD_INDEX
 cache_on
 EOF
-
 }
 cobd_cache_on
 echo "before test ...."
@@ -76,8 +73,9 @@ show_filesystem $CACHEMDS $CACHEOST
 
 #first step cp the tar to cache dev and untar it
 echo "cp $TARBALL to lustre dir and untar ..."
-${CPCMD} $TMP/${TARBALL} ${MNTPATH}    || exit 1
-${UNTARCMD} ${MNTPATH}/${TARBALL} -C ${MNTPATH} > /dev/null || exit 2 
+${CPCMD} ${TARBALL} ${MNTPATH} || exit 1
+${UNTARCMD} ${MNTPATH}/`basename ${TARBALL}` -C ${MNTPATH} > /dev/null || exit 2 
+
 #show status of the filesystem
 echo after cp show the filsystem....
 show_filesystem $CACHEMDS $CACHEOST  
@@ -92,10 +90,7 @@ echo .... done!
 
 #third step and write files to real dev
 mkdir -p $MNTPATH/new
-$CPCMD -f $TMP/$TARBALL $MNTPATH/new   || exit 1
-$UNTARCMD $MNTPATH/new/$TARBALL -C $MNTPATH/new > /dev/null || exit 2
+$CPCMD -f $TARBALL $MNTPATH/new        || exit 1
+$UNTARCMD $MNTPATH/new/`basename $TARBALL` -C $MNTPATH/new > /dev/null || exit 2
 show_filesystem $CACHEMDS $CACHEOST  
 echo .... done!
-
-
-