aboutsummaryrefslogtreecommitdiffstats
path: root/deploy/conf/cluster.conf
blob: 5d41d53c1d8d48e152d0e3ad04ae5d20c72d9e67 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# trustry/centos7
export OS_VERSION=${OS_VERSION:-"trusty"}

# for Operating System
if [ $OS_VERSION = 'xenial' ]; then
    export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)ubuntu-16\.04'}
elif [ $OS_VERSION = 'trusty' ]; then
    export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)ubuntu-14\.04\.3.*'}
else
    export ADAPTER_OS_PATTERN=${ADAPTER_OS_PATTERN:-'(?i)CentOS-7.*15.*'}
fi

# liberty/kilo/juno
export OPENSTACK_VERSION=${OPENSTACK_VERSION:-"liberty"}

# don't touch this
export ADAPTER_TARGET_SYSTEM_PATTERN="^openstack$"

if [ $OPENSTACK_VERSION = 'mitaka_xenial' ]; then
    export REPO_NAME="xenial-mitaka-ppa"
else
    export REPO_NAME="$OS_VERSION-$OPENSTACK_VERSION-ppa"
fi

export ADAPTER_NAME="openstack_$OPENSTACK_VERSION"
export ADAPTER_FLAVOR_PATTERN="HA-ansible-multinodes-$OPENSTACK_VERSION"

export DEFAULT_ROLES=""
export VIP="10.1.0.222"
c */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/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
###############################################################################

set -e
set -o errexit
set -o pipefail

: ${YARDSTICK_REPO:='https://gerrit.opnfv.org/gerrit/yardstick'}
: ${YARDSTICK_REPO_DIR:='/home/opnfv/repos/yardstick'}
: ${YARDSTICK_BRANCH:='master'} # branch, tag, sha1 or refspec

: ${INSTALLER_TYPE:='fuel'}
: ${INSTALLER_IP:='10.20.0.2'}

: ${POD_NAME:='opnfv-jump-2'}
: ${EXTERNAL_NET:='net04_ext'}

git_checkout()
{
    if git cat-file -e $1^{commit} 2>/dev/null; then
        # branch, tag or sha1 object
        git checkout $1
    else
        # refspec / changeset
        git fetch --tags --progress $2 $1
        git checkout FETCH_HEAD
    fi
}

echo
echo "INFO: Updating yardstick -> $YARDSTICK_BRANCH"
if [ ! -d $YARDSTICK_REPO_DIR ]; then
    git clone YARDSTICK_REPO $YARDSTICK_REPO_DIR
fi
cd $YARDSTICK_REPO_DIR


git checkout master && git pull
git_checkout $YARDSTICK_BRANCH $YARDSTICK_REPO

export EXTERNAL_NET INSTALLER_TYPE POD_NAME

# Verifiy

DISPATCHER_TYPE=file
DISPATCHER_FILE_NAME="/tmp/yardstick.out.$$"

exitcode=""

error_exit()
{
    local rc=$?

    if [ -z "$exitcode" ]; then
        # In case of recursive traps (!?)
        exitcode=$rc
    fi

    echo "Exiting with RC=$exitcode"

    exit $exitcode
}


install_yardstick()
{
    echo
    echo "========== Installing yardstick =========="

    if ! sudo -E python setup.py install; then
        echo 'Yardstick installation failed!'
        exit 1
    fi
}


run_test()
{
    echo
    echo "========== Running yardstick test suites =========="

    mkdir -p /etc/yardstick

    cat << EOF >> /etc/yardstick/yardstick.conf
[DEFAULT]
debug = True
dispatcher = ${DISPATCHER_TYPE}

[dispatcher_file]
file_name = ${DISPATCHER_FILE_NAME}

[dispatcher_http]
timeout = 5
target = ${DISPATCHER_HTTP_TARGET}
EOF

    local failed=0

    echo "----------------------------------------------"
    echo "Running samples/cyclictest-node-context.yaml  "
    echo "----------------------------------------------"

    if ! yardstick task start /opt/cyclictest-node-context.yaml; then
        echo "Yardstick test FAILED"
        exit 1
    fi
    echo "----------------------------------------------"
    echo "Dump test result:                             "
    cat ${DISPATCHER_FILE_NAME}
    echo "----------------------------------------------"
    rm -rf ${DISPATCHER_FILE_NAME}
}


verifiy()
{
    GITROOT=$YARDSTICK_REPO_DIR

    cd $GITROOT

    export YARDSTICK_VERSION=$(git rev-parse HEAD)

    # If any change needed for yardstick, applied here.
    if [ -e /opt/yardstick.patch ]
    then
        patch -p1 -i /opt/yardstick.patch
    fi
    # install yardstick
    install_yardstick

    trap "error_exit" EXIT SIGTERM

    run_test
}


verifiy