comparison test/runtime/7051189/Xchecksig.sh @ 6158:f9d57285de70

Merge
author asaha
date Thu, 07 Jun 2012 12:30:02 -0700
parents 037973617842
children 6acee021f5ac
comparison
equal deleted inserted replaced
6157:84e198dc2474 6158:f9d57285de70
1 # 1 #
2 # Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. 2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 # 4 #
5 # This code is free software; you can redistribute it and/or modify it 5 # This code is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License version 2 only, as 6 # under the terms of the GNU General Public License version 2 only, as
7 # published by the Free Software Foundation. 7 # published by the Free Software Foundation.
39 printf "TESTJAVA not set, selecting " ${TESTJAVA} 39 printf "TESTJAVA not set, selecting " ${TESTJAVA}
40 printf " If this is incorrect, try setting the variable manually.\n" 40 printf " If this is incorrect, try setting the variable manually.\n"
41 fi 41 fi
42 42
43 43
44 BIT_FLAG=""
45
46 OS=`uname -s` 44 OS=`uname -s`
47 case "$OS" in 45 case "$OS" in
48 SunOS | Linux ) 46 SunOS | Linux )
49 FS="/" 47 FS="/"
50 ## for solaris, linux it's HOME
51 FILE_LOCATION=$HOME
52 if [ -f ${FILE_LOCATION}${FS}JDK64BIT -a ${OS} = "SunOS" ]
53 then
54 BIT_FLAG=`cat ${FILE_LOCATION}${FS}JDK64BIT`
55 fi
56 ;; 48 ;;
57 Windows_* ) 49 Windows_* )
58 printf "Not testing libjsig.so on Windows. PASSED.\n " 50 printf "Not testing libjsig.so on Windows. PASSED.\n "
59 exit 0 51 exit 0
60 ;; 52 ;;
67 59
68 JAVA=${TESTJAVA}${FS}bin${FS}java 60 JAVA=${TESTJAVA}${FS}bin${FS}java
69 61
70 # LD_PRELOAD arch needs to match the binary we run, so run the java 62 # LD_PRELOAD arch needs to match the binary we run, so run the java
71 # 64-bit binary directly if we are testing 64-bit (bin/ARCH/java). 63 # 64-bit binary directly if we are testing 64-bit (bin/ARCH/java).
72 64 # Check if TESTVMOPS contains -d64, but cannot use
73 # However JPRT runs: .../solaris_x64_5.10-debug/bin/java 65 # java ${TESTVMOPS} to run "java -d64" with LD_PRELOAD.
74 # ..which is 32-bit, when it has built the 64-bit version to test.
75 #
76 # How does this script know we are meant to run the 64-bit version?
77 # Can check for the path of the binary containing "x64" on Solaris.
78 66
79 if [ ${OS} -eq "SunOS" ] 67 if [ ${OS} -eq "SunOS" ]
80 then 68 then
81 printf "SunOS test JAVA=${JAVA}" 69 printf "SunOS test TESTVMOPTS = ${TESTVMOPTS}"
82 printf ${JAVA} | grep x64 > /dev/null 70 printf ${TESTVMOPTS} | grep d64 > /dev/null
83 if [ $? -eq 0 ] 71 if [ $? -eq 0 ]
84 then 72 then
85 printf "SunOS x64 test, forcing -d64\n" 73 printf "SunOS 64-bit test\n"
86 BIT_FLAG=-d64 74 BIT_FLAG=-d64
87 fi 75 fi
88 fi 76 fi
89 77
90 ARCH=`uname -p` 78 ARCH=`uname -p`
125 if [ ! -f ${LIBJSIG} ] 113 if [ ! -f ${LIBJSIG} ]
126 then 114 then
127 printf "Skipping test: libjsig missing for given architecture: ${LIBJSIG}\n" 115 printf "Skipping test: libjsig missing for given architecture: ${LIBJSIG}\n"
128 exit 0 116 exit 0
129 fi 117 fi
130 # Use java -version to test, java version info appeas on stderr, 118 # Use java -version to test, java version info appears on stderr,
131 # the libjsig message we are removing appears on stdout. 119 # the libjsig message we are removing appears on stdout.
132 120
133 # grep returns zero meaning found, non-zero means not found: 121 # grep returns zero meaning found, non-zero means not found:
134 122
135 LD_PRELOAD=${LIBJSIG} ${JAVA} ${BIT_FLAG} -Xcheck:jni -version 2>&1 | grep "libjsig is activated" 123 LD_PRELOAD=${LIBJSIG} ${JAVA} ${TESTVMOPTS} -Xcheck:jni -version 2>&1 | grep "libjsig is activated"
136
137 if [ $? -eq 0 ]; then 124 if [ $? -eq 0 ]; then
138 printf "Failed: -Xcheck:jni prints message when libjsig.so is loaded.\n" 125 printf "Failed: -Xcheck:jni prints message when libjsig.so is loaded.\n"
139 exit 1 126 exit 1
140 fi 127 fi
141 128
142 129
143 LD_PRELOAD=${LIBJSIG} ${JAVA} ${BIT_FLAG} -Xcheck:jni -verbose:jni -version 2>&1 | grep "libjsig is activated" 130 LD_PRELOAD=${LIBJSIG} ${JAVA} ${TESTVMOPTS} -Xcheck:jni -verbose:jni -version 2>&1 | grep "libjsig is activated"
144 if [ $? != 0 ]; then 131 if [ $? != 0 ]; then
145 printf "Failed: -Xcheck:jni does not print message when libjsig.so is loaded and -verbose:jni is set.\n" 132 printf "Failed: -Xcheck:jni does not print message when libjsig.so is loaded and -verbose:jni is set.\n"
146 exit 1 133 exit 1
147 fi 134 fi
148 135