90b54a1c9fc72bff925f2d2c49c91cfa27c0614a
[releng.git] / jjb / qtip / helpers / validate-deploy.sh
1 #!/bin/bash
2 ##############################################################################
3 # Copyright (c) 2016 ZTE and others.
4 # All rights reserved. This program and the accompanying materials
5 # are made available under the terms of the Apache License, Version 2.0
6 # which accompanies this distribution, and is available at
7 # http://www.apache.org/licenses/LICENSE-2.0
8 ##############################################################################
9 set -e
10
11 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}
12 -e NODE_NAME=${NODE_NAME} -e CI_DEBUG=${CI_DEBUG}"
13 dir_imgstore="${HOME}/imgstore"
14
15 echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}"
16 docker pull opnfv/qtip:$DOCKER_TAG
17
18 cmd=" docker run -id -e $envs opnfv/qtip:${DOCKER_TAG} /bin/bash"
19 echo "Qtip: Running docker command: ${cmd}"
20 ${cmd}
21
22 container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1)
23 if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then
24     echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..."
25     exit 1
26 else
27     echo "The container ID is: ${container_id}"
28     QTIP_REPO=/home/opnfv/repos/qtip
29 # TODO(zhihui_wu): use qtip cli to execute benchmark test in the future
30     docker exec -t ${container_id} bash -c "cd ${QTIP_REPO}/qtip/runner/ &&
31     python runner.py -d /home/opnfv/qtip/results/ -b all"
32
33 fi
34
35 echo "Qtip done!"