}
writeconf() {
- local facet=$SINGLEMDS
- local dev=${facet}_dev
- shift
- stop ${facet} -f
- rm -f ${facet}active
- # who knows if/where $TUNEFS is installed? Better reformat if it fails...
- do_facet ${facet} "$TUNEFS --writeconf ${!dev}" || echo "tunefs failed, reformatting instead" && reformat
+ local facet=$SINGLEMDS
+ local dev=${facet}_dev
+ shift
+ stop ${facet} -f
+ rm -f ${facet}active
+ # who knows if/where $TUNEFS is installed? Better reformat if it fails...
+ do_facet ${facet} "$TUNEFS --writeconf ${!dev}" || echo "tunefs failed, reformatting instead" && reformat
+
+ gen_config
}
gen_config() {
- reformat
- # The MGS must be started before the OSTs for a new fs, so start
- # and stop to generate the startup logs.
+ # The MGS must be started before the OSTs for a new fs, so start
+ # and stop to generate the startup logs.
start_mds
start_ost
sleep 5
stop_mds
}
+reformat_and_config() {
+ reformat
+ gen_config
+}
+
start_mds() {
local facet=$SINGLEMDS
# we can not use MDSDEV1 here because SINGLEMDS could be set not to mds1 only
#create single point mountpoint
-gen_config
+reformat_and_config
test_0() {
setup
start_ost
start_mds && return 42
- gen_config
+ reformat_and_config
}
run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
MDS_MKFS_OPTS="--mgs --mdt --fsname=$FSNAME --device-size=$myMDSSIZE --param sys.timeout=$TIMEOUT $MDSOPT"
- gen_config
+ reformat_and_config
echo "mount lustre system..."
setup
check_mount || return 41
cleanup || return $?
MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
- gen_config
+ reformat_and_config
}
run_test 18 "check mkfs creates large journals"
cleanup_nocli
#writeconf to remove all ost2 traces for subsequent tests
writeconf
- start_mds
- start_ost
- sleep 5
- cleanup
}
run_test 29 "permanently remove an OST"
local fs2mdsdev=${fs2mds_DEV:-${MDSDEV}_2}
local fs2ostdev=${fs2ost_DEV:-$(ostdevname 1)_2}
- add fs2mds $MDS_MKFS_OPTS --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
+ add fs2mds $MDS_MKFS_OPTS --mkfsoptions='\"-J size=8\"' --fsname=${FSNAME2} --reformat $fs2mdsdev || exit 10
add fs2ost $OST_MKFS_OPTS --fsname=${FSNAME2} --index=8191 --mgsnode=$MGSNID --reformat $fs2ostdev || exit 10
start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
}
run_test 47 "server restart does not make client loss lru_resize settings"
-# reformat after this test must need - if test will failed
-# we will have unkillable file at FS
+cleanup_48() {
+ trap 0
+
+ # reformat after this test is needed - if test will failed
+ # we will have unkillable file at FS
+ reformat_and_config
+}
+
test_48() { # bug 17636
reformat
setup_noconfig
echo "ok" > $MOUNT/widestripe
$LFS getstripe $MOUNT/widestripe || return 11
+
+ trap cleanup_48 EXIT ERR
+
# fill acl buffer for avoid expand lsm to them
- awk -F : '{ print "u:"$1":rwx" }' /etc/passwd | while read acl; do
- setfacl -m $acl $MOUNT/widestripe
- done
- awk -F : '{ print "g:"$1":rwx" }' /etc/groups | while read acl; do
+ getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
setfacl -m $acl $MOUNT/widestripe
done
-
stat $MOUNT/widestripe || return 12
-
- cleanup || error "can't cleanup"
+
+ cleanup_48
return 0
}
run_test 48 "too many acls on file"
+# check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
+test_49() { # bug 17710
+ local OLD_MDS_MKFS_OPTS=$MDS_MKFS_OPTS
+ local OLD_OST_MKFS_OPTS=$OST_MKFS_OPTS
+ local LOCAL_TIMEOUT=20
+
+
+ OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$LOCAL_TIMEOUT $MKFSOPT $OSTOPT"
+
+ reformat
+ start_mds
+ start_ost
+ mount_client $MOUNT
+ check_mount || return 1
+
+ echo "check ldlm_timout..."
+ LDLM_MDS="`do_facet mds 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`"
+
+ if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $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 "LDLM_TIMEOUT($LDLM_MDS) is not correct"
+ fi
+
+ umount_client $MOUNT
+ stop_ost || return 2
+ stop_mds || return 3
+
+ OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$((LOCAL_TIMEOUT - 1)) $MKFSOPT $OSTOPT"
+
+ reformat
+ start_mds || return 4
+ start_ost || return 5
+ mount_client $MOUNT || return 6
+ check_mount || return 7
+
+ LDLM_MDS="`do_facet mds 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`"
+
+ if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $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 "LDLM_TIMEOUT($LDLM_MDS) is not correct"
+ fi
+
+ cleanup || return $?
+
+ MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
+ OST_MKFS_OPTS=$OLD_OST_MKFS_OPTS
+}
+run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
cleanup_gss
equals_msg `basename $0`: test complete