|
97 | 97 | Error: bgp summary from bgp container not in json format
|
98 | 98 | """
|
99 | 99 |
|
| 100 | +show_error_no_v6_neighbor = """\ |
| 101 | +No IPv6 neighbor is configured |
| 102 | +""" |
| 103 | + |
| 104 | +show_error_no_v4_neighbor = """\ |
| 105 | +No IPv4 neighbor is configured |
| 106 | +""" |
| 107 | + |
100 | 108 | show_bgp_summary_v4_chassis = """\
|
101 | 109 |
|
102 | 110 | IPv4 Unicast Summary:
|
@@ -319,3 +327,31 @@ def test_bgp_summary_v4_all_chassis(
|
319 | 327 | print("{}".format(result.output))
|
320 | 328 | assert result.exit_code == 0
|
321 | 329 | assert result.output == show_bgp_summary_v4_all_chassis
|
| 330 | + |
| 331 | + @pytest.mark.parametrize('setup_single_bgp_instance', |
| 332 | + ['show_bgp_summary_no_neigh'], indirect=['setup_single_bgp_instance']) |
| 333 | + def test_bgp_summary_no_v4_neigh( |
| 334 | + self, |
| 335 | + setup_bgp_commands, |
| 336 | + setup_single_bgp_instance): |
| 337 | + show = setup_bgp_commands |
| 338 | + runner = CliRunner() |
| 339 | + result = runner.invoke( |
| 340 | + show.cli.commands["ipv6"].commands["bgp"].commands["summary"], []) |
| 341 | + print("{}".format(result.output)) |
| 342 | + assert result.exit_code == 0 |
| 343 | + assert result.output == show_error_no_v6_neighbor |
| 344 | + |
| 345 | + @pytest.mark.parametrize('setup_single_bgp_instance', |
| 346 | + ['show_bgp_summary_no_neigh'], indirect=['setup_single_bgp_instance']) |
| 347 | + def test_bgp_summary_no_v6_neigh( |
| 348 | + self, |
| 349 | + setup_bgp_commands, |
| 350 | + setup_single_bgp_instance): |
| 351 | + show = setup_bgp_commands |
| 352 | + runner = CliRunner() |
| 353 | + result = runner.invoke( |
| 354 | + show.cli.commands["ip"].commands["bgp"].commands["summary"], []) |
| 355 | + print("{}".format(result.output)) |
| 356 | + assert result.exit_code == 0 |
| 357 | + assert result.output == show_error_no_v4_neighbor |
0 commit comments