Clean up the code for conf-sanity.sh test_49 to allow easier debugging
of test failures, which were seen intermittently during development.
Also clean up the coding style to match current guidelines.
Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: Iac60fd89c5f193bfa11d9223e75ae947c8b6e186
Reviewed-on: http://review.whamcloud.com/6207
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
-# FIXME - there is no reason to use all of these different
-# return codes, espcially when most of them are mapped to something
-# else anyway. The combination of test number and return code
-# figure out what failed.
+# FIXME - there is no reason to use all of these different return codes,
+# espcially when most of them are mapped to something else anyway.
+# The tests should use error() to describe the failure more clearly,
+# and reduce the need to look into the tests to see what failed.
run_test 48 "too many acls on file"
# check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
run_test 48 "too many acls on file"
# check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
+test_49a() { # bug 17710
local timeout_orig=$TIMEOUT
local ldlm_timeout_orig=$LDLM_TIMEOUT
local LOCAL_TIMEOUT=20
local timeout_orig=$TIMEOUT
local ldlm_timeout_orig=$LDLM_TIMEOUT
local LOCAL_TIMEOUT=20
- check_mount || return 1
+ check_mount || error "client mount failed"
echo "check ldlm_timout..."
echo "check ldlm_timout..."
- LDLM_MDS="`do_facet $SINGLEMDS lctl get_param -n ldlm_timeout`"
- LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
- LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
+ local LDLM_MDS="$(do_facet $SINGLEMDS lctl get_param -n ldlm_timeout)"
+ local LDLM_OST1="$(do_facet ost1 lctl get_param -n ldlm_timeout)"
+ local LDLM_CLIENT="$(do_facet client lctl get_param -n ldlm_timeout)"
- if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
+ if [ $LDLM_MDS -ne $LDLM_OST1 -o $LDLM_MDS -ne $LDLM_CLIENT ]; then
error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
fi
if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
fi
if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
- error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
+ error "LDLM_TIMEOUT($LDLM_MDS) is not $((LOCAL_TIMEOUT / 3))"
- stop_ost || return 2
- stop_mds || return 3
+ stop_ost || error "problem stopping OSS"
+ stop_mds || error "problem stopping MDS"
+
+ LDLM_TIMEOUT=$ldlm_timeout_orig
+ TIMEOUT=$timeout_orig
+}
+run_test 49a "check PARAM_SYS_LDLM_TIMEOUT option of mkfs.lustre"
+
+test_49b() { # bug 17710
+ local timeout_orig=$TIMEOUT
+ local ldlm_timeout_orig=$LDLM_TIMEOUT
+ local LOCAL_TIMEOUT=20
LDLM_TIMEOUT=$((LOCAL_TIMEOUT - 1))
LDLM_TIMEOUT=$((LOCAL_TIMEOUT - 1))
- check_mount || return 7
+ check_mount || error "client mount failed"
- LDLM_MDS="`do_facet $SINGLEMDS lctl get_param -n ldlm_timeout`"
- LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
- LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
+ local LDLM_MDS="$(do_facet $SINGLEMDS lctl get_param -n ldlm_timeout)"
+ local LDLM_OST1="$(do_facet ost1 lctl get_param -n ldlm_timeout)"
+ local LDLM_CLIENT="$(do_facet client lctl get_param -n ldlm_timeout)"
- if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
+ if [ $LDLM_MDS -ne $LDLM_OST1 -o $LDLM_MDS -ne $LDLM_CLIENT ]; then
error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
fi
if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
fi
if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
- error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
+ error "LDLM_TIMEOUT($LDLM_MDS) is not $((LOCAL_TIMEOUT - 1))"
+ cleanup || error "cleanup failed"
LDLM_TIMEOUT=$ldlm_timeout_orig
TIMEOUT=$timeout_orig
}
LDLM_TIMEOUT=$ldlm_timeout_orig
TIMEOUT=$timeout_orig
}
-run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
+run_test 49b "check PARAM_SYS_LDLM_TIMEOUT option of mkfs.lustre"
lazystatfs() {
# Test both statfs and lfs df and fail if either one fails
lazystatfs() {
# Test both statfs and lfs df and fail if either one fails