Handle missing ha:details attribute in router type driver unit tests

AKA: DE4039

Closes-Bug: #1698311

Change-Id: Ibc93c8c3f3cf7b522a0535435f2078d2268cf353
This commit is contained in:
Bob Melander 2017-06-16 10:09:27 +02:00
parent eb4ffe1010
commit 5abafee372
1 changed files with 12 additions and 2 deletions

View File

@ -1014,8 +1014,18 @@ class L3CfgAgentAsr1kRouterTypeDriverTestCase(
self.assertIn(g_rtr_2['id'], g_l_rtr_rr_ids)
self.assertFalse(g_rtr_1[ha.ENABLED])
e_context = bc.context.get_admin_context()
sync_routers = self.l3_plugin.get_sync_data_ext(e_context,
g_l_rtr_rr_ids)
incomplete_router_dicts = copy.copy(g_l_rtr_rr_ids)
sync_routers = []
attempt = 0
while incomplete_router_dicts and attempt < 10:
incomplete_router_dicts = []
new_sync_routers = self.l3_plugin.get_sync_data_ext(e_context,
g_l_rtr_rr_ids)
for s_r in new_sync_routers:
if s_r['status'] != cisco_constants.ROUTER_INFO_INCOMPLETE:
sync_routers.append(s_r)
else:
incomplete_router_dicts.append(s_r['id'])
self.assertEqual(2, len(sync_routers))
q_p = '%s=%s&%s=%s' % ('device_id', logical_global_router['id'],
'device_owner', DEVICE_OWNER_GLOBAL_ROUTER_GW)