From 18a7d0eaaa4c2dec29cc37e856712676cf3f5857 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 3 Apr 2020 16:15:55 +0300 Subject: [PATCH 1/2] tests: Replace prefixReceivedCount to pfxRcd in JSONs Signed-off-by: Donatas Abraitis --- tests/topotests/bgp-ecmp-topo1/r1/summary.txt | 40 +++++++++---------- .../topotests/bgp-ecmp-topo1/r1/summary20.txt | 40 +++++++++---------- tests/topotests/bgp_vrf_netns/r1/summary.txt | 2 +- .../topotests/bgp_vrf_netns/r1/summary20.txt | 2 +- .../topotests/evpn-pim-1/spine/bgp.summ.json | 2 - 5 files changed, 42 insertions(+), 44 deletions(-) diff --git a/tests/topotests/bgp-ecmp-topo1/r1/summary.txt b/tests/topotests/bgp-ecmp-topo1/r1/summary.txt index bccc483d52..11611d041b 100644 --- a/tests/topotests/bgp-ecmp-topo1/r1/summary.txt +++ b/tests/topotests/bgp-ecmp-topo1/r1/summary.txt @@ -9,121 +9,121 @@ "10.0.1.101":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.102":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.103":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.104":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.105":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.106":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.107":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.108":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.109":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.110":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.111":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.112":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.113":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.114":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.115":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.116":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.117":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.118":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.119":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.120":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" } }, diff --git a/tests/topotests/bgp-ecmp-topo1/r1/summary20.txt b/tests/topotests/bgp-ecmp-topo1/r1/summary20.txt index 73ae256abe..f90aedb1ec 100644 --- a/tests/topotests/bgp-ecmp-topo1/r1/summary20.txt +++ b/tests/topotests/bgp-ecmp-topo1/r1/summary20.txt @@ -8,121 +8,121 @@ "10.0.1.101":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.102":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.103":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.104":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.1.105":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.106":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.107":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.108":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.109":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.2.110":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.111":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.112":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.113":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.114":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.3.115":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.116":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.117":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.118":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.119":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" }, "10.0.4.120":{ "outq":0, "inq":0, - "prefixReceivedCount":42, + "pfxRcd":42, "state":"Established" } }, diff --git a/tests/topotests/bgp_vrf_netns/r1/summary.txt b/tests/topotests/bgp_vrf_netns/r1/summary.txt index 7473fa2151..1a079ff130 100644 --- a/tests/topotests/bgp_vrf_netns/r1/summary.txt +++ b/tests/topotests/bgp_vrf_netns/r1/summary.txt @@ -8,7 +8,7 @@ "10.0.1.101":{ "outq":0, "inq":0, - "prefixReceivedCount":10, + "pfxRcd":10, "state":"Established" } }, diff --git a/tests/topotests/bgp_vrf_netns/r1/summary20.txt b/tests/topotests/bgp_vrf_netns/r1/summary20.txt index 18318e07a8..2b5787e6da 100644 --- a/tests/topotests/bgp_vrf_netns/r1/summary20.txt +++ b/tests/topotests/bgp_vrf_netns/r1/summary20.txt @@ -7,7 +7,7 @@ "10.0.1.101":{ "outq":0, "inq":0, - "prefixReceivedCount":10, + "pfxRcd":10, "state":"Established" } }, diff --git a/tests/topotests/evpn-pim-1/spine/bgp.summ.json b/tests/topotests/evpn-pim-1/spine/bgp.summ.json index faf40c8d43..53370507e8 100644 --- a/tests/topotests/evpn-pim-1/spine/bgp.summ.json +++ b/tests/topotests/evpn-pim-1/spine/bgp.summ.json @@ -12,7 +12,6 @@ "tableVersion":0, "outq":0, "inq":0, - "prefixReceivedCount":3, "pfxRcd":3, "pfxSnt":7, "state":"Established", @@ -26,7 +25,6 @@ "tableVersion":0, "outq":0, "inq":0, - "prefixReceivedCount":3, "pfxRcd":3, "pfxSnt":7, "state":"Established", From 6f5dc2e508cb03a715588ba79b0b1c7a3618592e Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Fri, 3 Apr 2020 16:16:06 +0300 Subject: [PATCH 2/2] bgpd: Remove `prefixReceivedCount` from JSON This is already covered by pfxRcd. Removed due to consistency between CLI and JSON. Signed-off-by: Donatas Abraitis --- bgpd/bgp_vty.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 9f4347e736..0569a770c2 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9053,13 +9053,6 @@ static int bgp_show_summary(struct vty *vty, struct bgp *bgp, int afi, int safi, peer_uptime(peer->uptime, timebuf, BGP_UPTIME_LEN, use_json, json_peer); - /* - * Adding "pfxRcd" field to match with the corresponding - * CLI. "prefixReceivedCount" will be deprecated in - * future. - */ - json_object_int_add(json_peer, "prefixReceivedCount", - peer->pcount[afi][pfx_rcd_safi]); json_object_int_add(json_peer, "pfxRcd", peer->pcount[afi][pfx_rcd_safi]);