Whamcloud - gitweb
Branch b1_4_mountconf
authornathan <nathan>
Wed, 22 Mar 2006 22:49:14 +0000 (22:49 +0000)
committernathan <nathan>
Wed, 22 Mar 2006 22:49:14 +0000 (22:49 +0000)
b=9858
sanityN working

12 files changed:
lustre/tests/acceptance-small.sh
lustre/tests/cfg/local.sh
lustre/tests/mmap_sanity.c
lustre/tests/mountconf.sh
lustre/tests/oos2.sh
lustre/tests/recovery-small.sh
lustre/tests/replay-dual.sh
lustre/tests/replay-ost-single.sh
lustre/tests/replay-single.sh
lustre/tests/sanity-quota.sh
lustre/tests/sanity.sh
lustre/tests/sanityN.sh

index 8c11365..8da729a 100755 (executable)
@@ -61,6 +61,7 @@ for NAME in $CONFIGS; do
                fi
                rm -f /mnt/lustre/`hostname`/client.txt
        fi
+
        chown $UID $MOUNT && chmod 700 $MOUNT
        if [ "$BONNIE" != "no" ]; then
                mount | grep $MOUNT || sh llmount.sh
@@ -110,6 +111,7 @@ for NAME in $CONFIGS; do
                        echo "iozone $VER too old for multi-thread test"
                fi
        fi
+
        if [ "$FSX" != "no" ]; then
                mount | grep $MOUNT || sh llmount.sh
                $DEBUG_OFF
index f232d8b..2659454 100644 (file)
@@ -33,7 +33,8 @@ MOUNT=${MOUNT:-/mnt/${FSNAME}}
 MOUNT1=${MOUNT1:-$MOUNT}
 MOUNT2=${MOUNT2:-${MOUNT}2}
 DIR=${DIR:-$MOUNT}
-DIR2=${DIR2:-$MOUNT1}
+DIR1=${DIR:-$MOUNT1}
+DIR2=${DIR2:-$MOUNT2}
 MOUNTOPT=${MOUNTOPT:-"user_xattr,acl"}
 
 TIMEOUT=${TIMEOUT:-20}
index 5a61806..91b6a2f 100644 (file)
@@ -198,7 +198,7 @@ out_close:
         return rc;
 }
 
-/* cocurrent mmap operations on two nodes */
+/* concurrent mmap operations on two nodes */
 static int mmap_tst3(char *mnt)
 {
         char *ptr, mmap_file[256];
@@ -403,7 +403,7 @@ static int cancel_lru_locks(char *prefix)
         }
 
         if (prefix)
-                sprintf(cmd, "ls /proc/fs/lustre/ldlm/namespaces/%s_*/lru_size", prefix);
+                sprintf(cmd, "ls /proc/fs/lustre/ldlm/namespaces/*-%s-*/lru_size", prefix);
         else
                 sprintf(cmd, "ls /proc/fs/lustre/ldlm/namespaces/*/lru_size");
 
@@ -472,7 +472,7 @@ static int mmap_tst5(char *mnt)
         memset(ptr, 'a', region);
 
         /* cancel unused locks */
-        cancel_lru_locks("OSC");
+        cancel_lru_locks("osc");
         if (rc)
                 goto out_unmap;
 
@@ -538,7 +538,7 @@ static int mmap_tst6(char *mnt)
                 goto out;
         }
 
-        cancel_lru_locks("OSC");
+        cancel_lru_locks("osc");
         if (rc)
                 goto out;
 
