diff options
-rw-r--r-- | docs/jenkins-job-builder/index.rst | 6 | ||||
-rw-r--r-- | jjb/apex/apex.yml | 2 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-project-jobs.yml | 6 | ||||
-rw-r--r-- | jjb/compass4nfv/compass-verify-jobs.yml | 6 | ||||
-rw-r--r-- | jjb/fuel/fuel-daily-jobs.yml | 2 | ||||
-rw-r--r-- | jjb/global/releng-macros.yml | 1 | ||||
-rw-r--r-- | jjb/joid/joid-daily-jobs.yml | 2 | ||||
-rw-r--r-- | jjb/qtip/helpers/cleanup-deploy.sh | 15 | ||||
-rw-r--r-- | jjb/qtip/helpers/validate-deploy.sh | 23 | ||||
-rw-r--r-- | jjb/qtip/qtip-validate-jobs.yml | 5 | ||||
-rw-r--r-- | jjb/xci/bifrost-verify-jobs.yml | 32 | ||||
-rwxr-xr-x | jjb/xci/bifrost-verify.sh | 2 | ||||
-rw-r--r-- | jjb/xci/xci-daily-jobs.yml | 37 | ||||
-rwxr-xr-x | jjb/xci/xci-provision.sh | 2 | ||||
-rw-r--r-- | modules/opnfv/utils/ssh_utils.py | 13 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/bifrost-provision.sh (renamed from prototypes/bifrost/scripts/test-bifrost-deployment.sh) | 58 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/osa-bifrost-deployment.sh | 143 |
17 files changed, 143 insertions, 212 deletions
diff --git a/docs/jenkins-job-builder/index.rst b/docs/jenkins-job-builder/index.rst index b85b1320f..4d23ade38 100644 --- a/docs/jenkins-job-builder/index.rst +++ b/docs/jenkins-job-builder/index.rst @@ -1,9 +1,9 @@ -*************************** +=========================== Release Engineering Project -*************************** +=========================== .. toctree:: :numbered: :maxdepth: 2 - opnfv-jjb-usage.rst + opnfv-jjb-usage diff --git a/jjb/apex/apex.yml b/jjb/apex/apex.yml index 93eaa6c6c..aaf6c499a 100644 --- a/jjb/apex/apex.yml +++ b/jjb/apex/apex.yml @@ -383,7 +383,7 @@ block: true same-node: true - trigger-builds: - - project: 'cperf-apex-intel-pod2-daily-{stream}' + - project: 'cperf-apex-intel-pod2-daily-master' predefined-parameters: DEPLOY_SCENARIO=os-odl_l3-nofeature-noha block: true diff --git a/jjb/compass4nfv/compass-project-jobs.yml b/jjb/compass4nfv/compass-project-jobs.yml index 9b13e693a..f962518e0 100644 --- a/jjb/compass4nfv/compass-project-jobs.yml +++ b/jjb/compass4nfv/compass-project-jobs.yml @@ -12,10 +12,12 @@ - master: branch: '{stream}' gs-pathname: '' + ppa-pathname: '/{stream}' disabled: false - danube: branch: 'stable/{stream}' gs-pathname: '/{stream}' + ppa-pathname: '/{stream}' disabled: false jobs: @@ -47,6 +49,7 @@ - compass-project-parameter: installer: '{installer}' gs-pathname: '{gs-pathname}' + ppa-pathname: '{ppa-pathname}' - 'opnfv-build-ubuntu-defaults' - '{installer}-defaults' @@ -90,6 +93,7 @@ - compass-project-parameter: installer: '{installer}' gs-pathname: '{gs-pathname}' + ppa-pathname: '{ppa-pathname}' - '{node}-defaults' - '{installer}-defaults' scm: @@ -121,7 +125,7 @@ description: "URL to Google Storage." - string: name: PPA_REPO - default: "http://205.177.226.237:9999{gs-pathname}" + default: "http://205.177.226.237:9999{ppa-pathname}" - string: name: PPA_CACHE default: "$WORKSPACE/work/repo/" diff --git a/jjb/compass4nfv/compass-verify-jobs.yml b/jjb/compass4nfv/compass-verify-jobs.yml index e625c686a..14279e649 100644 --- a/jjb/compass4nfv/compass-verify-jobs.yml +++ b/jjb/compass4nfv/compass-verify-jobs.yml @@ -11,10 +11,12 @@ - master: branch: '{stream}' gs-pathname: '' + ppa-pathname: '/{stream}' disabled: false - danube: branch: 'stable/{stream}' gs-pathname: '/{stream}' + ppa-pathname: '/{stream}' disabled: false distro: @@ -111,6 +113,7 @@ - 'compass-verify-defaults': installer: '{installer}' gs-pathname: '{gs-pathname}' + ppa-pathname: '{ppa-pathname}' - string: name: DEPLOY_SCENARIO default: 'os-nosdn-nofeature-ha' @@ -229,6 +232,7 @@ - 'compass-verify-defaults': installer: '{installer}' gs-pathname: '{gs-pathname}' + ppa-pathname: '{ppa-pathname}' - string: name: DEPLOY_SCENARIO default: 'k8-nosdn-nofeature-ha' @@ -335,7 +339,7 @@ description: "URL to Google Storage." - string: name: PPA_REPO - default: "http://205.177.226.237:9999{gs-pathname}" + default: "http://205.177.226.237:9999{ppa-pathname}" - string: name: PPA_CACHE default: "$WORKSPACE/work/repo/" diff --git a/jjb/fuel/fuel-daily-jobs.yml b/jjb/fuel/fuel-daily-jobs.yml index 12456ddbb..32abad624 100644 --- a/jjb/fuel/fuel-daily-jobs.yml +++ b/jjb/fuel/fuel-daily-jobs.yml @@ -747,7 +747,7 @@ - trigger: name: 'fuel-os-odl_l2-nofeature-ha-zte-pod2-daily-master-trigger' triggers: - - timed: '0 18 * * *' + - timed: '' - trigger: name: 'fuel-os-odl_l3-nofeature-ha-zte-pod2-daily-master-trigger' triggers: diff --git a/jjb/global/releng-macros.yml b/jjb/global/releng-macros.yml index 63613f88d..6fdb4caf4 100644 --- a/jjb/global/releng-macros.yml +++ b/jjb/global/releng-macros.yml @@ -75,7 +75,6 @@ submodule: recursive: true timeout: 20 - shallow-clone: true - trigger: name: 'daily-trigger-disabled' triggers: diff --git a/jjb/joid/joid-daily-jobs.yml b/jjb/joid/joid-daily-jobs.yml index ec6c868c9..7dc718950 100644 --- a/jjb/joid/joid-daily-jobs.yml +++ b/jjb/joid/joid-daily-jobs.yml @@ -78,7 +78,7 @@ - 'k8-nosdn-nofeature-noha': auto-trigger-name: 'joid-{scenario}-{pod}-{stream}-trigger' - 'k8-nosdn-lb-noha': - auto-trigger-name: 'daily-trigger-disabled' + auto-trigger-name: 'joid-{scenario}-{pod}-{stream}-trigger' jobs: - 'joid-{scenario}-{pod}-daily-{stream}' diff --git a/jjb/qtip/helpers/cleanup-deploy.sh b/jjb/qtip/helpers/cleanup-deploy.sh index 95babb318..9cb19a583 100644 --- a/jjb/qtip/helpers/cleanup-deploy.sh +++ b/jjb/qtip/helpers/cleanup-deploy.sh @@ -7,20 +7,15 @@ # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## # Remove previous running containers if exist -if [[ ! -z $(docker ps -a | grep opnfv/qtip) ]]; then +if [[ ! -z $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG") ]]; then echo "Removing existing opnfv/qtip containers..." # workaround: sometimes it throws an error when stopping qtip container. # To make sure ci job unblocked, remove qtip container by force without stopping it. - docker rm -f $(docker ps -a | grep opnfv/qtip | awk '{print $1}') + docker rm -f $(docker ps -a | grep "opnfv/qtip:$DOCKER_TAG" | awk '{print $1}') fi # Remove existing images if exist -if [[ ! -z $(docker images | grep opnfv/qtip) ]]; then - echo "Docker images to remove:" - docker images | head -1 && docker images | grep opnfv/qtip - image_tags=($(docker images | grep opnfv/qtip | awk '{print $2}')) - for tag in "${image_tags[@]}"; do - echo "Removing docker image opnfv/qtip:$tag..." - docker rmi opnfv/qtip:$tag - done +if [[ $(docker images opnfv/qtip:${DOCKER_TAG} | wc -l) -gt 1 ]]; then + echo "Removing docker image opnfv/qtip:$DOCKER_TAG..." + docker rmi opnfv/qtip:$DOCKER_TAG fi diff --git a/jjb/qtip/helpers/validate-deploy.sh b/jjb/qtip/helpers/validate-deploy.sh index a73e33c2c..9f3dbe414 100644 --- a/jjb/qtip/helpers/validate-deploy.sh +++ b/jjb/qtip/helpers/validate-deploy.sh @@ -10,7 +10,10 @@ set -e envs="INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} -e NODE_NAME=${NODE_NAME} -e CI_DEBUG=${CI_DEBUG}" +ramfs=/tmp/qtip/ramfs +cfg_dir=$(dirname $ramfs) dir_imgstore="${HOME}/imgstore" +ramfs_volume="$ramfs:/mnt/ramfs" echo "--------------------------------------------------------" echo "POD: $NODE_NAME" @@ -21,7 +24,24 @@ echo "--------------------------------------------------------" echo "Qtip: Pulling docker image: opnfv/qtip:${DOCKER_TAG}" docker pull opnfv/qtip:$DOCKER_TAG -cmd=" docker run -id -e $envs opnfv/qtip:${DOCKER_TAG} /bin/bash" +# use ramfs to fix docker socket connection issue with overlay mode in centos +if [ ! -d $ramfs ]; then + mkdir -p $ramfs +fi + +if [ ! -z "$(df $ramfs | tail -n -1 | grep $ramfs)" ]; then + sudo mount -t tmpfs -o size=32M tmpfs $ramfs +fi + +# enable contro path in docker +cat <<EOF > ${cfg_dir}/ansible.cfg +[defaults] +callback_whitelist = profile_tasks +[ssh_connection] +control_path=/mnt/ramfs/ansible-ssh-%%h-%%p-%%r +EOF + +cmd=" docker run -id -e $envs -v ${ramfs_volume} opnfv/qtip:${DOCKER_TAG} /bin/bash" echo "Qtip: Running docker command: ${cmd}" ${cmd} @@ -32,6 +52,7 @@ if [ $(docker ps | grep 'opnfv/qtip' | wc -l) == 0 ]; then else echo "The container ID is: ${container_id}" QTIP_REPO=/home/opnfv/repos/qtip + docker cp ${cfg_dir}/ansible.cfg ${container_id}:/home/opnfv/.ansible.cfg # TODO(zhihui_wu): use qtip cli to execute benchmark test in the future docker exec -t ${container_id} bash -c "cd ${QTIP_REPO}/qtip/runner/ && python runner.py -d /home/opnfv/qtip/results/ -b all" diff --git a/jjb/qtip/qtip-validate-jobs.yml b/jjb/qtip/qtip-validate-jobs.yml index e1b71f516..8dd97de1d 100644 --- a/jjb/qtip/qtip-validate-jobs.yml +++ b/jjb/qtip/qtip-validate-jobs.yml @@ -95,9 +95,10 @@ name: qtip-validate-deploy builders: - shell: - !include-raw: ./helpers/validate-deploy.sh - - shell: !include-raw: ./helpers/cleanup-deploy.sh + - shell: + !include-raw: ./helpers/validate-deploy.sh + #----------- # parameter diff --git a/jjb/xci/bifrost-verify-jobs.yml b/jjb/xci/bifrost-verify-jobs.yml index 6aea1c4aa..b9798c777 100644 --- a/jjb/xci/bifrost-verify-jobs.yml +++ b/jjb/xci/bifrost-verify-jobs.yml @@ -53,11 +53,14 @@ # VM defaults #-------------------------------- - defaults: - name: vm_defaults + name: verify_vm_defaults + test-vm-num-nodes: '3' + test-vm-node-names: 'xcimaster controller00 compute00' + vm-domain-type: 'kvm' + vm-cpu: '2' vm-disk: '30' + vm-memory-size: '4096' vm-disk-cache: 'unsafe' - vm-memory: '4096' - vm-cpu: '2' #-------------------------------- # job templates @@ -67,7 +70,7 @@ disabled: '{obj:disabled}' - defaults: vm_defaults + defaults: verify_vm_defaults concurrent: false @@ -105,18 +108,27 @@ name: DIB_OS_PACKAGES default: '{dib-os-packages}' - string: - name: VM_DISK - default: '{vm-disk}' + name: TEST_VM_NUM_NODES + default: '{test-vm-num-nodes}' - string: - name: VM_DISK_CACHE - default: '{vm-disk-cache}' + name: TEST_VM_NODE_NAMES + default: '{test-vm-node-names}' - string: - name: VM_MEMORY - default: '{vm-memory}' + name: VM_DOMAIN_TYPE + default: '{vm-domain-type}' - string: name: VM_CPU default: '{vm-cpu}' - string: + name: VM_DISK + default: '{vm-disk}' + - string: + name: VM_MEMORY_SIZE + default: '{vm-memory-size}' + - string: + name: VM_DISK_CACHE + default: '{vm-disk-cache}' + - string: name: CLEAN_DIB_IMAGES default: 'true' - label: diff --git a/jjb/xci/bifrost-verify.sh b/jjb/xci/bifrost-verify.sh index 762466825..782a23445 100755 --- a/jjb/xci/bifrost-verify.sh +++ b/jjb/xci/bifrost-verify.sh @@ -117,7 +117,7 @@ sudo -E ./scripts/destroy-env.sh # provision 3 VMs; xcimaster, controller, and compute cd /opt/bifrost -sudo -E ./scripts/test-bifrost-deployment.sh +sudo -E ./scripts/bifrost-provision.sh # list the provisioned VMs cd /opt/bifrost diff --git a/jjb/xci/xci-daily-jobs.yml b/jjb/xci/xci-daily-jobs.yml index f42f86263..1f4e50be2 100644 --- a/jjb/xci/xci-daily-jobs.yml +++ b/jjb/xci/xci-daily-jobs.yml @@ -60,6 +60,7 @@ dib-os-element: 'opensuse-minimal' dib-os-packages: 'vim,less,bridge-utils,iputils,rsyslog,curl' extra-dib-elements: 'openssh-server' + #-------------------------------- # Phases #-------------------------------- @@ -75,6 +76,19 @@ - 'xci-{phase}-{pod}-{distro}-daily-{stream}' #-------------------------------- +# VM defaults +#-------------------------------- +- defaults: + name: daily_vm_defaults + test-vm-num-nodes: '6' + test-vm-node-names: 'xcimaster controller00 controller01 controller02 compute00 compute01' + vm-domain-type: 'kvm' + vm-cpu: '8' + vm-disk: '100' + vm-memory-size: '16384' + vm-disk-cache: 'unsafe' + +#-------------------------------- # job templates #-------------------------------- - job-template: @@ -168,6 +182,8 @@ disabled: '{obj:disabled}' + defaults: daily_vm_defaults + concurrent: false properties: @@ -212,6 +228,27 @@ name: DIB_OS_PACKAGES default: '{dib-os-packages}' - string: + name: TEST_VM_NUM_NODES + default: '{test-vm-num-nodes}' + - string: + name: TEST_VM_NODE_NAMES + default: '{test-vm-node-names}' + - string: + name: VM_DOMAIN_TYPE + default: '{vm-domain-type}' + - string: + name: VM_CPU + default: '{vm-cpu}' + - string: + name: VM_DISK + default: '{vm-disk}' + - string: + name: VM_MEMORY_SIZE + default: '{vm-memory-size}' + - string: + name: VM_DISK_CACHE + default: '{vm-disk-cache}' + - string: name: CLEAN_DIB_IMAGES default: 'true' - label: diff --git a/jjb/xci/xci-provision.sh b/jjb/xci/xci-provision.sh index a1ba78bf0..ba447aa48 100755 --- a/jjb/xci/xci-provision.sh +++ b/jjb/xci/xci-provision.sh @@ -86,7 +86,7 @@ sudo -E ./scripts/destroy-env.sh # provision 6 VMs; xcimaster, controller00, controller01, controller02, compute00, and compute01 cd /opt/bifrost -sudo -E ./scripts/osa-bifrost-deployment.sh +sudo -E ./scripts/bifrost-provision.sh # list the provisioned VMs cd /opt/bifrost diff --git a/modules/opnfv/utils/ssh_utils.py b/modules/opnfv/utils/ssh_utils.py index d17f5ae81..cbc62c75d 100644 --- a/modules/opnfv/utils/ssh_utils.py +++ b/modules/opnfv/utils/ssh_utils.py @@ -15,6 +15,7 @@ import paramiko from opnfv.utils import opnfv_logger as logger logger = logger.Logger("SSH utils").getLogger() +SSH_TIMEOUT = 60 def get_ssh_client(hostname, @@ -40,11 +41,13 @@ def get_ssh_client(hostname, client.load_system_host_keys() client.connect(hostname, username=username, - pkey=key) + pkey=key, + timeout=SSH_TIMEOUT) else: client.connect(hostname, username=username, - password=password) + password=password, + timeout=SSH_TIMEOUT) return client except Exception as e: @@ -96,7 +99,8 @@ class ProxyHopClient(paramiko.SSHClient): self.proxy_ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) self.proxy_ssh.connect(jh_ip, username=jh_user, - password=jh_pass) + password=jh_pass, + timeout=SSH_TIMEOUT) self.proxy_transport = self.proxy_ssh.get_transport() def connect(self, hostname, port=22, username='root', password=None, @@ -126,7 +130,8 @@ class ProxyHopClient(paramiko.SSHClient): super(ProxyHopClient, self).connect(hostname, username=username, pkey=proxy_key, - sock=self.proxy_channel) + sock=self.proxy_channel, + timeout=timeout) os.remove(self.local_ssh_key) except Exception as e: logger.error(e) diff --git a/prototypes/bifrost/scripts/test-bifrost-deployment.sh b/prototypes/bifrost/scripts/bifrost-provision.sh index 83cf1cc1b..0c13a8414 100755 --- a/prototypes/bifrost/scripts/test-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/bifrost-provision.sh @@ -7,9 +7,9 @@ # which accompanies this distribution, and is available at # http://www.apache.org/licenses/LICENSE-2.0 ############################################################################## - set -eux set -o pipefail + export PYTHONUNBUFFERED=1 SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" BIFROST_HOME=$SCRIPT_HOME/.. @@ -19,30 +19,32 @@ USE_DHCP="false" USE_VENV="false" BUILD_IMAGE=true PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} -BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} - -# Set defaults for ansible command-line options to drive the different -# tests. - -# NOTE(TheJulia/cinerama): The variables defined on the command line -# for the default and DHCP tests are to drive the use of Cirros as the -# deployed operating system, and as such sets the test user to cirros, -# and writes a debian style interfaces file out to the configuration -# drive as cirros does not support the network_info.json format file -# placed in the configuration drive. The "build image" test does not -# use cirros. - -TEST_VM_NUM_NODES=3 -export TEST_VM_NODE_NAMES="xcimaster controller00 compute00" -export VM_DOMAIN_TYPE="kvm" + +# Ensure the right inventory files is used based on branch +CURRENT_BIFROST_BRANCH=$(git rev-parse --abbrev-ref HEAD) +if [ $CURRENT_BIFROST_BRANCH = "master" ]; then + BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} + INVENTORY_FILE_FORMAT="baremetal_json_file" +else + BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.csv'} + INVENTORY_FILE_FORMAT="baremetal_csv_file" +fi +export BIFROST_INVENTORY_SOURCE=$BAREMETAL_DATA_FILE + +# Default settings for VMs +export TEST_VM_NUM_NODES=${TEST_VM_NUM_NODES:-3} +export TEST_VM_NODE_NAMES=${TEST_VM_NODE_NAMES:-"xcimaster controller00 compute00"} +export VM_DOMAIN_TYPE=${VM_DOMAIN_TYPE:-kvm} export VM_CPU=${VM_CPU:-4} export VM_DISK=${VM_DISK:-100} +export VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-8192} export VM_DISK_CACHE=${VM_DISK_CACHE:-unsafe} + +# Settings for bifrost TEST_PLAYBOOK="opnfv-virtual.yaml" USE_INSPECTOR=true USE_CIRROS=false TESTING_USER=root -VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-8192} DOWNLOAD_IPA=true CREATE_IPA_IMAGE=false INSPECT_NODES=true @@ -50,27 +52,21 @@ INVENTORY_DHCP=false INVENTORY_DHCP_STATIC_IP=false WRITE_INTERFACES_FILE=true -# Set BIFROST_INVENTORY_SOURCE -export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json - -# settings for console access +# Settings for console access export DIB_DEV_USER_PWDLESS_SUDO=yes export DIB_DEV_USER_PASSWORD=devuser -# settings for distro: trusty/ubuntu-minimal, 7/centos7 +# Settings for distro: trusty/ubuntu-minimal, 7/centos7, 42.2/suse export DIB_OS_RELEASE=${DIB_OS_RELEASE:-trusty} export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal} -# for centos 7: "vim,less,bridge-utils,iputils,rsyslog,curl" +# DIB OS packages export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl"} # Additional dib elements export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"} # Source Ansible -# NOTE(TheJulia): Ansible stable-1.9 source method tosses an error deep -# under the hood which -x will detect, so for this step, we need to suspend -# and then re-enable the feature. set +x +o nounset $SCRIPT_HOME/env-setup.sh source ${ANSIBLE_INSTALL_ROOT}/ansible/hacking/env-setup @@ -106,7 +102,7 @@ ${ANSIBLE} -vvvv \ -e test_vm_memory_size=${VM_MEMORY_SIZE} \ -e enable_venv=${ENABLE_VENV} \ -e test_vm_domain_type=${VM_DOMAIN_TYPE} \ - -e baremetal_json_file=${BAREMETAL_DATA_FILE} + -e ${INVENTORY_FILE_FORMAT}=${BAREMETAL_DATA_FILE} # Execute the installation and VM startup test. ${ANSIBLE} -vvvv \ @@ -128,9 +124,9 @@ ${ANSIBLE} -vvvv \ EXITCODE=$? if [ $EXITCODE != 0 ]; then - echo "****************************" - echo "Test failed. See logs folder" - echo "****************************" + echo "************************************" + echo "Provisioning failed. See logs folder" + echo "************************************" fi exit $EXITCODE diff --git a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh b/prototypes/bifrost/scripts/osa-bifrost-deployment.sh deleted file mode 100755 index fb66ae9e3..000000000 --- a/prototypes/bifrost/scripts/osa-bifrost-deployment.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -# SPDX-license-identifier: Apache-2.0 -############################################################################## -# Copyright (c) 2016 Ericsson AB and others. -# 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 -eux -set -o pipefail -export PYTHONUNBUFFERED=1 -SCRIPT_HOME="$(cd "$(dirname "$0")" && pwd)" -BIFROST_HOME=$SCRIPT_HOME/.. -ANSIBLE_INSTALL_ROOT=${ANSIBLE_INSTALL_ROOT:-/opt/stack} -ENABLE_VENV="false" -USE_DHCP="false" -USE_VENV="false" -BUILD_IMAGE=true -PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} - -# ensure the right inventory files is used based on branch -CURRENT_BIFROST_BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [ $CURRENT_BIFROST_BRANCH = "master" ]; then - export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.json'} -else - export BIFROST_INVENTORY_SOURCE=${BIFROST_INVENTORY_SOURCE:-'/tmp/baremetal.csv'} -fi - -# Set defaults for ansible command-line options to drive the different -# tests. - -# NOTE(TheJulia/cinerama): The variables defined on the command line -# for the default and DHCP tests are to drive the use of Cirros as the -# deployed operating system, and as such sets the test user to cirros, -# and writes a debian style interfaces file out to the configuration -# drive as cirros does not support the network_info.json format file -# placed in the configuration drive. The "build image" test does not -# use cirros. - -TEST_VM_NUM_NODES=6 -export TEST_VM_NODE_NAMES="xcimaster controller00 controller01 controller02 compute00 compute01" -export VM_DOMAIN_TYPE="kvm" -# 8 vCPU, 60 GB HDD are minimum equipment -export VM_CPU=${VM_CPU:-8} -export VM_DISK=${VM_DISK:-100} -export VM_DISK_CACHE=${VM_DISK_CACHE:-unsafe} -TEST_PLAYBOOK="opnfv-virtual.yaml" -USE_INSPECTOR=true -USE_CIRROS=false -TESTING_USER=root -# seting the memory to 16 GB to make more easily success -# 8 GB RAM is minimum equipment, but it work with at least 12 GB. -VM_MEMORY_SIZE=${VM_MEMORY_SIZE:-16384} -DOWNLOAD_IPA=true -CREATE_IPA_IMAGE=false -INSPECT_NODES=true -INVENTORY_DHCP=false -INVENTORY_DHCP_STATIC_IP=false -WRITE_INTERFACES_FILE=true - - -# settings for console access -export DIB_DEV_USER_PWDLESS_SUDO=yes -export DIB_DEV_USER_PASSWORD=devuser - -# settings for distro: trusty/ubuntu-minimal, 7/centos7 -export DIB_OS_RELEASE=${DIB_OS_RELEASE:-xenial} -export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal} - -# for centos 7: "vim,less,bridge-utils,iputils,rsyslog,curl" -export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"vlan,vim,less,bridge-utils,sudo,language-pack-en,iputils-ping,rsyslog,curl,python,debootstrap,ifenslave,ifenslave-2.6,lsof,lvm2,tcpdump,nfs-kernel-server,chrony"} - -# Additional dib elements -export EXTRA_DIB_ELEMENTS=${EXTRA_DIB_ELEMENTS:-"openssh-server"} - -# Source Ansible -# NOTE(TheJulia): Ansible stable-1.9 source method tosses an error deep -# under the hood which -x will detect, so for this step, we need to suspend -# and then re-enable the feature. -set +x +o nounset -$SCRIPT_HOME/env-setup.sh -source ${ANSIBLE_INSTALL_ROOT}/ansible/hacking/env-setup -ANSIBLE=$(which ansible-playbook) -set -x -o nounset - -logs_on_exit() { - $SCRIPT_HOME/collect-test-info.sh -} -trap logs_on_exit EXIT - -# Change working directory -cd $BIFROST_HOME/playbooks - -# Syntax check of dynamic inventory test path -for task in syntax-check list-tasks; do - ${ANSIBLE} \ - -i inventory/localhost \ - test-bifrost-create-vm.yaml \ - --${task} - ${ANSIBLE} \ - -i inventory/localhost \ - ${TEST_PLAYBOOK} \ - --${task} \ - -e testing_user=${TESTING_USER} -done - -# Create the test VMS -${ANSIBLE} \ - -i inventory/localhost \ - test-bifrost-create-vm.yaml \ - -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \ - -e test_vm_memory_size=${VM_MEMORY_SIZE} \ - -e enable_venv=${ENABLE_VENV} \ - -e test_vm_domain_type=${VM_DOMAIN_TYPE} - -# Execute the installation and VM startup test. -${ANSIBLE} \ - -i inventory/bifrost_inventory.py \ - ${TEST_PLAYBOOK} \ - -e use_cirros=${USE_CIRROS} \ - -e testing_user=${TESTING_USER} \ - -e test_vm_num_nodes=${TEST_VM_NUM_NODES} \ - -e inventory_dhcp=${INVENTORY_DHCP} \ - -e inventory_dhcp_static_ip=${INVENTORY_DHCP_STATIC_IP} \ - -e enable_venv=${ENABLE_VENV} \ - -e enable_inspector=${USE_INSPECTOR} \ - -e inspect_nodes=${INSPECT_NODES} \ - -e download_ipa=${DOWNLOAD_IPA} \ - -e create_ipa_image=${CREATE_IPA_IMAGE} \ - -e write_interfaces_file=${WRITE_INTERFACES_FILE} \ - -e ipv4_gateway=192.168.122.1 \ - -e wait_timeout=${PROVISION_WAIT_TIMEOUT} -EXITCODE=$? - -if [ $EXITCODE != 0 ]; then - echo "****************************" - echo "Test failed. See logs folder" - echo "****************************" -fi - -exit $EXITCODE |