[Functest] Add push-logs to functest-suite job
[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} -e NODE_NAME=${NODE_NAME}"
12 suite="TEST_CASE=all"
13 dir_imgstore="${HOME}/imgstore"
14 img_volume="${dir_imgstore}:/home/opnfv/imgstore"
15
16 echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}"
17 docker pull opnfv/qtip:$DOCKER_TAG
18
19 cmd=" docker run -id -e $envs -e $suite -v ${img_volume} opnfv/qtip:${DOCKER_TAG} /bin/bash"
20 echo "Qtip: Running docker command: ${cmd}"
21 ${cmd}
22
23 container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1)
24 if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then
25     echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..."
26     exit 1
27 else
28     echo "The container ID is: ${container_id}"
29     QTIP_REPO=/home/opnfv/repos/qtip
30 # TODO(yujunz): execute benchmark plan for compute-qpi
31 fi
32
33 echo "Qtip done!"