From 89febc5277827e665200acb86f1c333c1d511efb Mon Sep 17 00:00:00 2001 From: Kristian Hunt Date: Thu, 13 Aug 2015 14:48:30 +0200 Subject: 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 --- ci/run_tasks.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 ci/run_tasks.sh (limited to 'ci/run_tasks.sh') 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 -- cgit 1.2.3-korg