diff options
author | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-12-09 11:28:28 +0000 |
---|---|---|
committer | Andrew McDermott <andrew.mcdermott@linaro.org> | 2013-12-18 09:27:49 +0000 |
commit | 97e78cfdb81b04e19bad4290af74de5cd411d77c (patch) | |
tree | 4cd69346fc067d2fd2776054ab50d773c788216c /openembedded/scripts | |
parent | 40eb081cdd1a4fb8a4fee095914071786cccb2d5 (diff) |
mauve: break up tests into individual files
Broke up the tests based on the top-level Java packages (see
openembedded/mauve/all-packages.txt).
Running all the Mauve tests as one single test means that if a timeout
occurs we get zero results. By having individual tests we can have much
shorter timeouts and, should a test timeout, then only that test will
have no results as opposed to Mauve in its entirety. This change also
makes it practical to schedule the tests onto more devices using
multi-node testing.
Change-Id: I310282af072f40223f0998a1f5fda79b481dd584
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
Diffstat (limited to 'openembedded/scripts')
-rwxr-xr-x | openembedded/scripts/mauve-lava-test | 30 | ||||
-rwxr-xr-x | openembedded/scripts/mauve-test-pkg | 47 |
2 files changed, 34 insertions, 43 deletions
diff --git a/openembedded/scripts/mauve-lava-test b/openembedded/scripts/mauve-lava-test deleted file mode 100755 index bd815a8..0000000 --- a/openembedded/scripts/mauve-lava-test +++ /dev/null @@ -1,30 +0,0 @@ -#!/bin/bash - -# Lava Mauve test harness. -# -# Copyright (C) 2013, Linaro Limited. -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# Author: Andrew McDermott <andrew.mcdermott@linaro.org> -# - -while read -r pkg; do - [[ "$pkg" =~ ^#.*$ ]] && continue - [[ "$pkg" =~ ^$ ]] && continue - id=${pkg//\//.} - lava-test-case $id --shell mauve-test-pkg $pkg "$@" 2>&1 | tee /tmp/mauve-$id.txt - lava-test-case-attach $id /tmp/mauve-${id}.txt text/plain -done diff --git a/openembedded/scripts/mauve-test-pkg b/openembedded/scripts/mauve-test-pkg index caef9b8..8d7f6a4 100755 --- a/openembedded/scripts/mauve-test-pkg +++ b/openembedded/scripts/mauve-test-pkg @@ -26,9 +26,9 @@ function generate_exclude_list() { local excludes= while read -r line; do - [[ "$line" =~ ^#.*$ ]] && continue - [[ "$line" =~ ^$ ]] && continue - excludes="${excludes} -exclude ${line}" + [[ "$line" =~ ^#.*$ ]] && continue + [[ "$line" =~ ^$ ]] && continue + excludes="${excludes} -exclude ${line}" done < "$file" echo "${excludes}" @@ -36,9 +36,10 @@ function generate_exclude_list() { script=$(readlink -f $0) scriptpath=$(dirname $script) -java_pkg=$1; shift -java_pkg=${java_pkg//\//.} -blacklist_file="$scriptpath/../mauve/blacklist.d/${java_pkg}" +test_case=$1; shift +test_case_normalized=${test_case//\//.} +mauve_home=$1; shift +blacklist_file="${scriptpath}/../mauve/blacklist.d/${test_case_normalized}" javavm=$(which java) if [[ -z "$javavm" ]]; then @@ -49,12 +50,32 @@ fi excludes= if [[ -f ${blacklist_file} ]]; then - excludes=$(generate_exclude_list $blacklist_file) - while read -r line; do - [[ "$line" =~ ^#.*$ ]] && continue - [[ "$line" =~ ^$ ]] && continue - echo "SKIP: $line" - done < "$blacklist_file" + excludes=$(generate_exclude_list $blacklist_file) +else + blacklist_file=/dev/null fi -$javavm HarnessLinaro -vm $javavm -vmarg -Xmixed $excludes $java_pkg "$@" +output_dir="/tmp/${test_case_normalized}.$$" +mkdir -p $output_dir +pushd $output_dir +output_file="${test_case_normalized}.txt" + +echo $javavm HarnessLinaro $excludes $test_case "$@" +export CLASSPATH=$mauve_home +$javavm -client HarnessLinaro $excludes $test_case "$@" 2>&1 | tee $output_file + +if [[ -f ${blacklist_file} ]]; then + cp ${blacklist_file} ${test_case_normalized}-excluded-tests.txt + lava-test-run-attach ${test_case_normalized}-excluded-tests.txt +fi + +sed -n '/TEST RESULTS:/,$p' $output_file > ${test_case_normalized}-summary.txt +lava-test-run-attach ${test_case_normalized}-summary.txt + +grep '^FAIL:' $output_file > ${test_case_normalized}-failed.txt +lava-test-run-attach ${test_case_normalized}-failed.txt + +grep '^PASS:' $output_file > ${test_case_normalized}-success.txt +lava-test-run-attach ${test_case_normalized}-success.txt + +rm -rf $output_dir |