8041727: [TESTBUG] runtime/jsig/Test8017498.sh fails with Test8017498.sh: 50: [: x/usr/bin/gcc: unexpected operator
Fixed shell script issues Reviewed-by: dcubed, gtriantafill
This commit is contained in:
parent
e7456dcf86
commit
3a78ac3c1b
@ -31,15 +31,14 @@
|
|||||||
## @bug 8022301
|
## @bug 8022301
|
||||||
## @bug 8025519
|
## @bug 8025519
|
||||||
## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
|
## @summary sigaction(sig) results in process hang/timed-out if sig is much greater than SIGRTMAX
|
||||||
## @ignore 8041727
|
|
||||||
## @run shell/timeout=60 Test8017498.sh
|
## @run shell/timeout=60 Test8017498.sh
|
||||||
##
|
##
|
||||||
|
|
||||||
if [ "${TESTSRC}" = "" ]
|
if [ -z "${TESTSRC}" ]; then
|
||||||
then
|
TESTSRC="${PWD}"
|
||||||
TESTSRC=${PWD}
|
|
||||||
echo "TESTSRC not set. Using "${TESTSRC}" as default"
|
echo "TESTSRC not set. Using "${TESTSRC}" as default"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "TESTSRC=${TESTSRC}"
|
echo "TESTSRC=${TESTSRC}"
|
||||||
## Adding common setup Variables for running shell tests.
|
## Adding common setup Variables for running shell tests.
|
||||||
. ${TESTSRC}/../../test_env.sh
|
. ${TESTSRC}/../../test_env.sh
|
||||||
@ -52,12 +51,12 @@ case "$OS" in
|
|||||||
Linux)
|
Linux)
|
||||||
echo "Testing on Linux"
|
echo "Testing on Linux"
|
||||||
gcc_cmd=`which gcc`
|
gcc_cmd=`which gcc`
|
||||||
if [ "x$gcc_cmd" == "x" ]; then
|
if [ -z "$gcc_cmd" ]; then
|
||||||
echo "WARNING: gcc not found. Cannot execute test." 2>&1
|
echo "WARNING: gcc not found. Cannot execute test." 2>&1
|
||||||
exit 0;
|
exit 0;
|
||||||
fi
|
fi
|
||||||
MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}${VM_CPU}${FS}libjsig.so
|
MY_LD_PRELOAD=${TESTJAVA}${FS}jre${FS}lib${FS}${VM_CPU}${FS}libjsig.so
|
||||||
if [ "$VM_BITS" == "32" ] && [ "$VM_CPU" != "arm" ] && [ "$VM_CPU" != "ppc" ]; then
|
if [ "$VM_BITS" = "32" ] && [ "$VM_CPU" != "arm" ] && [ "$VM_CPU" != "ppc" ]; then
|
||||||
EXTRA_CFLAG=-m32
|
EXTRA_CFLAG=-m32
|
||||||
fi
|
fi
|
||||||
echo MY_LD_PRELOAD = ${MY_LD_PRELOAD}
|
echo MY_LD_PRELOAD = ${MY_LD_PRELOAD}
|
||||||
@ -70,7 +69,7 @@ esac
|
|||||||
|
|
||||||
THIS_DIR=.
|
THIS_DIR=.
|
||||||
|
|
||||||
cp ${TESTSRC}${FS}*.java ${THIS_DIR}
|
cp "${TESTSRC}${FS}"*.java "${THIS_DIR}"
|
||||||
${COMPILEJAVA}${FS}bin${FS}javac *.java
|
${COMPILEJAVA}${FS}bin${FS}javac *.java
|
||||||
|
|
||||||
$gcc_cmd -DLINUX -fPIC -shared \
|
$gcc_cmd -DLINUX -fPIC -shared \
|
||||||
@ -80,16 +79,19 @@ $gcc_cmd -DLINUX -fPIC -shared \
|
|||||||
-I${COMPILEJAVA}${FS}include${FS}linux \
|
-I${COMPILEJAVA}${FS}include${FS}linux \
|
||||||
${TESTSRC}${FS}TestJNI.c
|
${TESTSRC}${FS}TestJNI.c
|
||||||
|
|
||||||
|
if [ $? -ne 0 ] ; then
|
||||||
|
echo "Compile failed, Ignoring failed compilation and forcing the test to pass"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# run the java test in the background
|
# run the java test in the background
|
||||||
cmd="LD_PRELOAD=$MY_LD_PRELOAD \
|
cmd="LD_PRELOAD=$MY_LD_PRELOAD \
|
||||||
${TESTJAVA}${FS}bin${FS}java \
|
${TESTJAVA}${FS}bin${FS}java \
|
||||||
-Djava.library.path=. -server TestJNI 100"
|
-Djava.library.path=. -server TestJNI 100"
|
||||||
echo "$cmd > test.out 2>&1"
|
echo "$cmd > test.out"
|
||||||
eval $cmd > test.out 2>&1
|
eval $cmd > test.out
|
||||||
|
|
||||||
grep "old handler" test.out > ${NULL}
|
if grep "old handler" test.out > ${NULL}; then
|
||||||
if [ $? = 0 ]
|
|
||||||
then
|
|
||||||
echo "Test Passed"
|
echo "Test Passed"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user