author | ksrini |
Wed, 10 May 2017 15:12:43 -0700 | |
changeset 45062 | 37ed4313c8c1 |
parent 42338 | a60f280f803c |
permissions | -rw-r--r-- |
2 | 1 |
#!/bin/sh |
2 |
||
3 |
# |
|
20201
50cc2d25a60b
8020552: [launcher] changes to support removal of Solaris 32-bit distribution
ksrini
parents:
5506
diff
changeset
|
4 |
# Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
2 | 5 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6 |
# |
|
7 |
# This code is free software; you can redistribute it and/or modify it |
|
8 |
# under the terms of the GNU General Public License version 2 only, as |
|
9 |
# published by the Free Software Foundation. |
|
10 |
# |
|
11 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
# version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
# accompanied this code). |
|
16 |
# |
|
17 |
# You should have received a copy of the GNU General Public License version |
|
18 |
# 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
# |
|
5506 | 21 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
# or visit www.oracle.com if you need additional information or have any |
|
23 |
# questions. |
|
2 | 24 |
# |
25 |
||
26 |
# @test |
|
29528
d1a052f7ccef
8075565: Define @intermittent jtreg keyword and mark intermittently failing jdk tests
darcy
parents:
22965
diff
changeset
|
27 |
# @bug 4673940 4930794 |
2 | 28 |
# @summary Unit tests for inetd feature |
29 |
# |
|
30 |
# @build StateTest StateTestService EchoTest EchoService CloseTest Launcher Util |
|
31 |
# @run shell run_tests.sh |
|
29528
d1a052f7ccef
8075565: Define @intermittent jtreg keyword and mark intermittently failing jdk tests
darcy
parents:
22965
diff
changeset
|
32 |
# @key intermittent |
2 | 33 |
|
34 |
os=`uname -s` |
|
35 |
||
36 |
if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then |
|
37 |
echo "Test not designed to run on this operating system, skipping..." |
|
38 |
exit 0 |
|
39 |
fi |
|
40 |
||
41 |
# if TESTJAVA isn't set then we assume an interactive run. So that it's |
|
42 |
# clear which version of 'java' is running we do a 'which java' and |
|
43 |
# a 'java -version'. |
|
44 |
||
45 |
if [ -z "$TESTJAVA" ]; then |
|
46 |
TESTSRC=`pwd` |
|
47 |
TESTCLASSES=`pwd` |
|
48 |
JAVA=java |
|
49 |
which $JAVA |
|
50 |
${JAVA} -version |
|
51 |
else |
|
52 |
JAVA="${TESTJAVA}/bin/java" |
|
53 |
fi |
|
54 |
||
55 |
CLASSPATH=${TESTCLASSES} |
|
56 |
export CLASSPATH |
|
57 |
||
58 |
||
59 |
# Check that we have libLauncher.so for the right platform. |
|
20201
50cc2d25a60b
8020552: [launcher] changes to support removal of Solaris 32-bit distribution
ksrini
parents:
5506
diff
changeset
|
60 |
# On Solaris we assume 64-bit |
2 | 61 |
|
62 |
DFLAG= |
|
63 |
if [ "$os" = "SunOS" ]; then |
|
64 |
PLATFORM=solaris |
|
65 |
case "`uname -p`" in |
|
66 |
i[3-9]86) |
|
20201
50cc2d25a60b
8020552: [launcher] changes to support removal of Solaris 32-bit distribution
ksrini
parents:
5506
diff
changeset
|
67 |
ARCH=amd64 |
2 | 68 |
;; |
69 |
sparc) |
|
20201
50cc2d25a60b
8020552: [launcher] changes to support removal of Solaris 32-bit distribution
ksrini
parents:
5506
diff
changeset
|
70 |
ARCH=sparcv9 |
2 | 71 |
;; |
72 |
esac |
|
73 |
fi |
|
74 |
||
75 |
if [ "$os" = "Linux" ]; then |
|
76 |
PLATFORM=linux |
|
77 |
ARCH=unknown |
|
78 |
case "`uname -m`" in |
|
79 |
i[3-6]86) |
|
80 |
ARCH=i586 |
|
81 |
;; |
|
82 |
ia64) |
|
83 |
ARCH=ia64 |
|
84 |
;; |
|
85 |
x86_64) |
|
86 |
ARCH=amd64 |
|
87 |
;; |
|
88 |
esac |
|
89 |
fi |
|
90 |
||
91 |
LIBDIR=lib/${PLATFORM}-${ARCH} |
|
92 |
LAUNCHERLIB=${LIBDIR}/libLauncher.so |
|
93 |
echo $LIBDIR |
|
94 |
||
95 |
if [ ! -f "${TESTSRC}/${LAUNCHERLIB}" ]; then |
|
96 |
echo "Cannot find ${LAUNCHERLIB} - library not available for this system" |
|
97 |
exit 0 |
|
98 |
fi |
|
99 |
||
100 |
LD_LIBRARY_PATH=${TESTSRC}/${LIBDIR} |
|
101 |
export LD_LIBRARY_PATH |
|
102 |
||
103 |
failures=0 |
|
104 |
||
105 |
go() { |
|
106 |
echo '' |
|
42338
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
40261
diff
changeset
|
107 |
sh -xc "$JAVA ${TESTVMOPTS} --add-opens java.base/java.io=ALL-UNNAMED \ |
a60f280f803c
8169069: Module system implementation refresh (11/2016)
alanb
parents:
40261
diff
changeset
|
108 |
--add-opens java.base/sun.nio.ch=ALL-UNNAMED $DFLAG \ |
36511 | 109 |
$1 $2 $3 $4 $5 $6 $7 $8" 2>&1 |
2 | 110 |
if [ $? != 0 ]; then failures=`expr $failures + 1`; fi |
111 |
} |
|
112 |
||
113 |
# Run the tests |
|
114 |
||
115 |
go StateTest |
|
116 |
go EchoTest |
|
117 |
go CloseTest |
|
118 |
||
119 |
# Re-run StateTest with a SecurityManager set |
|
120 |
# Note that the system properties are arguments to StateTest and not options. |
|
121 |
# These system properties are passed to the launched service as options: |
|
122 |
# java [-options] class [args...] |
|
123 |
||
124 |
go StateTest -Djava.security.manager -Djava.security.policy=${TESTSRC}/java.policy.pass |
|
125 |
go StateTest -expectFail -Djava.security.manager -Djava.security.policy=${TESTSRC}/java.policy.fail |
|
126 |
||
127 |
||
128 |
# |
|
129 |
# Results |
|
130 |
# |
|
131 |
echo '' |
|
132 |
if [ $failures -gt 0 ]; |
|
133 |
then echo "$failures test(s) failed"; |
|
134 |
else echo "All test(s) passed"; fi |
|
135 |
exit $failures |