1 #!/bin/sh 2 3 # 4 # Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6 # 7 # This code is free software; you can redistribute it and/or modify it 8 # under the terms of the GNU General Public License version 2 only, as 9 # published by the Free Software Foundation. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 # or visit www.oracle.com if you need additional information or have any 23 # questions. 24 # 25 26 27 # @test 28 # @bug 4673940 29 # @bug 4930794 30 # @summary Unit tests for inetd feature 31 # 32 # @build StateTest StateTestService EchoTest EchoService CloseTest Launcher Util 33 # @run shell run_tests.sh 34 35 os=`uname -s` 36 37 if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then 38 echo "Test not designed to run on this operating system, skipping..." 39 exit 0 40 fi 41 42 43 # if TESTJAVA isn't set then we assume an interactive run. So that it's 44 # clear which version of 'java' is running we do a 'which java' and 45 # a 'java -version'. 46 47 if [ -z "$TESTJAVA" ]; then 48 TESTSRC=`pwd` 49 TESTCLASSES=`pwd` 50 JAVA=java 51 which $JAVA 52 ${JAVA} -d64 -version > /dev/null 2<&1 53 if [ $? = 1 ]; then 54 ${JAVA} -version 55 else 56 ${JAVA} -d64 -version 57 fi 58 else 59 JAVA="${TESTJAVA}/bin/java" 60 fi 61 62 CLASSPATH=${TESTCLASSES} 63 export CLASSPATH 64 65 66 # Check that we have libLauncher.so for the right platform. 67 # On Solaris we assume 64-bit if java -d64 works. 68 69 DFLAG= 70 if [ "$os" = "SunOS" ]; then 71 PLATFORM=solaris 72 case "`uname -p`" in 73 i[3-9]86) 74 ARCH=i586 75 ;; 76 sparc) 77 ARCH=sparc 78 ${JAVA} -d64 -version > /dev/null 2<&1 79 if [ $? = 1 ]; then 80 ARCH=sparc 81 else 82 ARCH=sparcv9 83 DFLAG=-d64 84 fi 85 ;; 86 esac 87 fi 88 89 if [ "$os" = "Linux" ]; then 90 PLATFORM=linux 91 ARCH=unknown 92 case "`uname -m`" in 93 i[3-6]86) 94 ARCH=i586 95 ;; 96 ia64) 97 ARCH=ia64 98 ;; 99 x86_64) 100 ARCH=amd64 101 ;; 102 esac 103 fi 104 | 1 #!/bin/sh 2 3 # 4 # Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. 5 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 6 # 7 # This code is free software; you can redistribute it and/or modify it 8 # under the terms of the GNU General Public License version 2 only, as 9 # published by the Free Software Foundation. 10 # 11 # This code is distributed in the hope that it will be useful, but WITHOUT 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 # version 2 for more details (a copy is included in the LICENSE file that 15 # accompanied this code). 16 # 17 # You should have received a copy of the GNU General Public License version 18 # 2 along with this work; if not, write to the Free Software Foundation, 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 # 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 # or visit www.oracle.com if you need additional information or have any 23 # questions. 24 # 25 26 27 # @test 28 # @bug 4673940 29 # @bug 4930794 30 # @summary Unit tests for inetd feature 31 # 32 # @build StateTest StateTestService EchoTest EchoService CloseTest Launcher Util 33 # @run shell run_tests.sh 34 35 os=`uname -s` 36 37 if [ "$os" != "Linux" -a "$os" != "SunOS" ]; then 38 echo "Test not designed to run on this operating system, skipping..." 39 exit 0 40 fi 41 42 arch=`uname -p` 43 if [ "$os" = "SunOS" ]; then 44 if [ "$arch" = "i386" -o "$arch" = "sparc" ]; then 45 echo "Test not designed to run on this operating system, skipping..." 46 exit 0 47 fi 48 fi 49 50 # if TESTJAVA isn't set then we assume an interactive run. So that it's 51 # clear which version of 'java' is running we do a 'which java' and 52 # a 'java -version'. 53 54 if [ -z "$TESTJAVA" ]; then 55 TESTSRC=`pwd` 56 TESTCLASSES=`pwd` 57 JAVA=java 58 which $JAVA 59 ${JAVA} -d64 -version > /dev/null 2<&1 60 if [ $? = 1 ]; then 61 ${JAVA} -version 62 else 63 ${JAVA} -d64 -version 64 fi 65 else 66 JAVA="${TESTJAVA}/bin/java" 67 fi 68 69 CLASSPATH=${TESTCLASSES} 70 export CLASSPATH 71 72 73 # Check that we have libLauncher.so for the right platform. 74 # On Solaris we assume 64-bit 75 76 DFLAG= 77 if [ "$os" = "SunOS" ]; then 78 PLATFORM=solaris 79 case "`uname -p`" in 80 i[3-9]86) 81 ARCH=amd64 82 ;; 83 sparc) 84 ARCH=sparcv9 85 ;; 86 esac 87 fi 88 89 if [ "$os" = "Linux" ]; then 90 PLATFORM=linux 91 ARCH=unknown 92 case "`uname -m`" in 93 i[3-6]86) 94 ARCH=i586 95 ;; 96 ia64) 97 ARCH=ia64 98 ;; 99 x86_64) 100 ARCH=amd64 101 ;; 102 esac 103 fi 104 |