1 # 2 # Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 # 5 # This code is free software; you can redistribute it and/or modify it 6 # under the terms of the GNU General Public License version 2 only, as 7 # published by the Free Software Foundation. 8 # 9 # This code is distributed in the hope that it will be useful, but WITHOUT 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 # version 2 for more details (a copy is included in the LICENSE file that 13 # accompanied this code). 14 # 15 # You should have received a copy of the GNU General Public License version 16 # 2 along with this work; if not, write to the Free Software Foundation, 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 # 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 # or visit www.oracle.com if you need additional information or have any 21 # questions. 22 # 23 24 #!/bin/ksh 25 # 26 # Script to build and launch the RMI reliability suite. 27 # This script is used to run the reliability test for a 28 # certain number of hours. This script is NOT used when 29 # running the juicer and benchmark tests as part of the 30 # jtreg regression suite. 31 32 JAVA_HOME=$1 33 WORK_DIR=$2 34 RES_DIR=$3 35 SHELLTOUSE=$4 36 SUITE_DIR=$5 37 NHOURS=$6 38 shift 6 39 VMOPTS=$* 40 41 ###You need not export these variables if your reliability run is from this shell itself###### 42 ###If you are launching another shell then you need to export these variables.####### 43 44 if [ "${WORK_DIR}" = "" ] ; then 45 WORK_DIR=`pwd` 46 fi 47 if [ "${RES_DIR}" = "" ] ; then 48 RES_DIR=`pwd`/results 49 fi 50 if [ "${SHELLTOUSE}" = "" ] ; then 51 SHELLTOUSE=ksh 52 fi 53 if [ "${JAVA_HOME}" = "" ] ; then 54 WHENCEJAVA=`whence java` 55 JAVABIN=`dirname ${WHENCEJAVA}` 56 JAVA_HOME=`dirname ${JAVABIN}` 57 fi 58 if [ "${SUITE_DIR}" = "" ] ; then 59 SUITE_DIR=`pwd` 60 fi 61 if [ "${VMOPTS}" = "" ] ; then 62 VMOPTS=-server -showversion 63 fi 64 if [ "${NHOURS}" = "" ] ; then 65 NHOURS=1 66 fi 67 68 export JAVA_HOME 69 export WORK_DIR 70 export RES_DIR 71 export SHELLTOUSE 72 export SUITE_DIR 73 export NHOURS 74 export VMOPTS 75 76 echo "######### launch_reliability script ##########" 77 echo "JAVA_HOME : $JAVA_HOME " 78 echo "WORK_DIR : $WORK_DIR " 79 echo "RES_DIR : $RES_DIR " 80 echo "SHELLTOUSE : $SHELLTOUSE " 81 echo "SUITE_DIR : $SUITE_DIR " 82 echo "NHOURS : $NHOURS " 83 echo "VMOPTS : $VMOPTS " 84 85 86 # set platform-dependent variables 87 if [ `uname` = "Linux" ] ; then 88 PATH_SEP=":" 89 else 90 PATH_SEP=";" 91 fi 92 93 export PATH_SEP 94 mainpid=$$ 95 96 mkdir -p ${RES_DIR} 97 98 rm -rf ${WORK_DIR}/rmibench_scratch 99 rm -rf ${WORK_DIR}/serialbench_scratch 100 rm -rf ${WORK_DIR}/juicer_scratch 101 mkdir -p ${WORK_DIR}/rmibench_scratch 102 mkdir -p ${WORK_DIR}/serialbench_scratch 103 mkdir -p ${WORK_DIR}/juicer_scratch 104 105 echo "" 106 echo " Starting RMI bench test " 107 $SHELLTOUSE ${SUITE_DIR}/scripts/run_rmibench.ksh ${WORK_DIR}/rmibench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 108 pid1=$! 109 110 sleep 30 111 echo "" 112 echo " Starting Serialization bench test " 113 $SHELLTOUSE ${SUITE_DIR}/scripts/run_serialbench.ksh ${WORK_DIR}/serialbench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 114 pid2=$! 115 116 sleep 30 117 echo "" 118 echo " Starting RMI juicer test " 119 $SHELLTOUSE ${SUITE_DIR}/scripts/run_juicer.ksh ${WORK_DIR}/juicer_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 120 pid3=$! 121 122 sleep 30 123 echo "" 124 echo " Waiting for jobs to complete" 125 126 wait $pid1 $pid2 $pid3 127 128 echo "" 129 echo " Done RMI reliability testing " 130 131 rm -rf ${WORK_DIR}/rmibench_scratch 132 rm -rf ${WORK_DIR}/serialbench_scratch 133 rm -rf ${WORK_DIR}/juicer_scratch 134 135 kill -9 $mainpid 136