aboutsummaryrefslogtreecommitdiff
path: root/src/shell/lisa_shell
diff options
context:
space:
mode:
Diffstat (limited to 'src/shell/lisa_shell')
-rwxr-xr-xsrc/shell/lisa_shell71
1 files changed, 54 insertions, 17 deletions
diff --git a/src/shell/lisa_shell b/src/shell/lisa_shell
index 3ce47f3..37cc0c3 100755
--- a/src/shell/lisa_shell
+++ b/src/shell/lisa_shell
@@ -121,7 +121,11 @@ if [ $ret -ne 0 ]; then
fi
curr_commit=$(git rev-parse HEAD)
-remote_name=$(git remote -v | grep ARM-software/lisa | grep -m 1 fetch | awk '{print $1}')
+remote_name=$(git remote -v | grep -i ARM-software/lisa | grep -m 1 fetch | awk '{print $1}')
+if [ -z "$remote_name" ]; then
+ echo "Couldn't find ARM-Software upstream remote, can't automatically update"
+ return 1
+fi
git merge-base --is-ancestor $curr_commit $remote_name/master
ret=$?
if [ $ret -ne 0 ]; then
@@ -283,26 +287,39 @@ fi
function _lisa-test-usage {
cat <<EOF
-Usage: lisa-test [args] FILE[:CLASS]
+Usage: lisa-test [--iterations ITERATIONS] [args] FILE[:CLASS]
Run automated tests. Tests can be found under the tests/ directory.
+ --iterations (or -n) sets the number of iterations to use for
+ each workload/target-conf, for tests that support this usage. 0 means use
+ the test's default iteration count.
+
This is a wrapper for the 'nosetests' utility, additional arguments are passed
to that tool.
Examples:
- Run all EAS Acceptance tests:
+ Run all EAS Generic tests:
- lisa-test tests/eas/acceptance.py
+ lisa-test tests/eas/generic.py
- Run ForkMigration test from EAS Acceptance suite:
+ Run RampUp test from EAS Generic suite:
- lisa-test tests/eas/acceptance.py:ForkMigration
+ lisa-test tests/eas/generic.py:RampUp
- Run ForkMigration test from EAS Acceptance suite, generating an XML test
+ Run RampUp test from EAS Generic suite, generating an XML test
report via nose's XUnit plugin (see nosetests documentation):
- lisa-test --with-xunit --xunit-file=report.xml tests/eas/acceptance.py:ForkMigration
+ lisa-test --with-xunit --xunit-file=report.xml tests/eas/generic.py:RampUp
+
+ Run RampUp test from EAS Generic suite, repeating the
+ workload 10 times and reporting how many times the test run
+ passed:
+
+ lisa-test --iterations 10 tests/eas/generic.py:RampUp
+
+ Run EAS Generic suite, repeating each workload 10 times:
+ lisa-test --iterations 10 tests/eas/generic.py
EOF
}
@@ -313,16 +330,36 @@ nosetests -v --nocapture --nologcapture \
}
function lisa-test {
-CMD=${1:-help}
+local iterations=0 # Means use default - see libs/utils/test.py
+local extra_args=""
+
echo
-case "x${CMD^^}" in
-"xHELP")
- _lisa-test-usage
- ;;
-*)
- _lisa-test $*
- local retcode=$?
-esac
+while [[ $# -gt 0 ]]; do
+ case "$1" in
+ help|-h|--help)
+ _lisa-test-usage
+ return 0
+ ;;
+ -n|--iterations)
+ iterations="$2"
+ shift
+ ;;
+ *)
+ # Unrecognised args are passed through to nosetests
+ extra_args="$extra_args $1"
+ ;;
+ esac
+ shift
+done
+
+if [ -z "$extra_args" ]; then
+ # No arguments provided, default to "help"
+ _lisa-test-usage
+ return 1
+fi
+
+(export LISA_TEST_ITERATIONS=$iterations; _lisa-test $extra_args)
+local retcode=$?
echo
echo
return $retcode