Whamcloud - gitweb
b=19053
[fs/lustre-release.git] / lustre / tests / sanity.sh
index bbe8d56..493ee2c 100644 (file)
@@ -6111,19 +6111,13 @@ test_150() {
 }
 run_test 150 "truncate/append tests"
 
-function roc_access() {
-        local list=$(comma_list $(osts_nodes))
-        ACCNUM=`do_nodes $list $LCTL get_param -n obdfilter.*.stats | \
-                grep 'cache_access'| awk '{print $2}' | \
-                awk '{sum=sum+$3} END{print sum}'`
-        echo $ACCNUM
-}
-
 function roc_hit() {
         local list=$(comma_list $(osts_nodes))
-        ACCNUM=`do_nodes $list $LCTL get_param -n obdfilter.*.stats | \
-                grep 'cache_hit'|awk '{print $2}' | \
-                awk '{sum=sum+$1} END{print sum}'`
+        local log=$TMP/${TESTSUITE}-$TESTNAME.param
+        do_nodes $list "$LCTL get_param -n obdfilter.*.stats" >$log
+
+        local ACCNUM=`awk '/^cache_hit/ {sum=sum+$2} END{print sum}' $log`
+        rm -f $log 
         echo $ACCNUM
 }
 
@@ -6369,31 +6363,44 @@ test_162() {
     touch $DIR/$tdir/d2/x2
     mkdir -p $DIR/$tdir/d2/a/b/c
     mkdir -p $DIR/$tdir/d2/p/q/r
+       # regular file
     FID=$($LFS path2fid $DIR/$tdir/d2/$tfile | tr -d '[')
     check_path "/$tdir/d2/$tfile" $DIR $FID --link 0
+
+       # softlink
+    ln -s $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/slink
+    FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink | tr -d '[')
+    check_path "/$tdir/d2/p/q/r/slink" $DIR $FID --link 0
+
+       # hardlink
     ln $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/hlink
     mv $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/a/b/c/new_file
     FID=$($LFS path2fid $DIR/$tdir/d2/a/b/c/new_file | tr -d '[')
     # fid2path dir/fsname should both work
     check_path "/$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
     check_path "/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
-    # check that there are 2 links
-    ${LFS} fid2path $DIR $FID | wc -l | grep -q 2 || \
-       err17935 "expected 2 links"
 
+    # hardlink count: check that there are 2 links
+    # Doesnt work with CMD yet: 17935
+       ${LFS} fid2path $DIR $FID | wc -l | grep -q 2 || \
+               err17935 "expected 2 links"
+
+       # hardlink indexing: remove the first link
     rm $DIR/$tdir/d2/p/q/r/hlink
     check_path "/$tdir/d2/a/b/c/new_file" $DIR $FID --link 0
-    # Doesnt work with CMD yet: 17935
-    return 0
+
+       return 0
 }
 run_test 162 "path lookup sanity"
 
 test_163() {
-       copytool --test || { skip "copytool test: $? 38=enosys" && return; }
+       remote_mds_nodsh && skip "remote MDS with nodsh" && return
+       copytool --test || { skip "copytool not runnable: $?" && return; }
        copytool &
        sleep 1
+       local uuid=$($LCTL get_param -n mdc.lustre-MDT0000-mdc-*.uuid)
        # this proc file is temporary and linux-only
-       $LCTL set_param mdc.lustre-MDT0000-mdc-*.netlink=0 || error "lnl send failed"
+       do_facet mds lctl set_param mdt.lustre-MDT0000.mdccomm=$uuid || error "lnl send failed"
        kill $!
 }
 run_test 163 "LustreNetLink kernelcomms"
@@ -6616,6 +6623,18 @@ test_213() {
 }
 run_test 213 "OSC lock completion and cancel race don't crash - bug 18829"
 
+test_214() { # for bug 20133
+       mkdir -p $DIR/d214p/d214c
+       for (( i=0; i < 340; i++ )) ; do
+               touch $DIR/d214p/d214c/a$i
+       done
+
+       ls -l $DIR/d214p || error "ls -l $DIR/d214p failed"
+       mv $DIR/d214p/d214c $DIR/ || error "mv $DIR/d214p/d214c $DIR/ failed"
+       ls $DIR/d214c || error "ls $DIR/d214c failed"
+       rm -rf $DIR/d214* || error "rm -rf $DIR/d214* failed"
+}
+run_test 214 "hash-indexed directory test - bug 20133"
 
 #
 # tests that do cleanup/setup should be run at the end