init_test_env $@
. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
+remote_mds_nodsh && skip "remote MDS with nodsh" && exit 0
+
[ "$SLOW" = "no" ] && EXCEPT_SLOW="100 101"
# $RUNAS_ID may get set incorrectly somewhere else
cnt_all2all=0
DBENCH_PID=0
PROC_CLI="srpc.info"
+# Escape "." to use lctl
+PROC_CLI=${PROC_CLI//\./\*}
# set manually
GSS=true
{
local flavor=$1
- output=`do_facet client cat $LPROC/mdc/*-MDT*-mdc-*/$PROC_CLI 2>/dev/null`
+ output=`do_facet client lctl get_param -n mdc.*-MDT*-mdc-*.$PROC_CLI 2>/dev/null`
count_flvr "$output" $flavor
}
{
local flavor=$1
- output=`do_facet client cat $LPROC/osc/*OST*-osc-[^M][^D][^T]*/$PROC_CLI 2>/dev/null`
+ output=`do_facet client lctl get_param -n osc.*OST*-osc-[^M][^D][^T]*.$PROC_CLI 2>/dev/null`
count_flvr "$output" $flavor
}
fi
for num in `seq $MDSCOUNT`; do
- output=`do_facet mds$num cat $LPROC/mdc/*-MDT*-mdc[0-9]*/$PROC_CLI 2>/dev/null`
+ output=`do_facet mds$num lctl get_param -n mdc.*-MDT*-mdc[0-9]*.$PROC_CLI 2>/dev/null`
tmpcnt=`count_flvr "$output" $flavor`
cnt=$((cnt + tmpcnt))
done
local cnt=0
for num in `seq $MDSCOUNT`; do
- output=`do_facet mds$num cat $LPROC/osc/*OST*-osc-MDT*/$PROC_CLI 2>/dev/null`
+ output=`do_facet mds$num lctl get_param -n osc.*OST*-osc-MDT*.$PROC_CLI 2>/dev/null`
tmpcnt=`count_flvr "$output" $flavor`
cnt=$((cnt + tmpcnt))
done
restore_to_default_flavor()
{
- local proc=$LPROC/mgs/MGS/live/$FSNAME
+ local proc="mgs.MGS.live.$FSNAME"
echo "restoring to default flavor..."
- nrule=`do_facet mgs cat $proc 2>/dev/null | grep ".srpc.flavor." | wc -l`
+ nrule=`do_facet mgs lctl get_param -n $proc 2>/dev/null | grep ".srpc.flavor." | wc -l`
# remove all existing rules if any
if [ $nrule -ne 0 ]; then
echo "$nrule existing rules"
- for rule in `do_facet mgs cat $proc 2>/dev/null | grep ".srpc.flavor."`; do
+ for rule in `do_facet mgs lctl get_param -n $proc 2>/dev/null | grep ".srpc.flavor."`; do
echo "remove rule: $rule"
spec=`echo $rule | awk -F = '{print $1}'`
do_facet mgs "$LCTL conf_param $spec="
fi
# verify no rules left
- nrule=`do_facet mgs cat $proc 2>/dev/null | grep ".srpc.flavor." | wc -l`
+ nrule=`do_facet mgs lctl get_param -n $proc 2>/dev/null | grep ".srpc.flavor." | wc -l`
[ $nrule -ne 0 ] && error "still $nrule rules left"
# wait for default flavor to be applied
start_dbench()
{
NPROC=`cat /proc/cpuinfo 2>/dev/null | grep ^processor | wc -l`
- [ $NPROC -lt 2 ] && NPROC=2
+ [ $NPROC -gt 2 ] && NPROC=2
sh rundbench $NPROC 1>/dev/null &
DBENCH_PID=$!
sleep 2
run_test 5 "lsvcgssd dead, operations lead to recovery"
test_6() {
+ local nfile=10
+
mkdir $DIR/d6 || error "mkdir $DIR/d6 failed"
- cp -a /etc/* $DIR/d6/ || error "cp failed"
+ for ((i=0; i<$nfile; i++)); do
+ dd if=/dev/zero of=$DIR/d6/file$i bs=8k count=1 || error "dd file$i failed"
+ done
ls -l $DIR/d6/* > /dev/null || error "ls failed"
rm -rf $DIR2/d6/* || error "rm failed"
+ rmdir $DIR2/d6/ || error "rmdir failed"
}
run_test 6 "test basic DLM callback works"
}
run_test 7 "exercise enlarge_reqbuf()"
-test_8() {
+test_8()
+{
+ debugsave
+ sysctl -w lnet.debug="other"
+ $LCTL dk > /dev/null
+
+ # sleep sometime in ctx handle
+ do_facet mds sysctl -w lustre.fail_val=60
+#define OBD_FAIL_SEC_CTX_HDL_PAUSE 0x1204
+ do_facet mds sysctl -w lustre.fail_loc=0x1204
+
+ $RUNAS $LFS flushctx || error "can't flush ctx"
+
+ $RUNAS df $DIR &
+ DFPID=$!
+ echo "waiting df (pid $TOUCHPID) to finish..."
+ sleep 2 # give df a chance to really trigger context init rpc
+ do_facet mds sysctl -w lustre.fail_loc=0
+ wait $DFPID || error "df should have succeeded"
+
+ $LCTL dk | grep "Early reply #" || error "No early reply"
+ debugrestore
+}
+run_test 8 "Early reply sent for slow gss context negotiation"
+
+#
+# following tests will manipulate flavors and may end with any flavor set,
+# so each test should not assume any start flavor.
+#
+
+test_50() {
local sample=$TMP/sanity-gss-8
local tdir=$MOUNT/dir8
local iosize="256K"
rm -rf $tdir
rm -f $sample
}
-run_test 8 "verify bulk hash algorithms works"
+run_test 50 "verify bulk hash algorithms works"
-test_9() {
+test_51() {
local s1=$TMP/sanity-gss-9.1
local s2=$TMP/sanity-gss-9.2
local s3=$TMP/sanity-gss-9.3
rm -rf $tdir
rm -f $sample
}
-run_test 9 "bulk data alignment test under encryption mode"
+run_test 51 "bulk data alignment test under encryption mode"
test_90() {
if [ "$SLOW" = "no" ]; then
#
# general rules
#
- nrule_old=`do_facet mgs cat $LPROC/mgs/MGS/live/$FSNAME 2>/dev/null \
+ nrule_old=`do_facet mgs lctl get_param -n mgs.MGS.live.$FSNAME 2>/dev/null \
| grep "$FSNAME.srpc.flavor." | wc -l`
echo "original general rules: $nrule_old"
set_rule $FSNAME elan$i any || error "remove rule $i"
done
- nrule_new=`do_facet mgs cat $LPROC/mgs/MGS/live/$FSNAME 2>/dev/null \
+ nrule_new=`do_facet mgs lctl get_param -n mgs.MGS.live.$FSNAME 2>/dev/null \
| grep "$FSNAME.srpc.flavor." | wc -l`
if [ $nrule_new != $nrule_old ]; then
error "general rule: $nrule_new != $nrule_old"
#
# target-specific rules
#
- nrule_old=`do_facet mgs cat $LPROC/mgs/MGS/live/$FSNAME 2>/dev/null \
+ nrule_old=`do_facet mgs lctl get_param -n mgs.MGS.live.$FSNAME 2>/dev/null \
| grep "$FSNAME-MDT0000.srpc.flavor." | wc -l`
echo "original target rules: $nrule_old"
set_rule $FSNAME-MDT0000 elan$i any || error "remove rule $i"
done
- nrule_new=`do_facet mgs cat $LPROC/mgs/MGS/live/$FSNAME 2>/dev/null \
+ nrule_new=`do_facet mgs lctl get_param -n mgs.MGS.live.$FSNAME 2>/dev/null \
| grep "$FSNAME-MDT0000.srpc.flavor." | wc -l`
if [ $nrule_new != $nrule_old ]; then
error "general rule: $nrule_new != $nrule_old"