1 #
2 # Copyright (c) 2005, 2015, 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 #
44
45 if [ ! -z "${TESTJAVA}" ] ; then
46 jdk="$TESTJAVA"
47 else
48 echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
49 exit 1
50 fi
51
52 runOne()
53 {
54 echo "$TESTJAVA/bin/java -classpath $TESTCLASSES $@"
55 $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@
56 }
57
58 # Retry 5 times to be more resilent to system load fluctation.
59 MAX=5
60 i=1
61 while true; do
62 echo "Run $i: TestSystemLoadAvg"
63 case `uname -s` in
64 SunOS | Linux | Darwin | AIX )
65 runOne GetSystemLoadAverage
66 ;;
67 * )
68 # On Windows -1.0 should be returned
69 runOne GetSystemLoadAverage "-1.0"
70 ;;
71 esac
72 if [ $? -eq 0 ]; then
73 # exit if the test passes
74 echo "Run $i: TestSystemLoadAvg test passed"
75 exit 0
76 elif [ $i -eq $MAX ] ; then
77 echo "TEST FAILED: TestSystemLoadAvg test failed $i runs"
78 exit 1
79 fi
80 i=`expr $i + 1`
81 # sleep for 5 seconds
82 sleep 5
83 done
|
1 #
2 # Copyright (c) 2005, 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 #
44
45 if [ ! -z "${TESTJAVA}" ] ; then
46 jdk="$TESTJAVA"
47 else
48 echo "--Error: TESTJAVA must be defined as the pathname of a jdk to test."
49 exit 1
50 fi
51
52 runOne()
53 {
54 echo "$TESTJAVA/bin/java -classpath $TESTCLASSES $@"
55 $TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@
56 }
57
58 # Retry 5 times to be more resilent to system load fluctation.
59 MAX=5
60 i=1
61 while true; do
62 echo "Run $i: TestSystemLoadAvg"
63 case `uname -s` in
64 Linux | Darwin | AIX )
65 runOne GetSystemLoadAverage
66 ;;
67 * )
68 # On Windows -1.0 should be returned
69 runOne GetSystemLoadAverage "-1.0"
70 ;;
71 esac
72 if [ $? -eq 0 ]; then
73 # exit if the test passes
74 echo "Run $i: TestSystemLoadAvg test passed"
75 exit 0
76 elif [ $i -eq $MAX ] ; then
77 echo "TEST FAILED: TestSystemLoadAvg test failed $i runs"
78 exit 1
79 fi
80 i=`expr $i + 1`
81 # sleep for 5 seconds
82 sleep 5
83 done
|