summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib
diff options
context:
space:
mode:
Diffstat (limited to 'test/scenario_test/lib')
-rw-r--r--test/scenario_test/lib/base.py5
-rw-r--r--test/scenario_test/lib/gobgp.py8
2 files changed, 9 insertions, 4 deletions
diff --git a/test/scenario_test/lib/base.py b/test/scenario_test/lib/base.py
index 1bba6f5b..7f73516b 100644
--- a/test/scenario_test/lib/base.py
+++ b/test/scenario_test/lib/base.py
@@ -224,6 +224,9 @@ class BGPContainer(Container):
self.policies = {}
super(BGPContainer, self).__init__(name, ctn_image_name)
+ def __repr__(self):
+ return str({'name':self.name, 'asn':self.asn, 'router_id':self.router_id})
+
def run(self):
self.create_config()
super(BGPContainer, self).run()
@@ -231,7 +234,7 @@ 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='',
+ is_rr_client=False, cluster_id=None,
flowspec=False):
neigh_addr = ''
local_addr = ''
diff --git a/test/scenario_test/lib/gobgp.py b/test/scenario_test/lib/gobgp.py
index aed7f16d..04b89ffe 100644
--- a/test/scenario_test/lib/gobgp.py
+++ b/test/scenario_test/lib/gobgp.py
@@ -186,9 +186,11 @@ class GoBGPContainer(BGPContainer):
n['RouteServer'] = {'RouteServerConfig': {'RouteServerClient': True}}
if info['is_rr_client']:
- clusterId = info['cluster_id']
- n['RouteReflector'] = {'RouteReflectorClient': True,
- 'RouteReflectorClusterId': clusterId}
+ clusterId = self.router_id
+ if 'cluster_id' in info and info['cluster_id'] is not None:
+ clusterId = info['cluster_id']
+ n['RouteReflector'] = {'RouteReflectorConfig' : {'RouteReflectorClient': True,
+ 'RouteReflectorClusterId': clusterId}}
f = lambda typ: [p for p in info['policies'].itervalues() if p['type'] == typ]
import_policies = f('import')