summaryrefslogtreecommitdiff
path: root/ubuntu/scripts
diff options
context:
space:
mode:
authorAlex Bennée <alex.bennee@linaro.org>2014-04-28 15:33:02 +0100
committerAlex Bennée <alex.bennee@linaro.org>2017-07-24 12:39:14 +0100
commit9f9be35248214dd34389ead0dd9223910cb5d129 (patch)
tree6b44d85fb4f25f9a9317e879f44cc35809162d4c /ubuntu/scripts
parent8db3a012ea1afe89a81a68cb18cb7bcafd194142 (diff)
new: qemu risu instruction testing.
This adds a simple instruction test based on risu. It downloads a pre-built RISU bundle and runs each binary with a corresponding trace file as a individual QEMU test. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Change-Id: I26caf1a6c128fab9da582cc7b18b597566ea13f2 --- v2 - ensure we have dirs to work in v3 - reverse the sense of the run (use --master to validate) - move tarball to more stable testcases subdir
Diffstat (limited to 'ubuntu/scripts')
-rwxr-xr-xubuntu/scripts/run-risu.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/ubuntu/scripts/run-risu.sh b/ubuntu/scripts/run-risu.sh
new file mode 100755
index 0000000..a889c2b
--- /dev/null
+++ b/ubuntu/scripts/run-risu.sh
@@ -0,0 +1,58 @@
+#!/bin/sh
+#
+# Run a set of risu tests, recording their results in LAVA
+#
+#set -x
+set -e
+
+# Print out some simple usage instructions
+usage() {
+ echo "Usage: `basename $0` RISU_BASE TEST_DIRECTORY"
+ echo ""
+ echo "This script is used to run a set of RISU tests."
+ exit 1
+}
+
+while getopts "hr:" opt
+do
+ case $opt in
+ h)
+ usage
+ ;;
+ *)
+ echo "Unknown option."
+ usage
+ ;;
+ esac
+done
+
+shift $(( $OPTIND -1 ))
+
+RISU_BASE=$1
+RISU_TESTS=$2
+
+cd ${RISU_BASE}
+
+if [ ! -x ${RISU_BASE}/risu ]; then
+ echo "Couldn't find RISU binary"
+ exit 1
+fi
+
+if [ ! -d ${RISU_BASE}/${RISU_TESTS} ]; then
+ echo "No test directory specified"
+ exit 1
+fi
+
+for binary_file in ${RISU_BASE}/${RISU_TESTS}/*.risu.bin; do
+ basename=${binary_file##*/}
+ test_name=${basename%.risu.bin}
+ trace_file=${binary_file}.trace
+ if [ ! -e ${trace_file} ]; then
+ echo "Skipping test: ${test_name} as missing trace file"
+ else
+ echo "Running test: ${test_name}"
+ lava-test-case risu-${test_name} --shell ${RISU_BASE}/risu --master ${binary_file} --trace=${trace_file}
+ fi
+done
+
+exit 0