diff options
| author | Zuul <zuul@review.opendev.org> | 2020-02-28 20:06:48 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2020-02-28 20:06:48 +0000 |
| commit | 438a611375fe489699aea79924ee7f4978eed0a9 (patch) | |
| tree | 2f5d54e5feb08e0c81949f1ea91f078f7b9fa021 /tests | |
| parent | 873b010f7e5baaa46df6090474af2446384344b8 (diff) | |
| parent | 1f0070db6cbc0bde8c187ddc50f91d4d4e6bc146 (diff) | |
| download | kolla-ansible-438a611375fe489699aea79924ee7f4978eed0a9.tar.gz kolla-ansible-438a611375fe489699aea79924ee7f4978eed0a9.zip | |
Merge "CI: Test floating ip allocation and connectivity to the instance"
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/pre.yml | 24 | ||||
| -rwxr-xr-x | tests/test-core-openstack.sh | 25 |
2 files changed, 49 insertions, 0 deletions
diff --git a/tests/pre.yml b/tests/pre.yml index 1fe5b0154..688ba1aab 100644 --- a/tests/pre.yml +++ b/tests/pre.yml @@ -40,6 +40,30 @@ - "kolla" - "ansible" + # NOTE(yoctozepto): let's observe forwarding behavior + - name: iptables - LOG FORWARD + become: true + iptables: + state: present + action: append + chain: FORWARD + jump: LOG + log_prefix: 'iptables FORWARD: ' + + # NOTE(yoctozepto): This is to undo Docker's default policy of DROP which + # breaks l3 forwarding and also linuxbridge deploys due to bridge-nf-call-iptables. + # FIXME(yoctozepto): really handle this for users - somehow my local multinode + # deploy fixed it for itself by setting it to ACCEPT on network nodes without + # my intervention but so far we have no idea what did that. It certainly does + # not happen in CI where all nodes are aio. + - name: iptables - ACCEPT FORWARD + become: True + iptables: + state: present + action: append + chain: FORWARD + jump: ACCEPT + - name: set new hostname based on ansible inventory file hostname: name: "{{ inventory_hostname }}" diff --git a/tests/test-core-openstack.sh b/tests/test-core-openstack.sh index 29334b58e..d767edfec 100755 --- a/tests/test-core-openstack.sh +++ b/tests/test-core-openstack.sh @@ -70,6 +70,31 @@ function test_instance_boot { echo "SUCCESS: Cinder volume attachment" fi + echo "TESTING: Floating ip allocation" + fip_addr=$(openstack floating ip create public1 -f value -c floating_ip_address) + openstack server add floating ip kolla_boot_test ${fip_addr} + echo "SUCCESS: Floating ip allocation" + + echo "TESTING: PING&SSH to floating ip" + attempts=6 + for i in $(seq 1 ${attempts}); do + if ping -c1 -W1 ${fip_addr} && ssh -v -o BatchMode=yes -o StrictHostKeyChecking=no cirros@${fip_addr} hostname; then + break + elif [[ $i -eq ${attempts} ]]; then + echo "Failed to access server via SSH after ${attempts} attempts" + return 1 + else + echo "Cannot access server - retrying" + fi + sleep 10 + done + echo "SUCCESS: PING&SSH to floating ip" + + echo "TESTING: Floating ip deallocation" + openstack server remove floating ip kolla_boot_test ${fip_addr} + openstack floating ip delete ${fip_addr} + echo "SUCCESS: Floating ip deallocation" + echo "TESTING: Server deletion" openstack server delete --wait kolla_boot_test echo "SUCCESS: Server deletion" |
