ONLY=${ONLY:-"$*"}
# bug number for skipped test:
-# 15977
+ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
if [ "$FAILURE_MODE" = "HARD" ]; then
}
run_test 26 "MDT startup failure cleans LOV (should return errs)"
-set_and_check() {
- local myfacet=$1
- local TEST=$2
- local PARAM=$3
- local ORIG=$(do_facet $myfacet "$TEST")
- if [ $# -gt 3 ]; then
- local FINAL=$4
- else
- local -i FINAL
- FINAL=$(($ORIG + 5))
- fi
- echo "Setting $PARAM from $ORIG to $FINAL"
- do_facet mgs "$LCTL conf_param $PARAM='$FINAL'" || error conf_param failed
-
- wait_update $(facet_host $myfacet) "$TEST" "$FINAL" || error check failed!
-}
-
test_27a() {
start_ost || return 1
start_mds || return 2
echo "Requeue thread should have started: "
ps -e | grep ll_cfg_requeue
- set_and_check ost1 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
+ set_conf_param_and_check ost1 \
+ "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" \
+ "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
cleanup_nocli
}
run_test 27a "Reacquire MGS lock if OST started first"
local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
facet_failover $SINGLEMDS
- set_and_check $SINGLEMDS "lctl get_param -n mdt.$device.identity_acquire_expire" "$device.mdt.identity_acquire_expire" || return 3
- set_and_check client "lctl get_param -n mdc.$device-mdc-*.max_rpcs_in_flight" "$device.mdc.max_rpcs_in_flight" || return 4
+ set_conf_param_and_check $SINGLEMDS \
+ "lctl get_param -n mdt.$device.identity_acquire_expire" \
+ "$device.mdt.identity_acquire_expire" || return 3
+ set_conf_param_and_check client \
+ "lctl get_param -n mdc.$device-mdc-*.max_rpcs_in_flight"\
+ "$device.mdc.max_rpcs_in_flight" || return 4
check_mount
cleanup
}
PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
ORIG=$($TEST)
FINAL=$(($ORIG + 1))
- set_and_check client "$TEST" "$PARAM" $FINAL || return 3
+ set_conf_param_and_check client "$TEST" "$PARAM" $FINAL || return 3
FINAL=$(($FINAL + 1))
- set_and_check client "$TEST" "$PARAM" $FINAL || return 4
+ set_conf_param_and_check client "$TEST" "$PARAM" $FINAL || return 4
umount_client $MOUNT || return 200
mount_client $MOUNT
RESULT=$($TEST)
else
echo "New config success: got $RESULT"
fi
- set_and_check client "$TEST" "$PARAM" $ORIG || return 5
+ set_conf_param_and_check client "$TEST" "$PARAM" $ORIG || return 5
cleanup
}
run_test 28 "permanent parameter setting"
ACTV=$(lctl get_param -n $PROC_ACT)
DEAC=$((1 - $ACTV))
- set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
+ set_conf_param_and_check client \
+ "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
# also check ost_server_uuid status
RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
if [ -z "$RESULT" ]; then
fi
# make sure it reactivates
- set_and_check client "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
+ set_conf_param_and_check client \
+ "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
umount_client $MOUNT
stop_ost2
ORIG=$($TEST)
LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
for i in ${LIST[@]}; do
- set_and_check client "$TEST" "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
+ set_conf_param_and_check client "$TEST" \
+ "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
done
# make sure client restart still works
umount_client $MOUNT
echo "Using fake nid $NEW"
TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
- set_and_check client "$TEST" "$FSNAME-OST0000.failover.node" $NEW || error "didn't add failover nid $NEW"
+ set_conf_param_and_check client "$TEST" \
+ "$FSNAME-OST0000.failover.node" $NEW ||
+ error "didn't add failover nid $NEW"
NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
echo $NIDS
NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
run_test 42 "invalid config param should not prevent client from mounting"
test_43() {
- [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"
- setup
- chmod ugo+x $DIR || error "chmod 0 failed"
- set_and_check mds \
- "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
- "$FSNAME.mdt.root_squash" \
- "0:0"
- set_and_check mds \
- "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
- "$FSNAME.mdt.nosquash_nids" \
- "NONE"
+ [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"
+ setup
+ chmod ugo+x $DIR || error "chmod 0 failed"
+ set_conf_param_and_check mds \
+ "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
+ "$FSNAME.mdt.root_squash" \
+ "0:0"
+ set_conf_param_and_check mds \
+ "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
+ "$FSNAME.mdt.nosquash_nids" \
+ "NONE"
#
# create set of test files
chmod go-rwx $DIR/$tdir-rootdir || error "chmod 3 failed"
touch $DIR/$tdir-rootdir/tfile-1 || error "touch failed"
- #
- # check root_squash:
- # set root squash UID:GID to RUNAS_ID
- # root should be able to access only files owned by RUNAS_ID
- #
- set_and_check mds \
- "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
- "$FSNAME.mdt.root_squash" \
- "$RUNAS_ID:$RUNAS_ID"
+ #
+ # check root_squash:
+ # set root squash UID:GID to RUNAS_ID
+ # root should be able to access only files owned by RUNAS_ID
+ #
+ set_conf_param_and_check mds \
+ "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
+ "$FSNAME.mdt.root_squash" \
+ "$RUNAS_ID:$RUNAS_ID"
ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-userfile)
dd if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
error "$ST: root create permission is granted"
echo "$ST: root create permission is denied - ok"
- #
- # check nosquash_nids:
- # put client's NID into nosquash_nids list,
- # root should be able to access root file after that
- #
- local NIDLIST=$(lctl list_nids all | tr '\n' ' ')
- NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
- NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
- set_and_check mds \
- "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
- "$FSNAME-MDTall.mdt.nosquash_nids" \
- "$NIDLIST"
+ #
+ # check nosquash_nids:
+ # put client's NID into nosquash_nids list,
+ # root should be able to access root file after that
+ #
+ local NIDLIST=$(lctl list_nids all | tr '\n' ' ')
+ NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
+ NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
+ set_conf_param_and_check mds \
+ "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
+ "$FSNAME-MDTall.mdt.nosquash_nids" \
+ "$NIDLIST"
ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
lassert 28 "$msg" '(($tstarted == $tmin && $tstarted == $tmax ))' || return $?
cleanup
- # Workaround a YALA bug where YALA expects that modules will remain
- # loaded on the servers
- LOAD_MODULES_REMOTE=false
load_modules
setup
cleanup
}
run_test 63 "Verify each page can at least hold 3 ldisk inodes"
+test_64() {
+ start_mds
+ start_ost
+ start_ost2 || error "Unable to start second ost"
+ mount_client $MOUNT || error "Unable to mount client"
+ stop_ost2 || error "Unable to stop second ost"
+ echo "$LFS df"
+ $LFS df --lazy || error "lfs df failed"
+ cleanup || return $?
+}
+run_test 64 "check lfs df --lazy "
+
if ! combined_mgs_mds ; then
stop mgs
fi