4651N/A * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. 1945N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1945N/A * This code is free software; you can redistribute it and/or modify it 1945N/A * under the terms of the GNU General Public License version 2 only, as 1945N/A * published by the Free Software Foundation. 1945N/A * This code is distributed in the hope that it will be useful, but WITHOUT 1945N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1945N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1945N/A * version 2 for more details (a copy is included in the LICENSE file that 1945N/A * You should have received a copy of the GNU General Public License version 1945N/A * 2 along with this work; if not, write to the Free Software Foundation, 1945N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 1945N/A * @bug 4780570 4731671 6354700 6367077 6670965 4882974 1945N/A * @summary Checks for LD_LIBRARY_PATH and execution on *nixes 1945N/A * @run main ExecutionEnvironment 3986N/A * This tests for various things as follows: 1945N/A * 1. uneccessary execs do not occur 1945N/A * 2. the environment is pristine, users environment variable wrt. 1945N/A * LD_LIBRARY_PATH if set are not modified in any way. 1945N/A * 3. the correct vm is chosen with -server and -client options 1945N/A * 4. the VM on Solaris correctly interprets the LD_LIBRARY_PATH32 1945N/A * and LD_LIBRARY_PATH64 variables if set by the user, ie. 1945N/A * a. if LD_LIBRARY_PATH32 is set it will override LD_LIBRARY_PATH 1945N/A * b. LD_LIBRARY_PATH64 is ignored if set 1945N/A * a. if LD_LIBRARY_PATH64 is set it will override LD_LIBRARY_PATH 1945N/A * b. LD_LIBRARY_PATH32 is ignored if set 1945N/A * 5. no extra symlink exists on Solaris ie. 1945N/A * a. perhaps we need to add a test to audit all environment variables are 1945N/A * in pristine condition after the launch, there may be a few that the 1945N/A * launcher may add as implementation details. 1945N/A * b. add a pldd for solaris to ensure only one libjvm.so is linked 1945N/A // Note: these paths need not exist on the filesytem 1945N/A codeList.
add(
" String value = (property) ? System.getProperty(name) : System.getenv(name);\n");
1945N/A * tests if the launcher pollutes the LD_LIBRARY_PATH variables ie. there 1945N/A * environment should be pristine. 1945N/A * ensures that there are no execs as long as we are in the same 1945N/A "> the process execing ?");
1945N/A * This test ensures that LD_LIBRARY_PATH* values are interpreted by the VM 1945N/A * and the expected java.library.path behaviour. 1945N/A * For Generic platforms (All *nixes): 1945N/A * * All LD_LIBRARY_PATH variable should be on java.library.path 1945N/A * * The LD_LIBRARY_PATH_32 should override LD_LIBRARY_PATH if specified 1945N/A * * The LD_LIBRARY_PATH_64 should override LD_LIBRARY_PATH if specified 1945N/A // verify the override occurs, since we know the invocation always 1945N/A // uses by default is 32-bit, therefore we also set the test 1945N/A // expectation to be the same. 1945N/A // try changing the model from 32 to 64 bit 1945N/A // verify the override occurs 1945N/A // try changing the model from 64 to 32 bit 1945N/A // verify the override occurs 1945N/A // make sure the 32/64 bit value exists 1945N/A // make sure the generic value is absent 1945N/A * ensures we have indeed exec'ed the correct vm of choice, all VMs support 1945N/A * -server, however 32-bit VMs support -client and -server. 1945N/A * checks to see there is no extra libjvm.so than needed 1945N/A // create our test jar first