From e48a46a6fd6f84ab74c07282265a30452ac51dc5 Mon Sep 17 00:00:00 2001 From: adilger Date: Sat, 28 Jan 2006 00:48:38 +0000 Subject: [PATCH] Branch b_release_1_4_6 Remove hard-coded test directory from 63b. SFS 3760 --- lustre/tests/sanity.sh | 54 ++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 27340bc..204f2aa 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2054,9 +2054,9 @@ test_52b() { run_test 52b "immutable flag test (should return errors) =======" test_53() { - for i in `ls -d /proc/fs/lustre/osc/OSC*mds1 2> /dev/null` ; do + for i in `ls -d $LPROC/osc/OSC*mds1 2> /dev/null` ; do ostname=`echo $i | cut -d _ -f 3-4 | sed -e s/_mds1//` - ost_last=`cat /proc/fs/lustre/obdfilter/$ostname/last_id` + ost_last=`cat $LPROC/obdfilter/$ostname/last_id` mds_last=`cat $i/prealloc_last_id` echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last" if [ $ost_last != $mds_last ]; then @@ -2213,7 +2213,7 @@ run_test 56 "check lfs find ====================================" test_57a() { # note test will not do anything if MDS is not local - for DEV in `cat /proc/fs/lustre/mds/*/mntdev`; do + for DEV in `cat $LPROC/mds/*/mntdev`; do dumpe2fs -h $DEV > $TMP/t57a.dump || error "can't access $DEV" DEVISIZE=`awk '/Inode size:/ { print $3 }' $TMP/t57a.dump` [ "$DEVISIZE" -gt 128 ] || error "inode size $DEVISIZE" @@ -2236,8 +2236,8 @@ test_57b() { $LFIND $FILE1 2>&1 | grep -q "no stripe" || error "$FILE1 has an EA" $LFIND $FILEN 2>&1 | grep -q "no stripe" || error "$FILEN has an EA" - MDSFREE="`cat /proc/fs/lustre/mds/*/kbytesfree`" - MDCFREE="`cat /proc/fs/lustre/mdc/*/kbytesfree`" + MDSFREE="`cat $LPROC/mds/*/kbytesfree`" + MDCFREE="`cat $LPROC/mdc/*/kbytesfree`" echo "opening files to create objects/EAs" for FILE in `seq -f $DIR/d57b/f%g 1 $FILECOUNT`; do $OPENFILE -f O_RDWR $FILE > /dev/null || error "opening $FILE" @@ -2248,8 +2248,8 @@ test_57b() { $LFIND $FILEN | grep -q "obdidx" || error "$FILEN missing EA" sleep 1 # make sure we get new statfs data - MDSFREE2="`cat /proc/fs/lustre/mds/*/kbytesfree`" - MDCFREE2="`cat /proc/fs/lustre/mdc/*/kbytesfree`" + MDSFREE2="`cat $LPROC/mds/*/kbytesfree`" + MDCFREE2="`cat $LPROC/mdc/*/kbytesfree`" if [ "$MDCFREE2" -lt "$((MDCFREE - 8))" ]; then if [ "$MDSFREE" != "$MDSFREE2" ]; then error "MDC before $MDCFREE != after $MDCFREE2" @@ -2305,16 +2305,16 @@ test_62() { f="$DIR/f62" echo foo > $f cancel_lru_locks OSC - echo 0x405 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0x405 cat $f && error "cat succeeded, expect -EIO" - echo 0 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0 } run_test 62 "verify obd_match failure doesn't LBUG (should -EIO)" # bug 2319 - oig_wait() interrupted causes crash because of invalid waitq. test_63() { - MAX_DIRTY_MB=`cat /proc/fs/lustre/osc/*/max_dirty_mb | head -n 1` - for i in /proc/fs/lustre/osc/*/max_dirty_mb ; do + MAX_DIRTY_MB=`cat $LPROC/osc/*/max_dirty_mb | head -n 1` + for i in $LPROC/osc/*/max_dirty_mb ; do echo 0 > $i done for i in `seq 10` ; do @@ -2324,7 +2324,7 @@ test_63() { sleep 1 done - for i in /proc/fs/lustre/osc/*/max_dirty_mb ; do + for i in $LPROC/osc/*/max_dirty_mb ; do echo $MAX_DIRTY_MB > $i done rm -f $DIR/f63 || true @@ -2338,16 +2338,16 @@ test_63b() { sysctl -w lnet.debug=-1 # ensure we have a grant to do async writes - dd if=/dev/zero of=/mnt/lustre/f63b bs=4k count=1 - rm /mnt/lustre/f63b + dd if=/dev/zero of=$DIR/$tfile bs=4k count=1 + rm $DIR/$tfile #define OBD_FAIL_OSC_BRW_PREP_REQ 0x406 sysctl -w lustre.fail_loc=0x80000406 - multiop /mnt/lustre/f63b Owy && \ + multiop $DIR/$tfile Owy && \ $LCTL dk /tmp/test63b.debug && \ sysctl -w lnet.debug=$DBG_SAVE && \ error "sync didn't return ENOMEM" - grep -q locked /proc/fs/lustre/llite/fs*/dump_page_cache && \ + grep -q locked $LPROC/llite/fs*/dump_page_cache && \ $LCTL dk /tmp/test63b.debug && \ sysctl -w lnet.debug=$DBG_SAVE && \ error "locked page left in cache after async error" || true @@ -2357,7 +2357,7 @@ run_test 63b "async write errors should be returned to fsync ===" test_64a () { df $DIR - grep "[0-9]" /proc/fs/lustre/osc/OSC*MNT*/cur* + grep "[0-9]" $LPROC/osc/OSC*MNT*/cur* } run_test 64a "verify filter grant calculations (in kernel) =====" @@ -2472,7 +2472,7 @@ test_67() { # bug 3285 - supplementary group fails on MDS, passes on client RC=$? if [ "$MDS" ]; then # can't tell which is correct otherwise - GROUP_UPCALL=`cat /proc/fs/lustre/mds/$MDS/group_upcall` + GROUP_UPCALL=`cat $LPROC/mds/$MDS/group_upcall` [ "$GROUP_UPCALL" = "NONE" -a $RC -eq 0 ] && \ error "no-upcall passed" || true [ "$GROUP_UPCALL" != "NONE" -a $RC -ne 0 ] && \ @@ -2536,20 +2536,20 @@ test_69() { f="$DIR/f69" touch $f - echo 0x217 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0x217 truncate $f 1 # vmtruncate() will ignore truncate() error. $DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT" - echo 0 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0 $DIRECTIO write $f 0 2 || error "write error" cancel_lru_locks OSC $DIRECTIO read $f 0 1 || error "read error" - echo 0x217 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0x217 $DIRECTIO read $f 1 1 && error "read succeeded, expect -ENOENT" - echo 0 > /proc/sys/lustre/fail_loc + sysctl -w lustre.fail_loc=0 rm -f $f } run_test 69 "verify oa2dentry return -ENOENT doesn't LBUG ======" @@ -2569,7 +2569,7 @@ test_71() { echo "copying necessary lib to $DIR" [ -d /lib64 ] && LIB71=/lib64 || LIB71=/lib - mkdir $DIR$LIB71 || error "can't create $DIR$LIB71" + mkdir -p $DIR$LIB71 || error "can't create $DIR$LIB71" cp $LIB71/libc* $DIR$LIB71 || error "can't copy $LIB71/libc*" cp $LIB71/ld-* $DIR$LIB71 || error "can't create $LIB71/ld-*" @@ -2577,9 +2577,7 @@ test_71() { chroot $DIR /dbench -c client.txt 2 RC=$? - rm -f $DIR/dbench - rm -f $TGT - rm -fr $DIR$LIB71 + rm -rf $DIR/dbench $TGT $DIR$LIB71 return $RC } @@ -2827,7 +2825,7 @@ test_102() { touch $testfile [ "$UID" != 0 ] && echo "skipping $TESTNAME (must run as root)" && return - [ -z "grep \ /proc/fs/lustre/mdc/MDC*MNT*/connect_flags" ] && echo "skipping $TESTNAME (must have user_xattr)" && return + [ -z "grep \ $LPROC/mdc/MDC*MNT*/connect_flags" ] && echo "skipping $TESTNAME (must have user_xattr)" && return echo "set/get xattr..." setfattr -n trusted.name1 -v value1 $testfile || error [ "`getfattr -n trusted.name1 $testfile 2> /dev/null | \ @@ -2878,7 +2876,7 @@ test_103 () { [ "$UID" != 0 ] && echo "skipping $TESTNAME (must run as root)" && return [ -z "`mount | grep " $DIR .*\"`" ] && echo "skipping $TESTNAME (must have acl)" && return - [ -z "`grep acl /proc/fs/lustre/mdc/MDC*MNT*/connect_flags`" ] && echo "skipping $TESTNAME (must have acl)" && return + [ -z "`grep acl $LPROC/mdc/MDC*MNT*/connect_flags`" ] && echo "skipping $TESTNAME (must have acl)" && return echo "performing cp ..." run_acl_subtest cp || error -- 1.8.3.1