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