summaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-12-28 21:02:03 +0900
committerISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>2015-12-28 21:02:03 +0900
commit58946b7924840f1effc993e95440266479c668d5 (patch)
treeac6fe1387af028f49a93f9f74f5bcf6ae694a376 /test
parent7a2b3951160804c6895714621099168e8e56aa74 (diff)
config: make config/state variable name simple
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test')
-rw-r--r--test/lib/gobgp.py26
-rw-r--r--test/performance_test/main.go15
2 files changed, 20 insertions, 21 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py
index 042d6696..f0dcb0fe 100644
--- a/test/lib/gobgp.py
+++ b/test/lib/gobgp.py
@@ -174,7 +174,7 @@ class GoBGPContainer(BGPContainer):
self._create_config_zebra()
def _create_config_bgp(self):
- config = {'Global': {'GlobalConfig': {'As': self.asn, 'RouterId': self.router_id}}}
+ config = {'Global': {'Config': {'As': self.asn, 'RouterId': self.router_id}}}
for peer, info in self.peers.iteritems():
afi_safi_list = []
version = netaddr.IPNetwork(info['neigh_addr']).version
@@ -196,7 +196,7 @@ class GoBGPContainer(BGPContainer):
afi_safi_list.append({'AfiSafiName': 'ipv6-flowspec'})
afi_safi_list.append({'AfiSafiName': 'l3vpn-ipv6-flowspec'})
- n = {'NeighborConfig':
+ n = {'Config':
{'NeighborAddress': info['neigh_addr'].split('/')[0],
'PeerAs': peer.asn,
'AuthPassword': info['passwd'],
@@ -205,17 +205,17 @@ class GoBGPContainer(BGPContainer):
}
if info['passive']:
- n['Transport'] = {'TransportConfig': {'PassiveMode': True}}
+ n['Transport'] = {'Config': {'PassiveMode': True}}
if info['is_rs_client']:
- n['RouteServer'] = {'RouteServerConfig': {'RouteServerClient': True}}
+ n['RouteServer'] = {'Config': {'RouteServerClient': True}}
if info['is_rr_client']:
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}}
+ n['RouteReflector'] = {'Config' : {'RouteReflectorClient': True,
+ 'RouteReflectorClusterId': clusterId}}
f = lambda typ: [p for p in info['policies'].itervalues() if p['type'] == typ]
import_policies = f('import')
@@ -228,16 +228,16 @@ class GoBGPContainer(BGPContainer):
if len(import_policies) + len(export_policies) + len(in_policies) + len(default_import_policy) \
+ len(default_export_policy) + len(default_in_policy) > 0:
- n['ApplyPolicy'] = {'ApplyPolicyConfig': {}}
+ n['ApplyPolicy'] = {'Config': {}}
if len(import_policies) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['ImportPolicy'] = [p['name'] for p in import_policies]
+ n['ApplyPolicy']['Config']['ImportPolicy'] = [p['name'] for p in import_policies]
if len(export_policies) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['ExportPolicy'] = [p['name'] for p in export_policies]
+ n['ApplyPolicy']['Config']['ExportPolicy'] = [p['name'] for p in export_policies]
if len(in_policies) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['InPolicy'] = [p['name'] for p in in_policies]
+ n['ApplyPolicy']['Config']['InPolicy'] = [p['name'] for p in in_policies]
def f(v):
if v == 'reject':
@@ -247,13 +247,13 @@ class GoBGPContainer(BGPContainer):
raise Exception('invalid default policy type {0}'.format(v))
if len(default_import_policy) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['DefaultImportPolicy'] = f(default_import_policy[0])
+ n['ApplyPolicy']['Config']['DefaultImportPolicy'] = f(default_import_policy[0])
if len(default_export_policy) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['DefaultExportPolicy'] = f(default_export_policy[0])
+ n['ApplyPolicy']['Config']['DefaultExportPolicy'] = f(default_export_policy[0])
if len(default_in_policy) > 0:
- n['ApplyPolicy']['ApplyPolicyConfig']['DefaultInPolicy'] = f(default_in_policy[0])
+ n['ApplyPolicy']['Config']['DefaultInPolicy'] = f(default_in_policy[0])
if 'Neighbors' not in config:
config['Neighbors'] = {'NeighborList': []}
diff --git a/test/performance_test/main.go b/test/performance_test/main.go
index b439c9a8..d005bcfa 100644
--- a/test/performance_test/main.go
+++ b/test/performance_test/main.go
@@ -17,7 +17,6 @@ package main
import (
"fmt"
- "net"
"os"
"time"
@@ -56,24 +55,24 @@ func main() {
for i := 0; i < num; i++ {
localAddr := fmt.Sprintf("10.10.%d.%d", (i+2)/255, (i+2)%255)
g := config.Global{
- GlobalConfig: config.GlobalConfig{
+ Config: config.GlobalConfig{
As: uint32(1001 + i),
- RouterId: net.ParseIP(localAddr),
+ RouterId: localAddr,
},
}
p := config.Neighbor{
- NeighborConfig: config.NeighborConfig{
+ Config: config.NeighborConfig{
PeerAs: 1000,
- NeighborAddress: net.ParseIP("10.10.0.1"),
+ NeighborAddress: "10.10.0.1",
},
Transport: config.Transport{
- TransportConfig: config.TransportConfig{
- LocalAddress: net.ParseIP(localAddr),
+ Config: config.TransportConfig{
+ LocalAddress: localAddr,
},
},
}
peer := newPeer(g, p, incoming)
- peerMap[p.Transport.TransportConfig.LocalAddress.String()] = peer
+ peerMap[p.Transport.Config.LocalAddress.String()] = peer
}
established := 0
ticker := time.NewTicker(time.Second * 5)