@@ -594,11 +594,11 @@ struct test_case {
 struct test_case tests[] = {
         { 1, "mmap test1: basic mmap operation", mmap_tst1, 1 },
         { 2, "mmap test2: MAP_PRIVATE not write back", mmap_tst2, 1 },
-        { 3, "mmap test3: cocurrent mmap ops on two nodes", mmap_tst3, 2 },
-        { 4, "mmap test4: c1 write to f1 from mmaped f2, " 
-             "c2 write to f1 from mmaped f1", mmap_tst4, 2 },
+        { 3, "mmap test3: concurrent mmap ops on two nodes", mmap_tst3, 2 },
+        { 4, "mmap test4: c1 write to f1 from mmapped f2, " 
+             "c2 write to f1 from mmapped f1", mmap_tst4, 2 },
         { 5, "mmap test5: read/write file to/from the buffer "
-             "which mmaped to just this file", mmap_tst5, 1 },
+             "which mmapped to just this file", mmap_tst5, 1 },
         { 6, "mmap test6: check mmap write/read content on two nodes", 
                 mmap_tst6, 2 },
         { 0, NULL, 0, 0 }
index ae23b38..9e9981e 100755 (executable)
@@ -48,16 +48,18 @@ mccleanup() {
     unload_modules
 }
 
-REFORMAT=${REFORMAT:---reformat}
-
-format() {
+mcformat() {
     stop_all
     echo Formatting mds, ost, ost2
-    add mds $MDS_MKFS_OPTS $REFORMAT $MDSDEV    > /dev/null || exit 10
-    add ost $OST_MKFS_OPTS $REFORMAT $OSTDEV    > /dev/null || exit 10
-    add ost2 $OST2_MKFS_OPTS $REFORMAT $OSTDEV2 > /dev/null || exit 10
+    add mds $MDS_MKFS_OPTS --reformat $MDSDEV    > /dev/null || exit 10
+    add ost $OST_MKFS_OPTS --reformat $OSTDEV    > /dev/null || exit 10
+    add ost2 $OST2_MKFS_OPTS --reformat $OSTDEV2 > /dev/null || exit 10
+}
+export MCFORMAT=${MCFORMAT:-"mcformat"}
+
+mount_client() {
+    grep " $1 " /proc/mounts || zconf_mount `hostname` $*
 }
-format
 
 mcsetup() {
     echo Setup mds, ost, ost2
@@ -66,7 +68,7 @@ mcsetup() {
     start ost2 $OSTDEV2 $OST2_MOUNT_OPTS
     [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
 
-    grep " $MOUNT " /proc/mounts || zconf_mount `hostname` $MOUNT
+    mount_client $MOUNT
     sleep 5
 }
 
index f7682bb..1eb5dbd 100644 (file)
@@ -54,14 +54,14 @@ fi
 # flush cache to OST(s) so avail numbers are correct
 sync; sleep 1 ; sync
 
-for OSC in /proc/fs/lustre/osc/OSC*MNT*; do
+for OSC in /proc/fs/lustre/osc/*-osc-*; do
        AVAIL=`cat $OSC/kbytesavail`
        GRANT=`cat $OSC/cur_grant_bytes`
        [ $(($AVAIL - $GRANT / 1024)) -lt 400 ] && OSCFULL=full
 done
 if [ -z "$OSCFULL" ]; then
        echo "no OSTs are close to full"
-       grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/{kbytesavail,cur*}|tee -a $LOG
+       grep "[0-9]" /proc/fs/lustre/osc/*-osc-*/{kbytesavail,cur*}|tee -a $LOG
        SUCCESS=0
 fi
 
index d58578d..ef8f460 100755 (executable)
@@ -142,7 +142,7 @@ test_11(){
     do_facet client multiop $MOUNT/$tfile Ow  || return 1
     do_facet client multiop $MOUNT/$tfile or  || return 2
 
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
 
     do_facet client multiop $MOUNT/$tfile or  || return 3
     drop_bl_callback multiop $MOUNT/$tfile Ow || echo "evicted as expected"
@@ -217,7 +217,7 @@ test_16() {
 
 #define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE
     sysctl -w lustre.fail_loc=0x80000504
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
     # will get evicted here
     do_facet client "cmp /etc/termcap $MOUNT/termcap"  && return 1
     sysctl -w lustre.fail_loc=0
@@ -250,7 +250,7 @@ test_18a() {
     do_facet client mkdir -p $MOUNT/$tdir
     f=$MOUNT/$tdir/$tfile
 
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
     pgcache_empty || return 1
 
     # 1 stripe on ost2
@@ -276,7 +276,7 @@ test_18b() {
     f=$MOUNT/$tdir/$tfile
     f2=$MOUNT/$tdir/${tfile}-2
 
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
     pgcache_empty || return 1
 
     # shouldn't have to set stripe size of count==1
@@ -319,7 +319,7 @@ test_19b() {
     do_facet client multiop $f Ow  || return 1
     do_facet client multiop $f or  || return 2
 
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
 
     do_facet client multiop $f or  || return 3
     drop_ldlm_cancel multiop $f Ow  || echo "client evicted, as expected"
@@ -333,7 +333,7 @@ test_20a() {        # bug 2983 - ldlm_handle_enqueue cleanup
        multiop $DIR/$tdir/${tfile} O_wc &
        MULTI_PID=$!
        sleep 1
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
 #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
        do_facet ost sysctl -w lustre.fail_loc=0x80000308
        kill -USR1 $MULTI_PID
@@ -346,7 +346,7 @@ run_test 20a "ldlm_handle_enqueue error (should return error)"
 test_20b() {   # bug 2986 - ldlm_handle_enqueue error during open
        mkdir -p $DIR/$tdir
        touch $DIR/$tdir/${tfile}
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
 #define OBD_FAIL_LDLM_ENQUEUE_EXTENT_ERR 0x308
        do_facet ost sysctl -w lustre.fail_loc=0x80000308
        dd if=/etc/hosts of=$DIR/$tdir/$tfile && \
@@ -367,7 +367,7 @@ run_test 20b "ldlm_handle_enqueue error (should return error)"
 
 test_24() {    # bug 2248 - eviction fails writeback but app doesn't see it
        mkdir -p $DIR/$tdir
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
        multiop $DIR/$tdir/$tfile Owy_wyc &
        MULTI_PID=$!
        usleep 500
index 5fe9d3a..329c410 100755 (executable)
@@ -459,7 +459,7 @@ test_18() { # bug 3822 - evicting client with enqueued lock
    sleep 1
 #define OBD_FAIL_LDLM_BL_CALLBACK        0x305
    do_facet client sysctl -w lustre.fail_loc=0x80000305  # drop cb, evict
-   cancel_lru_locks MDC
+   cancel_lru_locks mdc
    usleep 500 # wait to ensure first client is one that will be evicted
    openfile -f O_RDONLY $MOUNT2/$tdir/f0
    wait $OPENPID
index c9ae901..369df0a 100755 (executable)
@@ -117,7 +117,7 @@ test_4() {
     verify=$ROOT/tmp/verify-$$
     dd if=/dev/urandom bs=4096 count=1280 | tee $verify > $DIR/$tfile
     # invalidate cache, so that we're reading over the wire
-    for i in /proc/fs/lustre/ldlm/namespaces/OSC_*MNT*; do
+    for i in /proc/fs/lustre/ldlm/namespaces/*-osc-*; do
         echo -n clear > $i/lru_size
     done
     cmp $verify $DIR/$tfile &
@@ -145,7 +145,7 @@ test_5() {
 run_test 5 "Fail OST during iozone"
 
 kbytesfree() {
-   awk '{total+=$1} END {print total}' /proc/fs/lustre/osc/OSC_*MNT*/kbytesfree
+   awk '{total+=$1} END {print total}' /proc/fs/lustre/osc/*-osc-*/kbytesfree
 }
 
 test_6() {
index c6ac769..16dd696 100755 (executable)
@@ -748,7 +748,7 @@ test_36() {
     touch $DIR/$tfile
     checkstat $DIR/$tfile
     facet_failover mds
-    cancel_lru_locks MDC
+    cancel_lru_locks mdc
     if dmesg | grep "unknown lock cookie"; then 
        echo "cancel after replay failed"
        return 1
@@ -852,7 +852,7 @@ test_41() {
     # make sure the start of the file is ost1
     lfs setstripe $f $((128 * 1024)) 0 0 
     do_facet client dd if=/dev/zero of=$f bs=4k count=1 || return 3
-    cancel_lru_locks OSC
+    cancel_lru_locks osc
     # fail ost2 and read from ost1
     local osc2_dev=`$LCTL device_list | \
                awk '(/ost2.*client_facet/){print $4}' `
@@ -995,7 +995,7 @@ run_test 50 "Double OSC recovery, don't LASSERT (3812)"
 # b3764 timed out lock replay
 test_52() {
     touch $DIR/$tfile
-    cancel_lru_locks MDC
+    cancel_lru_locks mdc
 
     multiop $DIR/$tfile s
     replay_barrier mds
index 01f2869..b30fc42 100644 (file)
@@ -589,8 +589,7 @@ test_7()
        echo 0 > /proc/sys/lustre/fail_loc
 
        echo "  Trigger recovery..."
-       OSC0_UUID="`$LCTL dl | awk '/.* OSC_[^ ]+_OST.* / { print $1 }'`"
-       [ -z "$OSC0_UUID" ] && OSC0_UUID="`$LCTL dl | awk '/.* OSC_[^ ]+_ost1.* / { print $1 }'`"
+       OSC0_UUID="`$LCTL dl | awk '/.* *-osc-* / { print $1 }'`"
        for i in $OSC0_UUID; do
                $LCTL --device $i activate > /dev/null 2>&1 || error "activate osc failed!"
        done
index 13bdffd..ebf0584 100644 (file)
@@ -62,6 +62,8 @@ else
     fi
 fi
 
+SANITYLOG=${SANITYLOG:-/tmp/sanity.log}
+
 export NAME=${NAME:-local}
 
 SAVE_PWD=$PWD
@@ -77,8 +79,7 @@ CLEANUP=${CLEANUP:-:}
 
 setup() {
        echo -n "mnt.."
-       $MCSETUP
-#$MCSETUP > /dev/null || exit 10
+       $MCSETUP || exit 10
        echo "done"
 }
 SETUP=${SETUP:-:}
@@ -204,8 +205,10 @@ pass() {
 mounted_lustre_filesystems() {
        awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts
 }
+
 MOUNTED="`mounted_lustre_filesystems`"
 if [ -z "$MOUNTED" ]; then
+        $MCFORMAT
        $MCSETUP
        MOUNTED="`mounted_lustre_filesystems`"
        [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
index e7b0294..9c21bfd 100644 (file)
@@ -33,18 +33,21 @@ fi
 
 SAVE_PWD=$PWD
 
-clean() {
+# for MCSETUP and MCCLEANUP
+. mountconf.sh
+
+cleanup() {
        echo -n "cln.."
-       sh llmountcleanup.sh ${FORCE} > /dev/null || exit 20
+       $MCCLEANUP ${FORCE} > /dev/null || { echo "FAILed to clean up"; exit 20; }
 }
-CLEAN=${CLEAN:-}
+CLEANUP=${CLEANUP:-:}
 
-start() {
+setup() {
        echo -n "mnt.."
-       sh llmount.sh > /dev/null || exit 10
+       $MCSETUP || exit 10
        echo "done"
 }
-START=${START:-}
+SETUP=${SETUP:-:}
 
 log() {
        echo "$*"
@@ -61,8 +64,8 @@ trace() {
 TRACE=${TRACE:-""}
 
 run_one() {
-       if ! mount | grep -q $DIR1; then
-               $START
+       if ! grep -q $DIR /proc/mounts; then
+               $SETUP
        fi
        testnum=$1
        message=$2
@@ -75,7 +78,7 @@ run_one() {
        unset TESTNAME
        pass "($((`date +%s` - $BEFORE))s)"
        cd $SAVE_PWD
-       $CLEAN
+       $CLEANUP
 }
 
 build_test_filter() {
@@ -143,11 +146,23 @@ pass() {
        echo PASS $@
 }
 
-export MOUNT1=`mount| awk '/ lustre/ { print $3 }'| head -n 1`
-export MOUNT2=`mount| awk '/ lustre/ { print $3 }'| tail -n 1`
+mounted_lustre_filesystems() {
+       awk '($3 ~ "lustre" && $1 ~ ":") { print $2 }' /proc/mounts
+}
+MOUNTED="`mounted_lustre_filesystems`"
+if [ -z "$MOUNTED" ]; then
+    $MCFORMAT
+    $MCSETUP
+    mount_client $MOUNT2
+    MOUNTED="`mounted_lustre_filesystems`"
+    [ -z "$MOUNTED" ] && error "NAME=$NAME not mounted"
+    I_MOUNTED=yes
+fi
+export MOUNT1=`mounted_lustre_filesystems | head -n 1`
 [ -z "$MOUNT1" ] && error "NAME=$NAME not mounted once"
+export MOUNT2=`mounted_lustre_filesystems | tail -n 1`
 [ "$MOUNT1" = "$MOUNT2" ] && error "NAME=$NAME not mounted twice"
-[ `mount| awk '/ lustre/ { print $3 }'| wc -l` -ne 2 ] && \
+[ `mounted_lustre_filesystems | wc -l` -ne 2 ] && \
        error "NAME=$NAME mounted more than twice"
 
 export DIR1=${DIR1:-$MOUNT1}
@@ -387,17 +402,17 @@ test_16() {
 run_test 16 "2500 iterations of dual-mount fsx ================="
 
 cancel_lru_locks() {
-       for d in /proc/fs/lustre/ldlm/namespaces/$1*; do
+       for d in /proc/fs/lustre/ldlm/namespaces/*-$1-*; do
                echo clear > $d/lru_size
        done
-       grep "[0-9]" /proc/fs/lustre/ldlm/namespaces/$1*/lock_unused_count /dev/null
+       grep "[0-9]" /proc/fs/lustre/ldlm/namespaces/*-$1-*/lock_unused_count /dev/null
 }
 
 test_17() { # bug 3513, 3667
        [ ! -d /proc/fs/lustre/ost ] && echo "skipping OST-only test" && return
 
        cp /etc/termcap $DIR1/f17
-       cancel_lru_locks OSC > /dev/null
+       cancel_lru_locks osc > /dev/null
        #define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE    0x30a
        echo 0x8000030a > /proc/sys/lustre/fail_loc
        ls -ls $DIR1/f17 | awk '{ print $1,$6 }' > $DIR1/f17-1 & \
@@ -417,7 +432,7 @@ test_19() { # bug3811
        [ -d /proc/fs/lustre/obdfilter ] || return 0
 
        MAX=`cat /proc/fs/lustre/obdfilter/*/readcache_max_filesize | head -n 1`
-       for O in /proc/fs/lustre/obdfilter/OST*; do
+       for O in /proc/fs/lustre/obdfilter/*OST*; do
                echo 4096 > $O/readcache_max_filesize
        done
        dd if=/dev/urandom of=$TMP/f19b bs=512k count=32
@@ -425,7 +440,7 @@ test_19() { # bug3811
        cp $TMP/f19b $DIR1/f19b
        for i in `seq 1 20`; do
                [ $((i % 5)) -eq 0 ] && log "test_18 loop $i"
-               cancel_lru_locks OSC > /dev/null
+               cancel_lru_locks osc > /dev/null
                cksum $DIR1/f19b | cut -d" " -f 1,2 > $TMP/sum1 & \
                cksum $DIR2/f19b | cut -d" " -f 1,2 > $TMP/sum2
                wait
@@ -434,7 +449,7 @@ test_19() { # bug3811
                [ "`cat $TMP/sum2`" = "$SUM" ] || \
                        error "$DIR2/f19b `cat $TMP/sum2` != $SUM"
        done
-       for O in /proc/fs/lustre/obdfilter/OST*; do
+       for O in /proc/fs/lustre/obdfilter/*OST*; do
                echo $MAX > $O/readcache_max_filesize
        done
        rm $DIR1/f19b
@@ -443,12 +458,12 @@ test_19() { # bug3811
 
 test_20() {
        mkdir $DIR1/d20
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
        CNT=$((`cat /proc/fs/lustre/llite/fs0/dump_page_cache | wc -l`))
        multiop $DIR1/f20 Ow8190c
        multiop $DIR2/f20 Oz8194w8190c
        multiop $DIR1/f20 Oz0r8190c
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
        CNTD=$((`cat /proc/fs/lustre/llite/fs0/dump_page_cache | wc -l` - $CNT))
        [ $CNTD -gt 0 ] && \
            error $CNTD" page left in cache after lock cancel" || true
@@ -497,7 +512,7 @@ test_23() { # Bug 5972
        echo "others should see updated atime while another read" > $DIR1/f23
        
        # clear the lock(mode: LCK_PW) gotten from creating operation
-       cancel_lru_locks OSC
+       cancel_lru_locks osc
        
        time1=`date +%s`        
        sleep 2
@@ -524,3 +539,4 @@ rm -rf $DIR1/[df][0-9]* $DIR1/lnk || true
 
 echo '=========================== finished ==============================='
 [ -f "$SANITYLOG" ] && cat $SANITYLOG && exit 1 || true
+