author | jlaskey |
Fri, 23 Aug 2013 09:56:25 -0300 | |
changeset 19631 | 5a165897932b |
parent 12047 | 320a714614e9 |
child 20201 | 50cc2d25a60b |
permissions | -rw-r--r-- |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
1 |
/* |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
2 |
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
4 |
* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
8 |
* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
13 |
* accompanied this code). |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
14 |
* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
18 |
* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
21 |
* questions. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
22 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
23 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
24 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
25 |
* @test |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
26 |
* @bug 7029048 |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
27 |
* @summary Checks for LD_LIBRARY_PATH on *nixes |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
28 |
* @compile -XDignore.symbol.file ExecutionEnvironment.java Test7029048.java |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
29 |
* @run main Test7029048 |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
30 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
31 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
32 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
33 |
* 7029048: test for LD_LIBRARY_PATH set to different paths pointing which may |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
34 |
* contain a libjvm.so and may not, but we test to ensure that the launcher |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
35 |
* behaves correctly in all cases. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
36 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
37 |
import java.io.File; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
38 |
import java.io.IOException; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
39 |
import java.nio.file.Files; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
40 |
import java.util.ArrayList; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
41 |
import java.util.HashMap; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
42 |
import java.util.List; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
43 |
import java.util.Map; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
44 |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
45 |
public class Test7029048 extends TestHelper { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
46 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
47 |
static int passes = 0; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
48 |
static int errors = 0; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
49 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
50 |
private static final String LIBJVM = ExecutionEnvironment.LIBJVM; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
51 |
private static final String LD_LIBRARY_PATH = |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
52 |
ExecutionEnvironment.LD_LIBRARY_PATH; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
53 |
private static final String LD_LIBRARY_PATH_32 = |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
54 |
ExecutionEnvironment.LD_LIBRARY_PATH_32; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
55 |
private static final String LD_LIBRARY_PATH_64 = |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
56 |
ExecutionEnvironment.LD_LIBRARY_PATH_64; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
57 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
58 |
private static final File libDir = |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
59 |
new File(System.getProperty("sun.boot.library.path")); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
60 |
private static final File srcServerDir = new File(libDir, "server"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
61 |
private static final File srcLibjvmSo = new File(srcServerDir, LIBJVM); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
62 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
63 |
private static final File dstLibDir = new File("lib"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
64 |
private static final File dstLibArchDir = |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
65 |
new File(dstLibDir, getJreArch()); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
66 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
67 |
private static final File dstServerDir = new File(dstLibArchDir, "server"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
68 |
private static final File dstServerLibjvm = new File(dstServerDir, LIBJVM); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
69 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
70 |
private static final File dstClientDir = new File(dstLibArchDir, "client"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
71 |
private static final File dstClientLibjvm = new File(dstClientDir, LIBJVM); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
72 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
73 |
// used primarily to test the solaris variants in dual mode |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
74 |
private static final File dstOtherArchDir; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
75 |
private static final File dstOtherServerDir; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
76 |
private static final File dstOtherServerLibjvm; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
77 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
78 |
private static final Map<String, String> env = new HashMap<>(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
79 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
80 |
static { |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
81 |
if (isDualMode) { |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
82 |
dstOtherArchDir = new File(dstLibDir, getComplementaryJreArch()); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
83 |
dstOtherServerDir = new File(dstOtherArchDir, "server"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
84 |
dstOtherServerLibjvm = new File(dstOtherServerDir, LIBJVM); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
85 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
86 |
dstOtherArchDir = null; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
87 |
dstOtherServerDir = null; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
88 |
dstOtherServerLibjvm = null; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
89 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
90 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
91 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
92 |
static String getValue(String name, List<String> in) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
93 |
for (String x : in) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
94 |
String[] s = x.split("="); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
95 |
if (name.equals(s[0].trim())) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
96 |
return s[1].trim(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
97 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
98 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
99 |
return null; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
100 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
101 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
102 |
static void run(boolean want32, String dflag, Map<String, String> env, |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
103 |
int nLLPComponents, String caseID) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
104 |
final boolean want64 = want32 == false; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
105 |
env.put(ExecutionEnvironment.JLDEBUG_KEY, "true"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
106 |
List<String> cmdsList = new ArrayList<>(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
107 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
108 |
// only for a dual-mode system |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
109 |
if (want64 && isDualMode) { |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
110 |
cmdsList.add(java64Cmd); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
111 |
} else { |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
112 |
cmdsList.add(javaCmd); // a 32-bit java command for all |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
113 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
114 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
115 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
116 |
* empty or null strings can confuse the ProcessBuilder. A null flag |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
117 |
* indicates that the appropriate data model is enforced on the chosen |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
118 |
* launcher variant. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
119 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
120 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
121 |
if (dflag != null) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
122 |
cmdsList.add(dflag); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
123 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
124 |
cmdsList.add(want32 ? "-d32" : "-d64"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
125 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
126 |
cmdsList.add("-server"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
127 |
cmdsList.add("-jar"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
128 |
cmdsList.add(ExecutionEnvironment.testJarFile.getAbsolutePath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
129 |
String[] cmds = new String[cmdsList.size()]; |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
130 |
TestResult tr = doExec(env, cmdsList.toArray(cmds)); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
131 |
analyze(tr, nLLPComponents, caseID); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
132 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
133 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
134 |
// no cross launch, ie. no change to the data model. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
135 |
static void run(Map<String, String> env, int nLLPComponents, String caseID) |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
136 |
throws IOException { |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
137 |
boolean want32 = is32Bit; |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
138 |
run(want32, null, env, nLLPComponents, caseID); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
139 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
140 |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
141 |
static void analyze(TestResult tr, int nLLPComponents, String caseID) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
142 |
String envValue = getValue(LD_LIBRARY_PATH, tr.testOutput); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
143 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
144 |
* the envValue can never be null, since the test code should always |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
145 |
* print a "null" string. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
146 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
147 |
if (envValue == null) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
148 |
System.out.println(tr); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
149 |
throw new RuntimeException("NPE, likely a program crash ??"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
150 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
151 |
String values[] = envValue.split(File.pathSeparator); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
152 |
if (values.length == nLLPComponents) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
153 |
System.out.println(caseID + " :OK"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
154 |
passes++; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
155 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
156 |
System.out.println("FAIL: test7029048, " + caseID); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
157 |
System.out.println(" expected " + nLLPComponents |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
158 |
+ " but got " + values.length); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
159 |
System.out.println(envValue); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
160 |
System.out.println(tr); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
161 |
errors++; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
162 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
163 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
164 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
165 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
166 |
* A crucial piece, specifies what we should expect, given the conditions. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
167 |
* That is for a given enum type, the value indicates how many absolute |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
168 |
* environment variables that can be expected. This value is used to base |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
169 |
* the actual expected values by adding the set environment variable usually |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
170 |
* it is 1, but it could be more if the test wishes to set more paths in |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
171 |
* the future. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
172 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
173 |
private static enum LLP_VAR { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
174 |
LLP_SET_NON_EXISTENT_PATH(0), // env set, but the path does not exist |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
175 |
LLP_SET_EMPTY_PATH(0), // env set, with a path but no libjvm.so |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
176 |
LLP_SET_WITH_JVM(3); // env set, with a libjvm.so |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
177 |
private final int value; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
178 |
LLP_VAR(int i) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
179 |
this.value = i; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
180 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
181 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
182 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
183 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
184 |
* test for 7029048 |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
185 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
186 |
static void test7029048() throws IOException { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
187 |
String desc = null; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
188 |
for (LLP_VAR v : LLP_VAR.values()) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
189 |
switch (v) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
190 |
case LLP_SET_WITH_JVM: |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
191 |
// copy the files into the directory structures |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
192 |
copyFile(srcLibjvmSo, dstServerLibjvm); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
193 |
// does not matter if it is client or a server |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
194 |
copyFile(srcLibjvmSo, dstClientLibjvm); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
195 |
// does not matter if the arch do not match either |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
196 |
if (isDualMode) { |
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
197 |
copyFile(srcLibjvmSo, dstOtherServerLibjvm); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
198 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
199 |
desc = "LD_LIBRARY_PATH should be set"; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
200 |
break; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
201 |
case LLP_SET_EMPTY_PATH: |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
202 |
if (!dstClientDir.exists()) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
203 |
Files.createDirectories(dstClientDir.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
204 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
205 |
Files.deleteIfExists(dstClientLibjvm.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
206 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
207 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
208 |
if (!dstServerDir.exists()) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
209 |
Files.createDirectories(dstServerDir.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
210 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
211 |
Files.deleteIfExists(dstServerLibjvm.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
212 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
213 |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
214 |
if (isDualMode) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
215 |
if (!dstOtherServerDir.exists()) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
216 |
Files.createDirectories(dstOtherServerDir.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
217 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
218 |
Files.deleteIfExists(dstOtherServerLibjvm.toPath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
219 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
220 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
221 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
222 |
desc = "LD_LIBRARY_PATH should not be set"; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
223 |
break; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
224 |
case LLP_SET_NON_EXISTENT_PATH: |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
225 |
if (dstLibDir.exists()) { |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
226 |
recursiveDelete(dstLibDir); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
227 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
228 |
desc = "LD_LIBRARY_PATH should not be set"; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
229 |
break; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
230 |
default: |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
231 |
throw new RuntimeException("unknown case"); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
232 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
233 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
234 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
235 |
* Case 1: set the server path |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
236 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
237 |
env.clear(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
238 |
env.put(LD_LIBRARY_PATH, dstServerDir.getAbsolutePath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
239 |
run(env, v.value + 1, "Case 1: " + desc); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
240 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
241 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
242 |
* Case 2: repeat with client path |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
243 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
244 |
env.clear(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
245 |
env.put(LD_LIBRARY_PATH, dstClientDir.getAbsolutePath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
246 |
run(env, v.value + 1, "Case 2: " + desc); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
247 |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
248 |
if (!isDualMode) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
249 |
continue; // nothing more to do for Linux |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
250 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
251 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
252 |
// Tests applicable only to solaris. |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
253 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
254 |
// initialize test variables for dual mode operations |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
255 |
final File dst32ServerDir = is32Bit |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
256 |
? dstServerDir |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
257 |
: dstOtherServerDir; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
258 |
|
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
259 |
final File dst64ServerDir = is64Bit |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
260 |
? dstServerDir |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
261 |
: dstOtherServerDir; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
262 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
263 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
264 |
* Case 3: set the appropriate LLP_XX flag, |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
265 |
* java32 -d32, LLP_32 is relevant, LLP_64 is ignored |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
266 |
* java64 -d64, LLP_64 is relevant, LLP_32 is ignored |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
267 |
*/ |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
268 |
env.clear(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
269 |
env.put(LD_LIBRARY_PATH_32, dst32ServerDir.getAbsolutePath()); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
270 |
env.put(LD_LIBRARY_PATH_64, dst64ServerDir.getAbsolutePath()); |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
271 |
run(is32Bit, null, env, v.value + 1, "Case 3: " + desc); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
272 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
273 |
/* |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
274 |
* Case 4: we are in dual mode environment, running 64-bit then |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
275 |
* we have the following scenarios: |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
276 |
* java32 -d64, LLP_64 is relevant, LLP_32 is ignored |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
277 |
* java64 -d32, LLP_32 is relevant, LLP_64 is ignored |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
278 |
*/ |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
279 |
if (dualModePresent()) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
280 |
run(true, "-d64", env, v.value + 1, "Case 4A: " + desc); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
281 |
run(false,"-d32", env, v.value + 1, "Case 4B: " + desc); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
282 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
283 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
284 |
return; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
285 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
286 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
287 |
public static void main(String... args) throws Exception { |
12047
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11687
diff
changeset
|
288 |
if (TestHelper.isWindows || TestHelper.isMacOSX) { |
320a714614e9
7113349: Initial changeset for Macosx port to jdk
michaelm
parents:
11687
diff
changeset
|
289 |
System.out.println("Note: applicable on neither Windows nor MacOSX"); |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
290 |
return; |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
291 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
292 |
// create our test jar first |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
293 |
ExecutionEnvironment.createTestJar(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
294 |
|
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
295 |
// run the tests |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
296 |
test7029048(); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
297 |
if (errors > 0) { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
298 |
throw new Exception("Test7029048: FAIL: with " |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
299 |
+ errors + " errors and passes " + passes); |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
300 |
} else if (dualModePresent() && passes < 15) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
301 |
throw new Exception("Test7029048: FAIL: " + |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
302 |
"all tests did not run, expected " + 15 + " got " + passes); |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
303 |
} else if (isSolaris && passes < 9) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
304 |
throw new Exception("Test7029048: FAIL: " + |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
305 |
"all tests did not run, expected " + 9 + " got " + passes); |
11687
f13cadbb0bb5
7127906: (launcher) convert the launcher regression tests to java
ksrini
parents:
9244
diff
changeset
|
306 |
} else if (isLinux && passes < 6) { |
9244
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
307 |
throw new Exception("Test7029048: FAIL: " + |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
308 |
"all tests did not run, expected " + 6 + " got " + passes); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
309 |
} else { |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
310 |
System.out.println("Test7029048: PASS " + passes); |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
311 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
312 |
} |
84d85c90d5db
7029048: (launcher) fence the launcher against LD_LIBRARY_PATH
ksrini
parents:
diff
changeset
|
313 |
} |