[jdk8u-dev] RFR: 8299804: Fix non-portable code in hotspot shell tests in 8u
Severin Gehwolf
sgehwolf at openjdk.org
Tue Jan 10 17:46:08 UTC 2023
On Mon, 9 Jan 2023 13:02:17 GMT, zzambers <duke 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
Marked as reviewed by sgehwolf (Reviewer).
-------------
PR: https://git.openjdk.org/jdk8u-dev/pull/227
More information about the jdk8u-dev
mailing list