Skip to content

Commit

Permalink
[show]bgp]Display the Total number of neighbors in the show ip bgp(v6…
Browse files Browse the repository at this point in the history
…) summary. (#1079)

Two minor Fixes to the done
- reset the os environ UTILITIES_UNIT_TESTING_TOPOLOGY multi_asic_intfutil_test after the test is done
 - add the line "Total number of neighbors" to the show ip(v6) bgp summary

Signed-off-by: Arvindsrinivasan Lakshmi Narasimhan <arlakshm@microsoft.com>
  • Loading branch information
arlakshm authored Aug 26, 2020
1 parent 5b916ab commit 3425be4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/bgp_commands_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
10.0.0.59 4 64014 0 0 0 0 0 never Active ARISTA14T0
10.0.0.61 4 64015 0 0 0 0 0 never Active ARISTA15T0
10.0.0.63 4 64016 0 0 0 0 0 never Active ARISTA16T0
Total number of neighbors 24
"""

show_bgp_summary_v6 = """\
Expand Down Expand Up @@ -78,6 +80,8 @@
fc00::72 4 64013 0 0 0 0 0 never Active ARISTA13T0
fc00::76 4 64014 0 0 0 0 0 never Active ARISTA14T0
fc00::a 4 65200 6665 6671 0 0 0 2d09h38m 6402 ARISTA03T2
Total number of neighbors 24
"""

show_error_invalid_json = """\
Expand Down
1 change: 1 addition & 0 deletions tests/multi_asic_intfutil_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,4 @@ def teardown_class(cls):
os.environ["PATH"] = os.pathsep.join(
os.environ["PATH"].split(os.pathsep)[:-1])
os.environ["UTILITIES_UNIT_TESTING"] = "0"
os.environ["UTILITIES_UNIT_TESTING_TOPOLOGY"] = ""
2 changes: 2 additions & 0 deletions utilities_common/bgp_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ def display_bgp_summary(bgp_summary, af):
click.echo("\n")

click.echo(tabulate(natsorted(bgp_summary['peers']), headers=headers))
click.echo("\nTotal number of neighbors {}".
format(len(bgp_summary['peers'])))
except KeyError as e:
ctx = click.get_current_context()
ctx.fail("{} missing in the bgp_summary".format(e.args[0]))
Expand Down

0 comments on commit 3425be4

Please sign in to comment.