summaryrefslogtreecommitdiffhomepage
path: root/test/scenario_test/lib/gobgp.py
diff options
context:
space:
mode:
authorHiroshi Yokoi <yokoi.hiroshi@po.ntts.co.jp>2015-07-15 19:53:53 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2015-07-31 16:26:17 +0900
commit0b4b806c06f0ee50bb1bc1b30c38399553687abd (patch)
tree6898ec9eeb21a26668012c1c7743772da7b72214 /test/scenario_test/lib/gobgp.py
parent2ad42ead02cce21cf71b3dde0731e8f5c6d4ac6a (diff)
config: use the latest openconfig yang
Diffstat (limited to 'test/scenario_test/lib/gobgp.py')
-rw-r--r--test/scenario_test/lib/gobgp.py23
1 files changed, 13 insertions, 10 deletions
diff --git a/test/scenario_test/lib/gobgp.py b/test/scenario_test/lib/gobgp.py
index 433d779e..4092882a 100644
--- a/test/scenario_test/lib/gobgp.py
+++ b/test/scenario_test/lib/gobgp.py
@@ -108,7 +108,7 @@ class GoBGPContainer(BGPContainer):
return json.loads(output)['info']['bgp_state']
def create_config(self):
- config = {'Global': {'As': self.asn, 'RouterId': self.router_id}}
+ config = {'Global': {'GlobalConfig': {'As': self.asn, 'RouterId': self.router_id}}}
for peer, info in self.peers.iteritems():
if self.asn == peer.asn:
peer_type = self.PEER_TYPE_INTERNAL
@@ -129,14 +129,17 @@ class GoBGPContainer(BGPContainer):
afi_safi_list.append({'AfiSafiName': 'encap'})
afi_safi_list.append({'AfiSafiName': 'rtc'})
- n = {'NeighborAddress': info['neigh_addr'].split('/')[0],
- 'PeerAs': peer.asn,
- 'AuthPassword': info['passwd'],
- 'PeerType': peer_type,
- 'AfiSafiList': afi_safi_list}
+ n = {'NeighborConfig':
+ {'NeighborAddress': info['neigh_addr'].split('/')[0],
+ 'PeerAs': peer.asn,
+ 'AuthPassword': info['passwd'],
+ 'PeerType': peer_type,
+ },
+ 'AfiSafis': {'AfiSafiList': afi_safi_list}
+ }
if info['passive']:
- n['TransportOptions'] = {'PassiveMode': True}
+ n['Transport'] = {'TransportConfig': {'PassiveMode': True}}
if info['is_rs_client']:
n['RouteServer'] = {'RouteServerClient': True}
@@ -146,10 +149,10 @@ class GoBGPContainer(BGPContainer):
n['RouteReflector'] = {'RouteReflectorClient': True,
'RouteReflectorClusterId': clusterId}
- if 'NeighborList' not in config:
- config['NeighborList'] = []
+ if 'Neighbors' not in config:
+ config['Neighbors'] = {'NeighborList': []}
- config['NeighborList'].append(n)
+ config['Neighbors']['NeighborList'].append(n)
with open('{0}/gobgpd.conf'.format(self.config_dir), 'w') as f:
print colors.yellow('[{0}\'s new config]'.format(self.name))