summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-07 23:17:04 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-11-11 00:28:34 +0900
commit6dacfb38bf6e5c32abe39cfdfe825d3702316855 (patch)
treeaff47e475ce978bcd8667ca104933ba97cd3c72b
parent84d73c1b45006c40764c1587207b5ad67598e893 (diff)
scenario_test: use default interface for ipv4-peering
avoid creating many linux bridges via pipework Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
-rw-r--r--test/scenario_test/bgp_router_test.py22
-rw-r--r--test/scenario_test/bgp_zebra_test.py60
-rw-r--r--test/scenario_test/evpn_test.py3
-rw-r--r--test/scenario_test/flow_spec_test.py4
-rw-r--r--test/scenario_test/global_policy_test.py7
-rw-r--r--test/scenario_test/ibgp_router_test.py5
-rw-r--r--test/scenario_test/lib/base.py27
-rw-r--r--test/scenario_test/lib/exabgp.py12
-rw-r--r--test/scenario_test/route_reflector_test.py4
-rw-r--r--test/scenario_test/route_server_ipv4_v6_test.py9
-rw-r--r--test/scenario_test/route_server_malformed_test.py3
-rw-r--r--test/scenario_test/route_server_policy_grpc_test.py7
-rw-r--r--test/scenario_test/route_server_policy_test.py7
-rw-r--r--test/scenario_test/route_server_test.py13
14 files changed, 66 insertions, 117 deletions
diff --git a/test/scenario_test/bgp_router_test.py b/test/scenario_test/bgp_router_test.py
index 7e985552..b03d0ed2 100644
--- a/test/scenario_test/bgp_router_test.py
+++ b/test/scenario_test/bgp_router_test.py
@@ -52,16 +52,15 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for q in qs:
- g1.add_peer(q)
+ g1.add_peer(q, reload_config=False)
q.add_peer(g1)
+ g1.create_config()
+ g1.reload_config()
+
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3}
- cls.bridges = {'br01': br01}
# test each neighbor state is turned establish
def test_01_neighbor_established(self):
@@ -132,7 +131,6 @@ class GoBGPTestBase(unittest.TestCase):
initial_wait_time = q4.run()
time.sleep(initial_wait_time)
- self.bridges['br01'].addif(q4)
self.gobgp.add_peer(q4)
q4.add_peer(self.gobgp)
@@ -162,14 +160,6 @@ class GoBGPTestBase(unittest.TestCase):
initial_wait_time = q5.run()
time.sleep(initial_wait_time)
- br02 = Bridge(name='br02', subnet='192.168.20.0/24')
- br02.addif(q5)
- br02.addif(q2)
-
- br03 = Bridge(name='br03', subnet='192.168.30.0/24')
- br03.addif(q5)
- br03.addif(q3)
-
for q in [q2, q3]:
q5.add_peer(q)
q.add_peer(q5)
@@ -261,10 +251,8 @@ class GoBGPTestBase(unittest.TestCase):
g2 = GoBGPContainer(name='g2', asn=65000, router_id='192.168.0.5',
ctn_image_name=self.gobgp.image,
log_level=parser_option.gobgp_log_level)
- g2.run()
+ time.sleep(g2.run())
self.quaggas['g2'] = g2
- br01 = self.bridges['br01']
- br01.addif(g2)
g2.add_peer(g1, passive=True)
g1.add_peer(g2)
g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=g2)
diff --git a/test/scenario_test/bgp_zebra_test.py b/test/scenario_test/bgp_zebra_test.py
index 9fbf8cfe..7a024534 100644
--- a/test/scenario_test/bgp_zebra_test.py
+++ b/test/scenario_test/bgp_zebra_test.py
@@ -51,22 +51,26 @@ class GoBGPTestBase(unittest.TestCase):
o2_v6 = QuaggaBGPContainer(name='o2_v6', asn=65002, router_id='192.168.0.4')
# preparing the bridge for ipv4
- br01v4 = Bridge(name='br01', subnet='192.168.10.0/24')
- br02v4 = Bridge(name='br02', subnet='192.168.20.0/24')
- br03v4 = Bridge(name='br03', subnet='192.168.30.0/24')
+ br01_v4 = Bridge(name='br01_v4', subnet='192.168.10.0/24')
+ br02_v4 = Bridge(name='br02_v4', subnet='192.168.20.0/24')
+ br03_v4 = Bridge(name='br03_v4', subnet='192.168.30.0/24')
# preparing the bridge for ipv6
- br01v6 = Bridge(name='br01', subnet='2001:10::/32')
- br02v6 = Bridge(name='br02', subnet='2001:20::/32')
- br03v6 = Bridge(name='br03', subnet='2001:30::/32')
+ br01_v6 = Bridge(name='br01_v6', subnet='2001:10::/32')
+ br02_v6 = Bridge(name='br02_v6', subnet='2001:20::/32')
+ br03_v6 = Bridge(name='br03_v6', subnet='2001:30::/32')
cls.ctns = {'ipv4': [g1_v4, q1_v4, o1_v4, o2_v4],
'ipv6': [g1_v6, q1_v6, o1_v6, o2_v6]}
cls.gobgps = {'ipv4': g1_v4, 'ipv6': g1_v6}
cls.quaggas = {'ipv4': q1_v4, 'ipv6': q1_v6}
cls.others = {'ipv4': [o1_v4, o2_v4], 'ipv6': [o1_v6, o2_v6]}
- cls.bridges = {'ipv4': {'br01': br01v4, 'br02': br02v4, 'br03': br03v4},
- 'ipv6': {'br01': br01v6, 'br02': br02v6, 'br03': br03v6}}
+ cls.bridges = {'br01_v4' : br01_v4,
+ 'br02_v4' : br02_v4,
+ 'br03_v4' : br03_v4,
+ 'br01_v6' : br01_v6,
+ 'br02_v6' : br02_v6,
+ 'br03_v6' : br03_v6}
"""
No.1 start up ipv4 containers and check state
@@ -82,12 +86,12 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
# make ipv4 bridge and set ip to each container
- [self.bridges['ipv4']['br01'].addif(ctn) for ctn in [o1, g1]]
- [self.bridges['ipv4']['br02'].addif(ctn) for ctn in [g1, q1]]
- [self.bridges['ipv4']['br03'].addif(ctn) for ctn in [q1, o2]]
+ [self.bridges['br01_v4'].addif(ctn) for ctn in [o1, g1]]
+ [self.bridges['br02_v4'].addif(ctn) for ctn in [g1, q1]]
+ [self.bridges['br03_v4'].addif(ctn) for ctn in [q1, o2]]
- g1.add_peer(q1)
- q1.add_peer(g1)
+ g1.add_peer(q1, bridge=self.bridges['br02_v4'].name)
+ q1.add_peer(g1, bridge=self.bridges['br02_v4'].name)
g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q1)
@@ -100,8 +104,12 @@ class GoBGPTestBase(unittest.TestCase):
q1 = self.quaggas['ipv4']
o1 = self.others['ipv4'][0]
- next_hop = g1.ip_addrs[0][1].split('/')[0]
- o1.add_static_route(self.bridges['ipv4']['br02'].subnet, next_hop)
+ next_hop = None
+ for info in g1.ip_addrs:
+ if 'br01_v4' in info[2]:
+ 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')
"""
@@ -113,8 +121,8 @@ class GoBGPTestBase(unittest.TestCase):
q1 = self.quaggas['ipv4']
o2 = self.others['ipv4'][1]
- next_hop = q1.ip_addrs[1][1].split('/')[0]
- o2.add_static_route(self.bridges['ipv4']['br02'].subnet, next_hop)
+ 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')
"""
@@ -131,12 +139,12 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
# make ipv6 bridge and set ip to each container
- [self.bridges['ipv6']['br01'].addif(ctn) for ctn in [o1, g1]]
- [self.bridges['ipv6']['br02'].addif(ctn) for ctn in [g1, q1]]
- [self.bridges['ipv6']['br03'].addif(ctn) for ctn in [q1, o2]]
+ [self.bridges['br01_v6'].addif(ctn) for ctn in [o1, g1]]
+ [self.bridges['br02_v6'].addif(ctn) for ctn in [g1, q1]]
+ [self.bridges['br03_v6'].addif(ctn) for ctn in [q1, o2]]
- g1.add_peer(q1)
- q1.add_peer(g1)
+ g1.add_peer(q1, bridge=self.bridges['br02_v6'].name)
+ q1.add_peer(g1, bridge=self.bridges['br02_v6'].name)
g1.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q1)
@@ -149,9 +157,9 @@ class GoBGPTestBase(unittest.TestCase):
q1 = self.quaggas['ipv6']
o1 = self.others['ipv6'][0]
- next_hop = g1.ip_addrs[0][1].split('/')[0]
+ next_hop = g1.ip_addrs[1][1].split('/')[0]
g1.set_ipv6_forward()
- o1.add_static_route(self.bridges['ipv6']['br02'].subnet, next_hop)
+ o1.add_static_route(self.bridges['br02_v6'].subnet, next_hop)
q1.get_reachablily('2001:10::1')
"""
@@ -163,9 +171,9 @@ class GoBGPTestBase(unittest.TestCase):
q1 = self.quaggas['ipv6']
o2 = self.others['ipv6'][1]
- next_hop = q1.ip_addrs[1][1].split('/')[0]
+ next_hop = q1.ip_addrs[2][1].split('/')[0]
q1.set_ipv6_forward()
- o2.add_static_route(self.bridges['ipv6']['br02'].subnet, next_hop)
+ o2.add_static_route(self.bridges['br02_v6'].subnet, next_hop)
g1.get_reachablily('2001:30::2')
diff --git a/test/scenario_test/evpn_test.py b/test/scenario_test/evpn_test.py
index b3e893c5..b718bd3d 100644
--- a/test/scenario_test/evpn_test.py
+++ b/test/scenario_test/evpn_test.py
@@ -57,9 +57,6 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for a, b in combinations(ctns, 2):
a.add_peer(b, evpn=True)
b.add_peer(a, evpn=True)
diff --git a/test/scenario_test/flow_spec_test.py b/test/scenario_test/flow_spec_test.py
index bba92e1e..f3c6bff2 100644
--- a/test/scenario_test/flow_spec_test.py
+++ b/test/scenario_test/flow_spec_test.py
@@ -58,9 +58,6 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24', self_ip=True)
- [br01.addif(ctn) for ctn in ctns]
-
# ibgp peer. loop topology
for a, b in combinations(ctns, 2):
a.add_peer(b, flowspec=True)
@@ -68,7 +65,6 @@ class GoBGPTestBase(unittest.TestCase):
cls.gobgp = g1
cls.exabgp = e1
- cls.bridges = {'br01': br01}
# test each neighbor state is turned establish
def test_01_neighbor_established(self):
diff --git a/test/scenario_test/global_policy_test.py b/test/scenario_test/global_policy_test.py
index d3a417a9..a7c95d9a 100644
--- a/test/scenario_test/global_policy_test.py
+++ b/test/scenario_test/global_policy_test.py
@@ -61,9 +61,6 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
g1.local('gobgp global policy export add default reject')
for q in qs:
@@ -72,7 +69,6 @@ class GoBGPTestBase(unittest.TestCase):
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3}
- cls.bridges = {'br01': br01}
# test each neighbor state is turned establish
def test_01_neighbor_established(self):
@@ -86,8 +82,7 @@ class GoBGPTestBase(unittest.TestCase):
def test_03_add_peer(self):
q = ExaBGPContainer(name='q4', asn=65004, router_id='192.168.0.5')
q.add_route('10.10.0.0/24')
- q.run()
- self.bridges['br01'].addif(q)
+ time.sleep(q.run())
self.gobgp.add_peer(q)
q.add_peer(self.gobgp)
self.gobgp.wait_for(expected_state=BGP_FSM_ESTABLISHED, peer=q)
diff --git a/test/scenario_test/ibgp_router_test.py b/test/scenario_test/ibgp_router_test.py
index aa27c20d..5e40bf13 100644
--- a/test/scenario_test/ibgp_router_test.py
+++ b/test/scenario_test/ibgp_router_test.py
@@ -51,9 +51,6 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
# ibgp peer. loop topology
for a, b in combinations(ctns, 2):
a.add_peer(b)
@@ -61,7 +58,6 @@ class GoBGPTestBase(unittest.TestCase):
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2}
- cls.bridges = {'br01': br01}
# test each neighbor state is turned establish
def test_01_neighbor_established(self):
@@ -161,7 +157,6 @@ class GoBGPTestBase(unittest.TestCase):
initial_wait_time = q3.run()
time.sleep(initial_wait_time)
- self.bridges['br01'].addif(q3)
self.gobgp.add_peer(q3)
q3.add_peer(self.gobgp)
diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py
index d3cb9bd9..139cecc4 100644
--- a/test/scenario_test/lib/base.py
+++ b/test/scenario_test/lib/base.py
@@ -174,6 +174,10 @@ class Container(object):
self.id = try_several_times(lambda : local(str(c), capture=True))
self.is_running = True
self.local("ip li set up dev lo")
+ for line in self.local("ip a show dev eth0", capture=True).split('\n'):
+ if line.strip().startswith("inet "):
+ elems = [e.strip() for e in line.strip().split(' ')]
+ self.ip_addrs.append(('eth0', elems[1], 'docker0'))
return 0
def stop(self):
@@ -198,7 +202,7 @@ class Container(object):
else:
intf_name = "eth1"
c << "{0} {1}".format(self.docker_name(), ip_addr)
- self.ip_addrs.append((intf_name, ip_addr, bridge))
+ self.ip_addrs.append((intf_name, ip_addr, bridge.name))
try_several_times(lambda :local(str(c)))
def local(self, cmd, capture=False, flag=''):
@@ -215,7 +219,7 @@ class Container(object):
class BGPContainer(Container):
- WAIT_FOR_BOOT = 0
+ WAIT_FOR_BOOT = 1
RETRY_INTERVAL = 5
def __init__(self, name, asn, router_id, ctn_image_name):
@@ -241,13 +245,16 @@ class BGPContainer(Container):
def add_peer(self, peer, passwd=None, evpn=False, is_rs_client=False,
policies=None, passive=False,
is_rr_client=False, cluster_id=None,
- flowspec=False):
+ flowspec=False, bridge='', reload_config=True):
neigh_addr = ''
local_addr = ''
for me, you in itertools.product(self.ip_addrs, peer.ip_addrs):
+ if bridge != '' and bridge != me[2]:
+ continue
if me[2] == you[2]:
neigh_addr = you[1]
local_addr = me[1]
+ break
if neigh_addr == '':
raise Exception('peer {0} seems not ip reachable'.format(peer))
@@ -265,13 +272,13 @@ class BGPContainer(Container):
'policies': policies,
'passive': passive,
'local_addr': local_addr}
- if self.is_running:
+ if self.is_running and reload_config:
self.create_config()
self.reload_config()
- def del_peer(self, peer):
+ def del_peer(self, peer, reload_config=True):
del self.peers[peer]
- if self.is_running:
+ if self.is_running and reload_config:
self.create_config()
self.reload_config()
@@ -287,7 +294,7 @@ class BGPContainer(Container):
def add_route(self, route, rf='ipv4', attribute=None, aspath=None,
community=None, med=None, extendedcommunity=None,
nexthop=None, matchs=None, thens=None,
- local_pref=None):
+ local_pref=None, reload_config=True):
self.routes[route] = {'prefix': route,
'rf': rf,
'attr': attribute,
@@ -299,15 +306,15 @@ class BGPContainer(Container):
'extended-community': extendedcommunity,
'matchs': matchs,
'thens' : thens}
- if self.is_running:
+ if self.is_running and reload_config:
self.create_config()
self.reload_config()
- def add_policy(self, policy, peer=None):
+ def add_policy(self, policy, peer=None, reload_config=True):
self.policies[policy['name']] = policy
if peer in self.peers:
self.peers[peer]['policies'][policy['name']] = policy
- if self.is_running:
+ if self.is_running and reload_config:
self.create_config()
self.reload_config()
diff --git a/test/scenario_test/lib/exabgp.py b/test/scenario_test/lib/exabgp.py
index e14a084b..39298c4c 100644
--- a/test/scenario_test/lib/exabgp.py
+++ b/test/scenario_test/lib/exabgp.py
@@ -65,15 +65,7 @@ class ExaBGPContainer(BGPContainer):
for peer, info in self.peers.iteritems():
cmd << 'neighbor {0} {{'.format(info['neigh_addr'].split('/')[0])
cmd << ' router-id {0};'.format(self.router_id)
-
- local_addr = ''
- for me, you in itertools.product(self.ip_addrs, peer.ip_addrs):
- if me[2] == you[2]:
- local_addr = me[1]
- if local_addr == '':
- raise Exception('local_addr not found')
- local_addr = local_addr.split('/')[0]
- cmd << ' local-address {0};'.format(local_addr)
+ cmd << ' local-address {0};'.format(info['local_addr'].split('/')[0])
cmd << ' local-as {0};'.format(self.asn)
cmd << ' peer-as {0};'.format(peer.asn)
@@ -83,7 +75,7 @@ class ExaBGPContainer(BGPContainer):
cmd << ' static {'
for route in routes:
r = CmdBuffer(' ')
- nexthop = local_addr
+ nexthop = info['local_addr'].split('/')[0]
if route['next-hop']:
nexthop = route['next-hop']
r << ' route {0} next-hop {1}'.format(route['prefix'], nexthop)
diff --git a/test/scenario_test/route_reflector_test.py b/test/scenario_test/route_reflector_test.py
index 7650a4ac..73e7f4d9 100644
--- a/test/scenario_test/route_reflector_test.py
+++ b/test/scenario_test/route_reflector_test.py
@@ -65,9 +65,6 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
# g1 as a route reflector
g1.add_peer(q1, is_rr_client=True)
q1.add_peer(g1)
@@ -80,7 +77,6 @@ class GoBGPTestBase(unittest.TestCase):
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3, 'q4': q4}
- cls.bridges = {'br01': br01}
# test each neighbor state is turned establish
def test_01_neighbor_established(self):
diff --git a/test/scenario_test/route_server_ipv4_v6_test.py b/test/scenario_test/route_server_ipv4_v6_test.py
index e7d5d8e2..b0c75c27 100644
--- a/test/scenario_test/route_server_ipv4_v6_test.py
+++ b/test/scenario_test/route_server_ipv4_v6_test.py
@@ -59,10 +59,7 @@ class GoBGPIPv6Test(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- br01.addif(g1)
for ctn in v4:
- br01.addif(ctn)
g1.add_peer(ctn, is_rs_client=True)
ctn.add_peer(g1)
@@ -70,12 +67,12 @@ class GoBGPIPv6Test(unittest.TestCase):
br02.addif(g1)
for ctn in v6:
br02.addif(ctn)
- g1.add_peer(ctn, is_rs_client=True)
- ctn.add_peer(g1)
+ g1.add_peer(ctn, is_rs_client=True, bridge=br02.name)
+ ctn.add_peer(g1, bridge=br02.name)
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3, 'q4': q4}
- cls.bridges = {'br01': br01, 'br02': br02}
+ cls.bridges = {'br02': br02}
cls.ipv4s = {'q1': q1, 'q2': q2}
cls.ipv6s = {'q3': q3, 'q4': q4}
diff --git a/test/scenario_test/route_server_malformed_test.py b/test/scenario_test/route_server_malformed_test.py
index 83cc4c98..9bf92708 100644
--- a/test/scenario_test/route_server_malformed_test.py
+++ b/test/scenario_test/route_server_malformed_test.py
@@ -70,9 +70,6 @@ def boot(env):
initial_wait_time = max(ctn.run() for ctn in ctns)
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for q in [e1, e2]:
g1.add_peer(q, is_rs_client=True)
q.add_peer(g1)
diff --git a/test/scenario_test/route_server_policy_grpc_test.py b/test/scenario_test/route_server_policy_grpc_test.py
index 2bf84654..1d3a67e7 100644
--- a/test/scenario_test/route_server_policy_grpc_test.py
+++ b/test/scenario_test/route_server_policy_grpc_test.py
@@ -82,9 +82,6 @@ class ImportPolicy(object):
initial_wait_time = max(ctn.run() for ctn in ctns)
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for q in [e1, q1, q2]:
g1.add_peer(q, is_rs_client=True)
q.add_peer(g1)
@@ -457,8 +454,8 @@ class ImportPolicyIPV6(object):
[br01.addif(ctn) for ctn in ctns]
for q in [e1, q1, q2]:
- g1.add_peer(q, is_rs_client=True)
- q.add_peer(g1)
+ g1.add_peer(q, is_rs_client=True, bridge=br01.name)
+ q.add_peer(g1, bridge=br01.name)
env.g1 = g1
env.e1 = e1
diff --git a/test/scenario_test/route_server_policy_test.py b/test/scenario_test/route_server_policy_test.py
index e21b7713..1eb31f62 100644
--- a/test/scenario_test/route_server_policy_test.py
+++ b/test/scenario_test/route_server_policy_test.py
@@ -82,9 +82,6 @@ class ImportPolicy(object):
initial_wait_time = max(ctn.run() for ctn in ctns)
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for q in [e1, q1, q2]:
g1.add_peer(q, is_rs_client=True)
q.add_peer(g1)
@@ -498,8 +495,8 @@ class ImportPolicyIPV6(object):
[br01.addif(ctn) for ctn in ctns]
for q in [e1, q1, q2]:
- g1.add_peer(q, is_rs_client=True)
- q.add_peer(g1)
+ g1.add_peer(q, is_rs_client=True, bridge=br01.name)
+ q.add_peer(g1, bridge=br01.name)
env.g1 = g1
env.e1 = e1
diff --git a/test/scenario_test/route_server_test.py b/test/scenario_test/route_server_test.py
index 12b4e65c..5311f9ed 100644
--- a/test/scenario_test/route_server_test.py
+++ b/test/scenario_test/route_server_test.py
@@ -58,16 +58,12 @@ class GoBGPTestBase(unittest.TestCase):
time.sleep(initial_wait_time)
- br01 = Bridge(name='br01', subnet='192.168.10.0/24')
- [br01.addif(ctn) for ctn in ctns]
-
for rs_client in rs_clients:
g1.add_peer(rs_client, is_rs_client=True)
rs_client.add_peer(g1)
cls.gobgp = g1
cls.quaggas = {'q1': q1, 'q2': q2, 'q3': q3}
- cls.bridges = {'br01': br01}
def check_gobgp_local_rib(self):
for rs_client in self.quaggas.itervalues():
@@ -146,7 +142,6 @@ class GoBGPTestBase(unittest.TestCase):
initial_wait_time = q4.run()
time.sleep(initial_wait_time)
- self.bridges['br01'].addif(q4)
self.gobgp.add_peer(q4, is_rs_client=True)
q4.add_peer(self.gobgp)
@@ -184,14 +179,6 @@ class GoBGPTestBase(unittest.TestCase):
initial_wait_time = q5.run()
time.sleep(initial_wait_time)
- br02 = Bridge(name='br02', subnet='192.168.20.0/24')
- br02.addif(q5)
- br02.addif(q2)
-
- br03 = Bridge(name='br03', subnet='192.168.30.0/24')
- br03.addif(q5)
- br03.addif(q3)
-
for q in [q2, q3]:
q5.add_peer(q)
q.add_peer(q5)