提交 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. # Copyright 2009 Sun Microsystems, Inc. All Rights Reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
...@@ -30,21 +21,23 @@ ...@@ -30,21 +21,23 @@
# have any questions. # have any questions.
# #
if [ "${TESTSRC}" = "" ]
then TESTSRC=.
fi
if [ "${TESTJAVA}" = "" ] # @test Test6842838.sh
then # @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\`` PARENT=`dirname \`which java\``
TESTJAVA=`dirname ${PARENT}` TESTJAVA=`dirname ${PARENT}`
echo "TESTJAVA not set, selecting " ${TESTJAVA} printf "TESTJAVA not set. Test cannot execute. Failed.\n"
echo "If this is incorrect, try setting the variable manually."
fi fi
if [ "${TESTCLASSES}" = "" ] if [ "${TESTCLASSES}" = "" ]; then
then printf "TESTCLASSES not set. Test cannot execute. Failed.\n"
echo "TESTCLASSES not set. Test cannot execute. Failed."
exit 1 exit 1
fi fi
...@@ -58,18 +51,26 @@ case "$OS" in ...@@ -58,18 +51,26 @@ case "$OS" in
JAVA_EXE=${TESTJAVA}${FS}bin${FS}sparcv9${FS}java 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; exit 0;
;; ;;
esac 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 ${JAVA_EXE} -version
rm -f ${BADFILE} ${JAVA_EXE} -cp ${TESTCLASSES} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
${TESTJAVA}/bin/javac CreateBadJar.java LD_PRELOAD=${LIBUMEM} ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
${JAVA_EXE} CreateBadJar ${BADFILE} "META-INF/MANIFEST.MF"
LD_PRELOAD=/lib/64/libumem.so ${JAVA_EXE} -jar ${BADFILE} > test.out 2>&1
grep "Invalid or corrupt jarfile" test.out grep "Invalid or corrupt jarfile" test.out
exit $? exit $?
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册