summaryrefslogtreecommitdiffstats
path: root/tests/cyclictest.sh
diff options
context:
space:
mode:
authorYunhong Jiang <yunhong.jiang@linux.intel.com>2015-12-04 18:09:37 -0500
committerYunhong Jiang <yunhong.jiang@linux.intel.com>2016-01-05 19:32:49 -0800
commita04839a2f102d65aff45f6c4dbce15a35354594c (patch)
tree61412e381a6d5ef42308c99611656e9f870a16e8 /tests/cyclictest.sh
parenta78eb79f77d4abcf345803ed738f227bb5576ac8 (diff)
Cyclictest invokation script
We run the cyclictest through yardstick, which will help to setup the environment. Environment setup scripts are copied to the yardstick docker images. A yardstick cyclictest yaml file are also used. Change-Id: Iacf1299a38c3c81a08fd5fdbbf64c5a57f30c38b Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
Diffstat (limited to 'tests/cyclictest.sh')
-rwxr-xr-xtests/cyclictest.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/tests/cyclictest.sh b/tests/cyclictest.sh
new file mode 100755
index 000000000..840adc6fb
--- /dev/null
+++ b/tests/cyclictest.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+##############################################################################
+## Copyright (c) 2015 Intel Corp.
+##
+## All rights reserved. This program and the accompanying materials
+## are made available under the terms of the Apache License, Version 2.0
+## which accompanies this distribution, and is available at
+## http://www.apache.org/licenses/LICENSE-2.0
+###############################################################################
+
+usage () {
+ echo "Usage: ${0} rpmdir image_dir"
+ exit 1
+}
+
+if [[ $# -ne 2 ]]; then
+ usage
+fi
+
+rpmdir=$1
+imagedir=$2
+
+ROOT_DIR=$(cd $(dirname "$0")/.. && pwd)
+ENVDIR=${ROOT_DIR}/ci/envs/
+
+cleanup () {
+ docker stop $1
+ docker rm -v $1
+ # We should have already remove running containers when pull the image
+ docker rmi opnfv/yardstick
+}
+
+# Make sure we have latest image
+docker ps | grep opnfv/yardstick-ci |\
+ awk '{print $1}' | xargs -r docker stop &>/dev/null
+ docker ps -a | grep opnfv/yardstick |\
+ awk '{print $1}' | xargs -r docker rm &>/dev/null
+docker pull opnfv/yardstick
+
+id=$(docker run \
+--privileged=true \
+-d \
+-t \
+-e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
+-e "INSTALLER_IP=${INSTALLER_IP}" \
+opnfv/yardstick )
+
+trap 'cleanup $id' SIGHUP SIGINT SIGTERM
+
+${ROOT_DIR}/tests/update_yardstick.sh $id ${rpmdir} ${imagedir}
+
+if [[ -z $? ]]
+then
+ echo "Failed to update the yardstick environment"
+ exit 1
+fi
+
+docker exec $id sh -c "/opt/testexec.sh"
+
+cleanup $id