Skip to content

Commit

Permalink
Use JavaTestUtil for all tck
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 Apr 17, 2023
1 parent 4fd9cfa commit b893491
Show file tree
Hide file tree
Showing 10 changed files with 479 additions and 227 deletions.
84 changes: 75 additions & 9 deletions jck/agent-drive.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,80 @@
#!/bin/bash

echo "Starting JCK agent.."
eval $1
if [ $# -eq 2 ]; then
echo "Starting JCK agent.."
eval $1
pid=$!
echo "Agent started with PID $pid"

echo "Starting JCK harness.."
eval $2

pid=$!
echo "Test complete. Stopping JCK Agent.."
kill -9 $pid
elif [ $# -eq 4 ]; then
echo "Starting RMI Registry.."
eval $1
pid1=$!
echo "RMI Registry started with PID $pid1"

echo "Agent started with PID $pid"
echo "Starting RMID.."
eval $2
pid2=$!
echo "RMID started with PID $pid2"

echo "Starting JCK agent.."
eval $3
pid3=$!
echo "Agent started with PID $pid3"

echo "Starting JCK harness.."
eval $4

echo "Test complete."

echo "Stopping RMI Registry.."
kill -9 $pid1

echo "Stopping RMID.."
kill -9 $pid2

echo "Stopping JCK Agent.."
kill -9 $pid3
elif [ $# -eq 5 ]; then
echo "Starting RMI Registry.."
eval $1
pid1=$!
echo "RMI Registry started with PID $pid1"

echo "Starting JCK harness.."
eval $2

echo "Test complete. Stopping JCK Agent.."
kill -9 $pid
echo "Starting RMID.."
eval $2
pid2=$!
echo "RMID started with PID $pid2"

echo "Starting TNAMESERV.."
eval $3
pid3=$!
echo "TNAMESERV started with PID $pid3"

echo "Starting JCK agent.."
eval $4
pid4=$!
echo "Agent started with PID $pid4"

echo "Starting JCK harness.."
eval $5

echo "Test complete."

echo "Stopping RMI Registry.."
kill -9 $pid1

echo "Stopping RMID.."
kill -9 $pid2

echo "Stopping TNAMESERV.."
kill -9 $pid3

echo "Stopping JCK Agent.."
kill -9 $pid4
fi
8 changes: 6 additions & 2 deletions jck/compiler.api/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(JCK_CMD_TEMPLATE) tests=api/javax_tools testsuite=COMPILER; \
<command>$(GEN_JTB_GENERIC) tests=api/javax_tools testsuite=COMPILER; \
$(EXEC_RUNTIME_TEST); \
$(GEN_SUMMARY_GENERIC) tests=api/javax_tools testsuite=COMPILER; \
$(TEST_STATUS)</command>
<levels>
<level>sanity</level>
Expand All @@ -105,7 +107,9 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(JCK_CMD_TEMPLATE) tests=api/signaturetest testsuite=COMPILER; \
<command>$(GEN_JTB_GENERIC) tests=api/signaturetest testsuite=COMPILER; \
$(EXEC_RUNTIME_TEST); \
$(GEN_SUMMARY_GENERIC) tests=api/signaturetest testsuite=COMPILER; \
$(TEST_STATUS)</command>
<levels>
<level>sanity</level>
Expand Down
4 changes: 3 additions & 1 deletion jck/devtools.java2schema/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(JCK_CMD_TEMPLATE) tests=java2schema/DefaultMapping testsuite=DEVTOOLS; \
<command>$(GEN_JTB_GENERIC) tests=java2schema/DefaultMapping testsuite=DEVTOOLS; \
$(EXEC_RUNTIME_TEST); \
$(GEN_SUMMARY_GENERIC) tests=java2schema/DefaultMapping testsuite=DEVTOOLS; \
$(TEST_STATUS)</command>
<levels>
<level>sanity</level>
Expand Down
4 changes: 3 additions & 1 deletion jck/devtools.schema_bind/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
<variations>
<variation>NoOptions</variation>
</variations>
<command>$(JCK_CMD_TEMPLATE) tests=schema_bind/bind_factoryMethod testsuite=DEVTOOLS; \
<command>$(GEN_JTB_GENERIC) tests=schema_bind/bind_factoryMethod testsuite=DEVTOOLS; \
$(EXEC_RUNTIME_TEST); \
$(GEN_SUMMARY_GENERIC) tests=schema_bind/bind_factoryMethod testsuite=DEVTOOLS; \
$(TEST_STATUS)</command>
<levels>
<level>sanity</level>
Expand Down
28 changes: 23 additions & 5 deletions jck/jck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,34 @@ ifneq ($(filter aix_ppc-64 zos_390 linux_ppc-64_le linux_390-64, $(SPEC)),)
START_HARNESS = ssh -o StrictHostKeyChecking=no jenkins@$(AGENT_NODE) $(REFERENCE_JAVA_CMD) -jar $(JCK_ROOT)$(D)JCK-runtime-$(JCK_VERSION_NUMBER)$(D)lib$(D)javatest.jar -config $(WORKSPACE)$(D)compiler.jti @$(WORKSPACE)$(D)generated.jtb
else
REFERENCE_JAVA_CMD=$(TEST_ROOT)/../additionaljdkbinary/bin/java
GEN_JTB = $(REFERENCE_JAVA_CMD) -Djvm.options=$(Q)$(JVM_OPTIONS)$(Q) -Dother.opts=$(Q)$(OTHER_OPTS)$(Q) -cp $(TEST_ROOT)$(D)jck$(D)jtrunner$(D)bin JavatestUtil testRoot=$(TEST_ROOT) jckRoot=$(JCK_ROOT) jckversion=$(JCK_VERSION) testJava=$(JAVA_TO_TEST) riJava=$(REFERENCE_JAVA_CMD) workdir=$(REPORTDIR) configAltPath=$(CONFIG_ALT_PATH) agentHost=localhost task=cmdfilegen testExecutionType=multijvm
GEN_JTB = $(REFERENCE_JAVA_CMD) -Djvm.options=$(Q)$(JVM_OPTIONS)$(Q) -Dother.opts=$(Q)$(OTHER_OPTS)$(Q) -cp $(TEST_ROOT)$(D)jck$(D)jtrunner$(D)bin JavatestUtil testRoot=$(TEST_ROOT) jckRoot=$(JCK_ROOT) jckversion=$(JCK_VERSION) testJava=$(JAVA_TO_TEST) riJava=$(REFERENCE_JAVA_CMD) workdir=$(REPORTDIR) configAltPath=$(CONFIG_ALT_PATH) task=cmdfilegen testExecutionType=multijvm
GEN_SUMMARY = $(JAVA_TO_TEST) -Djvm.options=$(Q)$(JVM_OPTIONS)$(Q) -Dother.opts=$(Q)$(OTHER_OPTS)$(Q) -cp $(TEST_ROOT)$(D)jck$(D)jtrunner$(D)bin JavatestUtil testRoot=$(TEST_ROOT) jckRoot=$(JCK_ROOT) jckversion=$(JCK_VERSION) configAltPath=$(CONFIG_ALT_PATH) workdir=$(REPORTDIR) task=summarygen
START_AGENT = $(JAVA_TO_TEST) -Djavatest.security.allowPropertiesAccess=true -Djava.security.policy=$(JCK_ROOT)$(D)JCK-compiler-$(JCK_VERSION_NUMBER)$(D)lib$(D)jck.policy -classpath $(Q)$(JCK_ROOT)$(D)JCK-compiler-$(JCK_VERSION_NUMBER)$(D)lib$(D)javatest.jar$(P)$(JCK_ROOT)$(D)JCK-compiler-$(JCK_VERSION_NUMBER)$(D)classes$(Q) com.sun.javatest.agent.AgentMain -passive -trace &> $(REPORTDIR)$(D)agent.log &
START_HARNESS = $(REFERENCE_JAVA_CMD) -jar $(JCK_ROOT)$(D)JCK-runtime-$(JCK_VERSION_NUMBER)$(D)lib$(D)javatest.jar -config $(CONFIG_ALT_PATH)$(D)jck$(JCK_VERSION_NUMBER)$(D)compiler.jti @$(REPORTDIR)$(D)generated.jtb
endif

define START_MULTI_JVM_COMP_TEST
chmod +x $(TEST_ROOT)$(D)jck$(D)agent-drive.sh; \
$(TEST_ROOT)$(D)jck$(D)agent-drive.sh '$(START_AGENT)' '$(START_HARNESS)'
endef
$(shell chmod +x $(TEST_ROOT)$(D)jck$(D)agent-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) task=cmdfilegen spec=$(SPEC)
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) task=summarygen spec=$(SPEC)
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
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
START_TNAMESRV = $(TEST_JDK_HOME)/bin/tnameserv -ORBInitialPort 9876
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_COMP_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)

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)'
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)'
endif

ifeq (8, $(JDK_VERSION))
COMPILER_LANG_CLASS_TESTS_GROUP1=$(Q)lang/CLSS/clss426;lang/CLSS/clss419;lang/CLSS/clss089;lang/CLSS/clss421;lang/CLSS/clss045;lang/CLSS/clss087;lang/CLSS/clss073;lang/CLSS/clss417;lang/CLSS/clss428;lang/CLSS/clss410;lang/CLSS/clss074;lang/CLSS/clss444;lang/CLSS/clss020;lang/CLSS/clss212;lang/CLSS/clss018;lang/CLSS/clss215;lang/CLSS/clss027;lang/CLSS/clss443;lang/CLSS/clss481;lang/CLSS/clss475;lang/CLSS/clss223;lang/CLSS/clss011;lang/CLSS/clss029;lang/CLSS/clss016;lang/CLSS/clss224;lang/CLSS/clss472;lang/CLSS/clss411;lang/CLSS/clss075;lang/CLSS/clss072;lang/CLSS/clss416;lang/CLSS/clss086$(Q)
Expand Down
Loading

0 comments on commit b893491

Please sign in to comment.