#!/bin/bash -e # shellcheck disable=SC2034,SC2154,SC1090,SC1091 ############################################################################## # Copyright (c) 2017 Ericsson AB, Mirantis Inc., Enea AB and others. # jonas.bjurel@ericsson.com # 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 ############################################################################## ############################################################################## # BEGIN of Exit handlers # do_exit () { local RC=$? clean if [ ${RC} -eq 0 ]; then notify "\n[OK] MCP: Openstack installation finished succesfully!\n\n" 2 else notify "\n[ERROR] MCP: Openstack installation threw a fatal error!\n\n" fi } # # End of Exit handlers ############################################################################## ############################################################################## # BEGIN of usage description # usage () { cat << EOF xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx $(notify "$(basename "$0"): Deploy the Fuel@OPNFV MCP stack" 3) $(notify "USAGE:" 2) $(basename "$0") -b base-uri -l lab-name -p pod-name -s deploy-scenario \\ [-B PXE Bridge [-B Mgmt Bridge [-B Internal Bridge [-B Public Bridge]]]] \\ [-S storage-dir] [-L /path/to/log/file.tar.gz] \\ [-f [-f]] [-F] [-e] [-d] [-D] $(notify "OPTIONS:" 2) -b Base-uri for the stack-configuration structure -B Bridge(s): 1st usage = PXE, 2nd = Mgmt, 3rd = Internal, 4th = Public -d Dry-run -D Debug logging -e Do not launch environment deployment -f Deploy on existing Salt master (use twice to also skip config sync) -F Do only create a Salt master -h Print this message and exit -l Lab-name -p Pod-name -s Deploy-scenario short-name -S Storage dir for VM images -L Deployment log path and file name $(notify "Description:" 2) Deploys the Fuel@OPNFV stack on the indicated lab resource. This script provides the Fuel@OPNFV deployment abstraction. It depends on the OPNFV official configuration directory/file structure and provides a fairly simple mechanism to execute a deployment. $(notify "Input parameters to the build script are:" 2) -b Base URI to the configuration directory (needs to be provided in URI style, it can be a local resource: file:// or a remote resource http(s)://). A POD Descriptor File (PDF) should be available at: /labs//.yaml The default is './mcp/config'. -B Bridges to be used by deploy script. It can be specified several times, or as a comma separated list of bridges, or both: -B br1 -B br2,br3 First occurence sets PXE Brige, next Mgmt, then Internal and Public. For an empty value, the deploy script will use virsh to create the default expected network (e.g. -B pxe,,,public will use existing "pxe" and "public" bridges, respectively create "mgmt" and "internal"). Note that a virtual network "mcpcontrol" is always created. For virtual deploys, "mcpcontrol" is also used for PXE, leaving the PXE bridge unused. For baremetal deploys, PXE bridge is used for baremetal node provisioning, while "mcpcontrol" is used to provision the infrastructure VMs only. The default is 'pxebr'. -d Dry-run - Produce deploy config files, but do not execute deploy -D Debug logging - Enable extra logging in sh deploy scripts (set -x) -e Do not launch environment deployment -f Deploy on existing Salt master. It will skip infrastructure VM creation, but it will still sync reclass configuration from current repo to Salt Master node. If specified twice (e.g. -f -f), config sync will also be skipped. -F Do only create a Salt master -h Print this message and exit -L Deployment log path and name, eg. -L /home/jenkins/job.log.tar.gz -l Lab name as defined in the configuration directory, e.g. lf -p POD name as defined in the configuration directory, e.g. pod2 -s Deployment-scenario, this points to a short deployment scenario name, which has to be defined in config directory (e.g. os-odl-nofeature-ha). -S Storage dir for VM images, default is mcp/deploy/images $(notify "[NOTE] sudo & virsh priviledges are needed for this script to run" 3) Example: $(notify "sudo $(basename "$0") \\ -b file:///home/jenkins/securedlab \\ -l lf -p pod2 \\ -s os-odl-nofeature-ha" 2) EOF } # # END of usage description ############################################################################## ############################################################################## # BEGIN of colored notification wrapper # notify() { tput setaf "${2:-1}" || true echo -en "${1:-"[WARN] Unsupported opt arg: $3\\n"}" tput sgr0 } # # END of colored notification wrapper ############################################################################## ############################################################################## # BEGIN of deployment clean-up # clean() { echo "Cleaning up deploy tmp directories" } # # END of deployment clean-up ############################################################################## ############################################################################## # BEGIN of variables to customize # CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x REPO_ROOT_PATH=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..") DEPLOY_DIR=$(cd "${REPO_ROOT_PATH}/mcp/scripts"; pwd) STORAGE_DIR=$(cd "${REPO_ROOT_PATH}/mcp/deploy/images"; pwd) RECLASS_CLUSTER_DIR=$(cd "${REPO_ROOT_PATH}/mcp/reclass/classes/cluster"; pwd) DEPLOY_TYPE='baremetal' OPNFV_BRIDGES=('pxebr' 'mgmt' 'internal' 'public') URI_REGEXP='(file|https?|ftp)://.*' BASE_CONFIG_URI="file://${REPO_ROOT_PATH}/mcp/config" # Customize deploy workflow DRY_RUN=${DRY_RUN:-0} USE_EXISTING_INFRA=${USE_EXISTING_INFRA:-0} INFRA_CREATION_ONLY=${INFRA_CREATION_ONLY:-0} NO_DEPLOY_ENVIRONMENT=${NO_DEPLOY_ENVIRONMENT:-0} source "${DEPLOY_DIR}/globals.sh" # # END of variables to customize ############################################################################## ############################################################################## # BEGIN of main # set +x OPNFV_BRIDGE_IDX=0 while getopts "b:B:dDfFl:L:p:s:S:he" OPTION do case $OPTION in b) BASE_CONFIG_URI=${OPTARG} if [[ ! $BASE_CONFIG_URI =~ ${URI_REGEXP} ]]; then notify "[ERROR] -b $BASE_CONFIG_URI - invalid URI\n" usage exit 1 fi ;; B) OIFS=${IFS} IFS=',' OPT_BRIDGES=($OPTARG) for bridge in "${OPT_BRIDGES[@]}"; do if [ -n "${bridge}" ]; then OPNFV_BRIDGES[${OPNFV_BRIDGE_IDX}]="${bridge}" fi ((OPNFV_BRIDGE_IDX+=1)) done IFS=${OIFS} ;; d) DRY_RUN=1 ;; D) CI_DEBUG=1 ;; f) ((USE_EXISTING_INFRA+=1)) ;; F) INFRA_CREATION_ONLY=1 ;; e) NO_DEPLOY_ENVIRONMENT=1 ;; l) TARGET_LAB=${OPTARG} ;; L) DEPLOY_LOG="${OPTARG}" ;; p) TARGET_POD=${OPTARG} if [[ "${TARGET_POD}" =~ "virtual" ]]; then DEPLOY_TYPE='virtual' fi ;; s) DEPLOY_SCENARIO=${OPTARG} ;; S) if [[ ${OPTARG} ]]; then STORAGE_DIR="${OPTARG}" fi ;; h) usage exit 0 ;; *) notify "[ERROR] Arguments not according to new argument style\n" exit 1 ;; esac done if [[ "$(sudo whoami)" != 'root' ]]; then notify "[ERROR] This script requires sudo rights\n" 1>&2 exit 1 fi if ! virsh list >/dev/null 2>&1; then notify "[ERROR] This script
.. This work is licensed under a Creative Commons Attribution 4.0 International
.. License.
.. http://creativecommons.org/licenses/by/4.0
.. (c) OPNFV, Huawei Technologies Co.,Ltd and others.

*************************************
Yardstick Test Case Description TC011
*************************************

.. _iperf3: https://iperf.fr/

+-----------------------------------------------------------------------------+
|Packet delay variation between VMs                                           |
|                                                                             |
+--------------+--------------------------------------------------------------+
|test case id  | OPNFV_YARDSTICK_TC011_PACKET DELAY VARIATION BETWEEN VMs     |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|metric        | jitter: packet delay variation (ms)                          |
|              |                                                              |
+--------------+--------------------------------------------------------------+
|test purpose  | The purpose of TC011 is to evaluate the IaaS network         |
|              | performance with regards to network jitter (packet delay     |
|              | variation).                                                  |
|              | It measures the packet delay variation sending the packets   |
|              | from one VM to the other.                                    |
|              |                                                              |
|