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` = "SunOS" ] ; then
  88         PATH_SEP=":"
  89 
  90 elif [ `uname` = "Linux" ] ; then
  91         PATH_SEP=":"
  92 else
  93         PATH_SEP=";"
  94 fi
  95 
  96 export PATH_SEP
  97 mainpid=$$
  98 
  99 mkdir -p ${RES_DIR}
 100 
 101 rm -rf ${WORK_DIR}/rmibench_scratch
 102 rm -rf ${WORK_DIR}/serialbench_scratch
 103 rm -rf ${WORK_DIR}/juicer_scratch
 104 mkdir -p ${WORK_DIR}/rmibench_scratch
 105 mkdir -p ${WORK_DIR}/serialbench_scratch
 106 mkdir -p ${WORK_DIR}/juicer_scratch
 107 
 108 echo ""
 109 echo "     Starting RMI bench test "
 110 $SHELLTOUSE ${SUITE_DIR}/scripts/run_rmibench.ksh ${WORK_DIR}/rmibench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
 111 pid1=$!
 112 
 113 sleep 30
 114 echo ""
 115 echo "     Starting Serialization bench test "
 116 $SHELLTOUSE ${SUITE_DIR}/scripts/run_serialbench.ksh ${WORK_DIR}/serialbench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
 117 pid2=$!
 118 
 119 sleep 30
 120 echo ""
 121 echo "     Starting RMI juicer test "
 122 $SHELLTOUSE ${SUITE_DIR}/scripts/run_juicer.ksh ${WORK_DIR}/juicer_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
 123 pid3=$!
 124 
 125 sleep 30
 126 echo ""
 127 echo "     Waiting for jobs to complete"
 128 
 129 wait $pid1 $pid2 $pid3
 130 
 131 echo ""
 132 echo "     Done RMI reliability testing "
 133 
 134 rm -rf ${WORK_DIR}/rmibench_scratch
 135 rm -rf ${WORK_DIR}/serialbench_scratch
 136 rm -rf ${WORK_DIR}/juicer_scratch
 137 
 138 kill -9 $mainpid 
 139