1# 2# Copyright (c) 2003, 2020, 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 32JAVA_HOME=$1 33WORK_DIR=$2 34RES_DIR=$3 35SHELLTOUSE=$4 36SUITE_DIR=$5 37NHOURS=$6 38shift 6 39VMOPTS=$* 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 44if [ "${WORK_DIR}" = "" ] ; then 45 WORK_DIR=`pwd` 46fi 47if [ "${RES_DIR}" = "" ] ; then 48 RES_DIR=`pwd`/results 49fi 50if [ "${SHELLTOUSE}" = "" ] ; then 51 SHELLTOUSE=ksh 52fi 53if [ "${JAVA_HOME}" = "" ] ; then 54 WHENCEJAVA=`whence java` 55 JAVABIN=`dirname ${WHENCEJAVA}` 56 JAVA_HOME=`dirname ${JAVABIN}` 57fi 58if [ "${SUITE_DIR}" = "" ] ; then 59 SUITE_DIR=`pwd` 60fi 61if [ "${VMOPTS}" = "" ] ; then 62 VMOPTS=-server -showversion 63fi 64if [ "${NHOURS}" = "" ] ; then 65 NHOURS=1 66fi 67 68export JAVA_HOME 69export WORK_DIR 70export RES_DIR 71export SHELLTOUSE 72export SUITE_DIR 73export NHOURS 74export VMOPTS 75 76echo "######### launch_reliability script ##########" 77echo "JAVA_HOME : $JAVA_HOME " 78echo "WORK_DIR : $WORK_DIR " 79echo "RES_DIR : $RES_DIR " 80echo "SHELLTOUSE : $SHELLTOUSE " 81echo "SUITE_DIR : $SUITE_DIR " 82echo "NHOURS : $NHOURS " 83echo "VMOPTS : $VMOPTS " 84 85 86# set platform-dependent variables 87if [ `uname` = "Linux" ] ; then 88 PATH_SEP=":" 89else 90 PATH_SEP=";" 91fi 92 93export PATH_SEP 94mainpid=$$ 95 96mkdir -p ${RES_DIR} 97 98rm -rf ${WORK_DIR}/rmibench_scratch 99rm -rf ${WORK_DIR}/serialbench_scratch 100rm -rf ${WORK_DIR}/juicer_scratch 101mkdir -p ${WORK_DIR}/rmibench_scratch 102mkdir -p ${WORK_DIR}/serialbench_scratch 103mkdir -p ${WORK_DIR}/juicer_scratch 104 105echo "" 106echo " Starting RMI bench test " 107$SHELLTOUSE ${SUITE_DIR}/scripts/run_rmibench.ksh ${WORK_DIR}/rmibench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 108pid1=$! 109 110sleep 30 111echo "" 112echo " Starting Serialization bench test " 113$SHELLTOUSE ${SUITE_DIR}/scripts/run_serialbench.ksh ${WORK_DIR}/serialbench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 114pid2=$! 115 116sleep 30 117echo "" 118echo " Starting RMI juicer test " 119$SHELLTOUSE ${SUITE_DIR}/scripts/run_juicer.ksh ${WORK_DIR}/juicer_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS & 120pid3=$! 121 122sleep 30 123echo "" 124echo " Waiting for jobs to complete" 125 126wait $pid1 $pid2 $pid3 127 128echo "" 129echo " Done RMI reliability testing " 130 131rm -rf ${WORK_DIR}/rmibench_scratch 132rm -rf ${WORK_DIR}/serialbench_scratch 133rm -rf ${WORK_DIR}/juicer_scratch 134 135kill -9 $mainpid 136 137