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