提交 43cabac4 编写于 作者: K kevinw

6882768: (launcher) test for 6842838 is broken

Summary: Testcase correction.
Reviewed-by: ksrini
上级 010a7aac
#!/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 $?
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册