Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start/stop agent with every vm/jdwp test #6044

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions jck/jck-jdwp-test-drive.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/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/"
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" | while read -r test;
do
cp "$3" temp_jdwp.jtb
# Replace tests=vm/jdwp line with tests=<Individual test case>
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
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
2 changes: 2 additions & 0 deletions jck/jck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,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 $(TEST_STATUS) $(GEN_SUMMARY_GENERIC)$(JCK_ROOT) $(JCK_VERSION_NUMBER)
EXEC_RUNTIME_TEST_WITH_RMI_SERVICES = $(EXEC_RUNTIME_TEST_WITH_AGENT)

ifeq ($(JDK_VERSION), 8)
Expand Down
35 changes: 34 additions & 1 deletion jck/runtime.vm/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,36 @@
<group>jck</group>
</groups>
</test>
<test>
<testCaseName>jck-runtime-vm-jdwp-jdk-8-11</testCaseName>
<disables>
<disable>
<comment>backlog/issues/477</comment>
<impl>ibm</impl>
</disable>
<disable>
<comment>backlog/issues/477</comment>
<impl>openj9</impl>
</disable>
</disables>
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \
$(EXEC_RUNTIME_TEST_JDWP); \
</command>
<levels>
<level>sanity</level>
</levels>
<groups>
<group>jck</group>
</groups>
<versions>
<version>8</version>
<version>11</version>
</versions>
</test>
<test>
<test>
<testCaseName>jck-runtime-vm-jdwp</testCaseName>
<disables>
Expand All @@ -54,7 +84,7 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(GEN_JTB_GENERIC) tests=vm/jdwp testsuite=RUNTIME concurrency=1; \
<command>$(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
Expand All @@ -65,6 +95,9 @@
<groups>
<group>jck</group>
</groups>
<versions>
<version>17+<version>
</versions>
</test>
<test>
<testCaseName>jck-runtime-vm-jvmti</testCaseName>
Expand Down