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
#
# 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"
TRACE=${TRACE:-""}
check_kernel_version() {
- VERSION_FILE=$LPROC/version
+ VERSION_FILE=version
WANT_VER=$1
[ ! -f $VERSION_FILE ] && echo "can't find kernel version" && return 1
- GOT_VER=$(awk '/kernel:/ {print $2}' $VERSION_FILE)
+ GOT_VER=$(lctl get_param $VERSION_FILE | awk '/kernel:/ {print $2}')
[ $GOT_VER -ge $WANT_VER ] && return 0
log "test needs at least kernel version $WANT_VER, running $GOT_VER"
return 1
DIR=${DIR:-$MOUNT}
[ -z "`echo $DIR | grep $MOUNT`" ] && echo "$DIR not in $MOUNT" && exit 99
-LOVNAME=`cat $LPROC/llite/*/lov/common_name | tail -n 1`
-OSTCOUNT=`cat $LPROC/lov/$LOVNAME/numobd`
-STRIPECOUNT=`cat $LPROC/lov/$LOVNAME/stripecount`
-STRIPESIZE=`cat $LPROC/lov/$LOVNAME/stripesize`
-ORIGFREE=`cat $LPROC/lov/$LOVNAME/kbytesavail`
+LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
+OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
+STRIPECOUNT=`lctl get_param -n lov.$LOVNAME.stripecount`
+STRIPESIZE=`lctl get_param -n lov.$LOVNAME.stripesize`
+ORIGFREE=`lctl get_param -n lov.$LOVNAME.kbytesavail`
MAXFREE=${MAXFREE:-$((200000 * $OSTCOUNT))}
-MDS=$(\ls $LPROC/mdt 2> /dev/null | grep -v num_refs | tail -n 1)
+MDS=$(lctl get_param -N mdt.* | grep -v num_refs | tail -n 1 | cut -d"." -f2)
[ -f $DIR/d52a/foo ] && chattr -a $DIR/d52a/foo
[ -f $DIR/d52b/foo ] && chattr -i $DIR/d52b/foo
cancel_lru_locks osc
dd if=$MOUNT2/$tdir/d2/f1 of=/dev/null
stat $MOUNT2/$tdir/d2 $MOUNT2/$tdir/d2/f1 > /dev/null
- can1=`awk '/ldlm_cancel/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_canceld/stats`
- blk1=`awk '/ldlm_bl_callback/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_cbd/stats`
+ can1=`lctl get_param -n ldlm.services.ldlm_canceld.stats |
+ awk '/ldlm_cancel/ {print $2}'`
+ blk1=`lctl get_param -n ldlm.services.ldlm_cbd.stats |
+ awk '/ldlm_bl_callback/ {print $2}'`
unlink $MOUNT2/$tdir/d2/f1
- can2=`awk '/ldlm_cancel/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_canceld/stats`
- blk2=`awk '/ldlm_bl_callback/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_cbd/stats`
+ can2=`lctl get_param -n ldlm.services.ldlm_canceld.stats |
+ awk '/ldlm_cancel/ {print $2}'`
+ blk2=`lctl get_param -n ldlm.services.ldlm_cbd.stats |
+ awk '/ldlm_bl_callback/ {print $2}'`
umount $MOUNT2
[ $can1 -eq $can2 ] && error "It does not look like a cross-ref file."
[ $[$can1+1] -eq $can2 ] || error $[$[$can2-$can1]] "cancel RPC occured."
cancel_lru_locks osc
dd if=$MOUNT2/$tdir/d1/f1 of=/dev/null
stat $MOUNT2/$tdir/d1/f1 $MOUNT2/$tdir/d2 > /dev/null
- can1=`awk '/ldlm_cancel/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_canceld/stats`
- blk1=`awk '/ldlm_bl_callback/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_cbd/stats`
+ can1=`lctl get_param -n ldlm.services.ldlm_canceld.stats |
+ awk '/ldlm_cancel/ {print $2}'`
+ blk1=`lctl get_param -n ldlm.services.ldlm_cbd.stats |
+ awk '/ldlm_bl_callback/ {print $2}'`
ln $MOUNT2/$tdir/d1/f1 $MOUNT2/$tdir/d2/f2
- can2=`awk '/ldlm_cancel/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_canceld/stats`
- blk2=`awk '/ldlm_bl_callback/ {print $2}' /proc/fs/lustre/ldlm/services/ldlm_cbd/stats`
+ can2=`lctl get_param -n ldlm.services.ldlm_canceld.stats |
+ awk '/ldlm_cancel/ {print $2}'`
+ blk2=`lctl get_param -n ldlm.services.ldlm_cbd.stats |
+ awk '/ldlm_bl_callback/ {print $2}'`
umount $MOUNT2
[ $can1 -eq $can2 ] && error "It does not look like a cross-ref file."
[ $[$can1+1] -eq $can2 ] || error $[$[$can2-$can1]] "cancel RPC occured."
WTL=${WTL:-"$LUSTRE/tests/write_time_limit"}
PERM_CONF=/etc/lustre/perm.conf
-LLITE_LPROC=$LPROC/llite
-MDC_LPROC=$LPROC/mdc
-MDT_LPROC=$LPROC/mdt
-OST_LPROC=$LPROC/obdfilter
-
SANITYSECLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
FAIL_ON_ERROR=false
echo "without GSS support"
fi
-MDT="`do_facet $SINGLEMDS find $MDT_LPROC/ -name \*MDT\* -printf %f 2>/dev/null || true`"
+MDT="`do_facet $SINGLEMDS "lctl get_param -N mdt.\*MDT\*/stats | cut -d"." -f2" || true`"
if [ ! -z "$MDT" ]; then
- IDENTITY_FLUSH=$MDT_LPROC/$MDT/identity_flush
- MDSCAPA=$MDT_LPROC/$MDT/capa
- CAPA_TIMEOUT=$MDT_LPROC/$MDT/capa_timeout
+ IDENTITY_FLUSH=mdt.$MDT.identity_flush
+ MDSCAPA=mdt.$MDT.capa
+ CAPA_TIMEOUT=mdt.$MDT.capa_timeout
fi
# for CLIENT_TYPE
-if [ -z "$(grep remote $LLITE_LPROC/*/client_type 2>/dev/null)" ]; then
+if [ -z "$(lctl get_param -n llite.*.client_type | grep remote 2>/dev/null)" ]; then
CLIENT_TYPE="local"
echo "local client"
else
skip "test_1 for local client only" && return
do_facet $SINGLEMDS "rm -f $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
rm -rf $DIR/d1
mkdir $DIR/d1
$RUNAS -u $ID1 -v $ID0 touch $DIR/d1/f0 && error "touch (2)"
do_facet $SINGLEMDS "echo '* $ID1 setuid' > $PERM_CONF"
echo "enable uid $ID1 setuid"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
$RUNAS -u $ID1 -v $ID0 touch $DIR/d1/f1 || error "touch (3)"
chown root $DIR/d1 || error "chown (4)"
$RUNAS -u $ID1 -g $ID1 -j $ID0 touch $DIR/d1/f3 && error "touch (8)"
do_facet $SINGLEMDS "echo '* $ID1 setuid,setgid' > $PERM_CONF"
echo "enable uid $ID1 setuid,setgid"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
$RUNAS -u $ID1 -g $ID1 -j $ID0 touch $DIR/d1/f4 || error "touch (9)"
$RUNAS -u $ID1 -v $ID0 -g $ID1 -j $ID0 touch $DIR/d1/f5 || error "touch (10)"
rm -rf $DIR/d1
do_facet $SINGLEMDS "rm -f $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
}
run_test 1 "setuid/gid ============================="
test_2 () {
[ "$CLIENT_TYPE" = "local" ] && \
skip "remote_acl for remote client only" && return
- [ -z "$(grep ^acl $MDC_LPROC/*-mdc-*/connect_flags)" ] && \
+ [ -z "$(lctl get_param -n mdc.*-mdc-*.connect_flags | grep ^acl)" ] && \
skip "must have acl enabled" && return
[ -z "$(which setfacl 2>/dev/null)" ] && \
skip "could not find setfacl" && return
if [ ! -z "$MDT" ]; then
do_facet $SINGLEMDS "echo '* 0 rmtacl' > $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
fi
if lfs rgetfacl $DIR; then
if [ ! -z "$MDT" ]; then
do_facet $SINGLEMDS "rm -f $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
fi
cd $SAVE_PWD
if [ "$CLIENT_TYPE" != "remote" ]; then
if [ ! -z "$MDT" ]; then
do_facet $SINGLEMDS "echo '* $ID1 setgrp' > $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
fi
$RUNAS -u $ID1 -G1,2,$ID0 ls $DIR/d4 || error "setgroups (2)"
if [ ! -z "$MDT" ]; then
do_facet $SINGLEMDS "rm -f $PERM_CONF"
- do_facet $SINGLEMDS "echo -1 > $IDENTITY_FLUSH"
+ do_facet $SINGLEMDS "lctl set_param -n $IDENTITY_FLUSH=-1"
fi
fi
$RUNAS -u $ID1 -G1,2 ls $DIR/d4 && error "setgroups (3)"
[ $# -lt 1 ] && echo "Miss mds capability timeout value" && return 1
echo "Set mds capability timeout as $1 seconds"
- do_facet $SINGLEMDS "echo $1 > $CAPA_TIMEOUT"
+ do_facet $SINGLEMDS "lctl set_param -n $CAPA_TIMEOUT=$1"
return 0
}
*) echo "Invalid mds capability switch value" && return 2;;
esac
- do_facet $SINGLEMDS "echo $1 > $MDSCAPA"
+ do_facet $SINGLEMDS "lctl set_param -n $MDSCAPA=$1"
return 0
}
for i in `seq $OSTCOUNT`; do
local j=`expr $i - 1`
- local OST="`do_facet ost$i find $OST_LPROC/ -name \*OST\*$j -printf %f 2>/dev/null || true`"
- do_facet ost$i "echo $1 > $OST_LPROC/$OST/capa"
+ local OST="`do_facet ost$i "lctl get_param -N obdfilter.\*OST\*$j/stats | cut -d"." -f2" || true`"
+ do_facet ost$i "lctl set_param -n obdfilter.$OST.capa=$1"
done
return 0
}
SETUP=${SETUP:-:}
TRACE=${TRACE:-""}
-LPROC=/proc/fs/lustre
-
[ "$SANITYLOG" ] && rm -f $SANITYLOG || true
check_and_setup_lustre
-LPROC=/proc/fs/lustre
LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
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
- echo 4096 > $O/readcache_max_filesize
- done
+ MAX=`lctl get_param -n obdfilter.*.readcache_max_filesize | head -n 1`
+ lctl set_param -n obdfilter.*OST*.readcache_max_filesize=4096
dd if=/dev/urandom of=$TMP/f19b bs=512k count=32
SUM=`cksum $TMP/f19b | cut -d" " -f 1,2`
cp $TMP/f19b $DIR1/f19b
[ "`cat $TMP/sum2`" = "$SUM" ] || \
error "$DIR2/f19b `cat $TMP/sum2` != $SUM"
done
- for O in /proc/fs/lustre/obdfilter/*OST*; do
- echo $MAX > $O/readcache_max_filesize
- done
+ lctl set_param -n obdfilter.*OST*.readcache_max_filesize=$MAX
rm $DIR1/f19b
}
run_test 19 "test concurrent uncached read races ==============="
test_20() {
mkdir $DIR1/d20
cancel_lru_locks osc
- CNT=$((`cat /proc/fs/lustre/llite/*/dump_page_cache | wc -l`))
+ CNT=$((`lctl get_param -n llite.*.dump_page_cache | wc -l`))
multiop $DIR1/f20 Ow8190c
multiop $DIR2/f20 Oz8194w8190c
multiop $DIR1/f20 Oz0r8190c
cancel_lru_locks osc
- CNTD=$((`cat /proc/fs/lustre/llite/*/dump_page_cache | wc -l` - $CNT))
+ CNTD=$((`lctl get_param -n llite.*.dump_page_cache | wc -l` - $CNT))
[ $CNTD -gt 0 ] && \
error $CNTD" page left in cache after lock cancel" || true
}