blob: dd0fb85264477f532b57c8eaa64b5abdc7d05e74 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001#
2# Copyright 2003-2005 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
20# CA 95054 USA or visit www.sun.com if you need additional information or
21# have any 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` = "SunOS" ] ; then
88 PATH_SEP=":"
89
90elif [ `uname` = "Linux" ] ; then
91 PATH_SEP=":"
92else
93 PATH_SEP=";"
94fi
95
96export PATH_SEP
97mainpid=$$
98
99mkdir -p ${RES_DIR}
100
101rm -rf ${WORK_DIR}/rmibench_scratch
102rm -rf ${WORK_DIR}/serialbench_scratch
103rm -rf ${WORK_DIR}/juicer_scratch
104mkdir -p ${WORK_DIR}/rmibench_scratch
105mkdir -p ${WORK_DIR}/serialbench_scratch
106mkdir -p ${WORK_DIR}/juicer_scratch
107
108echo ""
109echo " Starting RMI bench test "
110$SHELLTOUSE ${SUITE_DIR}/scripts/run_rmibench.ksh ${WORK_DIR}/rmibench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
111pid1=$!
112
113sleep 30
114echo ""
115echo " Starting Serialization bench test "
116$SHELLTOUSE ${SUITE_DIR}/scripts/run_serialbench.ksh ${WORK_DIR}/serialbench_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
117pid2=$!
118
119sleep 30
120echo ""
121echo " Starting RMI juicer test "
122$SHELLTOUSE ${SUITE_DIR}/scripts/run_juicer.ksh ${WORK_DIR}/juicer_scratch $RES_DIR $JAVA_HOME $SUITE_DIR $NHOURS $VMOPTS &
123pid3=$!
124
125sleep 30
126echo ""
127echo " Waiting for jobs to complete"
128
129wait $pid1 $pid2 $pid3
130
131echo ""
132echo " Done RMI reliability testing "
133
134rm -rf ${WORK_DIR}/rmibench_scratch
135rm -rf ${WORK_DIR}/serialbench_scratch
136rm -rf ${WORK_DIR}/juicer_scratch
137
138kill -9 $mainpid
139