Skip to content
Snippets Groups Projects
Commit f25c468d authored by Nathan Rutman's avatar Nathan Rutman
Browse files

b=11217

i=scjody
i=brian
modify do_node to work remotely
parent d4288bbc
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ export REFORMAT="" ...@@ -10,6 +10,7 @@ export REFORMAT=""
export VERBOSE=false export VERBOSE=false
export GMNALNID=${GMNALNID:-/usr/sbin/gmlndnid} export GMNALNID=${GMNALNID:-/usr/sbin/gmlndnid}
export CATASTROPHE=${CATASTROPHE:-/proc/sys/lnet/catastrophe} export CATASTROPHE=${CATASTROPHE:-/proc/sys/lnet/catastrophe}
#export PDSH="pdsh -S -Rssh -w"
# eg, assert_env LUSTRE MDSNODES OSTNODES CLIENTS # eg, assert_env LUSTRE MDSNODES OSTNODES CLIENTS
assert_env() { assert_env() {
...@@ -164,10 +165,10 @@ wait_for_lnet() { ...@@ -164,10 +165,10 @@ wait_for_lnet() {
unload_modules() { unload_modules() {
lsmod | grep lnet > /dev/null && $LCTL dl && $LCTL dk $TMP/debug lsmod | grep lnet > /dev/null && $LCTL dl && $LCTL dk $TMP/debug
local MODULES=$($LCTL modules | awk '{ print $2 }') local MODULES=$($LCTL modules | awk '{ print $2 }')
$RMMOD $MODULES >/dev/null 2>&1 || true $RMMOD $MODULES > /dev/null 2>&1 || true
# do it again, in case we tried to unload ksocklnd too early # do it again, in case we tried to unload ksocklnd too early
MODULES=$($LCTL modules | awk '{ print $2 }') MODULES=$($LCTL modules | awk '{ print $2 }')
[ -n "$MODULES" ] && $RMMOD $MODULES >/dev/null || true [ -n "$MODULES" ] && $RMMOD $MODULES > /dev/null 2>&1 || true
MODULES=$($LCTL modules | awk '{ print $2 }') MODULES=$($LCTL modules | awk '{ print $2 }')
if [ -n "$MODULES" ]; then if [ -n "$MODULES" ]; then
echo "Modules still loaded: " echo "Modules still loaded: "
...@@ -178,7 +179,7 @@ unload_modules() { ...@@ -178,7 +179,7 @@ unload_modules() {
lsmod lsmod
return 2 return 2
else else
echo "Lustre stopped, but LNET is still loaded" echo "Lustre stopped but LNET is still loaded, waiting..."
wait_for_lnet || return 3 wait_for_lnet || return 3
fi fi
fi fi
...@@ -213,7 +214,7 @@ start() { ...@@ -213,7 +214,7 @@ start() {
echo Start of ${device} on ${facet} failed ${RC} echo Start of ${device} on ${facet} failed ${RC}
else else
do_facet ${facet} sync do_facet ${facet} sync
label=`do_facet ${facet} "e2label ${device}" | grep -v "CMD: "` label=$(do_facet ${facet} "e2label ${device}")
[ -z "$label" ] && echo no label for ${device} && exit 1 [ -z "$label" ] && echo no label for ${device} && exit 1
eval export ${facet}_svc=${label} eval export ${facet}_svc=${label}
eval export ${facet}_dev=${device} eval export ${facet}_dev=${device}
...@@ -230,7 +231,7 @@ stop() { ...@@ -230,7 +231,7 @@ stop() {
HOST=`facet_active_host $facet` HOST=`facet_active_host $facet`
[ -z $HOST ] && echo stop: no host for $facet && return 0 [ -z $HOST ] && echo stop: no host for $facet && return 0
running=`do_facet ${facet} "grep -c ${MOUNT%/*}/${facet}' ' /proc/mounts" | grep -v "CMD: "` running=$(do_facet ${facet} "grep -c ${MOUNT%/*}/${facet}' ' /proc/mounts") || true
if [ ${running} -ne 0 ]; then if [ ${running} -ne 0 ]; then
echo "Stopping ${MOUNT%/*}/${facet} (opts:$@)" echo "Stopping ${MOUNT%/*}/${facet} (opts:$@)"
do_facet ${facet} umount -d $@ ${MOUNT%/*}/${facet} do_facet ${facet} umount -d $@ ${MOUNT%/*}/${facet}
...@@ -242,7 +243,7 @@ stop() { ...@@ -242,7 +243,7 @@ stop() {
local INTERVAL=1 local INTERVAL=1
# conf-sanity 31 takes a long time cleanup # conf-sanity 31 takes a long time cleanup
while [ $WAIT -lt 300 ]; do while [ $WAIT -lt 300 ]; do
running=$(do_facet ${facet} "[ -e $LPROC ] && grep ST' ' $LPROC/devices" | grep -v "CMD: ") || true running=$(do_facet ${facet} "[ -e $LPROC ] && grep ST' ' $LPROC/devices") || true
if [ -z "${running}" ]; then if [ -z "${running}" ]; then
return 0 return 0
fi fi
...@@ -285,7 +286,7 @@ zconf_umount() { ...@@ -285,7 +286,7 @@ zconf_umount() {
client=$1 client=$1
mnt=$2 mnt=$2
[ "$3" ] && force=-f [ "$3" ] && force=-f
local running=`do_node $client "grep -c $mnt' ' /proc/mounts" | grep -v "CMD: "` local running=$(do_node $client "grep -c $mnt' ' /proc/mounts") || true
if [ $running -ne 0 ]; then if [ $running -ne 0 ]; then
echo "Stopping client $mnt (opts:$force)" echo "Stopping client $mnt (opts:$force)"
do_node $client umount $force $mnt do_node $client umount $force $mnt
...@@ -544,10 +545,11 @@ do_node() { ...@@ -544,10 +545,11 @@ do_node() {
myPDSH="no_dsh" myPDSH="no_dsh"
fi fi
if $VERBOSE; then if $VERBOSE; then
echo "CMD: $HOST $@" echo "CMD: $HOST $@" >&2
$myPDSH $HOST $LCTL mark "$@" > /dev/null 2>&1 || : $myPDSH $HOST $LCTL mark "$@" > /dev/null 2>&1 || :
fi fi
$myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; sh -c \"$@\")" $myPDSH $HOST "(PATH=\$PATH:$RLUSTRE/utils:$RLUSTRE/tests:/sbin:/usr/sbin; cd $RPWD; sh -c \"$@\")" | sed "s/^${HOST}: //"
return ${PIPESTATUS[0]}
} }
do_facet() { do_facet() {
...@@ -793,6 +795,7 @@ error() { ...@@ -793,6 +795,7 @@ error() {
log "${TESTSUITE}: **** FAIL:" $@ log "${TESTSUITE}: **** FAIL:" $@
$LCTL dk $TMP/lustre-log-$TESTNAME.log $LCTL dk $TMP/lustre-log-$TESTNAME.log
log "FAIL: $TESTNAME $@" log "FAIL: $TESTNAME $@"
$LCTL dk $TMP/lustrefail_${TESTSUITE}_${TESTNAME}.$(date +%s)
exit 1 exit 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