summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_route.c74
-rw-r--r--tests/topotests/bfd-bgp-cbit-topo3/r1/bgp_ipv6_routes_down.json4
-rw-r--r--tests/topotests/bfd-bgp-cbit-topo3/r3/bgp_ipv6_routes_down.json2
-rw-r--r--tests/topotests/bfd-topo1/r1/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-topo1/r2/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-topo1/r3/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-topo1/r4/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-vrf-topo1/r1/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-vrf-topo1/r2/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-vrf-topo1/r3/bgp_prefixes.json6
-rw-r--r--tests/topotests/bfd-vrf-topo1/r4/bgp_prefixes.json6
-rwxr-xr-xtests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py36
-rwxr-xr-xtests/topotests/bgp-route-map/test_route_map_topo1.py18
-rwxr-xr-xtests/topotests/bgp-route-map/test_route_map_topo2.py58
-rw-r--r--tests/topotests/bgp_aggregate-address_route-map/test_bgp_aggregate-address_route-map.py2
-rw-r--r--tests/topotests/bgp_default-route_route-map/test_bgp_default-originate_route-map.py2
-rwxr-xr-xtests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py2
-rw-r--r--tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py6
-rw-r--r--tests/topotests/bgp_set_local-preference_add_subtract/test_bgp_set_local-preference_add_subtract.py4
-rw-r--r--tests/topotests/lib/bgp.py14
-rw-r--r--tests/topotests/lib/common_config.py12
21 files changed, 116 insertions, 166 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index ce1babe45d..7aea1fec14 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7819,32 +7819,19 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
/* MED/Metric */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC))
- if (json_paths) {
-
- /*
- * Adding "metric" field to match with corresponding
- * CLI. "med" will be deprecated in future.
- */
- json_object_int_add(json_path, "med", attr->med);
+ if (json_paths)
json_object_int_add(json_path, "metric", attr->med);
- } else
+ else
vty_out(vty, "%10u", attr->med);
else if (!json_paths)
vty_out(vty, " ");
/* Local Pref */
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))
- if (json_paths) {
-
- /*
- * Adding "locPrf" field to match with corresponding
- * CLI. "localPref" will be deprecated in future.
- */
- json_object_int_add(json_path, "localpref",
- attr->local_pref);
+ if (json_paths)
json_object_int_add(json_path, "locPrf",
- attr->local_pref);
- } else
+ attr->local_pref);
+ else
vty_out(vty, "%7u", attr->local_pref);
else if (!json_paths)
vty_out(vty, " ");
@@ -7863,17 +7850,10 @@ void route_vty_out(struct vty *vty, const struct prefix *p,
/* Print aspath */
if (attr->aspath) {
- if (json_paths) {
-
- /*
- * Adding "path" field to match with corresponding
- * CLI. "aspath" will be deprecated in future.
- */
- json_object_string_add(json_path, "aspath",
- attr->aspath->str);
+ if (json_paths)
json_object_string_add(json_path, "path",
- attr->aspath->str);
- } else
+ attr->aspath->str);
+ else
aspath_print_vty(vty, "%s", attr->aspath, " ");
}
@@ -8016,34 +7996,16 @@ void route_vty_out_tmp(struct vty *vty, const struct prefix *p,
json_object_int_add(json_net, "metric",
attr->med);
- if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) {
-
- /*
- * Adding "locPrf" field to match with
- * corresponding CLI. "localPref" will be
- * deprecated in future.
- */
- json_object_int_add(json_net, "localPref",
- attr->local_pref);
+ if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF))
json_object_int_add(json_net, "locPrf",
- attr->local_pref);
- }
+ attr->local_pref);
json_object_int_add(json_net, "weight", attr->weight);
/* Print aspath */
- if (attr->aspath) {
-
- /*
- * Adding "path" field to match with
- * corresponding CLI. "localPref" will be
- * deprecated in future.
- */
- json_object_string_add(json_net, "asPath",
- attr->aspath->str);
+ if (attr->aspath)
json_object_string_add(json_net, "path",
- attr->aspath->str);
- }
+ attr->aspath->str);
/* Print origin */
json_object_string_add(json_net, "bgpOriginCode",
@@ -9077,21 +9039,15 @@ void route_vty_out_detail(struct vty *vty, struct bgp *bgp,
bgp_origin_long_str[attr->origin]);
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_MULTI_EXIT_DISC)) {
- if (json_paths) {
- /*
- * Adding "metric" field to match with
- * corresponding CLI. "med" will be
- * deprecated in future.
- */
- json_object_int_add(json_path, "med", attr->med);
+ if (json_paths)
json_object_int_add(json_path, "metric", attr->med);
- } else
+ else
vty_out(vty, ", metric %u", attr->med);
}
if (attr->flag & ATTR_FLAG_BIT(BGP_ATTR_LOCAL_PREF)) {
if (json_paths)
- json_object_int_add(json_path, "localpref",
+ json_object_int_add(json_path, "locPrf",
attr->local_pref);
else
vty_out(vty, ", localpref %u", attr->local_pref);
diff --git a/tests/topotests/bfd-bgp-cbit-topo3/r1/bgp_ipv6_routes_down.json b/tests/topotests/bfd-bgp-cbit-topo3/r1/bgp_ipv6_routes_down.json
index 54ae57f7be..ac5fd04074 100644
--- a/tests/topotests/bfd-bgp-cbit-topo3/r1/bgp_ipv6_routes_down.json
+++ b/tests/topotests/bfd-bgp-cbit-topo3/r1/bgp_ipv6_routes_down.json
@@ -14,7 +14,6 @@
"prefix": "2001:db8:6::",
"prefixLen": 64,
"network": "2001:db8:6::\/64",
- "med": 0,
"metric": 0,
"weight": 0,
"peerId": "2001:db8:4::1",
@@ -37,7 +36,6 @@
"prefix": "2001:db8:7::",
"prefixLen": 64, "network":
"2001:db8:7::\/64",
- "med": 0,
"metric": 0,
"weight": 0,
"peerId": "2001:db8:4::1",
@@ -60,7 +58,6 @@
"prefix": "2001:db8:8::",
"prefixLen": 64,
"network": "2001:db8:8::\/64",
- "med": 0,
"metric": 0,
"weight": 32768,
"peerId": "(unspec)",
@@ -83,7 +80,6 @@
"prefix": "2001:db8:9::",
"prefixLen": 64,
"network": "2001:db8:9::\/64",
- "med": 0,
"metric": 0,
"weight": 32768,
"peerId": "(unspec)",
diff --git a/tests/topotests/bfd-bgp-cbit-topo3/r3/bgp_ipv6_routes_down.json b/tests/topotests/bfd-bgp-cbit-topo3/r3/bgp_ipv6_routes_down.json
index a3bb222504..ab42b05e85 100644
--- a/tests/topotests/bfd-bgp-cbit-topo3/r3/bgp_ipv6_routes_down.json
+++ b/tests/topotests/bfd-bgp-cbit-topo3/r3/bgp_ipv6_routes_down.json
@@ -13,7 +13,6 @@
"prefix": "2001:db8:6::",
"prefixLen": 64,
"network": "2001:db8:6::\/64",
- "med": 0,
"metric": 0,
"weight": 32768,
"peerId": "(unspec)",
@@ -36,7 +35,6 @@
"prefix": "2001:db8:7::",
"prefixLen": 64,
"network": "2001:db8:7::\/64",
- "med": 0,
"metric": 0,
"weight": 32768,
"peerId": "(unspec)",
diff --git a/tests/topotests/bfd-topo1/r1/bgp_prefixes.json b/tests/topotests/bfd-topo1/r1/bgp_prefixes.json
index 4b2cc1ad62..1262f5e984 100644
--- a/tests/topotests/bfd-topo1/r1/bgp_prefixes.json
+++ b/tests/topotests/bfd-topo1/r1/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.0.2",
@@ -18,7 +18,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "102 103",
+ "path": "102 103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.0.2",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "102 104",
+ "path": "102 104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.0.2",
diff --git a/tests/topotests/bfd-topo1/r2/bgp_prefixes.json b/tests/topotests/bfd-topo1/r2/bgp_prefixes.json
index 39f3c0a835..0d47c0fc30 100644
--- a/tests/topotests/bfd-topo1/r2/bgp_prefixes.json
+++ b/tests/topotests/bfd-topo1/r2/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "101",
+ "path": "101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.0.1",
@@ -18,7 +18,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "103",
+ "path": "103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.1.1",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "104",
+ "path": "104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.2.1",
diff --git a/tests/topotests/bfd-topo1/r3/bgp_prefixes.json b/tests/topotests/bfd-topo1/r3/bgp_prefixes.json
index c92d4e052a..36fca17bbf 100644
--- a/tests/topotests/bfd-topo1/r3/bgp_prefixes.json
+++ b/tests/topotests/bfd-topo1/r3/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "102 101",
+ "path": "102 101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.1.2",
@@ -18,7 +18,7 @@
],
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.1.2",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "102 104",
+ "path": "102 104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.1.2",
diff --git a/tests/topotests/bfd-topo1/r4/bgp_prefixes.json b/tests/topotests/bfd-topo1/r4/bgp_prefixes.json
index cc8510dd61..efe7d47b1a 100644
--- a/tests/topotests/bfd-topo1/r4/bgp_prefixes.json
+++ b/tests/topotests/bfd-topo1/r4/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "102 101",
+ "path": "102 101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.2.2",
@@ -18,7 +18,7 @@
],
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.2.2",
@@ -34,7 +34,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "102 103",
+ "path": "102 103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.2.2",
diff --git a/tests/topotests/bfd-vrf-topo1/r1/bgp_prefixes.json b/tests/topotests/bfd-vrf-topo1/r1/bgp_prefixes.json
index 4b2cc1ad62..1262f5e984 100644
--- a/tests/topotests/bfd-vrf-topo1/r1/bgp_prefixes.json
+++ b/tests/topotests/bfd-vrf-topo1/r1/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.0.2",
@@ -18,7 +18,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "102 103",
+ "path": "102 103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.0.2",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "102 104",
+ "path": "102 104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.0.2",
diff --git a/tests/topotests/bfd-vrf-topo1/r2/bgp_prefixes.json b/tests/topotests/bfd-vrf-topo1/r2/bgp_prefixes.json
index 39f3c0a835..0d47c0fc30 100644
--- a/tests/topotests/bfd-vrf-topo1/r2/bgp_prefixes.json
+++ b/tests/topotests/bfd-vrf-topo1/r2/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "101",
+ "path": "101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.0.1",
@@ -18,7 +18,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "103",
+ "path": "103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.1.1",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "104",
+ "path": "104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.2.1",
diff --git a/tests/topotests/bfd-vrf-topo1/r3/bgp_prefixes.json b/tests/topotests/bfd-vrf-topo1/r3/bgp_prefixes.json
index c92d4e052a..36fca17bbf 100644
--- a/tests/topotests/bfd-vrf-topo1/r3/bgp_prefixes.json
+++ b/tests/topotests/bfd-vrf-topo1/r3/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "102 101",
+ "path": "102 101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.1.2",
@@ -18,7 +18,7 @@
],
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.1.2",
@@ -34,7 +34,7 @@
],
"10.254.254.4/32": [
{
- "aspath": "102 104",
+ "path": "102 104",
"prefix": "10.254.254.4",
"valid": true,
"peerId": "192.168.1.2",
diff --git a/tests/topotests/bfd-vrf-topo1/r4/bgp_prefixes.json b/tests/topotests/bfd-vrf-topo1/r4/bgp_prefixes.json
index cc8510dd61..efe7d47b1a 100644
--- a/tests/topotests/bfd-vrf-topo1/r4/bgp_prefixes.json
+++ b/tests/topotests/bfd-vrf-topo1/r4/bgp_prefixes.json
@@ -2,7 +2,7 @@
"routes": {
"10.254.254.1/32": [
{
- "aspath": "102 101",
+ "path": "102 101",
"prefix": "10.254.254.1",
"valid": true,
"peerId": "192.168.2.2",
@@ -18,7 +18,7 @@
],
"10.254.254.2/32": [
{
- "aspath": "102",
+ "path": "102",
"prefix": "10.254.254.2",
"valid": true,
"peerId": "192.168.2.2",
@@ -34,7 +34,7 @@
],
"10.254.254.3/32": [
{
- "aspath": "102 103",
+ "path": "102 103",
"prefix": "10.254.254.3",
"valid": true,
"peerId": "192.168.2.2",
diff --git a/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py b/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
index 3b2d9c25d7..1cd2c4417f 100755
--- a/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
+++ b/tests/topotests/bgp-path-attributes-topo1/test_bgp_path_attributes.py
@@ -430,7 +430,7 @@ def test_aspath_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "aspath"
+ attribute = "path"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
{"r7": input_dict["r7"]},
@@ -479,7 +479,7 @@ def test_aspath_attribute(request):
}
},
"set": {
- "aspath": {
+ "path": {
"as_num": "111 222",
"as_action": "prepend"
}
@@ -493,7 +493,7 @@ def test_aspath_attribute(request):
}
},
"set": {
- "aspath": {
+ "path": {
"as_num": "111 222",
"as_action": "prepend"
}
@@ -553,7 +553,7 @@ def test_aspath_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "aspath"
+ attribute = "path"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
{"r7": input_dict["r7"]},
@@ -714,7 +714,7 @@ def test_localpref_attribute(request):
}
},
"set": {
- "localpref": 1111
+ "locPrf": 1111
}
},
{
@@ -726,7 +726,7 @@ def test_localpref_attribute(request):
}
},
"set": {
- "localpref": 1111
+ "locPrf": 1111
}
}]
}
@@ -783,7 +783,7 @@ def test_localpref_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "localpref"
+ attribute = "locPrf"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
{"r7": input_dict["r7"]},
@@ -804,7 +804,7 @@ def test_localpref_attribute(request):
}
},
"set": {
- "localpref": 50
+ "locPrf": 50
}
},
{
@@ -816,7 +816,7 @@ def test_localpref_attribute(request):
}
},
"set": {
- "localpref": 50
+ "locPrf": 50
}
}]
}
@@ -828,7 +828,7 @@ def test_localpref_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "localpref"
+ attribute = "locPrf"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
{"r7": input_dict["r7"]},
@@ -1437,7 +1437,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 100
+ "metric": 100
}
},
{
@@ -1449,7 +1449,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 100
+ "metric": 100
}
}]
}
@@ -1465,7 +1465,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 10
+ "metric": 10
}
},
{
@@ -1477,7 +1477,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 10
+ "metric": 10
}
}]
}
@@ -1593,7 +1593,7 @@ def test_med_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "med"
+ attribute = "metric"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
input_dict, attribute)
@@ -1613,7 +1613,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 200
+ "metric": 200
}
},
{
@@ -1625,7 +1625,7 @@ def test_med_attribute(request):
}
},
"set": {
- "med": 200
+ "metric": 200
}
}]
}
@@ -1638,7 +1638,7 @@ def test_med_attribute(request):
# Verifying best path
dut = "r1"
- attribute = "med"
+ attribute = "metric"
for addr_type in ADDR_TYPES:
result = verify_best_path_as_per_bgp_attribute(tgen, addr_type, dut,
input_dict, attribute)
diff --git a/tests/topotests/bgp-route-map/test_route_map_topo1.py b/tests/topotests/bgp-route-map/test_route_map_topo1.py
index 22dd3a6380..c854e5a444 100755
--- a/tests/topotests/bgp-route-map/test_route_map_topo1.py
+++ b/tests/topotests/bgp-route-map/test_route_map_topo1.py
@@ -763,7 +763,7 @@ def test_route_map_multiple_seq_different_match_set_clause_p0(request):
}
},
"set": {
- "aspath": {
+ "path": {
"as_num": 500
}
}
@@ -777,7 +777,7 @@ def test_route_map_multiple_seq_different_match_set_clause_p0(request):
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
},
{
@@ -789,7 +789,7 @@ def test_route_map_multiple_seq_different_match_set_clause_p0(request):
}
},
"set": {
- "med": 50
+ "metric": 50
}
}
]
@@ -878,7 +878,7 @@ def test_route_map_multiple_seq_different_match_set_clause_p0(request):
"route_maps": {
"rmap_match_pf_list1": [{
"set": {
- "med": 50,
+ "metric": 50,
}
}],
}
@@ -972,8 +972,8 @@ def test_route_map_set_only_no_match_p0(request):
{
"action": "permit",
"set": {
- "med": 50,
- "localpref": 150,
+ "metric": 50,
+ "locPrf": 150,
"weight": 4000
}
}
@@ -1059,7 +1059,7 @@ def test_route_map_set_only_no_match_p0(request):
{
"action": "permit",
"set": {
- "med": 50,
+ "metric": 50,
}
}
]
@@ -1176,8 +1176,8 @@ def test_route_map_match_only_no_set_p0(request):
"rmap_match_pf_1_{}".format(addr_type): [{
"action": "permit",
"set": {
- "med": 50,
- "localpref": 150,
+ "metric": 50,
+ "locPrf": 150,
}
}
]
diff --git a/tests/topotests/bgp-route-map/test_route_map_topo2.py b/tests/topotests/bgp-route-map/test_route_map_topo2.py
index f2398c33ff..609cea5f92 100755
--- a/tests/topotests/bgp-route-map/test_route_map_topo2.py
+++ b/tests/topotests/bgp-route-map/test_route_map_topo2.py
@@ -288,7 +288,7 @@ def test_rmap_match_prefix_list_permit_in_and_outbound_prefixes_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
"weight": 100
}
},
@@ -302,7 +302,7 @@ def test_rmap_match_prefix_list_permit_in_and_outbound_prefixes_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
},
]
@@ -506,7 +506,7 @@ def test_modify_set_match_clauses_in_rmap_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}],
"rmap_match_pf_2_{}".format(addr_type): [{
@@ -518,7 +518,7 @@ def test_modify_set_match_clauses_in_rmap_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
}]
}
@@ -658,7 +658,7 @@ def test_modify_set_match_clauses_in_rmap_p0():
}
},
"set": {
- "localpref": 1000,
+ "locPrf": 1000,
}
}],
"rmap_match_pf_2_{}".format(addr_type): [{
@@ -670,7 +670,7 @@ def test_modify_set_match_clauses_in_rmap_p0():
}
},
"set": {
- "med": 2000
+ "metric": 2000
}
}]
}
@@ -844,7 +844,7 @@ def test_modify_prefix_list_referenced_by_rmap_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
"weight": 100
}
}],
@@ -857,7 +857,7 @@ def test_modify_prefix_list_referenced_by_rmap_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
}]
}
@@ -1093,7 +1093,7 @@ def test_remove_prefix_list_referenced_by_rmap_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}],
"rmap_match_pf_2_{}".format(addr_type): [{
@@ -1105,7 +1105,7 @@ def test_remove_prefix_list_referenced_by_rmap_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
}]
}
@@ -1639,7 +1639,7 @@ def test_multiple_match_statement_in_route_map_logical_ORed_p0():
}
},
"set": {
- "localpref": 150
+ "locPrf": 150
}
}]
}
@@ -1664,7 +1664,7 @@ def test_multiple_match_statement_in_route_map_logical_ORed_p0():
}
},
"set": {
- "localpref": 200
+ "locPrf": 200
}
}]
}
@@ -1894,7 +1894,7 @@ def test_multiple_match_statement_in_route_map_logical_ANDed_p1():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}]
}
@@ -1919,7 +1919,7 @@ def test_multiple_match_statement_in_route_map_logical_ANDed_p1():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}]
}
@@ -2043,7 +2043,7 @@ def test_add_remove_rmap_to_specific_neighbor_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}]
}
@@ -2234,7 +2234,7 @@ def test_clear_bgp_and_flap_interface_to_verify_rmap_properties_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
"weight": 100
}
}]
@@ -2578,7 +2578,7 @@ def test_set_localpref_weight_to_ebgp_and_med_to_ibgp_peers_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
}],
"rmap_match_pf_2_{}".format(addr_type): [{
@@ -2589,7 +2589,7 @@ def test_set_localpref_weight_to_ebgp_and_med_to_ibgp_peers_p0():
addr_type)
}},
"set": {
- "localpref": 150
+ "locPrf": 150
}
}],
"rmap_match_pf_3_{}".format(addr_type): [{
@@ -2841,9 +2841,9 @@ def test_multiple_set_on_single_sequence_in_rmap_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
"weight": 100,
- "med": 50
+ "metric": 50
}
}]
}
@@ -2985,7 +2985,7 @@ def test_route_maps_with_continue_clause_p0():
}
},
"set": {
- "localpref": 150
+ "locPrf": 150
},
"continue": "30"
},
@@ -2998,7 +2998,7 @@ def test_route_maps_with_continue_clause_p0():
}
},
"set": {
- "med": 200
+ "metric": 200
}
},
{
@@ -3010,7 +3010,7 @@ def test_route_maps_with_continue_clause_p0():
}
},
"set": {
- "med": 100
+ "metric": 100
}
}
]
@@ -3167,7 +3167,7 @@ def test_route_maps_with_goto_clause_p0():
}
},
"set": {
- "med": 100
+ "metric": 100
}
},
{
@@ -3179,7 +3179,7 @@ def test_route_maps_with_goto_clause_p0():
}
},
"set": {
- "med": 200
+ "metric": 200
}
}
]
@@ -3325,7 +3325,7 @@ def test_route_maps_with_call_clause_p0():
}
},
"set": {
- "localpref": 150
+ "locPrf": 150
},
"call": "rmap_match_pf_2_{}".format(addr_type)
}],
@@ -3337,7 +3337,7 @@ def test_route_maps_with_call_clause_p0():
}
},
"set": {
- "med": 200
+ "metric": 200
}
}]
}
@@ -3486,7 +3486,7 @@ def test_create_rmap_match_prefix_list_to_deny_in_and_outbound_prefixes_p0():
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
}
}],
"rmap_match_pf_2_{}".format(addr_type): [{
@@ -3497,7 +3497,7 @@ def test_create_rmap_match_prefix_list_to_deny_in_and_outbound_prefixes_p0():
}
},
"set": {
- "med": 50
+ "metric": 50
}
}]
}
diff --git a/tests/topotests/bgp_aggregate-address_route-map/test_bgp_aggregate-address_route-map.py b/tests/topotests/bgp_aggregate-address_route-map/test_bgp_aggregate-address_route-map.py
index d6753e9b23..053f928810 100644
--- a/tests/topotests/bgp_aggregate-address_route-map/test_bgp_aggregate-address_route-map.py
+++ b/tests/topotests/bgp_aggregate-address_route-map/test_bgp_aggregate-address_route-map.py
@@ -110,7 +110,7 @@ def test_bgp_maximum_prefix_invalid():
expected = {
'paths': [
{
- 'med': 123
+ 'metric': 123
}
]
}
diff --git a/tests/topotests/bgp_default-route_route-map/test_bgp_default-originate_route-map.py b/tests/topotests/bgp_default-route_route-map/test_bgp_default-originate_route-map.py
index 992ee85ab1..04a04cce37 100644
--- a/tests/topotests/bgp_default-route_route-map/test_bgp_default-originate_route-map.py
+++ b/tests/topotests/bgp_default-route_route-map/test_bgp_default-originate_route-map.py
@@ -110,7 +110,7 @@ def test_bgp_default_originate_route_map():
expected = {
'paths': [
{
- 'med': 123
+ 'metric': 123
}
]
}
diff --git a/tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py b/tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py
index 83ec1e784d..fcea958a93 100755
--- a/tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py
+++ b/tests/topotests/bgp_large_community/test_bgp_large_community_topo_1.py
@@ -598,7 +598,7 @@ def config_for_as_path(tgen, topo, tc_name):
"community_list": {"id": "ANY"}
},
"set": {
- "aspath": {
+ "path": {
"as_num": "4000000",
"as_action": "prepend"
}
diff --git a/tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py b/tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py
index f307edc678..d95adc185d 100644
--- a/tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py
+++ b/tests/topotests/bgp_reject_as_sets/test_bgp_reject_as_sets.py
@@ -130,13 +130,13 @@ def test_bgp_reject_as_sets():
expected = {
'advertisedRoutes': {
'172.16.0.0/16': {
- 'asPath': ''
+ 'path': ''
},
'192.168.254.0/30': {
- 'asPath': '65003'
+ 'path': '65003'
},
'192.168.255.0/30': {
- 'asPath': '65001'
+ 'path': '65001'
}
},
'totalPrefixCounter': 3
diff --git a/tests/topotests/bgp_set_local-preference_add_subtract/test_bgp_set_local-preference_add_subtract.py b/tests/topotests/bgp_set_local-preference_add_subtract/test_bgp_set_local-preference_add_subtract.py
index 09e195e22d..387cb0b42f 100644
--- a/tests/topotests/bgp_set_local-preference_add_subtract/test_bgp_set_local-preference_add_subtract.py
+++ b/tests/topotests/bgp_set_local-preference_add_subtract/test_bgp_set_local-preference_add_subtract.py
@@ -113,7 +113,7 @@ def test_bgp_set_local_preference():
expected = {
'paths': [
{
- 'localpref': 50,
+ 'locPrf': 50,
'nexthops': [
{
'ip': '192.168.255.3'
@@ -121,7 +121,7 @@ def test_bgp_set_local_preference():
]
},
{
- 'localpref': 150,
+ 'locPrf': 150,
'nexthops': [
{
'ip': '192.168.255.2'
diff --git a/tests/topotests/lib/bgp.py b/tests/topotests/lib/bgp.py
index 997b72d691..15f970ba75 100644
--- a/tests/topotests/lib/bgp.py
+++ b/tests/topotests/lib/bgp.py
@@ -1256,7 +1256,7 @@ def verify_bgp_attributes(tgen, addr_type, dut, static_routes, rmap_name,
}
},
"set": {
- "localpref": 150,
+ "locPrf": 150,
"weight": 100
}
}],
@@ -1269,7 +1269,7 @@ def verify_bgp_attributes(tgen, addr_type, dut, static_routes, rmap_name,
}
},
"set": {
- "med": 50
+ "metric": 50
}
}]
}
@@ -1406,7 +1406,7 @@ def verify_best_path_as_per_bgp_attribute(tgen, addr_type, router, input_dict,
}
}
}
- attribute = "localpref"
+ attribute = "locPrf"
result = verify_best_path_as_per_bgp_attribute(tgen, "ipv4", dut, \
input_dict, attribute)
Returns
@@ -1443,14 +1443,14 @@ def verify_best_path_as_per_bgp_attribute(tgen, addr_type, router, input_dict,
attribute_dict[next_hop_ip] = route_attribute[attribute]
# AS_PATH attribute
- if attribute == "aspath":
+ if attribute == "path":
# Find next_hop for the route have minimum as_path
_next_hop = min(attribute_dict, key=lambda x: len(set(
attribute_dict[x])))
compare = "SHORTEST"
# LOCAL_PREF attribute
- elif attribute == "localpref":
+ elif attribute == "locPrf":
# Find next_hop for the route have highest local preference
_next_hop = max(attribute_dict, key=(lambda k:
attribute_dict[k]))
@@ -1473,7 +1473,7 @@ def verify_best_path_as_per_bgp_attribute(tgen, addr_type, router, input_dict,
compare = ""
# MED attribute
- elif attribute == "med":
+ elif attribute == "metric":
# Find next_hop for the route have LOWEST MED
_next_hop = min(attribute_dict, key=(lambda k:
attribute_dict[k]))
@@ -1548,7 +1548,7 @@ def verify_best_path_as_per_admin_distance(tgen, addr_type, router, input_dict,
{"network": "200.50.2.0/32", \
"admin_distance": 60, "next_hop": "10.0.0.18"}]
}}
- attribute = "localpref"
+ attribute = "locPrf"
result = verify_best_path_as_per_admin_distance(tgen, "ipv4", dut, \
input_dict, attribute):
Returns
diff --git a/tests/topotests/lib/common_config.py b/tests/topotests/lib/common_config.py
index fc7581b1f2..8a9d2d64c9 100644
--- a/tests/topotests/lib/common_config.py
+++ b/tests/topotests/lib/common_config.py
@@ -1101,9 +1101,9 @@ def create_route_maps(tgen, input_dict, build=False):
"tag": "tag_id"
},
"set": {
- "localpref": 150,
- "med": 30,
- "aspath": {
+ "locPrf": 150,
+ "metric": 30,
+ "path": {
"num": 20000,
"action": "prepend",
},
@@ -1199,10 +1199,10 @@ def create_route_maps(tgen, input_dict, build=False):
set_data = rmap_dict["set"]
ipv4_data = set_data.setdefault("ipv4", {})
ipv6_data = set_data.setdefault("ipv6", {})
- local_preference = set_data.setdefault("localpref",
+ local_preference = set_data.setdefault("locPrf",
None)
- metric = set_data.setdefault("med", None)
- as_path = set_data.setdefault("aspath", {})
+ metric = set_data.setdefault("metric", None)
+ as_path = set_data.setdefault("path", {})
weight = set_data.setdefault("weight", None)
community = set_data.setdefault("community", {})
large_community = set_data.setdefault(