Browse Source

Merge "[Functional] Wait for the initial state of ha router before test" into stable/train

changes/57/813457/1
Zuul 7 months ago committed by Gerrit Code Review
parent
commit
b5d9bb9bab
  1. 7
      neutron/tests/functional/agent/l3/test_dvr_router.py
  2. 6
      neutron/tests/functional/agent/l3/test_ha_router.py

7
neutron/tests/functional/agent/l3/test_dvr_router.py

@ -1627,8 +1627,12 @@ class TestDvrRouter(DvrRouterTestFramework, framework.L3AgentTestFramework):
master, backup = self._get_master_and_slave_routers(
router1, router2, check_external_device=False)
utils.wait_until_true(lambda: master.ha_state == 'master')
utils.wait_until_true(lambda: backup.ha_state == 'backup')
self._assert_ip_addresses_in_dvr_ha_snat_namespace_with_fip(master)
self._assert_no_ip_addresses_in_dvr_ha_snat_namespace_with_fip(backup)
self.fail_ha_router(master)
utils.wait_until_true(lambda: backup.ha_state == 'master')
@ -1653,6 +1657,9 @@ class TestDvrRouter(DvrRouterTestFramework, framework.L3AgentTestFramework):
master, backup = self._get_master_and_slave_routers(
router1, router2, check_external_device=False)
utils.wait_until_true(lambda: master.ha_state == 'master')
utils.wait_until_true(lambda: backup.ha_state == 'backup')
self._assert_ip_addresses_in_dvr_ha_snat_namespace(master)
self._assert_no_ip_addresses_in_dvr_ha_snat_namespace(backup)

6
neutron/tests/functional/agent/l3/test_ha_router.py

@ -297,6 +297,7 @@ class L3HATestCase(framework.L3AgentTestFramework):
def test_delete_external_gateway_on_standby_router(self):
router_info = self.generate_router_info(enable_ha=True)
router = self.manage_router(self.agent, router_info)
common_utils.wait_until_true(lambda: router.ha_state == 'master')
self.fail_ha_router(router)
common_utils.wait_until_true(lambda: router.ha_state == 'backup')
@ -438,6 +439,11 @@ class L3HATestFailover(framework.L3AgentTestFramework):
self._assert_ipv6_accept_ra(slave_router, False)
self._assert_ipv6_forwarding(slave_router, False, False)
common_utils.wait_until_true(
lambda: master_router.ha_state == 'master')
common_utils.wait_until_true(
lambda: slave_router.ha_state == 'backup')
self.fail_ha_router(router1)
# NOTE: passing slave_router as first argument, because we expect

Loading…
Cancel
Save