Add QiLiang as committer
[yardstick.git] / ci / run_tasks.sh
1 #!/bin/bash
2
3 ##############################################################################
4 # Copyright (c) 2015 Ericsson AB and others.
5 #
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Apache License, Version 2.0
8 # which accompanies this distribution, and is available at
9 # http://www.apache.org/licenses/LICENSE-2.0
10 ##############################################################################
11
12 # Run yardstick tasks back-to-back
13 # This script is called from yardstick-{pod} job and decides which tasks
14 # are executed as part of that job.
15
16
17 # verify that virtual environment is activated
18 # assumes the virtual environment has been created as described in README.rst
19 if [[ ! $(which python | grep venv) ]]; then
20     echo "Unable to activate venv...Exiting"
21     exit 1
22 fi
23
24 EXIT_CODE=0
25
26 # Define tasks to be run
27 TASK_FILE_NAMES[0]='samples/ping.yaml'
28 TASK_FILE_NAMES[1]='samples/iperf3.yaml'
29 TASK_FILE_NAMES[2]='samples/pktgen.yaml'
30 TASK_FILE_NAMES[3]='samples/fio.yaml'
31
32 # Execute tasks
33 for TASK_FILE in ${TASK_FILE_NAMES[@]}
34 do
35     echo "Executing task from file: $TASK_FILE"
36     yardstick -d task start $TASK_FILE
37
38     if [ $? -ne 0 ]; then
39         EXIT_CODE=1
40     fi
41 done
42
43 exit $EXIT_CODE