DHCP test improvements

The DHCP test ultimately relies upon bifrost putting in place
the correct DHCP configuration to reliably boot machines, and then
(hopefully) ensure that no unknown machines are given leases.

This is in order to help simulate the Infracloud configuration.

In order to do this, and hopefully get the CI test into a passing
state, I have increased the amount of memory allocated to each VM
as the realistic minimum for IPA is 1 GB, and introduced specific
stops and starts to VMs present during the test sequence in order
to limit the number of concurrent running virtual machines.

Change-Id: Ia612414edd80d154200e9df12b410a327db19cff
This commit is contained in:
Julia Kreger 2016-03-16 18:23:03 -04:00
parent d4e765189c
commit 8a4d9ff32a
2 changed files with 43 additions and 14 deletions

View File

@ -8,11 +8,23 @@
---
- hosts: localhost
connection: local
name: "Remove existing leases file"
name: "Setting pre-test conditions"
become: yes
ignore_errors: yes
tasks:
- command: rm /var/lib/misc/dnsmasq.leases
# NOTE(TheJulia): While the test was created to run with five VMs,
# in the interest of keeping the active memory footprint small,
# should stop all of the VMs in advance, so we can proceed with
# install and initial deploy.
- name: Attempt to stop all test VMs
virt:
name: "testvm{{ item }}"
command: "stop"
state: shutdown
with_sequence: start=1 end={{ test_vm_num_nodes | default('5') }}
ignore_errors: yes
- name: Remove pre-existing leases file
command: rm /var/lib/misc/dnsmasq.leases
- hosts: localhost
connection: local
name: "Executes install, enrollment, and testing in one playbook"
@ -94,6 +106,32 @@
max_fail_percentage: 0
roles:
- role: bifrost-test-vm
- hosts: baremetal
connection: local
name: "Unprovisions the test node"
become: no
gather_facts: no
roles:
- role: bifrost-unprovision-node-dynamic
- role: ironic-delete-dynamic
- hosts: localhost
connection: local
name: "Executes test script"
become: yes
tasks:
# NOTE(TheJulia): Moved the power ON of the excess VMs until after
# the other test VMs have been shutdown, in order to explicitly
# validate that the dhcp config is working as expected and not
# serving these requests.
- name: Power on remaining test VMs
virt:
name: "testvm{{ item }}"
command: "start"
with_sequence: start=4 end={{ test_vm_num_nodes | default('5') }}
ignore_errors: yes
- name: Wait 30 seconds
pause:
seconds: 30
- hosts: localhost
connection: local
name: "Executes test script"
@ -104,16 +142,6 @@
inventory_dhcp_static_ip: "{{ inventory_dhcp_static_ip | bool }}"
roles:
- role: bifrost-test-dhcp
cleaning: false
testing: true
environment:
http_proxy: "{{ lookup('env','http_proxy') }}"
https_proxy: "{{ lookup('env','https_proxy') }}"
- hosts: baremetal
connection: local
name: "Unprovisions the test node"
become: no
gather_facts: no
roles:
- role: bifrost-unprovision-node-dynamic
- role: ironic-delete-dynamic

View File

@ -29,7 +29,7 @@ ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml --synt
ansible-playbook -vvvv -i inventory/localhost test-bifrost-dynamic.yaml --syntax-check --list-tasks
# Create the test VMS
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml -e test_vm_num_nodes="5" -e test_vm_memory_size="512"
ansible-playbook -vvvv -i inventory/localhost test-bifrost-create-vm.yaml -e test_vm_num_nodes="5" -e test_vm_memory_size="1024"
# cut file
head -n -2 /tmp/baremetal.csv > /tmp/baremetal.csv.new && mv /tmp/baremetal.csv.new /tmp/baremetal.csv
@ -52,7 +52,8 @@ ansible-playbook -vvvv \
-e use_cirros=true \
-e testing_user=cirros \
-e inventory_dhcp=true \
-e inventory_dhcp_static_ip=true
-e inventory_dhcp_static_ip=true \
-e test_vm_num_nodes="5"
EXITCODE=$?
if [ $EXITCODE != 0 ]; then