Skip to content

Commit

Permalink
[JDK18+] Set java.security.manager property for system tests
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
babsingh committed Feb 2, 2022
1 parent 5a03ab3 commit a280aae
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions system/systemtest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ ifeq (,$(findstring $(JDK_IMPL),hotspot))
OPENJ9_PRAM=;$(SYSTEMTEST_RESROOT)$(D)openj9-systemtest
endif

# 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: https://github.com/eclipse-openj9/openj9/issues/14412
ifeq ($(filter 8 9 10 11 12 13 14 15 16 17, $(JDK_VERSION)),)
JVM_OPTIONS:=-Djava.security.manager=allow $(JVM_OPTIONS)
endif

define SYSTEMTEST_CMD_TEMPLATE
perl $(SYSTEMTEST_RESROOT)$(D)STF$(D)stf.core$(D)scripts$(D)stf.pl \
-test-root=$(Q)$(SYSTEMTEST_RESROOT)$(D)STF;$(SYSTEMTEST_RESROOT)$(D)aqa-systemtest$(OPENJ9_PRAM)$(Q) \
Expand Down

0 comments on commit a280aae

Please sign in to comment.