From 29f02c1a9ea1955cc524e0a40eae175191ba5594 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Fri, 30 Sep 2016 15:30:48 +0100 Subject: [PATCH] Fix dhcp-agent-list-hosting-net race condition Restart the neutron-dhcp-agent prior to running the dhcp-agent-list-hosting-net command. This will ensure that (assuming everything is working), the dhcp-agent shows the hosting-net output appropriately. Additionally, we should retry the "ip netns ls" command until "qdhcp" is available, this can take some time and may cause further race conditions. Change-Id: I585f8c0752b9145c8441a25434769155c99ac00b Closes-Bug: #1629346 --- tests/test-neutron-functional.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test-neutron-functional.yml b/tests/test-neutron-functional.yml index 1089802c..09a9b06a 100644 --- a/tests/test-neutron-functional.yml +++ b/tests/test-neutron-functional.yml @@ -86,6 +86,14 @@ retries: 10 delay: 3 + # (andymccr): To avoid a race condition we can restart + # the neutron-dhcp-agent service: + # https://bugs.launchpad.net/openstack-ansible/+bug/1629346 + - name: Restart neutron-dhcp-agent service + service: + state: restarted + name: neutron-dhcp-agent + - name: Ensure the dhcp agent is on the net shell: | . /root/openrc @@ -98,6 +106,9 @@ - name: Check for dhcp network namespace shell: ip netns ls register: dhcp_namespace + until: dhcp_namespace.stdout.find("qdhcp") != -1 + retries: 5 + delay: 10 - name: List the namespaces debug: