[PATCH][TESTBUG] JDK-8214052: Wrong shell used
jesper.wilhelmsson at oracle.com
jesper.wilhelmsson at oracle.com
Sat Dec 8 03:10:06 UTC 2018
Hi,
Why do you replace != with -ne in one case and not in the other?
Thanks,
/Jesper
> On 8 Dec 2018, at 02:19, Sergey <merkel05 at gmail.com> wrote:
>
> Hi everyone,
>
> Could anyone please review that tiny fix for test script below?
> That would be extremely great if anyone could sponsor the change as well.
>
> Thanks and regards,
> Sergei
>
> On Thu, Dec 6, 2018, 08:37 Sergey <merkel05 at gmail.com wrote:
>
>> Hi,
>>
>> I've posted the original mail to the wrong mailing list and thanks to
>> David for guidance.
>>
>> Problem goes as follows: as stated in the bug description [1] there are few
>> places in the tests where extended bash syntax is being used.
>>
>> First one is (as per ticket in the headline):
>>
>> - vmTestbase/vm/compiler/CodeCacheInfoOnCompilation
>>
>> I've made a quick fix for that one and patch could be found
>> inlined below.
>>
>> Moreover what I've noticed is that grep gives me
>> another test script:
>>
>> - GeneratePropertyPassword.sh [2]
>>
>> that seems to be linked with another ticket [3] which is closed,
>> though it still uses the bash "[[" extension. Perhaps this [4] fix
>> needs to be reapplied.
>>
>> In regards to the patch below, 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 hotspot-dev
mailing list