diff --git a/jck/jck-jdwp-test-drive.sh b/jck/jck-jdwp-test-drive.sh new file mode 100644 index 0000000000..ed4c5886e2 --- /dev/null +++ b/jck/jck-jdwp-test-drive.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +jckAgentPID=0 +harnessExitCode=0 +jckHarnessPID=0 + +startJCKAgent() { + echo "Starting JCK agent.." + eval "$1" + jckAgentPID=$! + echo "Agent started with PID $jckAgentPID" +} + +stopJCKAgent() { + echo "Test complete. Stopping JCK Agent.." + kill -9 $jckAgentPID +} + +startJCKHarness() { + echo "Starting JCK harness.." + eval "$1" + jckHarnessPID=$! +} + +queryVmJdwpTest() { + local jck_root_path="$1/JCK-runtime-$2/" + eval "$3/bin/java -cp $jck_root_path/lib/javatest.jar com.sun.javatest.finder.ShowTests -finder com.sun.javatest.finder.HTMLTestFinder -end $jck_root_path/tests/testsuite.html -initial vm/jdwp | tr -d "[:blank:]"" +} + + +# Query all of the tests in $(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/tests/vm/jdwp/ +queryVmJdwpTest "$6" "$7" "$8" | while read -r test; +do + cp "$3" temp_jdwp.jtb + # Replace tests=vm/jdwp line with tests= + sed -i -e "s/tests vm/jdwp/tests $test/g" temp_jdwp.jtb + startJCKAgent "$1" + # $(TEST_STATUS) and $(GEN_SUMMARY_GENERIC) are passed into startJCKHarness + # startJCKHarness "$2" temp_jdwp.jtb "$4" "$5" tests=$test testsuite=RUNTIME + startJCKHarness "$2" temp_jdwp.jtb tests=$test testsuite=RUNTIME + sleep 60 # 60 second timeout + if kill -s 0 $jckHarnessPID 2>nul; then + echo "Testcase $test : Process $jckHarnessPID is still running after 60 seconds... killing..." + kill -9 $jckHarnessPID + harnessExitCode=124 + else + wait $jckHarnessPID + harnessExitCode=$? + fi + stopJCKAgent +done + +exit $harnessExitCode diff --git a/jck/jck.mk b/jck/jck.mk index 3b538f5e3c..d9de8b25e5 100644 --- a/jck/jck.mk +++ b/jck/jck.mk @@ -162,6 +162,7 @@ else endif $(shell chmod +x $(TEST_ROOT)$(D)jck$(D)agent-drive.sh) +$(shell chmod +x $(TEST_ROOT)$(D)jck$(D)jck-jdwp-test-drive.sh) START_MULTI_JVM_COMP_TEST = $(TEST_ROOT)$(D)jck$(D)agent-drive.sh '$(START_AGENT)' '$(START_HARNESS)' GEN_JTB_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) workdir=$(REPORTDIR) configAltPath=$(CONFIG_ALT_PATH) testJava=$(JAVA_TO_TEST) riJava=$(JAVA_TO_TEST) task=cmdfilegen spec=$(SPEC) $(APPLICATION_OPTIONS) @@ -171,9 +172,11 @@ START_RMIREG = $(TEST_JDK_HOME)/bin/rmiregistry > $(REPORTDIR)$(D)rmiregistry.lo 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_RUNTIME_TEST_NO_JTB = $(JAVA_TO_TEST) -jar $(JCK_ROOT)/JCK-runtime-$(JCK_VERSION_NUMBER)/lib/javatest.jar -config $(CONFIG_ALT_PATH)/$(JCK_VERSION)/runtime.jti 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_JDWP = $(TEST_ROOT)/jck/jck-jdwp-test-drive.sh '$(START_AGENT_GENERIC)' '$(EXEC_RUNTIME_TEST_NO_JTB)' @$(REPORTDIR)/generated.jtb $(JCK_ROOT) $(JCK_VERSION_NUMBER) $(TEST_JDK_HOME) EXEC_RUNTIME_TEST_WITH_RMI_SERVICES = $(EXEC_RUNTIME_TEST_WITH_AGENT) ifeq ($(JDK_VERSION), 8) diff --git a/jck/runtime.vm/playlist.xml b/jck/runtime.vm/playlist.xml index c71e51cced..9f5cda29fd 100644 --- a/jck/runtime.vm/playlist.xml +++ b/jck/runtime.vm/playlist.xml @@ -39,6 +39,38 @@ jck + + jck-runtime-vm-jdwp-jdk-8-11 + + + backlog/issues/477 + ibm + + + backlog/issues/477 + openj9 + + + + NoOptions + + $(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \ + $(EXEC_RUNTIME_TEST_JDWP) ; \ + + $(TEST_STATUS) ; \ + $(GEN_SUMMARY_GENERIC) tests=vm/jdwp testsuite=RUNTIME + + + sanity + + + jck + + + jck-runtime-vm-jdwp @@ -54,7 +86,7 @@ NoOptions - $(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \ + $(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \ $(EXEC_RUNTIME_TEST_WITH_AGENT); \ $(TEST_STATUS) ; \ $(GEN_SUMMARY_GENERIC) tests=vm/jdwp testsuite=RUNTIME @@ -65,6 +97,9 @@ jck + + 17+ + jck-runtime-vm-jvmti