author | iignatyev |
Wed, 15 Mar 2017 22:48:59 -0700 | |
changeset 44423 | 306c020eb154 |
parent 30376 | 2ccf2cf7ea48 |
permissions | -rw-r--r-- |
2 | 1 |
# |
30376
2ccf2cf7ea48
8078896: Add @modules as needed to the jdk_svc tests
ykantser
parents:
22602
diff
changeset
|
2 |
# Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. |
2 | 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 |
# |
|
5506 | 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. |
|
2 | 22 |
# |
23 |
||
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
5506
diff
changeset
|
24 |
# |
2 | 25 |
# @test |
44423 | 26 |
# @bug 6336608 6367473 6511738 |
2 | 27 |
# @summary Tests OperatingSystemMXBean.getSystemLoadAverage() api. |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
5506
diff
changeset
|
28 |
# @author Mandy Chung |
2 | 29 |
# |
30 |
# @run build GetSystemLoadAverage |
|
31 |
# @run shell/timeout=300 TestSystemLoadAvg.sh |
|
32 |
# |
|
33 |
||
34 |
# |
|
35 |
# This test tests the system load average on linux and solaris. |
|
36 |
# On windows tests if it returns -1.0 The verification is done |
|
37 |
# by the GetSystemLoadAverage class. By default it takes no |
|
38 |
# input argument which verifies the system load average with |
|
39 |
# /usr/bin/uptime command. Or specify "-1.0" as the input argument |
|
40 |
# indicatiing that the platform doesn't support the system load average. |
|
41 |
||
42 |
#Set appropriate jdk |
|
43 |
# |
|
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 $@" |
|
14786
a9f61e0cbe61
8003890: corelibs test scripts should pass TESTVMOPTS
chegar
parents:
14342
diff
changeset
|
55 |
$TESTJAVA/bin/java ${TESTVMOPTS} -classpath $TESTCLASSES $@ |
2 | 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 |
|
22602
0d9a07b0d7e9
8028537: PPC64: Updated the JDK regression tests to run on AIX
simonis
parents:
14786
diff
changeset
|
64 |
SunOS | Linux | Darwin | AIX ) |
2 | 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` |
|
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
5506
diff
changeset
|
81 |
# sleep for 5 seconds |
2 | 82 |
sleep 5 |
83 |
done |