mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-18 06:59:29 +00:00
6882768: (launcher) test for 6842838 is broken
Testcase correction. Reviewed-by: ksrini
This commit is contained in:
parent
938ca04641
commit
d3dbee73a6
@ -1,12 +1,3 @@
|
||||
#!/bin/sh -x
|
||||
|
||||
#
|
||||
# @test @(#)Test6842838.sh
|
||||
# @bug 6842838
|
||||
# @summary Test 6842838 64-bit launcher failure due to corrupt jar
|
||||
# @run shell Test6842838.sh
|
||||
#
|
||||
|
||||
#
|
||||
# Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
|
||||
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
@ -30,21 +21,23 @@
|
||||
# have any questions.
|
||||
#
|
||||
|
||||
if [ "${TESTSRC}" = "" ]
|
||||
then TESTSRC=.
|
||||
fi
|
||||
|
||||
if [ "${TESTJAVA}" = "" ]
|
||||
then
|
||||
# @test Test6842838.sh
|
||||
# @bug 6842838
|
||||
# @summary Test 6842838 64-bit launcher failure due to corrupt jar
|
||||
# @compile CreateBadJar.java
|
||||
# @run shell Test6842838.sh
|
||||
|
||||
set -x
|
||||
|
||||
if [ "${TESTJAVA}" = "" ]; then
|
||||
PARENT=`dirname \`which java\``
|
||||
TESTJAVA=`dirname ${PARENT}`
|
||||
echo "TESTJAVA not set, selecting " ${TESTJAVA}
|
||||
echo "If this is incorrect, try setting the variable manually."
|
||||
printf "TESTJAVA not set. Test cannot execute. Failed.\n"
|
||||
fi
|
||||
|
||||
if [ "${TESTCLASSES}" = "" ]
|
||||
then
|
||||
echo "TESTCLASSES not set. Test cannot execute. Failed."
|
||||
if [ "${TESTCLASSES}" = "" ]; then
|
||||
printf "TESTCLASSES not set. Test cannot execute. Failed.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -58,18 +51,26 @@ case "$OS" in
|
||||
JAVA_EXE=${TESTJAVA}${FS}bin${FS}sparcv9${FS}java
|
||||
;;
|
||||
* )
|
||||
echo "Only testing on sparcv9 (use libumem to reliably catch buffer overrun)"
|
||||
printf "Only testing on sparcv9 (use libumem to reliably catch buffer overrun)\n"
|
||||
exit 0;
|
||||
;;
|
||||
esac
|
||||
|
||||
BADFILE=newbadjar.jar
|
||||
if [ ! -x ${JAVA_EXE} ]; then
|
||||
printf "Warning: sparcv9 components not installed - skipping test.\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
LIBUMEM=/lib/64/libumem.so
|
||||
if [ ! -x ${LIBUMEM} ]; then
|
||||
printf "Warning: libumem not installed - skipping test.\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
BADFILE=newbadjar.jar
|
||||
${JAVA_EXE} -version
|
||||
rm -f ${BADFILE}
|
||||
${TESTJAVA}/bin/javac CreateBadJar.java
|
||||
${JAVA_EXE} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
|
||||
LD_PRELOAD=/lib/64/libumem.so ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
|
||||
${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
|
||||
LD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
|
||||
|
||||
grep "Invalid or corrupt jarfile" test.out
|
||||
exit $?
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user