| 1 |
#!/bin/bash |
| 2 |
|
| 3 |
# Licensed to the Apache Software Foundation (ASF) under one or more |
| 4 |
# contributor license agreements. See the NOTICE file distributed with |
| 5 |
# this work for additional information regarding copyright ownership. |
| 6 |
# The ASF licenses this file to you under the Apache License, Version 2.0 |
| 7 |
# (the "License"); you may not use this file except in compliance with |
| 8 |
# the License. You may obtain a copy of the License at |
| 9 |
# |
| 10 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 11 |
# |
| 12 |
# Unless required by applicable law or agreed to in writing, software |
| 13 |
# distributed under the License is distributed on an "AS IS" BASIS, |
| 14 |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 |
# See the License for the specific language governing permissions and |
| 16 |
# limitations under the License. |
| 17 |
|
| 18 |
TOOLDIR="${DERBYDIR}/${BRANCH_DIR}/tools/testing/reporting/scripts" |
| 19 |
. ${TOOLDIR}/env |
| 20 |
|
| 21 |
# LOCAL_EXEC="true" # Set to 'true' to execute on THIS host only!; i.e. do not loop over machines in $1. |
| 22 |
LOCAL_EXEC="false" # Set to NOT 'true' to execute on all machines in $1. |
| 23 |
RSH_SSH=ssh # Set to rsh or ssh. |
| 24 |
|
| 25 |
if [ "$1" == "" ] |
| 26 |
then |
| 27 |
echo "Usage: $0 fileListingHostsToRunTests" |
| 28 |
exit |
| 29 |
fi |
| 30 |
|
| 31 |
SANDBOX=`basename ${DERBYDIR}` |
| 32 |
if [ ! -e ${BUILDLOGDIR}/buildOK ] |
| 33 |
then |
| 34 |
echo "Derby was NOT (re)built:" |
| 35 |
echo " ${BUILDLOGDIR}/buildOK does not exist." |
| 36 |
### UNCOMMENT TO SEND MAIL. ${TOOLDIR}/textMail "${SANDBOX} was NOT (re)built" "${MAILTOINT}" "${UPDATELOGDIR}/update.out ${BUILDLOGDIR}/lastBuildInfo" |
| 37 |
exit |
| 38 |
fi |
| 39 |
|
| 40 |
HOSTLISTFILE=$1 |
| 41 |
echo "Execute runAllTests on all hosts listed in ${HOSTLISTFILE}" |
| 42 |
if [ ! -e $HOSTLISTFILE ] |
| 43 |
then |
| 44 |
echo "$HOSTLISTFILE does not exist." |
| 45 |
exit |
| 46 |
fi |
| 47 |
|
| 48 |
if [ "${DERBYDIR}" = "" ] |
| 49 |
then |
| 50 |
echo "DERBYDIR must be defined as it is sent to startDerbyTests" |
| 51 |
exit |
| 52 |
fi |
| 53 |
if [ ! -e ${DERBYDIR} ] |
| 54 |
then |
| 55 |
echo "Nonexisting DERBYDIR: ${DERBYDIR} was given to $0." |
| 56 |
exit |
| 57 |
fi |
| 58 |
|
| 59 |
if [ "${LOCAL_EXEC}" != "true" ] |
| 60 |
then |
| 61 |
HOSTLIST=`grep -v "^#" ${HOSTLISTFILE}` |
| 62 |
for HOST in ${HOSTLIST} |
| 63 |
do |
| 64 |
if [ "${HOST}" == "exit" ] |
| 65 |
then |
| 66 |
echo "Exit: found ${HOST}" |
| 67 |
exit |
| 68 |
fi |
| 69 |
|
| 70 |
echo "Host: ${HOST}" |
| 71 |
echo "${RSH_SSH} ${HOST} \"${TOOLDIR}/startDerbyTests ${DERBYDIR}\"" |
| 72 |
${RSH_SSH} ${HOST} "${TOOLDIR}/startDerbyTests ${DERBYDIR}" |
| 73 |
done |
| 74 |
else |
| 75 |
${TOOLDIR}/startDerbyTests ${DERBYDIR} |
| 76 |
fi |
| 77 |
|
| 78 |
# We can't handle win/cygwin via 'rsh host cmd' so must use a flag which |
| 79 |
# is detected by a looping script on the cygwin host(s): |
| 80 |
# touch ${TESTLOGDIR}/ReadyToStartOnCygWin |
| 81 |
touch ${DERBYDIR}/testing/ReadyToStartOnCygWin |
| 82 |
# To be detected by ${TOOLDIR}/loopToDetectAndStartDerbyTestsOnCygwin |