summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/bgp_zebra_test.py
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-09-12 19:28:07 -0700
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-09-12 23:05:06 -0700
commit990ddcf304c2dbb766a612fd6b045f45abb2784a (patch)
treec84bc69a57e5fc26ea73bb6f1b605ffdff7cb31c /test/scenario_test/bgp_zebra_test.py
parentc2d0ee36c36d132ae6e72a542d877e9206c0337a (diff)
test: avoid hard-code interface names in bgp_zebra_test.py
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'test/scenario_test/bgp_zebra_test.py')
-rw-r--r--test/scenario_test/bgp_zebra_test.py16
1 files changed, 12 insertions, 4 deletions
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',