summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew McDermott <andrew.mcdermott@linaro.org>2013-11-20 10:31:19 +0000
committerAndrew McDermott <andrew.mcdermott@linaro.org>2013-11-20 11:51:46 +0000
commit373cdbb32122ca95c8fe157a4ba976a1e842329e (patch)
tree9fb3d583a4ee5b07b3019e3bc61c520f91024306
parent78c84dc5583bd762d012c7c23df6904b83206810 (diff)
Matches commit 751be8e82a104ad60e7fa67227cff2bc6e10a01a
commit 751be8e82a104ad60e7fa67227cff2bc6e10a01a Author: Andrew McDermott <andrew.mcdermott@linaro.org> Date: Thu Nov 14 15:11:19 2013 +0000 Rework OpenJDK tests to invoke jtreg directly This commit reworks the invocation of the JTREG tests to rely on jtreg(1) directly. It was previously using the makefiles in the OpenJDK test directories but there were significant differences between the JDK Makefile and the hotspot Makefile which added unnecessary complexity, particularly as we now want to run tests against both -client and -server VMs. There are also additional parameters for specifying the test timeout and job concurrency. And I also moved the exclude file into this repo so that it can be subject to code reviews. Change-Id: Ic90df7969f862c3fc5ecb71f658601cd2e1d89ba Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org> Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
-rwxr-xr-xmake-yaml-files.sh118
1 files changed, 39 insertions, 79 deletions
diff --git a/make-yaml-files.sh b/make-yaml-files.sh
index da2cf5e..8e3e07a 100755
--- a/make-yaml-files.sh
+++ b/make-yaml-files.sh
@@ -21,7 +21,11 @@
progname=$(basename $0)
-function test_setup_content() {
+function yaml_test_case_content() {
+ local testname=$1
+
+ oldifs=$IFS
+
IFS='' read -r -d '' t1 <<EOF
# Copyright (C) $(date +%Y), Linaro Limited.
#
@@ -38,7 +42,7 @@ function test_setup_content() {
# PLEASE DO NOT HAND EDIT THIS FILE.
#
metadata:
- name: jtreg-setup
+ name: ${testname}
format: "Lava-Test-Shell Test Definition 1.0"
description: "Regression tests for the OpenJDK platform"
version: 1.0
@@ -50,105 +54,61 @@ metadata:
- test
devices:
- rtsm_ve-armv8
-EOF
-
- IFS='' read -r -d '' t2 <<-'EOF'
+params:
+ - 'JAVA_VM=-client'
+ - 'JTREG_VERBOSE=-v1'
+ - 'JTREG_CONC=-conc:1'
+ - 'JTREG_TIMEOUT=-timeout:3'
+ - 'JTREG_EXCLUDE_FILE=../jtreg/exclude.txt'
+ - 'PRODUCT_HOME=/usr/lib/jvm/java-8-openjdk'
install:
git-repos:
- git://git.linaro.org/leg/openjdk/jtreg-bin.git
- - git://git.linaro.org/leg/openjdk/openjdk8-aarch64-test-archive.git
- git://git.linaro.org/qa/test-definitions.git
+EOF
+
+ IFS='' read -r -d '' t2 <<-'EOF'
run:
steps:
- - 'cp -r /lava/tests/$TESTRUN_ID $HOME'
- - 'echo "export JTREG_TESTRUN_ID=$HOME/$TESTRUN_ID" > $HOME/jtreg-setup.env'
- - 'source $HOME/jtreg-setup.env'
- - 'TEST_DIR=$JTREG_TESTRUN_ID/openjdk8-aarch64-test-archive'
- - 'CLASSES_DIR=$TEST_DIR/openjdk8-aarch64-port-snapshot/JTwork/classes'
- - 'JT_HOME=$JTREG_TESTRUN_ID/jtreg-bin/jtreg'
- - 'for i in $TEST_DIR/openjdk8-aarch64-port-snapshot/jdk/*; do find $i -print | xargs touch -d now; done'
- - 'for i in $TEST_DIR/openjdk8-aarch64-port-snapshot/hotspot/*; do find $i -print | xargs touch -d now; done'
- - 'for i in $CLASSES_DIR/*; do find $i -print | xargs touch -d tomorrow; done'
- - 'echo "PATH=$JTREG_TESTRUN_ID/jtreg-bin/jtreg/linux/bin:$PATH" >> $HOME/jtreg-setup.env'
- - 'echo "TEST_DIR=$JTREG_TESTRUN_ID/openjdk8-aarch64-test-archive" >> $HOME/jtreg-setup.env'
- - 'echo "CLASSES_DIR=$TEST_DIR/openjdk8-aarch64-port-snapshot/JTwork/classes" >> $HOME/jtreg-setup.env'
- - 'echo "export JT_HOME=$JTREG_TESTRUN_ID/jtreg-bin/jtreg" >> $HOME/jtreg-setup.env'
- - 'echo "export JT_JAVA=/usr/lib/jvm/java-8-openjdk/bin/java" >> $HOME/jtreg-setup.env'
- - 'echo "export PRODUCT_HOME=/usr/lib/jvm/java-8-openjdk" >> $HOME/jtreg-setup.env'
- - 'echo "export JDK_TEST_DIR=$TEST_DIR/openjdk8-aarch64-port-snapshot/jdk/test" >> $HOME/jtreg-setup.env'
- - 'echo "export HOTSPOT_TEST_DIR=$TEST_DIR/openjdk8-aarch64-port-snapshot/hotspot/test" >> $HOME/jtreg-setup.env'
- - 'echo "export JTREG=$JT_HOME/linux/bin/jtreg-lava" >> $HOME/jtreg-setup.env'
- - 'echo "export JTREG_LAVA_PREBUILT_CLASSES_DIR=$CLASSES_DIR" >> $HOME/jtreg-setup.env'
- - 'echo "env" >> $HOME/jtreg-setup.env'
- - 'cat $HOME/jtreg-setup.env'
- - 'lava-test-case jtreg-setup --result pass'
+ - 'PATH=/lava/tests/$TESTRUN_ID/jtreg-bin/jtreg/linux/bin:$PATH'
+ - 'cd /lava/tests/$TESTRUN_ID/test-definitions/openembedded/scripts'
EOF
IFS=$oldifs
echo "${t1}${t2}"
}
-function yaml_content() {
- local testname=$1
-
+function yaml_postamble_content() {
oldifs=$IFS
-
- IFS='' read -r -d '' t1 <<EOF
-# Copyright (C) $(date +%Y), Linaro Limited.
-#
-# PLEASE DO NOT HAND EDIT THIS FILE.
-#
-# This file has been auto-generated from:
-#
-# $progname
-#
-# which can be found in the following repo:
-#
-# git://git.linaro.org/leg/openjdk/jtreg-lava-scripts
-#
-# PLEASE DO NOT HAND EDIT THIS FILE.
-#
-metadata:
- name: ${testname}
- format: "Lava-Test-Shell Test Definition 1.0"
- description: "Regression tests for the OpenJDK platform"
- version: 1.0
- maintainer:
- - andrew.mcdermott@linaro.org
- os:
- - openembedded
- scope:
- - test
- devices:
- - rtsm_ve-armv8
-EOF
-
- IFS='' read -r -d '' t2 <<-'EOF'
-run:
- steps:
- - 'source $HOME/jtreg-setup.env'
- - 'cd $JTREG_TESTRUN_ID/test-definitions/openembedded/scripts'
+ IFS='' read -r -d '' postamble <<-'EOF'
+parse:
+ pattern: "(?P<result>^(Passed|FAILED)):\\s+(?P<test_case_id>(.*))"
+ fixupdict:
+ Passed: pass
+ FAILED: fail
EOF
IFS=$oldifs
- echo "${t1}${t2}"
+ echo "${postamble}"
}
-yaml_txt=$(test_setup_content)
-echo "$yaml_txt" > "jtreg-setup.yaml"
-
-for i in jdk_beans1 jdk_io jdk_lang jdk_math jdk_net jdk_other jdk_security1 jdk_text jdk_time jdk_util; do
- yaml_txt=$(yaml_content $i)
- test_txt=" - './jtreg-test \$JDK_TEST_DIR $i'"
+for i in jdk_beans jdk_io jdk_lang jdk_math jdk_net jdk_other jdk_security1 jdk_text jdk_time jdk_util; do
+ echo $i
+ IFS='_' read -a tc <<< "$i"
+ yaml_txt=$(yaml_test_case_content $i)
+ test_txt=" - './jtreg-test -t $i -j \$JAVA_VM -p \$PRODUCT_HOME -- \$JTREG_CONC \$JTREG_TEST_MODE \$JTREG_TIMEOUT -exclude:\$JTREG_EXCLUDE_FILE \$JTREG_VERBOSE \$PRODUCT_HOME/jtreg/jdk/test/java/${tc[1]}'"
echo "$yaml_txt" > "jtreg-${i}.yaml"
echo "$test_txt" >> "jtreg-${i}.yaml"
+ echo "$(yaml_postamble_content)" >> "jtreg-${i}.yaml"
done
-testtype="hotspot"
+test_prefix="hotspot"
for i in sanity compiler gc runtime serviceability testlibrary; do
- yaml_txt=$(yaml_content "${testtype}-${i}")
- test_txt=" - 'TESTDIRS=$i ./jtreg-test \$HOTSPOT_TEST_DIR $i'"
- echo "$yaml_txt" > "jtreg-${testtype}-${i}.yaml"
- echo "$test_txt" >> "jtreg-${testtype}-${i}.yaml"
+ echo "${test_prefix}-${i}"
+ yaml_txt=$(yaml_test_case_content "${test_prefix}-${i}")
+ test_txt=" - './jtreg-test -t ${test_prefix}-${i} -j \$JAVA_VM -p \$PRODUCT_HOME -- \$JTREG_CONC \$JTREG_TEST_MODE \$JTREG_TIMEOUT -exclude:\$JTREG_EXCLUDE_FILE \$JTREG_VERBOSE \$PRODUCT_HOME/jtreg/hotspot/test/$i'"
+ echo "$yaml_txt" > "jtreg-${test_prefix}-${i}.yaml"
+ echo "$test_txt" >> "jtreg-${test_prefix}-${i}.yaml"
+ echo "$(yaml_postamble_content)" >> "jtreg-${test_prefix}-${i}.yaml"
done