- set -o errexit
- set -o pipefail
-
- echo "Yardstick: prepare Yardstick environment"
-
- # source openstack vars
- if [[ ! -f $HOME/opnfv-openrc.sh ]]; then
- echo "Unable to access file $HOME/opnfv-openrc.sh"
- exit 1
- fi
- source $HOME/opnfv-openrc.sh
-
- # check if cirros-0.3.3 image is already available
- # if not, create the image
- echo "Yardstick: configure the image"
- IMAGE_NAME=cirros-0.3.3
- if [[ ! $(nova image-show $IMAGE_NAME > /dev/null 2>&1) ]]; then
- echo "Image $IMAGE_NAME doesn't exist. Creating image $IMAGE_NAME"
- glance image-create --name cirros-0.3.3 --is-public true --disk-format qcow2 --container-format bare --file $HOME/yardstick/cirros-0.3.3-x86_64-disk.img
- else
- echo "Image $IMAGE_NAME exists. Proceeding with yardstick."
- fi
-
- # set virtualenv
- echo "Yardstick: setup virtualenv"
- cd $WORKSPACE
- virtualenv $WORKSPACE/yardstick_venv
- source $WORKSPACE/yardstick_venv/bin/activate
- python setup.py develop > /dev/null 2>&1
+ set -o errexit
+
+ echo "Yardstick: Run benchmark test suites ..."
+
+ # Remove old containers
+ docker ps | grep opnfv/yardstick-ci |\
+ awk '{print $1}' | xargs -r docker stop &>/dev/null
+ docker ps -a | grep opnfv/yardstick-ci |\
+ awk '{print $1}' | xargs -r docker rm &>/dev/null