#!/bin/bash
+# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
+# vim:autoindent:shiftwidth=4:tabstop=4:
#
# Run select tests by setting ONLY, or as arguments to the script.
# Skip specific tests by setting EXCEPT.
}
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
}
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"
do_facet mgs $LCTL pool_new $FSNAME.$POOL
# get param should return err until pool is created
wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL 2>/dev/null || echo foo" "" || error "Pool creation of $POOL failed"
+ [ $($LFS pool_list $FSNAME | grep -c $POOL) -eq 1 ] || error "$POOL not in lfs pool_list"
}
run_test 200a "Create new pool =========================================="
do_facet mgs $LCTL pool_add $FSNAME.$POOL \
$FSNAME-OST[$TGTPOOL_FIRST-$TGTPOOL_MAX/$TGTPOOL_STEP]
wait_update $HOSTNAME "lctl get_param -n lov.$FSNAME-*.pools.$POOL | sort -u | tr '\n' ' ' " "$TGT" || error "Add to pool failed"
+ local lfscount=$($LFS pool_list $FSNAME.$POOL | grep -c "\-OST")
+ local addcount=$((($TGTPOOL_MAX - $TGTPOOL_FIRST) / $TGTPOOL_STEP + 1))
+ [ $lfscount -eq $addcount ] || error "lfs pool_list bad ost count $lfscount != $addcount"
}
run_test 200b "Add targets to a pool ===================================="
}
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