author | alexsch |
Thu, 31 Jul 2014 14:28:10 +0400 | |
changeset 26019 | 10a56d28f48d |
parent 21646 | 38f9ba0664de |
permissions | -rw-r--r-- |
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
1 |
#!/bin/sh -x |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
2 |
|
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
3 |
# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
4 |
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
5 |
# |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
6 |
# This code is free software; you can redistribute it and/or modify it |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
7 |
# under the terms of the GNU General Public License version 2 only, as |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
8 |
# published by the Free Software Foundation. |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
9 |
# |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
10 |
# This code is distributed in the hope that it will be useful, but WITHOUT |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
11 |
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
12 |
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
13 |
# version 2 for more details (a copy is included in the LICENSE file that |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
14 |
# accompanied this code). |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
15 |
# |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
16 |
# You should have received a copy of the GNU General Public License version |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
17 |
# 2 along with this work; if not, write to the Free Software Foundation, |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
18 |
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
19 |
# |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
20 |
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
21 |
# or visit www.oracle.com if you need additional information or have any |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
22 |
# questions. |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
23 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
24 |
# @test |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
25 |
# @bug 7169888 |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
26 |
# @compile -XDignore.symbol.file JdpUnitTest.java JdpClient.java JdpDoSomething.java |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
27 |
# @run shell JdpTest.sh --jtreg --no-compile |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
28 |
# @summary No word Failed expected in the test output |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
29 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
30 |
_verbose=no |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
31 |
_jtreg=no |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
32 |
_compile=yes |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
33 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
34 |
# temporary disable jcmd related tests |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
35 |
# _testsuite="01,02,03,04,05" |
21646 | 36 |
_testsuite="01" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
37 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
38 |
_pwd=`pwd` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
39 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
40 |
_testclasses=".classes" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
41 |
_testsrc="${_pwd}" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
42 |
_lockFileName="JdpDoSomething.lck" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
43 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
44 |
_logname=".classes/output.txt" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
45 |
_last_pid="" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
46 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
47 |
_ip="224.0.23.178" |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
48 |
_port="7095" |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
49 |
_jmxport="4545" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
50 |
|
15657
c588664d547e
8007786: JDK-8002048 testcase doesn't work on Solaris
dsamersoff
parents:
15642
diff
changeset
|
51 |
_do_compile(){ |
15642
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
52 |
# If the test run without JTReg, we have to compile it by our self |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
53 |
# Under JTReg see @compile statement above |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
54 |
# sun.* packages is not included to symbol file lib/ct.sym so we have |
15642
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
55 |
# to ignore it |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
56 |
|
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
57 |
if [ ! -d ${_testclasses} ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
58 |
then |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
59 |
mkdir -p ${_testclasses} |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
60 |
fi |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
61 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
62 |
rm -f ${_testclasses}/*.class |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
63 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
64 |
# Compile testcase |
15642
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
65 |
${COMPILEJAVA}/bin/javac -XDignore.symbol.file -d ${_testclasses} \ |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
66 |
JdpUnitTest.java \ |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
67 |
JdpDoSomething.java \ |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
68 |
JdpClient.java |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
69 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
70 |
|
15657
c588664d547e
8007786: JDK-8002048 testcase doesn't work on Solaris
dsamersoff
parents:
15642
diff
changeset
|
71 |
if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
72 |
then |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
73 |
echo "ERROR: Can't compile" |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
74 |
exit 255 |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
75 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
76 |
} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
77 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
78 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
79 |
_app_start(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
80 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
81 |
testappname=$1 |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
82 |
shift |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
83 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
84 |
${TESTJAVA}/bin/java -server $* -cp ${_testclasses} ${testappname} >> ${_logname} 2>&1 & |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
85 |
_last_pid=$! |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
86 |
|
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
87 |
# wait until VM is actually starts. |
20509
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
88 |
# please note, if vm doesn't start for some reason |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
89 |
# jtreg kills the test by timeout. Don't file a bug. |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
90 |
cnt=1 |
20509
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
91 |
while true |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
92 |
do |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
93 |
npid=`_get_pid` |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
94 |
if [ "${npid}" != "" ] |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
95 |
then |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
96 |
break |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
97 |
fi |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
98 |
if [ "${cnt}" = "10" ] |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
99 |
then |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
100 |
echo "ERROR: Test app not started. Please check machine resources before filing a bug." |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
101 |
if [ "${_jtreg}" = "yes" ] |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
102 |
then |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
103 |
exit 255 |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
104 |
fi |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
105 |
break |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
106 |
fi |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
107 |
cnt=`expr $cnt + 1` |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
108 |
sleep 1 |
9f5b0fa647cd
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents:
17721
diff
changeset
|
109 |
done |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
110 |
} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
111 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
112 |
_get_pid(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
113 |
${TESTJAVA}/bin/jps | sed -n "/Jdp/s/ .*//p" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
114 |
} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
115 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
116 |
_app_stop(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
117 |
rm ${_lockFileName} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
118 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
119 |
# wait until VM is actually shuts down |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
120 |
while true |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
121 |
do |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
122 |
npid=`_get_pid` |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
123 |
if [ "${npid}" = "" ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
124 |
then |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
125 |
break |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
126 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
127 |
sleep 1 |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
128 |
done |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
129 |
} |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
130 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
131 |
_testme(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
132 |
${TESTJAVA}/bin/java \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
133 |
-cp ${_testclasses} \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
134 |
$* \ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
135 |
-Dcom.sun.management.jdp.port=${_port} \ |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
136 |
-Dcom.sun.management.jdp.address=${_ip} \ |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
137 |
JdpClient |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
138 |
} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
139 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
140 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
141 |
_jcmd(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
142 |
${TESTJAVA}/bin/jcmd JdpDoSomething $* > /dev/null 2>/dev/null |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
143 |
} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
144 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
145 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
146 |
_echo(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
147 |
echo "$*" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
148 |
echo "$*" >> ${_logname} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
149 |
} |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
150 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
151 |
# ============= TESTS ====================================== |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
152 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
153 |
test_01(){ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
154 |
|
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
155 |
_echo "**** Test one ****" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
156 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
157 |
_app_start JdpUnitTest \ |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
158 |
-Dcom.sun.management.jdp.port=${_port} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
159 |
-Dcom.sun.management.jdp.address=${_ip} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
160 |
-Dcom.sun.management.jdp.name=testme \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
161 |
-Djava.rmi.server.hostname=localhost \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
162 |
-Dcom.sun.management.jdp.pause=5 |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
163 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
164 |
res=`_testme` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
165 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
166 |
case "${res}" in |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
167 |
OK*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
168 |
_echo "Passed" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
169 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
170 |
*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
171 |
_echo "Failed!" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
172 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
173 |
esac |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
174 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
175 |
_app_stop |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
176 |
} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
177 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
178 |
test_02(){ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
179 |
|
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
180 |
_echo "**** Test two ****" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
181 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
182 |
_app_start JdpDoSomething \ |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
183 |
-Dcom.sun.management.jdp.port=${_port} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
184 |
-Dcom.sun.management.jdp.address=${_ip} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
185 |
-Dcom.sun.management.jdp.pause=5 \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
186 |
-Dcom.sun.management.jdp.name=testme \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
187 |
-Djava.rmi.server.hostname=localhost \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
188 |
-Dcom.sun.management.jmxremote.port=${_jmxport} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
189 |
-Dcom.sun.management.jmxremote.authenticate=false \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
190 |
-Dcom.sun.management.jmxremote.ssl=false |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
191 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
192 |
res=`_testme` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
193 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
194 |
case "${res}" in |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
195 |
OK*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
196 |
_echo "Passed" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
197 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
198 |
*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
199 |
_echo "Failed!" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
200 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
201 |
esac |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
202 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
203 |
_app_stop |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
204 |
} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
205 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
206 |
test_03(){ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
207 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
208 |
_echo "**** Test three ****" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
209 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
210 |
_app_start JdpDoSomething |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
211 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
212 |
_jcmd ManagementAgent.start\ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
213 |
jdp.port=${_port} \ |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
214 |
jdp.address=${_ip} \ |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
215 |
jdp.pause=5 \ |
21298
d8a11a962ee3
8024071: In ManagementAgent.start it should be possible to set the jdp.name parameter.
dsamersoff
parents:
21295
diff
changeset
|
216 |
jdp.name=jcmdtest \ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
217 |
jmxremote.port=${_jmxport} \ |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
218 |
jmxremote.authenticate=false \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
219 |
jmxremote.ssl=false |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
220 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
221 |
res=`_testme` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
222 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
223 |
case "${res}" in |
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
224 |
OK*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
225 |
_echo "Passed" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
226 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
227 |
*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
228 |
_echo "Failed!" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
229 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
230 |
esac |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
231 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
232 |
_app_stop |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
233 |
} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
234 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
235 |
test_04(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
236 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
237 |
_echo "**** Test four ****" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
238 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
239 |
_app_start JdpDoSomething \ |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
240 |
-Dcom.sun.management.jmxremote.autodiscovery=true \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
241 |
-Dcom.sun.management.jdp.name=testme \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
242 |
-Djava.rmi.server.hostname=localhost \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
243 |
-Dcom.sun.management.jmxremote.port=${_jmxport} \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
244 |
-Dcom.sun.management.jmxremote.authenticate=false \ |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
245 |
-Dcom.sun.management.jmxremote.ssl=false |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
246 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
247 |
res=`_testme` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
248 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
249 |
case "${res}" in |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
250 |
OK*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
251 |
_echo "Passed" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
252 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
253 |
*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
254 |
_echo "Failed!" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
255 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
256 |
esac |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
257 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
258 |
_app_stop |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
259 |
} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
260 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
261 |
test_05(){ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
262 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
263 |
_echo "**** Test five ****" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
264 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
265 |
_app_start JdpDoSomething |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
266 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
267 |
_jcmd ManagementAgent.start\ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
268 |
jmxremote.autodiscovery=true \ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
269 |
jmxremote.port=${_jmxport} \ |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
270 |
jmxremote.authenticate=false \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
271 |
jmxremote.ssl=false |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
272 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
273 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
274 |
res=`_testme` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
275 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
276 |
case "${res}" in |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
277 |
OK*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
278 |
_echo "Passed" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
279 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
280 |
*) |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
281 |
_echo "Failed!" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
282 |
;; |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
283 |
esac |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
284 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
285 |
_app_stop |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
286 |
} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
287 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
288 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
289 |
# ============= MAIN ======================================= |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
290 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
291 |
if [ "x${TESTJAVA}" = "x" ] |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
292 |
then |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
293 |
echo "TESTJAVA env have to be set" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
294 |
exit |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
295 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
296 |
|
15642
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
297 |
# COMPILEJAVA variable is set when we test jre |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
298 |
if [ "x${COMPILEJAVA}" = "x" ] |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
299 |
then |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
300 |
COMPILEJAVA="${TESTJAVA}" |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
301 |
fi |
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
302 |
|
5d93957f4749
8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents:
15531
diff
changeset
|
303 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
304 |
#------------------------------------------------------------------------------ |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
305 |
# reading parameters |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
306 |
|
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
307 |
for parm in "$@" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
308 |
do |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
309 |
case $parm in |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
310 |
--verbose) _verbose=yes ;; |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
311 |
--jtreg) _jtreg=yes ;; |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
312 |
--no-compile) _compile=no ;; |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
313 |
--testsuite=*) _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"` ;; |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
314 |
*) |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
315 |
echo "Undefined parameter $parm. Try --help for help" |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
316 |
exit |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
317 |
;; |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
318 |
esac |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
319 |
done |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
320 |
|
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
321 |
if [ "${_compile}" = "yes" ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
322 |
then |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
323 |
_do_compile |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
324 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
325 |
|
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
326 |
if [ "${_jtreg}" = "yes" ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
327 |
then |
21295
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
328 |
_testclasses=${TESTCLASSES} |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
329 |
_testsrc=${TESTSRC} |
5c73446feb1f
8004213: JDP packet needs pid, broadcast interval and rmi server hostname fields
dsamersoff
parents:
20509
diff
changeset
|
330 |
_logname="output.txt" |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
331 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
332 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
333 |
# Make sure _tesclasses is absolute path |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
334 |
tt=`echo ${_testclasses} | sed -e 's,/,,'` |
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
335 |
if [ "${tt}" = "${_testclasses}" ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
336 |
then |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
337 |
_testclasses="${_pwd}/${_testclasses}" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
338 |
fi |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
339 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
340 |
_policyname="${_testclasses}/policy" |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
341 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
342 |
rm -f ${_logname} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
343 |
rm -f ${_policyname} |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
344 |
|
15663
aab03a20f48f
8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents:
15657
diff
changeset
|
345 |
if [ -f ${_testsrc}/policy.tpl ] |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
346 |
then |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
347 |
|
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
348 |
cat ${_testsrc}/policy.tpl | \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
349 |
sed -e "s,@_TESTCLASSES@,${_testclasses},g" -e "s,@TESTJAVA@,${TESTJAVA},g" \ |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
350 |
> ${_policyname} |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
351 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
352 |
fi |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
353 |
|
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
354 |
# Local mode tests |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
355 |
for i in `echo ${_testsuite} | sed -e "s/,/ /g"` |
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
356 |
do |
17721
1d6516794d05
8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents:
16748
diff
changeset
|
357 |
test_${i} |
15531
071efc9f31ad
8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff
changeset
|
358 |
done |