jdk/test/sun/management/jdp/JdpTest.sh
author dsamersoff
Thu, 03 Oct 2013 16:54:55 +0400
changeset 20509 9f5b0fa647cd
parent 17721 1d6516794d05
child 21295 5c73446feb1f
permissions -rw-r--r--
8009213: sun/management/jdp/JdpTest.sh fails with exit code 1 Summary: There's no guarantee that the java process has executed far enough to be found by jps when we try to obtain it's pid. Reviewed-by: sla
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
16748
ed60b6527f64 8012048: JDK8 b85 source with GPL header errors
katleman
parents: 15663
diff changeset
     3
# Copyright (c) 2011, 2012, 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"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
    36
_testsuite="01,02,04"
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
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
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 \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
    67
                                             JdpDoSomething.java  \
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
20509
9f5b0fa647cd 8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents: 17721
diff changeset
    87
# wait until VM is actually starts. 
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.
9f5b0fa647cd 8009213: sun/management/jdp/JdpTest.sh fails with exit code 1
dsamersoff
parents: 17721
diff changeset
    90
  cnt=1 
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
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   138
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   139
}
15531
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
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   142
_jcmd(){
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   143
    ${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
   144
}
15531
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
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 "$*"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   149
    echo "$*" >> ${_logname}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   150
}
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   151
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   152
# ============= TESTS ======================================
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   153
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   154
test_01(){
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   155
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   156
    _echo "**** Test one ****"
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   157
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   158
    _app_start JdpUnitTest \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   159
    -Dcom.sun.management.jdp.port=${_port} \
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   160
    -Dcom.sun.management.jdp.address=${_ip} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   161
    -Dcom.sun.management.jdp.pause=5
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   162
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   163
    res=`_testme`
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   164
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   165
    case "${res}" in
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   166
     OK*)
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   167
	_echo "Passed"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   168
     ;;
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
	_echo "Failed!"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   171
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   172
    esac
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   173
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   174
    _app_stop
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   175
}
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   176
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   177
test_02(){
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   178
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   179
    _echo "**** Test two ****"
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   180
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   181
    _app_start JdpDoSomething \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   182
     -Dcom.sun.management.jdp.port=${_port} \
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   183
     -Dcom.sun.management.jdp.address=${_ip} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   184
     -Dcom.sun.management.jdp.pause=5 \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   185
     -Dcom.sun.management.jmxremote.port=${_jmxport} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   186
     -Dcom.sun.management.jmxremote.authenticate=false \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   187
     -Dcom.sun.management.jmxremote.ssl=false
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   188
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   189
    res=`_testme`
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   190
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   191
    case "${res}" in
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   192
     OK*)
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   193
	_echo "Passed"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   194
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   195
     *)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   196
	_echo "Failed!"
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
    esac
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   199
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   200
    _app_stop
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   201
}
15531
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
test_03(){
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
    _echo "**** Test three ****"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   206
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   207
    _app_start JdpDoSomething
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   208
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   209
    _jcmd  ManagementAgent.start\
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   210
                jdp.port=${_port} \
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   211
                jdp.address=${_ip} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   212
                jdp.pause=5 \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   213
                jmxremote.port=${_jmxport} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   214
                jmxremote.authenticate=false \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   215
                jmxremote.ssl=false
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   216
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   217
    res=`_testme`
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   218
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   219
    case "${res}" in
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   220
     OK*)
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   221
	_echo "Passed"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   222
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   223
     *)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   224
	_echo "Failed!"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   225
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   226
    esac
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   227
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   228
    _app_stop
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   229
}
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   230
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   231
test_04(){
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   232
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   233
    _echo "**** Test four ****"
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
    _app_start JdpDoSomething \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   236
     -Dcom.sun.management.jmxremote.autodiscovery=true \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   237
     -Dcom.sun.management.jmxremote.port=${_jmxport} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   238
     -Dcom.sun.management.jmxremote.authenticate=false \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   239
     -Dcom.sun.management.jmxremote.ssl=false
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   240
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   241
    res=`_testme`
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   242
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   243
    case "${res}" in
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   244
     OK*)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   245
	_echo "Passed"
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
     *)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   248
	_echo "Failed!"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   249
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   250
    esac
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   251
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   252
    _app_stop
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   253
}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   254
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   255
test_05(){
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   256
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   257
    _echo "**** Test five ****"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   258
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   259
    _app_start JdpDoSomething
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
    _jcmd  ManagementAgent.start\
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   262
                jmxremote.autodiscovery=true \
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   263
                jmxremote.port=${_jmxport} \
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   264
                jmxremote.authenticate=false \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   265
                jmxremote.ssl=false
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
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   268
    res=`_testme`
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   269
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   270
    case "${res}" in
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   271
     OK*)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   272
	_echo "Passed"
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
     *)
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   275
	_echo "Failed!"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   276
     ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   277
    esac
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   278
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   279
    _app_stop
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   280
}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   281
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
# ============= MAIN =======================================
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
if [ "x${TESTJAVA}" = "x" ]
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   286
then
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   287
  echo "TESTJAVA env have to be set"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   288
  exit
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   289
fi
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   290
15642
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   291
# COMPILEJAVA variable is set when we test jre
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   292
if [ "x${COMPILEJAVA}" = "x" ]
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   293
then
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   294
   COMPILEJAVA="${TESTJAVA}"
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   295
fi
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   296
5d93957f4749 8007277: JDK-8002048 testcase fails to compile
dsamersoff
parents: 15531
diff changeset
   297
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   298
#------------------------------------------------------------------------------
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   299
# reading parameters
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   300
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   301
for parm in "$@"
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   302
do
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   303
   case $parm in
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   304
  --verbose)      _verbose=yes  ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   305
  --jtreg)        _jtreg=yes    ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   306
  --no-compile)   _compile=no   ;;
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   307
  --testsuite=*)  _testsuite=`_echo $parm | sed "s,^--.*=\(.*\),\1,"`  ;;
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   308
  *)
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   309
     echo "Undefined parameter $parm. Try --help for help"
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   310
     exit
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   311
   ;;
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   312
 esac
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   313
done
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   314
15663
aab03a20f48f 8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents: 15657
diff changeset
   315
