Mercurial > hg > truffle
annotate test/runtime/7051189/Xchecksig.sh @ 11517:1f03076a121b
Merge
author | Mick Jordan <mick.jordan@oracle.com> |
---|---|
date | Tue, 03 Sep 2013 14:09:56 -0700 |
parents | 04d6d4322c6a |
children |
rev | line source |
---|---|
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
1 # |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
2 # Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
4 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
5 # This code is free software; you can redistribute it and/or modify it |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
6 # under the terms of the GNU General Public License version 2 only, as |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
7 # published by the Free Software Foundation. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
8 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
9 # This code is distributed in the hope that it will be useful, but WITHOUT |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
12 # version 2 for more details (a copy is included in the LICENSE file that |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
13 # accompanied this code). |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
14 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
15 # You should have received a copy of the GNU General Public License version |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
16 # 2 along with this work; if not, write to the Free Software Foundation, |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
18 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
20 # or visit www.oracle.com if you need additional information or have any |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
21 # questions. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
22 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
23 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
24 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
25 # @test Xchecksig.sh |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
26 # @bug 7051189 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
27 # @summary Need to suppress info message if -xcheck:jni used with libjsig.so |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
28 # @run shell Xchecksig.sh |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
29 # |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
30 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
31 if [ "${TESTSRC}" = "" ] |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
32 then |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
33 TESTSRC=${PWD} |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
34 echo "TESTSRC not set. Using "${TESTSRC}" as default" |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
35 fi |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
36 echo "TESTSRC=${TESTSRC}" |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
37 ## Adding common setup Variables for running shell tests. |
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
38 . ${TESTSRC}/../../test_env.sh |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
39 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
40 OS=`uname -s` |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
41 case "$OS" in |
6635
83b6305a5638
7191926: Remove MKS dependency in Hotspot regression tests
coleenp
parents:
6598
diff
changeset
|
42 Windows_* | CYGWIN_* ) |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
43 printf "Not testing libjsig.so on Windows. PASSED.\n " |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
44 exit 0 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
45 ;; |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
46 esac |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
47 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
48 JAVA=${TESTJAVA}${FS}bin${FS}java |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
49 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
50 # LD_PRELOAD arch needs to match the binary we run, so run the java |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
51 # 64-bit binary directly if we are testing 64-bit (bin/ARCH/java). |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
52 # Check if TESTVMOPS contains -d64, but cannot use |
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
53 # java ${TESTVMOPS} to run "java -d64" with LD_PRELOAD. |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
54 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
55 if [ ${OS} -eq "SunOS" ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
56 then |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
57 printf "SunOS test TESTVMOPTS = ${TESTVMOPTS}" |
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
58 printf ${TESTVMOPTS} | grep d64 > /dev/null |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
59 if [ $? -eq 0 ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
60 then |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
61 printf "SunOS 64-bit test\n" |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
62 BIT_FLAG=-d64 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
63 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
64 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
65 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
66 ARCH=`uname -p` |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
67 case $ARCH in |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
68 i386) |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
69 if [ X${BIT_FLAG} != "X" ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
70 then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
71 ARCH=amd64 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
72 JAVA=${TESTJAVA}${FS}bin${FS}${ARCH}${FS}java |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
73 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
74 ;; |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
75 sparc) |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
76 if [ X${BIT_FLAG} != "X" ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
77 then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
78 ARCH=sparcv9 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
79 JAVA=${TESTJAVA}${FS}bin${FS}${ARCH}${FS}java |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
80 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
81 ;; |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
82 * ) |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
83 printf "Not testing architecture $ARCH, skipping test.\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
84 exit 0 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
85 ;; |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
86 esac |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
87 |
8831
04d6d4322c6a
8009152: A number of jtreg tests need review/improvement
collins
parents:
6635
diff
changeset
|
88 LIBJSIG=${COMPILEJAVA}${FS}jre${FS}lib${FS}${ARCH}${FS}libjsig.so |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
89 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
90 # If libjsig and binary do not match, skip test. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
91 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
92 A=`file ${LIBJSIG} | awk '{ print $3 }'` |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
93 B=`file ${JAVA} | awk '{ print $3 }'` |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
94 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
95 if [ $A -ne $B ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
96 then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
97 printf "Mismatching binary and library to preload, skipping test.\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
98 exit 0 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
99 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
100 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
101 if [ ! -f ${LIBJSIG} ] |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
102 then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
103 printf "Skipping test: libjsig missing for given architecture: ${LIBJSIG}\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
104 exit 0 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
105 fi |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
106 # Use java -version to test, java version info appears on stderr, |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
107 # the libjsig message we are removing appears on stdout. |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
108 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
109 # grep returns zero meaning found, non-zero means not found: |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
110 |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
111 LD_PRELOAD=${LIBJSIG} ${JAVA} ${TESTVMOPTS} -Xcheck:jni -version 2>&1 | grep "libjsig is activated" |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
112 if [ $? -eq 0 ]; then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
113 printf "Failed: -Xcheck:jni prints message when libjsig.so is loaded.\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
114 exit 1 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
115 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
116 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
117 |
6074
037973617842
7157734: hotspot test scripts not testing 64-bit JVM under JPRT/JTREG.
kevinw
parents:
3956
diff
changeset
|
118 LD_PRELOAD=${LIBJSIG} ${JAVA} ${TESTVMOPTS} -Xcheck:jni -verbose:jni -version 2>&1 | grep "libjsig is activated" |
3956
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
119 if [ $? != 0 ]; then |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
120 printf "Failed: -Xcheck:jni does not print message when libjsig.so is loaded and -verbose:jni is set.\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
121 exit 1 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
122 fi |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
123 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
124 printf "PASSED\n" |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
125 exit 0 |
3607aac85aa9
7051189: Need to suppress info message if -xcheck:jni used with libjsig.so
kevinw
parents:
diff
changeset
|
126 |