Skip to content

Commit

Permalink
Limit rmi services to only rmi test + Add agent startup to jdwp
Browse files Browse the repository at this point in the history
Signed-off-by: Mesbah Alam <Mesbah_Alam@ca.ibm.com>
  • Loading branch information
Mesbah-Alam committed Jun 6, 2023
1 parent 02824d8 commit 5ed2e39
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 26 deletions.
36 changes: 24 additions & 12 deletions jck/agent-drive.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash -ue
#!/bin/bash

jckAgentPID=0
rmiRegistryPID=0
rmidPID=0
tnameservPID=0
harnessExitCode=0

startJCKAgent() {
echo "Starting JCK agent.."
Expand All @@ -19,7 +20,7 @@ stopJCKAgent() {

startJCKHarness() {
echo "Starting JCK harness.."
eval $1
eval $1; return $?
}

startRMIRegistry() {
Expand Down Expand Up @@ -61,24 +62,35 @@ stopTNameServ() {
if [ $# -eq 2 ]; then
startJCKAgent "$1"
startJCKHarness "$2"
harnessExitCode=$?
stopJCKAgent
elif [ $# -eq 3 ]; then
startJCKAgent "$1"
startTNameServ "$2"
startJCKHarness "$3"
harnessExitCode=$?
stopJCKAgent
stopTNameServ
elif [ $# -eq 4 ]; then
startRMIRegistry "$1"
startRMID "$2"
startJCKAgent "$3"
startJCKAgent "$1"
startRMIRegistry "$2"
startRMID "$3"
startJCKHarness "$4"
harnessExitCode=$?
stopJCKAgent
stopRMIRegistry
stopRMID
stopJCKAgent
elif [ $# -eq 5 ]; then
startRMIRegistry "$1"
startRMID "$2"
startTNameServ "$3"
startJCKAgent "$4"
startJCKAgent "$1"
startRMIRegistry "$2"
startRMID "$3"
startTNameServ "$4"
startJCKHarness "$5"
harnessExitCode=$?
stopJCKAgent
stopRMIRegistry
stopRMID
stopJCKAgent
stopTNameServ
stopJCKAgent
fi

exit $harnessExitCode
9 changes: 5 additions & 4 deletions jck/jck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -150,20 +150,21 @@ GEN_JTB_GENERIC = $(JAVA_TO_TEST) -Djvm.options=$(Q)$(JVM_OPTIONS)$(Q) -Dother.o
GEN_SUMMARY_GENERIC = $(JAVA_TO_TEST) -Djvm.options=$(Q)$(JVM_OPTIONS)$(Q) -Dother.opts=$(Q)$(OTHER_OPTS)$(Q) -cp $(TEST_ROOT)/jck/jtrunner/bin JavatestUtil testRoot=$(TEST_ROOT) jckRoot=$(JCK_ROOT) jckversion=$(JCK_VERSION) configAltPath=$(CONFIG_ALT_PATH) workdir=$(REPORTDIR) spec=$(SPEC) task=summarygen
START_AGENT_GENERIC = $(JAVA_TO_TEST) -Djavatest.security.allowPropertiesAccess=true -Djava.security.policy=$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/jck.policy -classpath $(Q)$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/javatest.jar$(P)$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/classes$(Q) com.sun.javatest.agent.AgentMain -passive -trace &> $(REPORTDIR)/agent.log &
START_RMIREG = $(TEST_JDK_HOME)/bin/rmiregistry > $(REPORTDIR)$(D)rmiregistry.log &
START_RMID = $(TEST_JDK_HOME)/bin/rmid -J-Dsun.rmi.activation.execPolicy=none -J-Djava.security.policy=$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/jck.policym > $(REPORTDIR)$(D)rmid.log &
START_RMID = $(TEST_JDK_HOME)/bin/rmid -J-Dsun.rmi.activation.execPolicy=none -J-Djava.security.policy=$(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/jck.policy > $(REPORTDIR)$(D)rmid.log &
START_TNAMESRV = $(TEST_JDK_HOME)/bin/tnameserv -ORBInitialPort 9876 > $(REPORTDIR)$(D)tnameserv.log &
EXEC_RUNTIME_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/runtime.jti @$(REPORTDIR)/generated.jtb
EXEC_COMPILER_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-compiler-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/compiler.jti @$(REPORTDIR)/generated.jtb
EXEC_DEVTOOLS_TEST = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-devtools-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/devtools.jti @$(REPORTDIR)/generated.jtb
EXEC_RUNTIME_TEST_WITH_AGENT = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(EXEC_RUNTIME_TEST)'
EXEC_RUNTIME_TEST_WITH_SERVICES = $(EXEC_RUNTIME_TEST)
EXEC_RUNTIME_TEST_WITH_RMI_SERVICES = $(EXEC_RUNTIME_TEST_WITH_AGENT)

ifeq ($(JDK_VERSION), 8)
EXEC_RUNTIME_TEST_WITH_SERVICES = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(START_RMIREG)' '$(START_RMID)' '$(START_TNAMESRV)' '$(EXEC_RUNTIME_TEST)'
EXEC_RUNTIME_TEST_WITH_RMI_SERVICES = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(START_RMIREG)' '$(START_RMID)' '$(START_TNAMESRV)' '$(EXEC_RUNTIME_TEST)'
EXEC_RUNTIME_TEST_WITH_AGENT = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(START_TNAMESRV)' '$(EXEC_RUNTIME_TEST)'
endif

ifeq ($(JDK_VERSION), 11)
EXEC_RUNTIME_TEST_WITH_SERVICES = $(TEST_ROOT)/jck/agent-drive.sh '$(START_RMIREG)' '$(START_RMID)' '$(START_AGENT_GENERIC)' '$(EXEC_RUNTIME_TEST)'
EXEC_RUNTIME_TEST_WITH_RMI_SERVICES = $(TEST_ROOT)/jck/agent-drive.sh '$(START_AGENT_GENERIC)' '$(START_RMIREG)' '$(START_RMID)' '$(EXEC_RUNTIME_TEST)'
endif

ifeq (8, $(JDK_VERSION))
Expand Down
18 changes: 9 additions & 9 deletions jck/runtime.api/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/java_util/regex testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/java_util/regex testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -400,7 +400,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/java_util/ResourceBundle testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/java_util/ResourceBundle testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -554,8 +554,8 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/java_net testsuite=RUNTIME concurrency=1; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES) ; \
<command>$(GEN_JTB_GENERIC) tests=api/java_net testsuite=RUNTIME concurrency=1 && \
$(EXEC_RUNTIME_TEST_WITH_AGENT) && \
$(GEN_SUMMARY_GENERIC) tests=api/java_net testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -595,7 +595,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/java_rmi testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_RMI_SERVICES); \
$(GEN_SUMMARY_GENERIC) tests=api/java_rmi testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -691,7 +691,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/java_util testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/java_util testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -848,7 +848,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/javax_management testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/javax_management testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -1104,7 +1104,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/javax_xml testsuite=RUNTIME concurrency=1; \
$(EXEC_RUNTIME_TEST_WITH_SERVICES); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/javax_xml testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down Expand Up @@ -1158,7 +1158,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=api/org_omg testsuite=RUNTIME; \
$(EXEC_RUNTIME_TEST); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=api/org_omg testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down
2 changes: 1 addition & 1 deletion jck/runtime.vm/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \
$(EXEC_RUNTIME_TEST); \
$(EXEC_RUNTIME_TEST_WITH_AGENT); \
$(GEN_SUMMARY_GENERIC) tests=vm/jdwp testsuite=RUNTIME; \
$(TEST_STATUS)</command>
<levels>
Expand Down

0 comments on commit 5ed2e39

Please sign in to comment.