Parameterize infracloud playbook by platforms
[releng.git] / prototypes / bifrost / scripts / test-bifrost-deployment.sh
old mode 100644 (file)
new mode 100755 (executable)
index ecd05e0..fb49afc
@@ -1,3 +1,4 @@
+#!/bin/bash
 # SPDX-license-identifier: Apache-2.0
 ##############################################################################
 # Copyright (c) 2016 Ericsson AB and others.
@@ -6,7 +7,6 @@
 # which accompanies this distribution, and is available at
 # http://www.apache.org/licenses/LICENSE-2.0
 ##############################################################################
-#!/bin/bash
 
 set -eux
 set -o pipefail
@@ -33,6 +33,8 @@ BUILD_IMAGE=true
 TEST_VM_NUM_NODES=3
 export TEST_VM_NODE_NAMES="jumphost.opnfvlocal controller00.opnfvlocal compute00.opnfvlocal"
 export VM_DOMAIN_TYPE="kvm"
+export VM_CPU=4
+export VM_DISK=100
 TEST_PLAYBOOK="test-bifrost-infracloud.yaml"
 USE_INSPECTOR=true
 USE_CIRROS=false
@@ -55,6 +57,13 @@ export ELEMENTS_PATH=/usr/share/diskimage-builder/elements:/opt/puppet-infraclou
 export DIB_DEV_USER_PWDLESS_SUDO=yes
 export DIB_DEV_USER_PASSWORD=devuser
 
+# settings for distro: trusty/ubuntu-minimal, 7/centos-minimal
+export DIB_OS_RELEASE=${DIB_OS_RELEASE:-trusty}
+export DIB_OS_ELEMENT=${DIB_OS_ELEMENT:-ubuntu-minimal}
+
+# for centos 7: "openssh-server,vim,less,bridge-utils,iputils,rsyslog,curl"
+export DIB_OS_PACKAGES=${DIB_OS_PACKAGES:-"openssh-server,vlan,vim,less,bridge-utils,language-pack-en,iputils-ping,rsyslog,curl"}
+
 # 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
@@ -69,17 +78,17 @@ set -x -o nounset
 cd $BIFROST_HOME/playbooks
 
 # Syntax check of dynamic inventory test path
-${ANSIBLE} -vvvv \
-       -i inventory/localhost \
-       test-bifrost-create-vm.yaml \
-       --syntax-check \
-       --list-tasks
-${ANSIBLE} -vvvv \
-       -i inventory/localhost \
-       ${TEST_PLAYBOOK} \
-       --syntax-check \
-       --list-tasks \
-       -e testing_user=${TESTING_USER}
+for task in syntax-check list-tasks; do
+    ${ANSIBLE} -vvvv \
+           -i inventory/localhost \
+           test-bifrost-create-vm.yaml \
+           --${task}
+    ${ANSIBLE} -vvvv \
+           -i inventory/localhost \
+           ${TEST_PLAYBOOK} \
+           --${task} \
+           -e testing_user=${TESTING_USER}
+done
 
 # Create the test VMS
 ${ANSIBLE} -vvvv \