diff options
Diffstat (limited to 'prototypes/bifrost')
-rw-r--r-- | prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml | 2 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/destroy-env.sh | 35 | ||||
-rwxr-xr-x | prototypes/bifrost/scripts/test-bifrost-deployment.sh | 16 |
3 files changed, 29 insertions, 24 deletions
diff --git a/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml b/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml index 541a1f7d4..07d5e245b 100644 --- a/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml +++ b/prototypes/bifrost/playbooks/test-bifrost-infracloud.yaml @@ -54,7 +54,7 @@ dib_os_element: "{{ lookup('env','DIB_OS_ELEMENT') }}" dib_os_release: "{{ lookup('env', 'DIB_OS_RELEASE') }}" extra_dib_elements: "{{ lookup('env', 'EXTRA_DIB_ELEMENTS') | default('') }}" - dib_elements: "vm serial-console simple-init devuser infra-cloud-bridge puppet growroot {{ extra_dib_elements }}" + dib_elements: "vm enable-serial-console simple-init devuser infra-cloud-bridge puppet growroot {{ extra_dib_elements }}" dib_packages: "{{ lookup('env', 'DIB_OS_PACKAGES') }}" when: create_image_via_dib | bool == true and transform_boot_image | bool == false environment: diff --git a/prototypes/bifrost/scripts/destroy-env.sh b/prototypes/bifrost/scripts/destroy-env.sh index cdc55df1b..b73092b0f 100755 --- a/prototypes/bifrost/scripts/destroy-env.sh +++ b/prototypes/bifrost/scripts/destroy-env.sh @@ -14,24 +14,23 @@ if [[ $(whoami) != "root" ]]; then exit 1 fi -virsh destroy jumphost.opnfvlocal || true -virsh destroy controller00.opnfvlocal || true -virsh destroy compute00.opnfvlocal || true -virsh undefine jumphost.opnfvlocal || true -virsh undefine controller00.opnfvlocal || true -virsh undefine compute00.opnfvlocal || true - -service ironic-conductor stop - -echo "removing from database" -mysql -u root ironic --execute "truncate table ports;" -mysql -u root ironic --execute "delete from node_tags;" -mysql -u root ironic --execute "delete from nodes;" -mysql -u root ironic --execute "delete from conductors;" +# Delete all VMs on the slave since proposed patchsets +# may leave undesired VM leftovers +for vm in $(virsh list --all --name); do + virsh destroy $vm || true + virsh undefine $vm || true +done + +service ironic-conductor stop || true + +echo "removing ironic database" +if $(which mysql &> /dev/null); then + mysql -u root ironic --execute "drop database ironic;" +fi echo "removing leases" [[ -e /var/lib/misc/dnsmasq/dnsmasq.leases ]] && > /var/lib/misc/dnsmasq/dnsmasq.leases echo "removing logs" -rm -rf /var/log/libvirt/baremetal_logs/*.log +rm -rf /var/log/libvirt/baremetal_logs/* # clean up dib images only if requested explicitly CLEAN_DIB_IMAGES=${CLEAN_DIB_IMAGES:-false} @@ -48,6 +47,6 @@ rm -rf /var/lib/libvirt/images/*.qcow2 echo "restarting services" service dnsmasq restart || true service libvirtd restart -service ironic-api restart -service ironic-conductor start -service ironic-inspector restart +service ironic-api restart || true +service ironic-conductor start || true +service ironic-inspector restart || true diff --git a/prototypes/bifrost/scripts/test-bifrost-deployment.sh b/prototypes/bifrost/scripts/test-bifrost-deployment.sh index 90f014c74..b7165ffd1 100755 --- a/prototypes/bifrost/scripts/test-bifrost-deployment.sh +++ b/prototypes/bifrost/scripts/test-bifrost-deployment.sh @@ -18,6 +18,7 @@ ENABLE_VENV="false" USE_DHCP="false" USE_VENV="false" BUILD_IMAGE=true +BAREMETAL_DATA_FILE=${BAREMETAL_DATA_FILE:-'/tmp/baremetal.json'} PROVISION_WAIT_TIMEOUT=${PROVISION_WAIT_TIMEOUT:-3600} # Set defaults for ansible command-line options to drive the different @@ -36,6 +37,7 @@ export TEST_VM_NODE_NAMES="jumphost.opnfvlocal controller00.opnfvlocal compute00 export VM_DOMAIN_TYPE="kvm" export VM_CPU=${VM_CPU:-4} export VM_DISK=${VM_DISK:-100} +export VM_DISK_CACHE=${VM_DISK_CACHE:-unsafe} TEST_PLAYBOOK="test-bifrost-infracloud.yaml" USE_INSPECTOR=true USE_CIRROS=false @@ -49,10 +51,10 @@ INVENTORY_DHCP_STATIC_IP=false WRITE_INTERFACES_FILE=true # Set BIFROST_INVENTORY_SOURCE -export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.csv +export BIFROST_INVENTORY_SOURCE=/tmp/baremetal.json # DIB custom elements path -export ELEMENTS_PATH=/usr/share/diskimage-builder/elements:/opt/puppet-infracloud/files/elements +export ELEMENTS_PATH=/opt/puppet-infracloud/files/elements # settings for console access export DIB_DEV_USER_PWDLESS_SUDO=yes @@ -78,6 +80,11 @@ 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 @@ -101,7 +108,8 @@ ${ANSIBLE} -vvvv \ -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} + -e test_vm_domain_type=${VM_DOMAIN_TYPE} \ + -e baremetal_json_file=${BAREMETAL_DATA_FILE} # Execute the installation and VM startup test. ${ANSIBLE} -vvvv \ @@ -128,6 +136,4 @@ if [ $EXITCODE != 0 ]; then echo "****************************" fi -$SCRIPT_HOME/collect-test-info.sh - exit $EXITCODE |