summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Scalbert <louis.scalbert@6wind.com>2021-05-12 15:47:21 +0200
committerLouis Scalbert <louis.scalbert@6wind.com>2021-06-04 15:03:10 +0200
commit6cac2fcc47fd14204b07fa63d97666fc946f4a7c (patch)
tree8fae5bd0f44188c46cf8faa6b71cdad76cae1c1a
parenttopotests: remove uneccessary vtysh cmd request (diff)
downloadfrr-6cac2fcc47fd14204b07fa63d97666fc946f4a7c.tar.xz
frr-6cac2fcc47fd14204b07fa63d97666fc946f4a7c.zip
bgpd: modify VRF/view display in show bgp summary
Modify VRF/view display in show bgp summary: - to be more concise - to display on which VRF/view no neighbor was found Before patch: ubuntu# show bgp vrf all summary Instance default: IPv4 Unicast Summary: BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0 (...) IPv6 Unicast Summary: Instance private: IPv4 Unicast Summary: ubuntu# show bgp vrf all ipv4 multicast summary % No BGP neighbors found % No BGP neighbors found After patch: ubuntu# show bgp vrf all summary IPv4 Unicast Summary (VRF default): BGP router identifier XX.XX.XX.XX, local AS number XXXX vrf-id 0 (...) IPv6 Unicast Summary (VRF default): (...) IPv4 Unicast Summary (VRF private): (...) ubuntu# show bgp vrf all ipv4 multicast summary % No BGP neighbors found in VRF default % No BGP neighbors found in VRF private Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
-rw-r--r--bgpd/bgp_vty.c14
-rw-r--r--doc/user/bgp.rst4
-rw-r--r--tests/topotests/all_protocol_startup/test_all_protocol_startup.py24
3 files changed, 20 insertions, 22 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 9748df9f9..c21e0aa50 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -11440,10 +11440,12 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
safi,
true));
} else {
- vty_out(vty, "\n%s Summary:\n",
+ vty_out(vty,
+ "\n%s Summary (%s):\n",
get_afi_safi_str(afi,
safi,
- false));
+ false),
+ bgp->name_pretty);
}
}
bgp_show_summary(vty, bgp, afi, safi, fpeer,
@@ -11464,7 +11466,8 @@ static void bgp_show_summary_afi_safi(struct vty *vty, struct bgp *bgp, int afi,
if (use_json)
vty_out(vty, "{}\n");
else
- vty_out(vty, "%% No BGP neighbors found\n");
+ vty_out(vty, "%% No BGP neighbors found in %s\n",
+ bgp->name_pretty);
}
}
@@ -11496,11 +11499,6 @@ static void bgp_show_all_instances_summary_vty(struct vty *vty, afi_t afi,
(bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
? VRF_DEFAULT_NAME
: bgp->name);
- } else {
- vty_out(vty, "\nInstance %s:\n",
- (bgp->inst_type == BGP_INSTANCE_TYPE_DEFAULT)
- ? VRF_DEFAULT_NAME
- : bgp->name);
}
if (neighbor) {
fpeer = peer_lookup_in_view(vty, bgp, neighbor,
diff --git a/doc/user/bgp.rst b/doc/user/bgp.rst
index dd042e258..202df373e 100644
--- a/doc/user/bgp.rst
+++ b/doc/user/bgp.rst
@@ -442,7 +442,7 @@ Require policy on EBGP
exit1# show bgp summary
- IPv4 Unicast Summary:
+ IPv4 Unicast Summary (VRF default):
BGP router identifier 10.10.10.1, local AS number 65001 vrf-id 0
BGP table version 4
RIB entries 7, using 1344 bytes of memory
@@ -3245,7 +3245,7 @@ structure is extended with :clicmd:`show bgp [afi] [safi]`.
exit1# show ip bgp summary wide
- IPv4 Unicast Summary:
+ IPv4 Unicast Summary (VRF default):
BGP router identifier 192.168.100.1, local AS number 65534 vrf-id 0
BGP table version 3
RIB entries 5, using 920 bytes of memory
diff --git a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
index 0be3760aa..4a07ba38e 100644
--- a/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
+++ b/tests/topotests/all_protocol_startup/test_all_protocol_startup.py
@@ -928,21 +928,21 @@ def test_bgp_summary():
actual = re.sub(r"Total number.*", "", actual)
actual = re.sub(r"Displayed.*", "", actual)
# Remove IPv4 Unicast Summary (Title only)
- actual = re.sub(r"IPv4 Unicast Summary:", "", actual)
+ actual = re.sub(r"IPv4 Unicast Summary \(VRF default\):", "", actual)
# Remove IPv4 Multicast Summary (all of it)
- actual = re.sub(r"IPv4 Multicast Summary:", "", actual)
+ actual = re.sub(r"IPv4 Multicast Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv4 Multicast neighbor is configured", "", actual)
# Remove IPv4 VPN Summary (all of it)
- actual = re.sub(r"IPv4 VPN Summary:", "", actual)
+ actual = re.sub(r"IPv4 VPN Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv4 VPN neighbor is configured", "", actual)
# Remove IPv4 Encap Summary (all of it)
- actual = re.sub(r"IPv4 Encap Summary:", "", actual)
+ actual = re.sub(r"IPv4 Encap Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv4 Encap neighbor is configured", "", actual)
# Remove Unknown Summary (all of it)
- actual = re.sub(r"Unknown Summary:", "", actual)
+ actual = re.sub(r"Unknown Summary \(VRF default\):", "", actual)
actual = re.sub(r"No Unknown neighbor is configured", "", actual)
- actual = re.sub(r"IPv4 labeled-unicast Summary:", "", actual)
+ actual = re.sub(r"IPv4 labeled-unicast Summary \(VRF default\):", "", actual)
actual = re.sub(
r"No IPv4 labeled-unicast neighbor is configured", "", actual
)
@@ -1067,22 +1067,22 @@ def test_bgp_ipv6_summary():
actual = re.sub(r"Total number.*", "", actual)
actual = re.sub(r"Displayed.*", "", actual)
# Remove IPv4 Unicast Summary (Title only)
- actual = re.sub(r"IPv6 Unicast Summary:", "", actual)
+ actual = re.sub(r"IPv6 Unicast Summary \(VRF default\):", "", actual)
# Remove IPv4 Multicast Summary (all of it)
- actual = re.sub(r"IPv6 Multicast Summary:", "", actual)
+ actual = re.sub(r"IPv6 Multicast Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv6 Multicast neighbor is configured", "", actual)
# Remove IPv4 VPN Summary (all of it)
- actual = re.sub(r"IPv6 VPN Summary:", "", actual)
+ actual = re.sub(r"IPv6 VPN Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv6 VPN neighbor is configured", "", actual)
# Remove IPv4 Encap Summary (all of it)
- actual = re.sub(r"IPv6 Encap Summary:", "", actual)
+ actual = re.sub(r"IPv6 Encap Summary \(VRF default\):", "", actual)
actual = re.sub(r"No IPv6 Encap neighbor is configured", "", actual)
# Remove Unknown Summary (all of it)
- actual = re.sub(r"Unknown Summary:", "", actual)
+ actual = re.sub(r"Unknown Summary \(VRF default\):", "", actual)
actual = re.sub(r"No Unknown neighbor is configured", "", actual)
# Remove Labeled Unicast Summary (all of it)
- actual = re.sub(r"IPv6 labeled-unicast Summary:", "", actual)
+ actual = re.sub(r"IPv6 labeled-unicast Summary \(VRF default\):", "", actual)
actual = re.sub(
r"No IPv6 labeled-unicast neighbor is configured", "", actual
)