diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-01-02 02:13:30 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2016-01-09 05:17:57 -0800 |
commit | cc8d0fd748f83d774ec59e680586421cd9d9a6d2 (patch) | |
tree | 393a564c3d6389084f098732528b3b4206cd60de /test | |
parent | 0c1c373e498db1023e4f307f362598a096e36df0 (diff) |
config: refactor config structure
- change config variable name to chaincase from camelcase
- remove unnecessary wrapper structs which only contain one slice field
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'test')
-rw-r--r-- | test/lib/gobgp.py | 84 | ||||
-rw-r--r-- | test/scenario_test/route_server_policy_test.py | 696 |
2 files changed, 389 insertions, 391 deletions
diff --git a/test/lib/gobgp.py b/test/lib/gobgp.py index 06924edd..18e7ddc8 100644 --- a/test/lib/gobgp.py +++ b/test/lib/gobgp.py @@ -174,51 +174,51 @@ class GoBGPContainer(BGPContainer): self._create_config_zebra() def _create_config_bgp(self): - config = {'Global': {'Config': {'As': self.asn, 'RouterId': self.router_id}}} + config = {'global': {'config': {'as': self.asn, 'router-id': self.router_id}}} for peer, info in self.peers.iteritems(): afi_safi_list = [] version = netaddr.IPNetwork(info['neigh_addr']).version if version == 4: - afi_safi_list.append({'AfiSafiName': 'ipv4-unicast'}) + afi_safi_list.append({'afi-safi-name': 'ipv4-unicast'}) elif version == 6: - afi_safi_list.append({'AfiSafiName': 'ipv6-unicast'}) + afi_safi_list.append({'afi-safi-name': 'ipv6-unicast'}) else: Exception('invalid ip address version. {0}'.format(version)) if info['evpn']: - afi_safi_list.append({'AfiSafiName': 'l2vpn-evpn'}) - afi_safi_list.append({'AfiSafiName': 'encap'}) - afi_safi_list.append({'AfiSafiName': 'rtc'}) + afi_safi_list.append({'afi-safi-name': 'l2vpn-evpn'}) + afi_safi_list.append({'afi-safi-name': 'encap'}) + afi_safi_list.append({'afi-safi-name': 'rtc'}) if info['flowspec']: - afi_safi_list.append({'AfiSafiName': 'ipv4-flowspec'}) - afi_safi_list.append({'AfiSafiName': 'l3vpn-ipv4-flowspec'}) - afi_safi_list.append({'AfiSafiName': 'ipv6-flowspec'}) - afi_safi_list.append({'AfiSafiName': 'l3vpn-ipv6-flowspec'}) - - n = {'Config': - {'NeighborAddress': info['neigh_addr'].split('/')[0], - 'PeerAs': peer.asn, - 'AuthPassword': info['passwd'], + afi_safi_list.append({'afi-safi-name': 'ipv4-flowspec'}) + afi_safi_list.append({'afi-safi-name': 'l3vpn-ipv4-flowspec'}) + afi_safi_list.append({'afi-safi-name': 'ipv6-flowspec'}) + afi_safi_list.append({'afi-safi-name': 'l3vpn-ipv6-flowspec'}) + + n = {'config': + {'neighbor-address': info['neigh_addr'].split('/')[0], + 'peer-as': peer.asn, + 'auth-password': info['passwd'], }, - 'AfiSafis': {'AfiSafiList': afi_safi_list}, - 'Timers': {'Config': { - 'ConnectRetry': 10, - }}, + 'afi-safis': afi_safi_list, + 'timers': {'config': { + 'connect-retry': 10, + }}, } if info['passive']: - n['Transport'] = {'Config': {'PassiveMode': True}} + n['transport'] = {'config': {'passive-mode': True}} if info['is_rs_client']: - n['RouteServer'] = {'Config': {'RouteServerClient': True}} + n['route-server'] = {'config': {'route-server-client': 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'] = {'Config' : {'RouteReflectorClient': True, - 'RouteReflectorClusterId': clusterId}} + n['route-reflector'] = {'config' : {'route-reflector-client': True, + 'route-reflector-cluster-id': clusterId}} f = lambda typ: [p for p in info['policies'].itervalues() if p['type'] == typ] import_policies = f('import') @@ -231,16 +231,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'] = {'Config': {}} + n['apply-policy'] = {'config': {}} if len(import_policies) > 0: - n['ApplyPolicy']['Config']['ImportPolicy'] = [p['name'] for p in import_policies] + n['apply-policy']['config']['import-policy-list'] = [p['name'] for p in import_policies] if len(export_policies) > 0: - n['ApplyPolicy']['Config']['ExportPolicy'] = [p['name'] for p in export_policies] + n['apply-policy']['config']['export-policy-list'] = [p['name'] for p in export_policies] if len(in_policies) > 0: - n['ApplyPolicy']['Config']['InPolicy'] = [p['name'] for p in in_policies] + n['apply-policy']['config']['in-policy-list'] = [p['name'] for p in in_policies] def f(v): if v == 'reject': @@ -250,41 +250,41 @@ class GoBGPContainer(BGPContainer): raise Exception('invalid default policy type {0}'.format(v)) if len(default_import_policy) > 0: - n['ApplyPolicy']['Config']['DefaultImportPolicy'] = f(default_import_policy[0]) + n['apply-policy']['config']['default-import-policy'] = f(default_import_policy[0]) if len(default_export_policy) > 0: - n['ApplyPolicy']['Config']['DefaultExportPolicy'] = f(default_export_policy[0]) + n['apply-policy']['config']['default-export-policy'] = f(default_export_policy[0]) if len(default_in_policy) > 0: - n['ApplyPolicy']['Config']['DefaultInPolicy'] = f(default_in_policy[0]) + n['apply-policy']['config']['default-in-policy'] = f(default_in_policy[0]) - if 'Neighbors' not in config: - config['Neighbors'] = {'NeighborList': []} + if 'neighbors' not in config: + config['neighbors'] = [] - config['Neighbors']['NeighborList'].append(n) + config['neighbors'].append(n) - config['DefinedSets'] = {} + config['defined-sets'] = {} if self.prefix_set: - config['DefinedSets']['PrefixSets'] = {'PrefixSetList': [self.prefix_set]} + config['defined-sets']['prefix-sets'] = [self.prefix_set] if self.neighbor_set: - config['DefinedSets']['NeighborSets'] = {'NeighborSetList': [self.neighbor_set]} + config['defined-sets']['neighbor-sets'] = [self.neighbor_set] if self.bgp_set: - config['DefinedSets']['BgpDefinedSets'] = self.bgp_set + config['defined-sets']['bgp-defined-sets'] = self.bgp_set policy_list = [] for p in self.policies.itervalues(): - policy = {'Name': p['name'], - 'Statements':{'StatementList': p['statements']}} + policy = {'name': p['name'], + 'statements': p['statements']} policy_list.append(policy) if len(policy_list) > 0: - config['PolicyDefinitions'] = {'PolicyDefinitionList': policy_list} + config['policy-definitions'] = policy_list if self.zebra: - config['Global']['Zebra'] = {'Enabled': True, - 'RedistributeRouteType':['connect']} + config['global']['zebra'] = {'enabled': True, + 'redistribute-route-type-list':['connect']} with open('{0}/gobgpd.conf'.format(self.config_dir), 'w') as f: print colors.yellow('[{0}\'s new config]'.format(self.name)) diff --git a/test/scenario_test/route_server_policy_test.py b/test/scenario_test/route_server_policy_test.py index 0fdc3967..f01d63e3 100644 --- a/test/scenario_test/route_server_policy_test.py +++ b/test/scenario_test/route_server_policy_test.py @@ -99,22 +99,22 @@ class ImportPolicy(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.0.0/16', - 'MasklengthRange': '16..24'} + p0 = {'ip-prefix': '192.168.0.0/16', + 'masklength-range': '16..24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -166,22 +166,22 @@ class ExportPolicy(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.0.0/16', - 'MasklengthRange': '16..24'} + p0 = {'ip-prefix': '192.168.0.0/16', + 'masklength-range': '16..24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -253,22 +253,22 @@ class ImportPolicyUpdate(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} - p1 = {'IpPrefix': '192.168.200.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} + p1 = {'ip-prefix': '192.168.200.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0, p1]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0, p1]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -303,20 +303,20 @@ class ImportPolicyUpdate(object): q2 = env.q2 g1.clear_policy() - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -383,21 +383,21 @@ class ExportPolicyUpdate(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} - p1 = {'IpPrefix': '192.168.200.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} + p1 = {'ip-prefix': '192.168.200.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0, p1]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0, p1]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -432,20 +432,20 @@ class ExportPolicyUpdate(object): q2 = env.q2 g1.clear_policy() - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -527,22 +527,22 @@ class ImportPolicyIPV6(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001::/32', - 'MasklengthRange': '64..128'} + p0 = {'ip-prefix': '2001::/32', + 'masklength-range': '64..128'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -597,22 +597,22 @@ class ExportPolicyIPV6(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001::/32', - 'MasklengthRange': '64..128'} + p0 = {'ip-prefix': '2001::/32', + 'masklength-range': '64..128'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -680,22 +680,22 @@ class ImportPolicyIPV6Update(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001:0:10:2::/64'} - p1 = {'IpPrefix': '2001:0:10:20::/64'} + p0 = {'ip-prefix': '2001:0:10:2::/64'} + p1 = {'ip-prefix': '2001:0:10:20::/64'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0, p1]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0, p1]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -725,22 +725,22 @@ class ImportPolicyIPV6Update(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001:0:10:2::/64'} + p0 = {'ip-prefix': '2001:0:10:2::/64'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': { - 'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': { + 'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -803,22 +803,22 @@ class ExportPolicyIPv6Update(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001:0:10:2::/64'} - p1 = {'IpPrefix': '2001:0:10:20::/64'} + p0 = {'ip-prefix': '2001:0:10:2::/64'} + p1 = {'ip-prefix': '2001:0:10:20::/64'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0, p1]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0, p1]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -848,21 +848,21 @@ class ExportPolicyIPv6Update(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '2001:0:10:2::/64'} + p0 = {'ip-prefix': '2001:0:10:2::/64'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[q2]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[q2]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'export', @@ -911,10 +911,10 @@ class ImportPolicyAsPathLengthCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'AsPathLength': {'Operator': 'ge', - 'Value': 10}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'as-path-length': {'operator': 'ge', + 'value': 10}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -969,13 +969,13 @@ class ImportPolicyAsPathCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - as0 = {'AsPathSets': {'AsPathSetList': [{'AsPathSetName': 'as0', 'AsPath': ['^{0}'.format(e1.asn)]}]}} + as0 = {'as-path-sets': [{'as-path-set-name': 'as0', 'as-path-list': ['^{0}'.format(e1.asn)]}]} g1.set_bgp_defined_set(as0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchAsPathSet': {'AsPathSet': 'as0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-as-path-set': {'as-path-set': 'as0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1022,13 +1022,13 @@ class ImportPolicyAsPathAnyCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - as0 = {'AsPathSets': {'AsPathSetList': [{'AsPathSetName': 'as0', 'AsPath': ['65098']}]}} + as0 = {'as-path-sets': [{'as-path-set-name': 'as0', 'as-path-list': ['65098']}]} g1.set_bgp_defined_set(as0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchAsPathSet': {'AsPathSet': 'as0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-as-path-set': {'as-path-set': 'as0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1075,13 +1075,13 @@ class ImportPolicyAsPathOriginCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - as0 = {'AsPathSets': {'AsPathSetList': [{'AsPathSetName': 'as0', 'AsPath': ['65090$']}]}} + as0 = {'as-path-sets': [{'as-path-set-name': 'as0', 'as-path-list': ['65090$']}]} g1.set_bgp_defined_set(as0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchAsPathSet': {'AsPathSet': 'as0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-as-path-set': {'as-path-set': 'as0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1128,13 +1128,13 @@ class ImportPolicyAsPathOnlyCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - as0 = {'AsPathSets': {'AsPathSetList': [{'AsPathSetName': 'as0', 'AsPath': ['^65100$']}]}} + as0 = {'as-path-sets': [{'as-path-set-name': 'as0', 'as-path-list': ['^65100$']}]} g1.set_bgp_defined_set(as0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchAsPathSet': {'AsPathSet': 'as0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-as-path-set': {'as-path-set': 'as0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1182,15 +1182,14 @@ class ImportPolicyAsPathMismatchCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': - [{'CommunitySetName': 'cs0', - 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', + 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchCommunitySet': {'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-community-set': {'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1245,14 +1244,13 @@ class ImportPolicyCommunityCondition(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': - {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchCommunitySet': {'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-community-set': {'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1300,13 +1298,13 @@ class ImportPolicyCommunityRegexp(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['6[0-9]+:[0-9]+']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['6[0-9]+:[0-9]+']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchCommunitySet': {'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-community-set': {'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -1362,15 +1360,15 @@ class ImportPolicyCommunityAction(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions': {'MatchCommunitySet': {'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'ADD', - 'SetCommunityMethod': {'Communities': ['65100:20']}}}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions': {'match-community-set': {'community-set': 'cs0', 'match-set-options': 'any'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'add', + 'set-community-method': {'communities-list': ['65100:20']}}}}} policy = {'name': 'policy0', 'type': 'import', @@ -1437,15 +1435,15 @@ class ImportPolicyCommunityReplace(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REPLACE', - 'SetCommunityMethod': {'Communities': ['65100:20']}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REPLACE', + 'set-community-method': {'communities-list': ['65100:20']}}}}} policy = {'name': 'policy0', 'type': 'import', @@ -1504,15 +1502,15 @@ class ImportPolicyCommunityRemove(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REMOVE', - 'SetCommunityMethod': {'Communities': ['65100:10', '65100:20']}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REMOVE', + 'set-community-method': {'communities-list': ['65100:10', '65100:20']}}}}} policy = {'name': 'policy0', 'type': 'import', @@ -1589,15 +1587,15 @@ class ImportPolicyCommunityNull(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REPLACE', - 'SetCommunityMethod': {'Communities': []}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REPLACE', + 'set-community-method': {'communities-list': []}}}}} policy = {'name': 'policy0', 'type': 'import', @@ -1664,15 +1662,15 @@ class ExportPolicyCommunityAdd(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'ADD', - 'SetCommunityMethod': {'Communities': ['65100:20']}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'add', + 'set-community-method': {'communities-list': ['65100:20']}}}}} policy = {'name': 'policy0', 'type': 'export', @@ -1738,15 +1736,15 @@ class ExportPolicyCommunityReplace(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REPLACE', - 'SetCommunityMethod': {'Communities': ['65100:20']}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REPLACE', + 'set-community-method': {'communities-list': ['65100:20']}}}}} policy = {'name': 'policy0', 'type': 'export', @@ -1812,15 +1810,15 @@ class ExportPolicyCommunityRemove(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REMOVE', - 'SetCommunityMethod': {'Communities': ['65100:20', '65100:30']}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REMOVE', + 'set-community-method': {'communities-list': ['65100:20', '65100:30']}}}}} policy = {'name': 'policy0', 'type': 'export', @@ -1889,15 +1887,15 @@ class ExportPolicyCommunityNull(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetCommunity': {'Options': 'REPLACE', - 'SetCommunityMethod': {'Communities': []}}}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-community': {'options': 'REPLACE', + 'set-community-method': {'communities-list': []}}}}} policy = {'name': 'policy0', 'type': 'export', @@ -1973,9 +1971,9 @@ class ImportPolicyMedReplace(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '100'}}} policy = {'name': 'policy0', 'type': 'import', @@ -2035,9 +2033,9 @@ class ImportPolicyMedAdd(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '+100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '+100'}}} policy = {'name': 'policy0', 'type': 'import', @@ -2097,9 +2095,9 @@ class ImportPolicyMedSub(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '-100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '-100'}}} policy = {'name': 'policy0', 'type': 'import', @@ -2159,9 +2157,9 @@ class ExportPolicyMedReplace(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '100'}}} policy = {'name': 'policy0', 'type': 'export', @@ -2221,9 +2219,9 @@ class ExportPolicyMedAdd(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '+100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '+100'}}} policy = {'name': 'policy0', 'type': 'export', @@ -2283,9 +2281,9 @@ class ExportPolicyMedSub(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - st0 = {'Name': 'st0', - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetMed': '-100'}}} + st0 = {'name': 'st0', + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-med': '-100'}}} policy = {'name': 'policy0', 'type': 'export', @@ -2344,13 +2342,13 @@ class InPolicyReject(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'in', @@ -2404,13 +2402,13 @@ class InPolicyAccept(object): e1 = env.e1 q1 = env.q1 q2 = env.q2 - cs0 = {'CommunitySets': {'CommunitySetList': [{'CommunitySetName': 'cs0', 'Community': ['65100:10']}]}} + cs0 = {'community-sets': [{'community-set-name': 'cs0', 'community-list': ['65100:10']}]} g1.set_bgp_defined_set(cs0) - st0 = {'Name': 'st0', - 'Conditions':{'BgpConditions':{'MatchCommunitySet':{'CommunitySet': 'cs0'}}}, - 'Actions':{'RouteDisposition': {'AcceptRoute': True}}} + st0 = {'name': 'st0', + 'conditions':{'bgp-conditions':{'match-community-set':{'community-set': 'cs0'}}}, + 'actions':{'route-disposition': {'accept-route': True}}} policy = {'name': 'policy0', 'type': 'in', @@ -2472,22 +2470,22 @@ class InPolicyUpdate(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} - p1 = {'IpPrefix': '192.168.200.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} + p1 = {'ip-prefix': '192.168.200.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0, p1]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0, p1]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'in', @@ -2523,20 +2521,20 @@ class InPolicyUpdate(object): q2 = env.q2 g1.clear_policy() - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - ns0 = {'NeighborSetName': 'ns0', - 'NeighborInfo': [g1.peers[e1]['neigh_addr'].split('/')[0]]} + ns0 = {'neighbor-set-name': 'ns0', + 'neighbor-info-list': [g1.peers[e1]['neigh_addr'].split('/')[0]]} g1.set_neighbor_set(ns0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}, - 'MatchNeighborSet': {'NeighborSet': ns0['NeighborSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}, + 'match-neighbor-set': {'neighbor-set': ns0['neighbor-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'in', @@ -2589,16 +2587,16 @@ class ExportPolicyAsPathPrepend(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetAsPathPrepend': {'RepeatN': 5, 'As': "65005"}}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-as-path-prepend': {'repeat-n': 5, 'as': "65005"}}}} policy = {'name': 'policy0', 'type': 'export', @@ -2677,16 +2675,16 @@ class ImportPolicyAsPathPrependLastAS(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetAsPathPrepend': {'RepeatN': 5, 'As': "last-as"}}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-as-path-prepend': {'repeat-n': 5, 'as': "last-as"}}}} policy = {'name': 'policy0', 'type': 'import', @@ -2755,16 +2753,16 @@ class ExportPolicyAsPathPrependLastAS(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.20.0/24'} + p0 = {'ip-prefix': '192.168.20.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - st0 = {'Name': 'st0', - 'Conditions': {'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': {'SetAsPathPrepend': {'RepeatN': 5, 'As': "last-as"}}}} + st0 = {'name': 'st0', + 'conditions': {'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}}, + 'actions': {'route-disposition': {'accept-route': True}, + 'bgp-actions': {'set-as-path-prepend': {'repeat-n': 5, 'as': "last-as"}}}} policy = {'name': 'policy0', 'type': 'export', @@ -2832,14 +2830,14 @@ class ImportPolicyExCommunityOriginCondition(object): q1 = env.q1 q2 = env.q2 - es0 = {'ExtCommunitySets': {'ExtCommunitySetList': [{'ExtCommunitySetName': 'es0', - 'ExtCommunity': ['SoO:65001.65100:200']}]}} + es0 = {'ext-community-sets': [{'ext-community-set-name': 'es0', + 'ext-community-list': ['SoO:65001.65100:200']}]} g1.set_bgp_defined_set(es0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions':{'MatchExtCommunitySet':{'ExtCommunitySet': 'es0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions':{'match-ext-community-set':{'ext-community-set': 'es0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -2884,14 +2882,14 @@ class ImportPolicyExCommunityTargetCondition(object): q1 = env.q1 q2 = env.q2 - es0 = {'ExtCommunitySets': {'ExtCommunitySetList': [{'ExtCommunitySetName': 'es0', - 'ExtCommunity': ['RT:6[0-9]+:3[0-9]+']}]}} + es0 = {'ext-community-sets': [{'ext-community-set-name': 'es0', + 'ext-community-list': ['RT:6[0-9]+:3[0-9]+']}]} g1.set_bgp_defined_set(es0) - st0 = {'Name': 'st0', - 'Conditions': {'BgpConditions':{'MatchExtCommunitySet':{'ExtCommunitySet': 'es0'}}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': {'bgp-conditions':{'match-ext-community-set':{'ext-community-set': 'es0'}}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'import', @@ -2936,16 +2934,16 @@ class InPolicyPrefixCondition(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.10.0/24'} + p0 = {'ip-prefix': '192.168.10.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) - st0 = {'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': {'PrefixSet': ps0['PrefixSetName']}}, - 'Actions': {'RouteDisposition': {'AcceptRoute': False}}} + st0 = {'name': 'st0', + 'conditions': { + 'match-prefix-set': {'prefix-set': ps0['prefix-set-name']}}, + 'actions': {'route-disposition': {'accept-route': False}}} policy = {'name': 'policy0', 'type': 'in', @@ -3004,26 +3002,26 @@ class ImportPolicyExCommunityAdd(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.10.0/24'} + p0 = {'ip-prefix': '192.168.10.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) st0 = { - 'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': { - 'PrefixSet': ps0['PrefixSetName'] + 'name': 'st0', + 'conditions': { + 'match-prefix-set': { + 'prefix-set': ps0['prefix-set-name'] } }, - 'Actions': { - 'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': { - 'SetExtCommunity': { - 'Options': 'ADD', - 'SetExtCommunityMethod': { - 'Communities': ['rt:65000:1'], + 'actions': { + 'route-disposition': {'accept-route': True}, + 'bgp-actions': { + 'set-ext-community': { + 'options': 'add', + 'set-ext-community-method': { + 'communities-list': ['rt:65000:1'], } }, } @@ -3085,26 +3083,26 @@ class ImportPolicyExCommunityAdd2(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.10.0/24'} + p0 = {'ip-prefix': '192.168.10.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) st0 = { - 'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': { - 'PrefixSet': ps0['PrefixSetName'] + 'name': 'st0', + 'conditions': { + 'match-prefix-set': { + 'prefix-set': ps0['prefix-set-name'] } }, - 'Actions': { - 'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': { - 'SetExtCommunity': { - 'Options': 'ADD', - 'SetExtCommunityMethod': { - 'Communities': ['rt:65100:100'], + 'actions': { + 'route-disposition': {'accept-route': True}, + 'bgp-actions': { + 'set-ext-community': { + 'options': 'add', + 'set-ext-community-method': { + 'communities-list': ['rt:65100:100'], } }, } @@ -3171,26 +3169,26 @@ class ImportPolicyExCommunityMultipleAdd(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.10.0/24'} + p0 = {'ip-prefix': '192.168.10.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) st0 = { - 'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': { - 'PrefixSet': ps0['PrefixSetName'] + 'name': 'st0', + 'conditions': { + 'match-prefix-set': { + 'prefix-set': ps0['prefix-set-name'] } }, - 'Actions': { - 'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': { - 'SetExtCommunity': { - 'Options': 'ADD', - 'SetExtCommunityMethod': { - 'Communities': ['rt:65100:100', 'rt:100:100'], + 'actions': { + 'route-disposition': {'accept-route': True}, + 'bgp-actions': { + 'set-ext-community': { + 'options': 'add', + 'set-ext-community-method': { + 'communities-list': ['rt:65100:100', 'rt:100:100'], } }, } @@ -3257,26 +3255,26 @@ class ExportPolicyExCommunityAdd(object): q1 = env.q1 q2 = env.q2 - p0 = {'IpPrefix': '192.168.10.0/24'} + p0 = {'ip-prefix': '192.168.10.0/24'} - ps0 = {'PrefixSetName': 'ps0', - 'PrefixList': [p0]} + ps0 = {'prefix-set-name': 'ps0', + 'prefix-list': [p0]} g1.set_prefix_set(ps0) st0 = { - 'Name': 'st0', - 'Conditions': { - 'MatchPrefixSet': { - 'PrefixSet': ps0['PrefixSetName'] + 'name': 'st0', + 'conditions': { + 'match-prefix-set': { + 'prefix-set': ps0['prefix-set-name'] } }, - 'Actions': { - 'RouteDisposition': {'AcceptRoute': True}, - 'BgpActions': { - 'SetExtCommunity': { - 'Options': 'ADD', - 'SetExtCommunityMethod': { - 'Communities': ['rt:65000:1'], + 'actions': { + 'route-disposition': {'accept-route': True}, + 'bgp-actions': { + 'set-ext-community': { + 'options': 'add', + 'set-ext-community-method': { + 'communities-list': ['rt:65000:1'], } }, } |