[jdk8u-dev] RFR: 8299804: Fix non-portable code in hotspot shell tests in 8u
zzambers
duke at openjdk.org
Wed Jan 11 12:36:26 UTC 2023
On Mon, 9 Jan 2023 20:28:00 GMT, Paul Hohensee <phh at openjdk.org> wrote:
>> Some hotspot shell tests use `==` for comparison inside of `[ ]`. However this is bash extension and it is not portable (posix test command only knows single `=`, see: [1]).
>>
>> This results in errors on systems where default shell is not bash, such as Ubuntu used in GHA (which defaults to "Dash" shell). E.g.:
>> `Test7107135.sh: 50: [: x/bin/gcc: unexpected operator`
>> Expressions are then treated as always false.
>>
>> Problem is only present on 8u as newer jdks use different approach for shell/jni tests and no longer have these shell tests.
>>
>> Testing:
>> Tests passed in GHA, logs no longer contain these errors. (Affected tests passed even before, as problematic comparisons happen to have such form and placement, that they did not cause test failures, but logs contained error messages.)
>>
>> [1] https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
>
> Lgtm.
@phohensee @jerboaa thanks
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/227
More information about the jdk8u-dev
mailing list