Skip to content

Commit cfa108a

Browse files
authored
[JDK18+] Set java.security.manager property for system tests (#3310)
In JDK18+, java.security.manager == null behaves as -Djava.security.manager=disallow. In JDK17-, java.security.manager == null behaves as -Djava.security.manager=allow. In case of system tests, the base infra (STF) which is used to launch tests utilizes the security manager in net.adoptopenjdk.loadTest.LoadTest.overrideSecurityManager. For system tests to work as expected, -Djava.security.manager=allow behaviour is needed in JDK18+. Related: eclipse-openj9/openj9#14412 Signed-off-by: Babneet Singh <[email protected]>
1 parent 58a0ea5 commit cfa108a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

system/systemtest.mk

+11
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,17 @@ ifeq (,$(findstring $(JDK_IMPL),hotspot))
4646
OPENJ9_PRAM=;$(SYSTEMTEST_RESROOT)$(D)openj9-systemtest
4747
endif
4848

49+
# In JDK18+, java.security.manager == null behaves as -Djava.security.manager=disallow.
50+
# In JDK17-, java.security.manager == null behaves as -Djava.security.manager=allow.
51+
# In case of system tests, the base infra (STF) which is used to launch tests utilizes
52+
# the security manager in net.adoptopenjdk.loadTest.LoadTest.overrideSecurityManager.
53+
# For system tests to work as expected, -Djava.security.manager=allow behaviour is
54+
# needed in JDK18+.
55+
# Related: https://github.com/eclipse-openj9/openj9/issues/14412
56+
ifeq ($(filter 8 9 10 11 12 13 14 15 16 17, $(JDK_VERSION)),)
57+
JVM_OPTIONS:=-Djava.security.manager=allow $(JVM_OPTIONS)
58+
endif
59+
4960
define SYSTEMTEST_CMD_TEMPLATE
5061
perl $(SYSTEMTEST_RESROOT)$(D)STF$(D)stf.core$(D)scripts$(D)stf.pl \
5162
-test-root=$(Q)$(SYSTEMTEST_RESROOT)$(D)STF;$(SYSTEMTEST_RESROOT)$(D)aqa-systemtest$(OPENJ9_PRAM)$(Q) \

0 commit comments

Comments
 (0)