if [ "${_compile}" = "yes" ]
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   316
then
15657
c588664d547e 8007786: JDK-8002048 testcase doesn't work on Solaris
dsamersoff
parents: 15642
diff changeset
   317
 _do_compile
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   318
fi
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   319
15663
aab03a20f48f 8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents: 15657
diff changeset
   320
if [ "${_jtreg}" = "yes" ]
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   321
then
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   322
 _testclasses=${TESTCLASSES}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   323
 _testsrc=${TESTSRC}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   324
 _logname="output.txt"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   325
fi
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   326
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   327
# Make sure _tesclasses is absolute path
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   328
tt=`echo ${_testclasses} | sed -e 's,/,,'`
15663
aab03a20f48f 8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents: 15657
diff changeset
   329
if [ "${tt}" = "${_testclasses}" ]
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   330
then
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   331
  _testclasses="${_pwd}/${_testclasses}"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   332
fi
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   333
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   334
_policyname="${_testclasses}/policy"
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   335
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   336
rm -f ${_logname}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   337
rm -f ${_policyname}
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   338
15663
aab03a20f48f 8008095: TEST_BUG: JDK-8002048 one more testcase failure on Solaris
dsamersoff
parents: 15657
diff changeset
   339
if [ -f ${_testsrc}/policy.tpl ]
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   340
then
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
cat ${_testsrc}/policy.tpl | \
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   343
     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
   344
 > ${_policyname}
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   345
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   346
fi
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   347
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   348
# Local mode tests
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   349
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
   350
do
17721
1d6516794d05 8014420: Default JDP address does not match the one assigned by IANA
dsamersoff
parents: 16748
diff changeset
   351
  test_${i}
15531
071efc9f31ad 8002048: Protocol to discovery of manageable Java processes on a network
dsamersoff
parents:
diff changeset
   352
done