2 ##############################################################################
3 ## Copyright (c) 2015 Intel Corp.
5 ## All rights reserved. This program and the accompanying materials
6 ## are made available under the terms of the Apache License, Version 2.0
7 ## which accompanies this distribution, and is available at
8 ## http://www.apache.org/licenses/LICENSE-2.0
9 ###############################################################################
15 : ${YARDSTICK_REPO:='https://gerrit.opnfv.org/gerrit/yardstick'}
16 : ${YARDSTICK_REPO_DIR:='/home/opnfv/repos/yardstick'}
17 : ${YARDSTICK_BRANCH:='master'} # branch, tag, sha1 or refspec
19 : ${INSTALLER_TYPE:='fuel'}
20 : ${INSTALLER_IP:='10.20.0.2'}
22 : ${POD_NAME:='opnfv-jump-2'}
23 : ${EXTERNAL_NET:='net04_ext'}
27 if git cat-file -e $1^{commit} 2>/dev/null; then
28 # branch, tag or sha1 object
32 git fetch --tags --progress $2 $1
33 git checkout FETCH_HEAD
38 echo "INFO: Updating yardstick -> $YARDSTICK_BRANCH"
39 if [ ! -d $YARDSTICK_REPO_DIR ]; then
40 git clone YARDSTICK_REPO $YARDSTICK_REPO_DIR
42 cd $YARDSTICK_REPO_DIR
45 git checkout master && git pull
46 git_checkout $YARDSTICK_BRANCH $YARDSTICK_REPO
48 export EXTERNAL_NET INSTALLER_TYPE POD_NAME
53 DISPATCHER_FILE_NAME="/tmp/yardstick.out.$$"
61 if [ -z "$exitcode" ]; then
62 # In case of recursive traps (!?)
66 echo "Exiting with RC=$exitcode"
75 echo "========== Installing yardstick =========="
77 if ! sudo -E python setup.py install; then
78 echo 'Yardstick installation failed!'
87 echo "========== Running yardstick test suites =========="
89 mkdir -p /etc/yardstick
91 cat << EOF >> /etc/yardstick/yardstick.conf
94 dispatcher = ${DISPATCHER_TYPE}
97 file_name = ${DISPATCHER_FILE_NAME}
101 target = ${DISPATCHER_HTTP_TARGET}
106 echo "----------------------------------------------"
107 echo "Running samples/cyclictest-node-context.yaml "
108 echo "----------------------------------------------"
110 if ! yardstick task start /opt/cyclictest-node-context.yaml; then
111 echo "Yardstick test FAILED"
114 echo "----------------------------------------------"
115 echo "Dump test result: "
116 cat ${DISPATCHER_FILE_NAME}
117 echo "----------------------------------------------"
118 rm -rf ${DISPATCHER_FILE_NAME}
124 GITROOT=$YARDSTICK_REPO_DIR
128 export YARDSTICK_VERSION=$(git rev-parse HEAD)
130 # If any change needed for yardstick, applied here.
131 if [ -e /opt/yardstick.patch ]
133 patch -p1 -i /opt/yardstick.patch
138 trap "error_exit" EXIT SIGTERM