提交 2d3972eb 编写于 作者: D dsamersoff

8014420: Default JDP address does not match the one assigned by IANA

Summary: JDP protocol defaults changed to IANA assigned values
Reviewed-by: dholmes, jbachorik, hirt
Contributed-by: fweimer@redhat.com
上级 7a23cad9
...@@ -77,7 +77,7 @@ public class Agent { ...@@ -77,7 +77,7 @@ public class Agent {
private static final String SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME = private static final String SNMP_ADAPTOR_BOOTSTRAP_CLASS_NAME =
"sun.management.snmp.AdaptorBootstrap"; "sun.management.snmp.AdaptorBootstrap";
private static final String JDP_DEFAULT_ADDRESS = "239.255.255.225"; private static final String JDP_DEFAULT_ADDRESS = "224.0.23.178";
private static final int JDP_DEFAULT_PORT = 7095; private static final int JDP_DEFAULT_PORT = 7095;
// The only active agent allowed // The only active agent allowed
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
* *
* - `INSTANCE_NAME` -- The user-provided name of the running instance * - `INSTANCE_NAME` -- The user-provided name of the running instance
* *
* The protocol sends packets to 239.255.255.225:7095 by default. * The protocol sends packets to 224.0.23.178:7095 by default.
* *
* The protocol uses system properties to control it's behaviour: * The protocol uses system properties to control it's behaviour:
* - `com.sun.management.jdp.port` -- override default port * - `com.sun.management.jdp.port` -- override default port
......
...@@ -2,17 +2,17 @@ ...@@ -2,17 +2,17 @@
# Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
# #
# This code is free software; you can redistribute it and/or modify it # This code is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 only, as # under the terms of the GNU General Public License version 2 only, as
# published by the Free Software Foundation. # published by the Free Software Foundation.
# #
# This code is distributed in the hope that it will be useful, but WITHOUT # This code is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# version 2 for more details (a copy is included in the LICENSE file that # version 2 for more details (a copy is included in the LICENSE file that
# accompanied this code). # accompanied this code).
# #
# You should have received a copy of the GNU General Public License version # You should have received a copy of the GNU General Public License version
# 2 along with this work; if not, write to the Free Software Foundation, # 2 along with this work; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
# questions. # questions.
# @test # @test
# @bug 7169888 # @bug 7169888
# @compile -XDignore.symbol.file JdpUnitTest.java JdpClient.java JdpDoSomething.java # @compile -XDignore.symbol.file JdpUnitTest.java JdpClient.java JdpDoSomething.java
# @run shell JdpTest.sh --jtreg --no-compile # @run shell JdpTest.sh --jtreg --no-compile
# @summary No word Failed expected in the test output # @summary No word Failed expected in the test output
...@@ -44,17 +44,20 @@ _lockFileName="JdpDoSomething.lck" ...@@ -44,17 +44,20 @@ _lockFileName="JdpDoSomething.lck"
_logname=".classes/output.txt" _logname=".classes/output.txt"
_last_pid="" _last_pid=""
_ip="224.0.23.178"
_port="7095"
_jmxport="4545"
_do_compile(){ _do_compile(){
# If the test run without JTReg, we have to compile it by our self # If the test run without JTReg, we have to compile it by our self
# Under JTReg see @compile statement above # Under JTReg see @compile statement above
# sun.* packages is not included to symbol file lib/ct.sym so we have # sun.* packages is not included to symbol file lib/ct.sym so we have
# to ignore it # to ignore it
if [ ! -d ${_testclasses} ] if [ ! -d ${_testclasses} ]
then then
mkdir -p ${_testclasses} mkdir -p ${_testclasses}
fi fi
rm -f ${_testclasses}/*.class rm -f ${_testclasses}/*.class
...@@ -64,11 +67,11 @@ _do_compile(){ ...@@ -64,11 +67,11 @@ _do_compile(){
JdpDoSomething.java \ JdpDoSomething.java \
JdpClient.java JdpClient.java
if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ] if [ ! -f ${_testclasses}/JdpDoSomething.class -o ! -f ${_testclasses}/JdpClient.class -o ! -f ${_testclasses}/JdpUnitTest.class ]
then then
echo "ERROR: Can't compile" echo "ERROR: Can't compile"
exit -1 exit 255
fi fi
} }
...@@ -84,10 +87,10 @@ _app_start(){ ...@@ -84,10 +87,10 @@ _app_start(){
npid=`_get_pid` npid=`_get_pid`
if [ "${npid}" = "" ] if [ "${npid}" = "" ]
then then
echo "ERROR: Test app not started" echo "ERROR: Test app not started. Please check machine resources before filing a bug."
if [ "${_jtreg}" = "yes" ] if [ "${_jtreg}" = "yes" ]
then then
exit -1 exit 255
fi fi
fi fi
} }
...@@ -100,53 +103,53 @@ _app_stop(){ ...@@ -100,53 +103,53 @@ _app_stop(){
rm ${_lockFileName} rm ${_lockFileName}
# wait until VM is actually shuts down # wait until VM is actually shuts down
while true while true
do do
npid=`_get_pid` npid=`_get_pid`
if [ "${npid}" = "" ] if [ "${npid}" = "" ]
then then
break break
fi fi
sleep 1 sleep 1
done done
} }
_testme(){ _testme(){
${TESTJAVA}/bin/java \ ${TESTJAVA}/bin/java \
-cp ${_testclasses} \ -cp ${_testclasses} \
$* \ $* \
-Dcom.sun.management.jdp.port=7095 \ -Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=239.255.255.225 \ -Dcom.sun.management.jdp.address=${_ip} \
JdpClient JdpClient
} }
_jcmd(){ _jcmd(){
${TESTJAVA}/bin/jcmd JdpDoSomething $* > /dev/null 2>/dev/null ${TESTJAVA}/bin/jcmd JdpDoSomething $* > /dev/null 2>/dev/null
} }
_echo(){ _echo(){
echo "$*" echo "$*"
echo "$*" >> ${_logname} echo "$*" >> ${_logname}
} }
# ============= TESTS ====================================== # ============= TESTS ======================================
test_01(){ test_01(){
_echo "**** Test one ****" _echo "**** Test one ****"
_app_start JdpUnitTest \ _app_start JdpUnitTest \
-Dcom.sun.management.jdp.port=7095 \ -Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=239.255.255.225 \ -Dcom.sun.management.jdp.address=${_ip} \
-Dcom.sun.management.jdp.pause=5 -Dcom.sun.management.jdp.pause=5
res=`_testme` res=`_testme`
case "${res}" in case "${res}" in
OK*) OK*)
_echo "Passed" _echo "Passed"
;; ;;
*) *)
...@@ -155,24 +158,24 @@ test_01(){ ...@@ -155,24 +158,24 @@ test_01(){
esac esac
_app_stop _app_stop
} }
test_02(){ test_02(){
_echo "**** Test two ****" _echo "**** Test two ****"
_app_start JdpDoSomething \ _app_start JdpDoSomething \
-Dcom.sun.management.jdp.port=7095 \ -Dcom.sun.management.jdp.port=${_port} \
-Dcom.sun.management.jdp.address=239.255.255.225 \ -Dcom.sun.management.jdp.address=${_ip} \
-Dcom.sun.management.jdp.pause=5 \ -Dcom.sun.management.jdp.pause=5 \
-Dcom.sun.management.jmxremote.port=4545 \ -Dcom.sun.management.jmxremote.port=${_jmxport} \
-Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.ssl=false
res=`_testme` res=`_testme`
case "${res}" in case "${res}" in
OK*) OK*)
_echo "Passed" _echo "Passed"
;; ;;
*) *)
...@@ -181,26 +184,26 @@ test_02(){ ...@@ -181,26 +184,26 @@ test_02(){
esac esac
_app_stop _app_stop
} }
test_03(){ test_03(){
_echo "**** Test three ****" _echo "**** Test three ****"
_app_start JdpDoSomething _app_start JdpDoSomething
_jcmd ManagementAgent.start\ _jcmd ManagementAgent.start\
jdp.port=7095 \ jdp.port=${_port} \
jdp.address=239.255.255.225 \ jdp.address=${_ip} \
jdp.pause=5 \ jdp.pause=5 \
jmxremote.port=4545 \ jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \ jmxremote.authenticate=false \
jmxremote.ssl=false jmxremote.ssl=false
res=`_testme` res=`_testme`
case "${res}" in case "${res}" in
OK*) OK*)
_echo "Passed" _echo "Passed"
;; ;;
*) *)
...@@ -209,7 +212,7 @@ test_03(){ ...@@ -209,7 +212,7 @@ test_03(){
esac esac
_app_stop _app_stop
} }
test_04(){ test_04(){
...@@ -217,7 +220,7 @@ test_04(){ ...@@ -217,7 +220,7 @@ test_04(){
_app_start JdpDoSomething \ _app_start JdpDoSomething \
-Dcom.sun.management.jmxremote.autodiscovery=true \ -Dcom.sun.management.jmxremote.autodiscovery=true \
-Dcom.sun.management.jmxremote.port=4545 \ -Dcom.sun.management.jmxremote.port=${_jmxport} \
-Dcom.sun.management.jmxremote.authenticate=false \ -Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.ssl=false
...@@ -243,7 +246,7 @@ test_05(){ ...@@ -243,7 +246,7 @@ test_05(){
_jcmd ManagementAgent.start\ _jcmd ManagementAgent.start\
jmxremote.autodiscovery=true \ jmxremote.autodiscovery=true \
jmxremote.port=4545 \ jmxremote.port=${_jmxport} \
jmxremote.authenticate=false \ jmxremote.authenticate=false \
jmxremote.ssl=false jmxremote.ssl=false
...@@ -279,20 +282,20 @@ fi ...@@ -279,20 +282,20 @@ fi
#------------------------------------------------------------------------------ #------------------------------------------------------------------------------
# reading parameters # reading parameters
for parm in "$@" for parm in "$@"
do do
case $parm in case $parm in
--verbose) _verbose=yes ;; --verbose) _verbose=yes ;;
--jtreg) _jtreg=yes ;; --jtreg) _jtreg=yes ;;
--no-compile) _compile=no ;; --no-compile) _compile=no ;;
--testsuite=*) _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"` ;; --testsuite=*) _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"` ;;
*) *)
echo "Undefined parameter $parm. Try --help for help" echo "Undefined parameter $parm. Try --help for help"
exit exit
;; ;;
esac esac
done done
if [ "${_compile}" = "yes" ] if [ "${_compile}" = "yes" ]
...@@ -325,11 +328,11 @@ then ...@@ -325,11 +328,11 @@ then
cat ${_testsrc}/policy.tpl | \ cat ${_testsrc}/policy.tpl | \
sed -e "s,@_TESTCLASSES@,${_testclasses},g" -e "s,@TESTJAVA@,${TESTJAVA},g" \ sed -e "s,@_TESTCLASSES@,${_testclasses},g" -e "s,@TESTJAVA@,${TESTJAVA},g" \
> ${_policyname} > ${_policyname}
fi fi
# Local mode tests # Local mode tests
for i in `echo ${_testsuite} | sed -e "s/,/ /g"` for i in `echo ${_testsuite} | sed -e "s/,/ /g"`
do do
test_${i} test_${i}
done done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册