Skip to content
Snippets Groups Projects
Commit d2e736e8 authored by Elena Gryaznova's avatar Elena Gryaznova
Browse files

re-vert komaln 1.42.10.76.2.2 t-f changes unrelated to 14471

parent c5791bb0
No related branches found
No related tags found
No related merge requests found
...@@ -66,7 +66,6 @@ print_summary () { ...@@ -66,7 +66,6 @@ print_summary () {
init_test_env() { init_test_env() {
export LUSTRE=`absolute_path $LUSTRE` export LUSTRE=`absolute_path $LUSTRE`
export TESTSUITE=`basename $0 .sh` export TESTSUITE=`basename $0 .sh`
export LTESTDIR=${LTESTDIR:-$LUSTRE/../ltest}
[ -d /r ] && export ROOT=${ROOT:-/r} [ -d /r ] && export ROOT=${ROOT:-/r}
export TMP=${TMP:-$ROOT/tmp} export TMP=${TMP:-$ROOT/tmp}
...@@ -119,6 +118,7 @@ init_test_env() { ...@@ -119,6 +118,7 @@ init_test_env() {
ONLY=${ONLY:-$*} ONLY=${ONLY:-$*}
[ "$TESTSUITELOG" ] && rm -f $TESTSUITELOG || true [ "$TESTSUITELOG" ] && rm -f $TESTSUITELOG || true
rm -f $TMP/*active
} }
...@@ -358,14 +358,29 @@ zconf_umount() { ...@@ -358,14 +358,29 @@ zconf_umount() {
} }
zconf_mount_clients() { zconf_mount_clients() {
local OPTIONS
local clients=$1 local clients=$1
local mnt=$2 local mnt=$2
echo "Mounting clients: $clients" # Only supply -o to mount if we have options
local client if [ -n "$MOUNTOPT" ]; then
for client in ${clients//,/ }; do OPTIONS="-o $MOUNTOPT"
zconf_mount $client $mnt || true fi
done local device=$MGSNID:/$FSNAME
if [ -z "$mnt" -o -z "$FSNAME" ]; then
echo Bad zconf mount command: opt=$OPTIONS dev=$device mnt=$mnt
exit 1
fi
echo "Starting client $clients: $OPTIONS $device $mnt"
do_nodes $clients mkdir -p $mnt
do_nodes $clients mount -t lustre $OPTIONS $device $mnt || return 1
do_nodes $clients "sysctl -w lnet.debug=$PTLDEBUG;
sysctl -w lnet.subsystem_debug=${SUBSYSTEM# };
sysctl -w lnet.debug_mb=${DEBUG_SIZE};"
return 0
} }
zconf_umount_clients() { zconf_umount_clients() {
...@@ -373,11 +388,8 @@ zconf_umount_clients() { ...@@ -373,11 +388,8 @@ zconf_umount_clients() {
local mnt=$2 local mnt=$2
[ "$3" ] && force=-f [ "$3" ] && force=-f
echo "Umounting clients: $clients" echo "Stopping clients: $clients $mnt (opts:$force)"
local client do_nodes $clients umount $force $mnt
for client in ${clients//,/ }; do
zconf_umount $client $mnt $force || true
done
} }
shutdown_facet() { shutdown_facet() {
...@@ -654,8 +666,8 @@ facet_active() { ...@@ -654,8 +666,8 @@ facet_active() {
local facet=$1 local facet=$1
local activevar=${facet}active local activevar=${facet}active
if [ -f ./${facet}active ] ; then if [ -f $TMP/${facet}active ] ; then
source ./${facet}active source $TMP/${facet}active
fi fi
active=${!activevar} active=${!activevar}
...@@ -689,7 +701,7 @@ change_active() { ...@@ -689,7 +701,7 @@ change_active() {
fi fi
# save the active host for this facet # save the active host for this facet
activevar=${facet}active activevar=${facet}active
echo "$activevar=${!activevar}" > ./$activevar echo "$activevar=${!activevar}" > $TMP/$activevar
} }
do_node() { do_node() {
...@@ -721,6 +733,46 @@ do_node() { ...@@ -721,6 +733,46 @@ do_node() {
return ${PIPESTATUS[0]} return ${PIPESTATUS[0]}
} }
do_nodes() {
local nodes=$1
shift
nodes=${nodes//,/ }
# split list to local and remote
local rnodes=$(echo " $nodes " | sed -re "s/\s+$HOSTNAME\s+/ /g")
if [ "$(get_node_count $nodes)" != "$(get_node_count $rnodes)" ]; then
do_node $HOSTNAME $@
fi
[ -z "$(echo $rnodes)" ] && return 0
# This is part from do_node
local myPDSH=$PDSH
rnodes=$(comma_list $rnodes)
[ -z "$myPDSH" -o "$myPDSH" = "no_dsh" ] && \
echo "cannot run remote command on $rnodes with $myPDSH" && return 128
if $VERBOSE; then
echo "CMD: $rnodes $@" >&2
$myPDSH $rnodes $LCTL mark "$@" > /dev/null 2>&1 || :
fi
if [ "$myPDSH" = "rsh" ]; then
# we need this because rsh does not return exit code of an executed command
local command_status="$TMP/cs"
rsh $rnodes ":> $command_status"
rsh $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin;
cd $RPWD; sh -c \"$@\") ||
echo command failed >$command_status"
[ -n "$($myPDSH $rnodes cat $command_status)" ] && return 1 || true
return 0
fi
$myPDSH $rnodes "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; sh -c \"$@\")" | sed -re "s/\w+:\s//g"
return ${PIPESTATUS[0]}
}
do_facet() { do_facet() {
facet=$1 facet=$1
shift shift
...@@ -734,7 +786,7 @@ add() { ...@@ -734,7 +786,7 @@ add() {
shift shift
# make sure its not already running # make sure its not already running
stop ${facet} -f stop ${facet} -f
rm -f ${facet}active rm -f $TMP/${facet}active
do_facet ${facet} $MKFS $* do_facet ${facet} $MKFS $*
} }
...@@ -767,9 +819,14 @@ stopall() { ...@@ -767,9 +819,14 @@ stopall() {
fi fi
[ "$CLIENTONLY" ] && return [ "$CLIENTONLY" ] && return
# The add fn does rm ${facet}active file, this would be enough
# if we use do_facet <facet> only after the facet added, but
# currently we use do_facet mds in local.sh
stop mds -f stop mds -f
rm -f ${TMP}/mdsactive
for num in `seq $OSTCOUNT`; do for num in `seq $OSTCOUNT`; do
stop ost$num -f stop ost$num -f
rm -f $TMP/ost${num}active
done done
return 0 return 0
} }
...@@ -830,10 +887,22 @@ setupall() { ...@@ -830,10 +887,22 @@ setupall() {
|| do_facet mds "$TUNEFS --writeconf $MDSDEV" || do_facet mds "$TUNEFS --writeconf $MDSDEV"
set_obd_timeout mds $TIMEOUT set_obd_timeout mds $TIMEOUT
start mds $MDSDEV $MDS_MOUNT_OPTS start mds $MDSDEV $MDS_MOUNT_OPTS
# We started mds, now we should set failover variable properly.
# Set mdsfailover_HOST if it is not set (the default failnode).
mdsfailover_HOST=$(facet_host mds)
for num in `seq $OSTCOUNT`; do for num in `seq $OSTCOUNT`; do
DEVNAME=`ostdevname $num` DEVNAME=`ostdevname $num`
set_obd_timeout ost$num $TIMEOUT set_obd_timeout ost$num $TIMEOUT
start ost$num $DEVNAME $OST_MOUNT_OPTS start ost$num $DEVNAME $OST_MOUNT_OPTS
# We started ost$num, now we should set ost${num}failover variable properly.
# Set ost${num}failover_HOST if it is not set (the default failnode).
varname=ost${num}failover_HOST
if [ -z "${!varname}" ]; then
eval ost${num}failover_HOST=$(facet_host ost${num})
fi
done done
fi fi
[ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE [ "$DAEMONFILE" ] && $LCTL debug_daemon start $DAEMONFILE $DAEMONSIZE
...@@ -1066,6 +1135,15 @@ cancel_lru_locks() { ...@@ -1066,6 +1135,15 @@ cancel_lru_locks() {
$LCTL mark "cancel_lru_locks $1 stop" $LCTL mark "cancel_lru_locks $1 stop"
} }
set_nodes_failloc () {
local nodes=$1
local node
for node in $nodes ; do
do_node $node sysctl -w lustre.fail_loc=$2
done
}
default_lru_size() default_lru_size()
{ {
NR_CPU=$(grep -c "processor" /proc/cpuinfo) NR_CPU=$(grep -c "processor" /proc/cpuinfo)
...@@ -1154,7 +1232,7 @@ build_test_filter() { ...@@ -1154,7 +1232,7 @@ build_test_filter() {
eval ONLY_${O}=true eval ONLY_${O}=true
done done
[ "$EXCEPT$ALWAYS_EXCEPT" ] && \ [ "$EXCEPT$ALWAYS_EXCEPT" ] && \
log "skipping tests: `echo $EXCEPT $ALWAYS_EXCEPT`" log "excepting tests: `echo $EXCEPT $ALWAYS_EXCEPT`"
[ "$EXCEPT_SLOW" ] && \ [ "$EXCEPT_SLOW" ] && \
log "skipping tests SLOW=no: `echo $EXCEPT_SLOW`" log "skipping tests SLOW=no: `echo $EXCEPT_SLOW`"
for E in $EXCEPT $ALWAYS_EXCEPT; do for E in $EXCEPT $ALWAYS_EXCEPT; do
...@@ -1423,6 +1501,17 @@ is_patchless () ...@@ -1423,6 +1501,17 @@ is_patchless ()
lctl get_param version | grep -q patchless lctl get_param version | grep -q patchless
} }
get_node_count() {
local nodes="$@"
echo $nodes | wc -w || true
}
mixed_ost_devs () {
local nodes=$(osts_nodes)
local osscount=$(get_node_count "$nodes")
[ ! "$OSTCOUNT" = "$osscount" ]
}
check_runas_id_ret() { check_runas_id_ret() {
local myRC=0 local myRC=0
local myRUNAS_ID=$1 local myRUNAS_ID=$1
......
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