aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristian Hunt <kristian.hunt@gmail.com>2015-08-13 14:48:30 +0200
committerJörgen Karlsson <jorgen.w.karlsson@ericsson.com>2015-08-26 11:10:50 +0000
commit89febc5277827e665200acb86f1c333c1d511efb (patch)
tree87a7fbf6012f48f45dfedf5a53da68c3a89d3856
parent92c599e30571557bc3d5fc882b0bff0a88716db9 (diff)
Add script for running yardstick tasks back-to-back
This script enables to run multiple yardstick tasks in the yardstick daily build without having to change the Jenkins job in the releng repository. This script should be executed from the main yardstick directory just as run_tests.sh. If at least one of the tasks listed returns a non-zero value then the script continues executing, but in the end will exit with value 1. JIRA: YARDSTICK-106 Change-Id: I8a6bb7e6c03ec551709ff66a45aad7257fb36e92 Signed-off-by: Kristian Hunt <kristian.hunt@gmail.com>
-rw-r--r--ci/run_tasks.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/ci/run_tasks.sh b/ci/run_tasks.sh
new file mode 100644
index 000000000..27ccb3a3c
--- /dev/null
+++ b/ci/run_tasks.sh
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+##############################################################################
+# Copyright (c) 2015 Ericsson AB and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Apache License, Version 2.0
+# which accompanies this distribution, and is available at
+# http://www.apache.org/licenses/LICENSE-2.0
+##############################################################################
+
+# Run yardstick tasks back-to-back
+# This script is called from yardstick-{pod} job and decides which tasks
+# are executed as part of that job.
+
+
+# verify that virtual environment is activated
+# assumes the virtual environment has been created as described in README.rst
+if [[ ! $(which python | grep venv) ]]; then
+ echo "Unable to activate venv...Exiting"
+ exit 1
+fi
+
+EXIT_CODE=0
+
+# Define tasks to be run
+TASK_FILE_NAMES[0]='samples/ping.yaml'
+TASK_FILE_NAMES[1]='samples/iperf3.yaml'
+TASK_FILE_NAMES[2]='samples/pktgen.yaml'
+TASK_FILE_NAMES[3]='samples/fio.yaml'
+
+# Execute tasks
+for TASK_FILE in ${TASK_FILE_NAMES[@]}
+do
+ echo "Executing task from file: $TASK_FILE"
+ yardstick -d task start $TASK_FILE
+
+ if [ $? -ne 0 ]; then
+ EXIT_CODE=1
+ fi
+done
+
+exit $EXIT_CODE \ No newline at end of file