From 990ddcf304c2dbb766a612fd6b045f45abb2784a Mon Sep 17 00:00:00 2001 From: FUJITA Tomonori Date: Mon, 12 Sep 2016 19:28:07 -0700 Subject: test: avoid hard-code interface names in bgp_zebra_test.py Signed-off-by: FUJITA Tomonori --- test/scenario_test/bgp_zebra_test.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'test/scenario_test') diff --git a/test/scenario_test/bgp_zebra_test.py b/test/scenario_test/bgp_zebra_test.py index 8672a33b..7693c355 100644 --- a/test/scenario_test/bgp_zebra_test.py +++ b/test/scenario_test/bgp_zebra_test.py @@ -110,7 +110,9 @@ class GoBGPTestBase(unittest.TestCase): next_hop = info[1].split('/')[0] self.assertFalse(next_hop == None) o1.add_static_route(self.bridges['br02_v4'].subnet, next_hop) - q1.get_reachablily('192.168.10.1') + addr = [e[1] for e in o1.ip_addrs if 'br01_v4' in e[2] ] + self.assertTrue(len(addr) == 1) + q1.get_reachablily(addr[0]) """ No.3 check whether the ping is reachable in container @@ -123,7 +125,9 @@ class GoBGPTestBase(unittest.TestCase): next_hop = q1.ip_addrs[2][1].split('/')[0] o2.add_static_route(self.bridges['br02_v4'].subnet, next_hop) - g1.get_reachablily('192.168.30.2') + addr = [e[1] for e in o2.ip_addrs if 'br03_v4' in e[2] ] + self.assertTrue(len(addr) == 1) + g1.get_reachablily(addr[0]) """ No.4 start up ipv4 containers and check state @@ -160,7 +164,9 @@ class GoBGPTestBase(unittest.TestCase): next_hop = g1.ip_addrs[1][1].split('/')[0] g1.set_ipv6_forward() o1.add_static_route(self.bridges['br02_v6'].subnet, next_hop) - q1.get_reachablily('2001:10::1') + addr = [e[1] for e in o1.ip_addrs if 'br01_v6' in e[2] ] + self.assertTrue(len(addr) == 1) + q1.get_reachablily(addr[0]) """ No.6 check whether the ping is reachable in container @@ -174,7 +180,9 @@ class GoBGPTestBase(unittest.TestCase): next_hop = q1.ip_addrs[2][1].split('/')[0] q1.set_ipv6_forward() o2.add_static_route(self.bridges['br02_v6'].subnet, next_hop) - g1.get_reachablily('2001:30::2') + addr = [e[1] for e in o2.ip_addrs if 'br03_v6' in e[2] ] + self.assertTrue(len(addr) == 1) + g1.get_reachablily(addr[0]) def test_07_mpath_test_setup(self): g1 = GoBGPContainer(name='g1', asn=65000, router_id='192.168.0.1', -- cgit v1.2.3