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 ##############################################################################
11 envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP}
12 -e NODE_NAME=${NODE_NAME} -e CI_DEBUG=${CI_DEBUG}"
14 dir_imgstore="${HOME}/imgstore"
15 ramfs_volume="$ramfs:/mnt/ramfs"
17 echo "--------------------------------------------------------"
18 echo "POD: $NODE_NAME"
19 echo "INSTALLER: $INSTALLER_TYPE"
20 echo "Scenario: $DEPLOY_SCENARIO"
21 echo "--------------------------------------------------------"
23 echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}"
24 docker pull opnfv/qtip:$DOCKER_TAG
26 # use ramfs to fix docker socket connection issue with overlay mode in centos
27 if [ ! -d $ramfs ]; then
31 if [ ! -z $(df $ramfs | tail -n -1 | grep $ramfs) ]; then
32 sudo mount -t tmpfs -o size=32M tmpfs $ramfs
35 # enable contro path in docker
36 echo <<EOF > /tmp/ansible.cfg
38 callback_whitelist = profile_tasks
40 control_path=/mnt/ramfs/ansible-ssh-%%h-%%p-%%r
43 cmd=" docker run -id -e $envs -v ${ramfs_volume} opnfv/qtip:${DOCKER_TAG} /bin/bash"
44 echo "Qtip: Running docker command: ${cmd}"
47 container_id=$(docker ps | grep "opnfv/qtip:${DOCKER_TAG}" | awk '{print $1}' | head -1)
48 if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then
49 echo "The container opnfv/qtip with ID=${container_id} has not been properly started. Exiting..."
52 echo "The container ID is: ${container_id}"
53 QTIP_REPO=/home/opnfv/repos/qtip
54 docker cp /tmp/ansible.cfg ${container_id}:/home/opnfv/.ansible.cfg
55 # TODO(zhihui_wu): use qtip cli to execute benchmark test in the future
56 docker exec -t ${container_id} bash -c "cd ${QTIP_REPO}/qtip/runner/ &&
57 python runner.py -d /home/opnfv/qtip/results/ -b all"