Skip to content
Snippets Groups Projects
Commit da784db5 authored by komaln's avatar komaln
Browse files

b=14471

r=Adilger
Changed conf-sanity.sh to use 'lctl {get,set}_param'
parent 300175e3
No related branches found
No related tags found
No related merge requests found
...@@ -912,7 +912,7 @@ test_24a() { ...@@ -912,7 +912,7 @@ test_24a() {
umount_client $MOUNT umount_client $MOUNT
# the MDS must remain up until last MDT # the MDS must remain up until last MDT
stop_mds stop_mds
MDS=$(do_facet mds "cat $LPROC/devices" | awk '($3 ~ "mdt" && $4 ~ "MDS") { print $4 }') MDS=$(do_facet mds "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDS") { print $4 }')
[ -z "$MDS" ] && error "No MDS" && return 8 [ -z "$MDS" ] && error "No MDS" && return 8
cleanup_24a cleanup_24a
cleanup_nocli || return 6 cleanup_nocli || return 6
...@@ -950,8 +950,8 @@ test_26() { ...@@ -950,8 +950,8 @@ test_26() {
#define OBD_FAIL_MDS_FS_SETUP 0x135 #define OBD_FAIL_MDS_FS_SETUP 0x135
do_facet mds "sysctl -w lustre.fail_loc=0x80000135" do_facet mds "sysctl -w lustre.fail_loc=0x80000135"
start_mds && echo MDS started && return 1 start_mds && echo MDS started && return 1
cat $LPROC/devices lctl get_param -n devices
DEVS=$(cat $LPROC/devices | wc -l) DEVS=$(lctl get_param -n devices | wc -l)
[ $DEVS -gt 0 ] && return 2 [ $DEVS -gt 0 ] && return 2
unload_modules || return 203 unload_modules || return 203
} }
...@@ -994,7 +994,7 @@ test_27a() { ...@@ -994,7 +994,7 @@ test_27a() {
start_mds || return 2 start_mds || return 2
echo "Requeue thread should have started: " echo "Requeue thread should have started: "
ps -e | grep ll_cfg_requeue ps -e | grep ll_cfg_requeue
set_and_check ost1 "cat $LPROC/obdfilter/$FSNAME-OST0000/client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3 set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
cleanup_nocli cleanup_nocli
} }
run_test 27a "Reacquire MGS lock if OST started first" run_test 27a "Reacquire MGS lock if OST started first"
...@@ -1002,15 +1002,15 @@ run_test 27a "Reacquire MGS lock if OST started first" ...@@ -1002,15 +1002,15 @@ run_test 27a "Reacquire MGS lock if OST started first"
test_27b() { test_27b() {
setup setup
facet_failover mds facet_failover mds
set_and_check mds "cat $LPROC/mds/$FSNAME-MDT0000/group_acquire_expire" "$FSNAME-MDT0000.mdt.group_acquire_expire" || return 3 set_and_check mds "lctl get_param -n mds.$FSNAME-MDT0000.group_acquire_expire" "$FSNAME-MDT0000.mdt.group_acquire_expire" || return 3
set_and_check client "cat $LPROC/mdc/$FSNAME-MDT0000-mdc-*/max_rpcs_in_flight" "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4 set_and_check client "lctl get_param -n mdc.$FSNAME-MDT0000-mdc-*.max_rpcs_in_flight" "$FSNAME-MDT0000.mdc.max_rpcs_in_flight" || return 4
cleanup cleanup
} }
run_test 27b "Reacquire MGS lock after failover" run_test 27b "Reacquire MGS lock after failover"
test_28() { test_28() {
setup setup
TEST="cat $LPROC/llite/$FSNAME-*/max_read_ahead_whole_mb" TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
ORIG=$($TEST) ORIG=$($TEST)
declare -i FINAL declare -i FINAL
FINAL=$(($ORIG + 10)) FINAL=$(($ORIG + 10))
...@@ -1036,32 +1036,28 @@ test_29() { ...@@ -1036,32 +1036,28 @@ test_29() {
sleep 10 sleep 10
local PARAM="$FSNAME-OST0001.osc.active" local PARAM="$FSNAME-OST0001.osc.active"
local PROC_ACT="$LPROC/osc/$FSNAME-OST0001-osc-*/active" local PROC_ACT="osc.$FSNAME-OST0001-osc-*.active"
local PROC_UUID="$LPROC/osc/$FSNAME-OST0001-osc-*/ost_server_uuid" local PROC_UUID="osc.$FSNAME-OST0001-osc-*.ost_server_uuid"
if [ ! -r $PROC_ACT ]; then
echo "Can't read $PROC_ACT" ACTV=$(lctl get_param -n $PROC_ACT)
ls $LPROC/osc/$FSNAME-*
return 1
fi
ACTV=$(cat $PROC_ACT)
DEAC=$((1 - $ACTV)) DEAC=$((1 - $ACTV))
set_and_check client "cat $PROC_ACT" "$PARAM" $DEAC || return 2 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
# also check ost_server_uuid status # also check ost_server_uuid status
RESULT=$(grep DEACTIV $PROC_UUID) RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
if [ -z "$RESULT" ]; then if [ -z "$RESULT" ]; then
echo "Live client not deactivated: $(cat $PROC_UUID)" echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
return 3 return 3
else else
echo "Live client success: got $RESULT" echo "Live client success: got $RESULT"
fi fi
# check MDT too # check MDT too
local MPROC="$LPROC/osc/$FSNAME-OST0001-osc/active" local MPROC="osc.$FSNAME-OST0001-osc.active"
local MAX=30 local MAX=30
local WAIT=0 local WAIT=0
while [ 1 ]; do while [ 1 ]; do
sleep 5 sleep 5
RESULT=`do_facet mds " [ -r $MPROC ] && cat $MPROC"` RESULT=`do_facet mds " lctl get_param -n $MPROC"`
[ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC" [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
if [ $RESULT -eq $DEAC ]; then if [ $RESULT -eq $DEAC ]; then
echo "MDT deactivated also after $WAIT sec (got $RESULT)" echo "MDT deactivated also after $WAIT sec (got $RESULT)"
...@@ -1078,16 +1074,16 @@ test_29() { ...@@ -1078,16 +1074,16 @@ test_29() {
# test new client starts deactivated # test new client starts deactivated
umount_client $MOUNT || return 200 umount_client $MOUNT || return 200
mount_client $MOUNT mount_client $MOUNT
RESULT=$(grep DEACTIV $PROC_UUID | grep NEW) RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
if [ -z "$RESULT" ]; then if [ -z "$RESULT" ]; then
echo "New client not deactivated from start: $(cat $PROC_UUID)" echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
return 5 return 5
else else
echo "New client success: got $RESULT" echo "New client success: got $RESULT"
fi fi
# make sure it reactivates # make sure it reactivates
set_and_check client "cat $PROC_ACT" "$PARAM" $ACTV || return 6 set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
umount_client $MOUNT umount_client $MOUNT
stop_ost2 stop_ost2
...@@ -1103,7 +1099,7 @@ run_test 29 "permanently remove an OST" ...@@ -1103,7 +1099,7 @@ run_test 29 "permanently remove an OST"
test_30() { test_30() {
setup setup
TEST="cat $LPROC/llite/$FSNAME-*/max_read_ahead_whole_mb" TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
ORIG=$($TEST) ORIG=$($TEST)
for i in $(seq 1 20); do for i in $(seq 1 20); do
set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3 set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
...@@ -1144,13 +1140,13 @@ test_32a() { ...@@ -1144,13 +1140,13 @@ test_32a() {
$TUNEFS $TMP/$tdir/mds || error "tunefs failed" $TUNEFS $TMP/$tdir/mds || error "tunefs failed"
# nids are wrong, so client wont work, but server should start # nids are wrong, so client wont work, but server should start
start mds $TMP/$tdir/mds "-o loop,exclude=lustre-OST0000" || return 3 start mds $TMP/$tdir/mds "-o loop,exclude=lustre-OST0000" || return 3
local UUID=$(cat $LPROC/mds/lustre-MDT0000/uuid) local UUID=$(lctl get_param -n mds.lustre-MDT0000.uuid)
echo MDS uuid $UUID echo MDS uuid $UUID
[ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID" [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID"
$TUNEFS --mgsnode=`hostname` $TMP/$tdir/ost1 || error "tunefs failed" $TUNEFS --mgsnode=`hostname` $TMP/$tdir/ost1 || error "tunefs failed"
start ost1 $TMP/$tdir/ost1 "-o loop" || return 5 start ost1 $TMP/$tdir/ost1 "-o loop" || return 5
UUID=$(cat $LPROC/obdfilter/lustre-OST0000/uuid) UUID=$(cat lctl get_param -n obdfilter.lustre-OST0000.uuid)
echo OST uuid $UUID echo OST uuid $UUID
[ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID" [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID"
...@@ -1171,7 +1167,8 @@ test_32a() { ...@@ -1171,7 +1167,8 @@ test_32a() {
MOUNTOPT="exclude=lustre-OST0000" MOUNTOPT="exclude=lustre-OST0000"
mount_client $MOUNT mount_client $MOUNT
MOUNTOPT=$OLDMOUNTOPT MOUNTOPT=$OLDMOUNTOPT
set_and_check client "cat $LPROC/mdc/*/max_rpcs_in_flight" "lustre-MDT0000.mdc.max_rpcs_in_flight" || return 11 set_and_check client "lctl get_param -n mdc.*.max_rpcs_in_flight" "lustre-MDT0000.mdc.max_rpcs_in_flight" ||
return 11
zconf_umount `hostname` $MOUNT -f zconf_umount `hostname` $MOUNT -f
cleanup_nocli cleanup_nocli
...@@ -1209,13 +1206,13 @@ test_32b() { ...@@ -1209,13 +1206,13 @@ test_32b() {
# writeconf will cause servers to register with their current nids # writeconf will cause servers to register with their current nids
$TUNEFS --writeconf --fsname=$NEWNAME $TMP/$tdir/mds || error "tunefs failed" $TUNEFS --writeconf --fsname=$NEWNAME $TMP/$tdir/mds || error "tunefs failed"
start mds $TMP/$tdir/mds "-o loop" || return 3 start mds $TMP/$tdir/mds "-o loop" || return 3
local UUID=$(cat $LPROC/mds/${NEWNAME}-MDT0000/uuid) local UUID=$(lctl get_param -n mds.${NEWNAME}-MDT0000.uuid)
echo MDS uuid $UUID echo MDS uuid $UUID
[ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID" [ "$UUID" == "mdsA_UUID" ] || error "UUID is wrong: $UUID"
$TUNEFS --mgsnode=`hostname` --fsname=$NEWNAME --writeconf $TMP/$tdir/ost1 || error "tunefs failed" $TUNEFS --mgsnode=`hostname` --fsname=$NEWNAME --writeconf $TMP/$tdir/ost1 || error "tunefs failed"
start ost1 $TMP/$tdir/ost1 "-o loop" || return 5 start ost1 $TMP/$tdir/ost1 "-o loop" || return 5
UUID=$(cat $LPROC/obdfilter/${NEWNAME}-OST0000/uuid) UUID=$(lctl get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
echo OST uuid $UUID echo OST uuid $UUID
[ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID" [ "$UUID" == "ost1_UUID" ] || error "UUID is wrong: $UUID"
...@@ -1234,7 +1231,7 @@ test_32b() { ...@@ -1234,7 +1231,7 @@ test_32b() {
FSNAME=$NEWNAME FSNAME=$NEWNAME
mount_client $MOUNT mount_client $MOUNT
FSNAME=$OLDFS FSNAME=$OLDFS
set_and_check client "cat $LPROC/mdc/*/max_rpcs_in_flight" "${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight" || return 11 set_and_check client "lctl get_param -n mdc.*.max_rpcs_in_flight" "${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight" || return 11
[ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2479747619 779" ] || return 12 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "2479747619 779" ] || return 12
echo "ok." echo "ok."
...@@ -1395,7 +1392,7 @@ test_36() { # 12743 ...@@ -1395,7 +1392,7 @@ test_36() { # 12743
fi fi
[ $OSTCOUNT -lt 2 ] && skip "skipping test for single OST" && return [ $OSTCOUNT -lt 2 ] && skip "skipping test for single OST" && return
[ $(grep -c obdfilter $LPROC/devices) -eq 0 ] && [ $(lctl get_param -n devices | grep -c obdfilter) -eq 0 ] &&
skip "skipping test for remote OST" && return skip "skipping test for remote OST" && return
local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2} local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
...@@ -1415,12 +1412,9 @@ test_36() { # 12743 ...@@ -1415,12 +1412,9 @@ test_36() { # 12743
dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
BKTOTAL=`awk 'BEGIN{total=0}; {total+=$1}; END{print total}' \ BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
$LPROC/obdfilter/*/kbytestotal` BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
BKFREE=`awk 'BEGIN{free=0}; {free+=$1}; END{print free}' \ BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
$LPROC/obdfilter/*/kbytesfree`
BKAVAIL=`awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}' \
$LPROC/obdfilter/*/kbytesavail`
STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'` STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
DFTOTAL=`echo $STRING | cut -d, -f1` DFTOTAL=`echo $STRING | cut -d, -f1`
DFUSED=`echo $STRING | cut -d, -f2` DFUSED=`echo $STRING | cut -d, -f2`
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment