With the move of obdfilter to ofd some of the lctl
parameters got moved around. For the test suite a function
{get,set}_obdfilter_param was written to handle this change so
this patch updates a few more test to use this api.
Signed-off-by: James Simmons <uja.ornl@gmail.com>
Change-Id: I05ca4711b198061de1378b79d2f7f35d5a1c75af
Reviewed-on: http://review.whamcloud.com/4726
Reviewed-by: Li Wei <wei.g.li@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
local ost_dev
ost_name=$(ostname_from_index $obdidx)
local ost_dev
ost_name=$(ostname_from_index $obdidx)
- ost_dev=$(get_obdfilter_param $node $ost_name mntdev)
+ ost_dev=$(get_osd_param $node $ost_name mntdev)
if [ $? -ne 0 ]; then
printf "unable to find OST%04x on $facet\n" $obdidx
return 1
if [ $? -ne 0 ]; then
printf "unable to find OST%04x on $facet\n" $obdidx
return 1
local mds_last
local ost_last
local ostnum
local mds_last
local ost_last
local ostnum
# only test MDT0000
local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS)
# only test MDT0000
local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS)
param=`echo ${value[0]} | cut -d "=" -f1`
ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2`
mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param)
param=`echo ${value[0]} | cut -d "=" -f1`
ostname=`echo $param | cut -d "." -f2 | cut -d - -f 1-2`
mds_last=$(do_facet $SINGLEMDS lctl get_param -n $param)
- ostnum=$(echo $ostname | sed "s/${FSNAME}-OST//g" | awk '{print ($1+1)}' )
- ost_last=$(do_facet ost$ostnum lctl get_param -n obdfilter.$ostname.last_id | head -n 1)
+ ostnum=$(index_from_ostuuid ${ostname}_UUID)
+ node=$(facet_active_host ost$((ostnum+1)))
+ param="obdfilter.$ostname.last_id"
+ ost_last=$(do_node $node lctl get_param -n $param | head -n 1)
echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
if [ $ost_last != $mds_last ]; then
error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
echo "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
if [ $ost_last != $mds_last ]; then
error "$ostname.last_id=$ost_last ; MDS.last_id=$mds_last"
STRIPE_OFFSET=0
local list=$(comma_list $(osts_nodes))
STRIPE_OFFSET=0
local list=$(comma_list $(osts_nodes))
- do_nodes $list $LCTL set_param -n obdfilter.*.read_cache_enable=0
- do_nodes $list $LCTL set_param -n obdfilter.*.writethrough_cache_enable=0
+ set_osd_param $list '' read_cache_enable 0
+ set_osd_param $list '' writethrough_cache_enable 0
trap cleanup_test101bc EXIT
# prepare the read-ahead file
trap cleanup_test101bc EXIT
# prepare the read-ahead file
rm -f $DIR/$tfile
local list=$(comma_list $(osts_nodes))
rm -f $DIR/$tfile
local list=$(comma_list $(osts_nodes))
- do_nodes $list $LCTL set_param -n obdfilter.*.read_cache_enable=1
- do_nodes $list $LCTL set_param -n obdfilter.*.writethrough_cache_enable=1
+ set_osd_param $list '' read_cache_enable 1
+ set_osd_param $list '' writethrough_cache_enable 1
function roc_hit() {
local list=$(comma_list $(osts_nodes))
function roc_hit() {
local list=$(comma_list $(osts_nodes))
- echo $(get_obdfilter_param $list '' stats |
+ echo $(get_osd_param $list '' stats |
awk '/'cache_hit'/ {sum+=$2} END {print sum}')
}
awk '/'cache_hit'/ {sum+=$2} END {print sum}')
}
on=0;
fi
local list=$(comma_list $(osts_nodes))
on=0;
fi
local list=$(comma_list $(osts_nodes))
- set_obdfilter_param $list '' $1_cache_enable $on
+ set_osd_param $list '' $1_cache_enable $on
local list=$(comma_list $(osts_nodes))
# check whether obdfilter is cache capable at all
local list=$(comma_list $(osts_nodes))
# check whether obdfilter is cache capable at all
- if ! get_obdfilter_param $list '' read_cache_enable >/dev/null; then
+ if ! get_osd_param $list '' read_cache_enable >/dev/null; then
echo "not cache-capable obdfilter"
return 0
fi
# check cache is enabled on all obdfilters
echo "not cache-capable obdfilter"
return 0
fi
# check cache is enabled on all obdfilters
- if get_obdfilter_param $list '' read_cache_enable | grep 0; then
+ if get_osd_param $list '' read_cache_enable | grep 0; then
echo "oss cache is disabled"
return 0
fi
echo "oss cache is disabled"
return 0
fi
- set_obdfilter_param $list '' writethrough_cache_enable 1
+ set_osd_param $list '' writethrough_cache_enable 1
# pages should be in the case right after write
dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || error "dd failed"
# pages should be in the case right after write
dd if=/dev/urandom of=$DIR/$tfile bs=4k count=$CPAGES || error "dd failed"
# the following read invalidates the cache
cancel_lru_locks osc
# the following read invalidates the cache
cancel_lru_locks osc
- set_obdfilter_param $list '' read_cache_enable 0
+ set_osd_param $list '' read_cache_enable 0
cat $DIR/$tfile >/dev/null
# now data shouldn't be found in the cache
cat $DIR/$tfile >/dev/null
# now data shouldn't be found in the cache
error "IN CACHE: before: $BEFORE, after: $AFTER"
fi
error "IN CACHE: before: $BEFORE, after: $AFTER"
fi
- set_obdfilter_param $list '' read_cache_enable 1
+ set_osd_param $list '' read_cache_enable 1
rm -f $DIR/$tfile
}
run_test 151 "test cache on oss and controls ==============================="
rm -f $DIR/$tfile
}
run_test 151 "test cache on oss and controls ==============================="
local node=$(facet_active_host ost1)
# check whether obdfilter is cache capable at all
local node=$(facet_active_host ost1)
# check whether obdfilter is cache capable at all
- if ! get_obdfilter_param $node '' read_cache_enable >/dev/null; then
+ if ! get_osd_param $node '' read_cache_enable >/dev/null; then
echo "not cache-capable obdfilter"
return 0
fi
echo "not cache-capable obdfilter"
return 0
fi
- local MAX=$(get_obdfilter_param $node '' readcache_max_filesize | \
+ local MAX=$(get_osd_param $node '' readcache_max_filesize | \
- set_obdfilter_param $node '' readcache_max_filesize 4096
+ set_osd_param $node '' readcache_max_filesize 4096
dd if=/dev/urandom of=$TMP/$tfile bs=512k count=32
local SUM=$(cksum $TMP/$tfile | cut -d" " -f 1,2)
cp $TMP/$tfile $DIR1/$tfile
dd if=/dev/urandom of=$TMP/$tfile bs=512k count=32
local SUM=$(cksum $TMP/$tfile | cut -d" " -f 1,2)
cp $TMP/$tfile $DIR1/$tfile
[ "$(cat $TMP/sum2)" = "$SUM" ] || \
error "$DIR2/$tfile $(cat $TMP/sum2) != $SUM"
done
[ "$(cat $TMP/sum2)" = "$SUM" ] || \
error "$DIR2/$tfile $(cat $TMP/sum2) != $SUM"
done
- set_obdfilter_param $node '' readcache_max_filesize $MAX
+ set_osd_param $node '' readcache_max_filesize $MAX
rm $DIR1/$tfile
}
run_test 19 "test concurrent uncached read races ==============="
rm $DIR1/$tfile
}
run_test 19 "test concurrent uncached read races ==============="
-# This and set_obdfilter_param() shall be used to access OSD parameters
+# This and set_osd_param() shall be used to access OSD parameters
# once existed under "obdfilter":
#
# mntdev
# once existed under "obdfilter":
#
# mntdev
# read_cache_enable
# writethrough_cache_enable
#
# read_cache_enable
# writethrough_cache_enable
#
local nodes=$1
local device=${2:-$FSNAME-OST*}
local name=$3
local nodes=$1
local device=${2:-$FSNAME-OST*}
local name=$3
osd-*.$device.$name 2>&1" | grep -v 'Found no match'
}
osd-*.$device.$name 2>&1" | grep -v 'Found no match'
}
local nodes=$1
local device=${2:-$FSNAME-OST*}
local name=$3
local nodes=$1
local device=${2:-$FSNAME-OST*}
local name=$3
local dev
if [ "$type" == ost ]; then
local dev
if [ "$type" == ost ]; then
- devs=$(get_obdfilter_param $node "" mntdev)
+ devs=$(get_osd_param $node "" mntdev)
else
devs=$(do_node $node \
"lctl get_param -n osd-*.$FSNAME-M*.mntdev")
else
devs=$(do_node $node \
"lctl get_param -n osd-*.$FSNAME-M*.mntdev")