From 85a7417fd0d15c4275d515b9eca04d2a8b0f5749 Mon Sep 17 00:00:00 2001 From: Devang Doshi Date: Tue, 28 Mar 2017 14:20:03 -0700 Subject: [PATCH] Tempest: Fix for test_mdproxy_with_server_on_two_ls test case - test_mdproxy_with_server_on_two_ls is failing. In list_port we scan for 1st instance fixed ip and compare with the topo. In this case Instance has 2 fixed ips, so this test case was interim failing. Change-Id: I18b09948e9e043ff0123250aace28b0b5034017d --- vmware_nsx_tempest/tests/nsxv3/scenario/test_mdproxy.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vmware_nsx_tempest/tests/nsxv3/scenario/test_mdproxy.py b/vmware_nsx_tempest/tests/nsxv3/scenario/test_mdproxy.py index fce3e5e25f..362f3c6d60 100644 --- a/vmware_nsx_tempest/tests/nsxv3/scenario/test_mdproxy.py +++ b/vmware_nsx_tempest/tests/nsxv3/scenario/test_mdproxy.py @@ -124,13 +124,15 @@ class TestMDProxy(manager.NetworkScenarioTest): return ports_list['ports'] def _get_port_id(self, network_id, subnet_id, instance): - _, instance_addr = instance["addresses"].items()[0] - instance_fixed_ip = instance_addr[0]["addr"] + instance_addrs = instance["addresses"].items() + instance_fixed_ips = [] + for addr in instance_addrs: + instance_fixed_ips.append(addr[1][0]["addr"]) for port in self._list_ports(device_id=instance['id']): port_fixed_ip = port["fixed_ips"][0]["ip_address"] if port["network_id"] == network_id and port["fixed_ips"][0][ "subnet_id"] == subnet_id and "compute:" in port[ - "device_owner"] and port_fixed_ip == instance_fixed_ip: + "device_owner"] and port_fixed_ip in instance_fixed_ips: port_id = port["id"] self.assertIsNotNone(port_id, "Failed to find Instance's port id!!!") return port_id