pushd $tmp/mnt/lustre
fi
$r cat $list_file | sort -k 6 >$tmp/list.orig
- ls -Rni --time-style=+%s | sort -k 6 >$tmp/list || {
+ ls -Rni --time-style=+%s | sort -k 6 |
+ sed 's/\. / /' >$tmp/list || {
error_noexit "ls"
return 1
}
stop ost1 -f || error "unable to stop OST1"
stop_mds || error "Unable to stop MDS"
stop_mds || error "Unable to stop MDS on second try"
- unload_modules_conf || error "unload_modules_conf failed"
}
run_test 41a "mount mds with --nosvc and --nomgs"
do_facet mgs $LCTL conf_param $FSNAME.sys.some_wrong_param=20
cleanup || error "stopping $FSNAME failed with invalid sys param"
- load_modules
setup
check_mount || error "client was not mounted with invalid sys param"
cleanup || error "stopping $FSNAME failed with invalid sys param"
[ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"
ID1=${ID1:-501}
- USER1=$(cat /etc/passwd | grep :$ID1:$ID1: | cut -d: -f1)
+ USER1=$(getent passwd | grep :$ID1:$ID1: | cut -d: -f1)
[ -z "$USER1" ] && skip_env "missing user with uid=$ID1 gid=$ID1" &&
return
[ "$MDSCOUNT" -lt "2" ] && skip_env "$MDSCOUNT < 2, skipping" && return
[ $(facet_fstype ost1) == zfs ] && import_zpool ost1
- load_modules
do_facet mds2 "$TUNEFS --param mdc.active=0 $(mdsdevname 2)" ||
error "tunefs MDT2 failed"
start_mds || error "Unable to start MDT"
local newvalue="${opts}=$(expr $basethr \* $ncpts)"
setmodopts -a $modname "$newvalue" oldvalue
- load_modules
setup
check_mount || return 41
return $?
cleanup
- load_modules
setup
}
}
run_test 70d "stop MDT1, mkdir succeed, create remote dir fail"
+test_70e() {
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.62) ] ||
+ { skip "Need MDS version at least 2.7.62"; return 0; }
+
+ cleanup || error "cleanup failed with $?"
+
+ local mdsdev=$(mdsdevname 1)
+ local ostdev=$(ostdevname 1)
+ local mdsvdev=$(mdsvdevname 1)
+ local ostvdev=$(ostvdevname 1)
+ local opts_mds="$(mkfs_opts mds1 $mdsdev) --reformat $mdsdev $mdsvdev"
+ local opts_ost="$(mkfs_opts ost1 $ostdev) --reformat $ostdev $ostvdev"
+
+ add mds1 $opts_mds || error "add mds1 failed"
+ start_mdt 1 || error "start mdt1 failed"
+ add ost1 $opts_ost || error "add ost1 failed"
+ start_ost || error "start ost failed"
+ mount_client $MOUNT > /dev/null || error "mount client $MOUNT failed"
+
+ local soc=$(do_facet mds1 "$LCTL get_param -n \
+ mdt.*MDT0000.sync_lock_cancel")
+ [ $soc == "never" ] || error "SoC enabled on single MDS"
+
+ for i in $(seq 2 $MDSCOUNT); do
+ mdsdev=$(mdsdevname $i)
+ mdsvdev=$(mdsvdevname $i)
+ opts_mds="$(mkfs_opts mds$i $mdsdev) --reformat $mdsdev \
+ $mdsvdev"
+ add mds$i $opts_mds || error "add mds$i failed"
+ start_mdt $i || error "start mdt$i fail"
+ done
+
+ wait_dne_interconnect
+
+ for i in $(seq $MDSCOUNT); do
+ soc=$(do_facet mds$i "$LCTL get_param -n \
+ mdt.*MDT000$((i - 1)).sync_lock_cancel")
+ [ $soc == "blocking" ] || error "SoC not enabled on DNE"
+ done
+
+ for i in $(seq 2 $MDSCOUNT); do
+ stop_mdt $i || error "stop mdt$i fail"
+ done
+ soc=$(do_facet mds1 "$LCTL get_param -n \
+ mdt.*MDT0000.sync_lock_cancel")
+ [ $soc == "never" ] || error "SoC enabled on single MDS"
+
+ cleanup || error "cleanup failed with $?"
+}
+run_test 70e "Sync-on-Cancel will be enabled by default on DNE"
+
test_71a() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
if combined_mgs_mds; then
for num in $(seq $MDSCOUNT); do
add mds${num} $(mkfs_opts mds$num $(mdsdevname $num)) \
- --reformat $(mdsdevname $num) $(mdsvdevname $num) ||
- error "add mds $num failed"
+ --reformat $(mdsdevname $num) $(mdsvdevname $num) ||
+ error "add mds $num failed"
do_facet mds${num} "$TUNE2FS -O extents $(mdsdevname $num)" ||
error "$TUNE2FS failed on mds${num}"
done
run_test 72 "test fast symlink with extents flag enabled"
test_73() { #LU-3006
- load_modules
[ $(facet_fstype ost1) == zfs ] && import_zpool ost1
do_facet ost1 "$TUNEFS --failnode=1.2.3.4@$NETTYPE $(ostdevname 1)" ||
error "1st tunefs failed"
local i
local index
local ost_indices
+ local LOV_V1_INSANE_STRIPE_COUNT=65532
for i in $(seq $OSTCOUNT); do
- index=$((RANDOM * 2))
+ index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT))
ost_indices+=" $index"
done
ost_indices=$(comma_list $ost_indices)
local i
local index
local ost_indices
+ local LOV_V1_INSANE_STRIPE_COUNT=65532
for i in $(seq $OSTCOUNT); do
- index=$((RANDOM * 2))
+ index=$(((RANDOM * 2) % LOV_V1_INSANE_STRIPE_COUNT))
ost_indices+=" $index"
done
ost_indices=$(comma_list $ost_indices)
run_test 83 "ENOSPACE on OST doesn't cause message VFS: \
Busy inodes after unmount ..."
-recovery_time_min() {
- local CONNECTION_SWITCH_MIN=5
- local CONNECTION_SWITCH_INC=5
- local CONNECTION_SWITCH_MAX
- local RECONNECT_DELAY_MAX
- local INITIAL_CONNECT_TIMEOUT
- local max
- local TO_20
-
- #CONNECTION_SWITCH_MAX=min(50, max($CONNECTION_SWITCH_MIN,$TIMEOUT)
- (($CONNECTION_SWITCH_MIN>$TIMEOUT)) && \
- max=$CONNECTION_SWITCH_MIN || max=$TIMEOUT
- (($max<50)) && CONNECTION_SWITCH_MAX=$max || CONNECTION_SWITCH_MAX=50
-
- #INITIAL_CONNECT_TIMEOUT = max(CONNECTION_SWITCH_MIN, \
- #obd_timeout/20)
- TO_20=$(($TIMEOUT/20))
- (($CONNECTION_SWITCH_MIN>$TO_20)) && \
- INITIAL_CONNECT_TIMEOUT=$CONNECTION_SWITCH_MIN || \
- INITIAL_CONNECT_TIMEOUT=$TO_20
-
- RECONNECT_DELAY_MAX=$(($CONNECTION_SWITCH_MAX+$CONNECTION_SWITCH_INC+ \
- $INITIAL_CONNECT_TIMEOUT))
- echo $((2*$RECONNECT_DELAY_MAX))
-}
-
test_84() {
local facet=$SINGLEMDS
local num=$(echo $facet | tr -d "mds")
local correct_clients
local wrap_up=5
- load_modules
echo "start mds service on $(facet_active_host $facet)"
start_mds \
"-o recovery_time_hard=$time_min,recovery_time_soft=$time_min" $@ ||
local nid
local found
- load_modules
-
[[ $(lustre_version_code ost1) -ge $(version_code 2.7.63) ]] ||
{ skip "Need OST version at least 2.7.63" && return 0; }
[[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.7.63) ]] ||
}
run_test 91 "evict-by-nid support"
+generate_ldev_conf() {
+ # generate an ldev.conf file
+ local ldevconfpath=$1
+ touch $ldevconfpath
+ printf "%s\t-\t%s-MGS0000\t%s\n" \
+ $mgs_HOST \
+ $FSNAME \
+ $(mgsdevname) >> $ldevconfpath
+
+ local mdsfo_host=$mdsfailover_HOST;
+ if [ -z "$mdsfo_host" ]; then
+ mdsfo_host="-"
+ fi
+
+ for num in $(seq $MDSCOUNT); do
+ printf "%s\t%s\t%s-MDT%04d\t%s\n" \
+ $mds_HOST \
+ $mdsfo_host \
+ $FSNAME \
+ $num \
+ $(mdsdevname $num) >> $ldevconfpath
+ done
+
+ local ostfo_host=$ostfailover_HOST;
+ if [ -z "$ostfo_host" ]; then
+ ostfo_host="-"
+ fi
+
+ for num in $(seq $OSTCOUNT); do
+ printf "%s\t%s\t%s-OST%04d\t%s\n" \
+ $ost_HOST \
+ $ostfo_host \
+ $FSNAME \
+ $num \
+ $(ostdevname $num) >> $ldevconfpath
+ done
+}
+
+generate_nids() {
+ # generate a nids file (mapping between hostname to nid)
+ # looks like we only have the MGS nid available to us
+ # so just echo that to a file
+ local nidspath=$1
+ touch $nidspath
+ echo -e "${mgs_HOST}\t${MGSNID}" >> $nidspath
+}
+
+test_92() {
+ local LDEVCONFPATH=$TMP/ldev.conf
+ local NIDSPATH=$TMP/nids
+
+ echo "Host is $(hostname)"
+
+ generate_ldev_conf $LDEVCONFPATH
+ generate_nids $NIDSPATH
+
+ echo "----- ldev.conf -----"
+ cat $LDEVCONFPATH
+ echo "--- END ldev.conf ---"
+
+ echo "----- /etc/nids -----"
+ cat $NIDSPATH
+ echo "--- END /etc/nids ---"
+
+ # ldev can be in our build tree and if we aren't in a
+ # build tree, use 'which' to try and find it
+ local LDEV=$LUSTRE/scripts/ldev
+ [ ! -f "$LDEV" ] && local LDEV=$(which ldev 2> /dev/null)
+
+ echo "ldev path is $LDEV"
+
+ if [ ! -f "$LDEV" ]; then
+ rm $LDEVCONFPATH $NIDSPATH
+ error "failed to find ldev!"
+ fi
+
+ # echo the mgs nid and compare it to environment variable MGSNID
+ # also, ldev.conf and nids is a server side thing, use the OSS
+ # hostname
+ local output
+ output=$(perl $LDEV -c $LDEVCONFPATH -H \
+ $ost_HOST -n $NIDSPATH echo %m)
+
+ echo "-- START OF LDEV OUTPUT --"
+ echo -e "$output"
+ echo "--- END OF LDEV OUTPUT ---"
+
+ # ldev failed, error
+ if [ $? -ne 0 ]; then
+ rm $LDEVCONFPATH $NIDSPATH
+ error "ldev failed to execute!"
+ fi
+
+ # need to process multiple lines because of combined MGS and MDS
+ echo -e $output | awk '{ print $2 }' | while read -r line ; do
+ if [ "$line" != "$MGSNID" ]; then
+ rm $LDEVCONFPATH $NIDSPATH
+ error "ldev failed mgs nid '$line', expected '$MGSNID'"
+ fi
+ done
+
+ rm $LDEVCONFPATH $NIDSPATH
+}
+run_test 92 "ldev returns MGS NID correctly in command substitution"
+
if ! combined_mgs_mds ; then
stop mgs
fi