[PATCH][TESTBUG] JDK-8214052: Wrong shell used
Sergey
merkel05 at gmail.com
Wed Dec 5 20:47:40 UTC 2018
Hi,
As stated in the bug description [1] there are few
places in the tests where bash syntax is being used.
First one is (as per ticket):
- vmTestbase/vm/compiler/CodeCacheInfoOnCompilation
I've made a quick fix for that one and patch could be found
inlined below.
Moreover what I've observed is that simple grepping gives me
another test script, that uses bash extensions:
- GeneratePropertyPassword.sh [2]
It seems to be linked with another ticket [3] which is closed,
though it still uses the bash "[[" extension. Perhaps that fix [4]
needs to be reapplied.
In regards to the patch itself, please let me know if I've missed
something. Changes were successfully tested with `dash v0.5.10.2-1`.
[1] https://bugs.openjdk.java.net/browse/JDK-8214052
[2]
http://hg.openjdk.java.net/jdk/sandbox/file/413c28945e0f/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh#l37
[3] https://bugs.openjdk.java.net/browse/JDK-8025886
[4] http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/a2551e12a9ea0.5.10.2-1
Regards,
su -
diff --git
a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/run.sh
b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/run.sh
---
a/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/run.sh
+++
b/test/hotspot/jtreg/vmTestbase/vm/compiler/CodeCacheInfoOnCompilation/run.sh
@@ -27,7 +27,7 @@
ver=$(${TESTED_JAVA_HOME}/bin/java ${JAVA_OPTS} -version 2>&1)
isComp=$( echo ${ver} | grep -c "compiled mode")
-if [[ $isComp != 1 ]]; then
+if [ "$isComp" -ne 1 ]; then
echo "skipped. This test works only with -Xcomp"
exit
fi
@@ -40,7 +40,7 @@
res=$(${TESTED_JAVA_HOME}/bin/java ${JAVA_OPTS}
-XX:+PrintCodeCacheOnCompilation -XX:-Inline
vm.compiler.CodeCacheInfoOnCompilation.PrintOnCall | egrep -ce "${pattern}")
echo "res: " ${res}
-if (( "${res}" != "0" )); then
+if [ "$res" != "0" ]; then
echo "passed"
true
else
More information about the core-libs-dev
mailing list