From 6e98e9588e4dfc4729281c07b9bfa9884cc2a7a1 Mon Sep 17 00:00:00 2001 From: Shi Su <67605788+shi-su@users.noreply.github.com> Date: Thu, 2 Sep 2021 13:25:55 -0700 Subject: [PATCH] [static route] Ignore BGP summary failure What is the motivation for this PR? The command show ip bgp summary may fail if there are no BGP sessions up. Since static route feature has no dependency on BGP, the test cases should continue even if the command fails. How did you do it? Ignore failure on show ip bgp summary command. --- tests/route/test_static_route.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/route/test_static_route.py b/tests/route/test_static_route.py index be50db25cc4..e3e62ac8b0f 100644 --- a/tests/route/test_static_route.py +++ b/tests/route/test_static_route.py @@ -125,7 +125,7 @@ def check_route_redistribution(duthost, prefix, ipv6, removed=False): SHOW_BGP_SUMMARY_CMD = "show ip bgp summary" SHOW_BGP_ADV_ROUTES_CMD_TEMPLATE = "show ip bgp neighbor {} advertised-routes" - bgp_summary = duthost.shell(SHOW_BGP_SUMMARY_CMD)["stdout"].split("\n") + bgp_summary = duthost.shell(SHOW_BGP_SUMMARY_CMD, module_ignore_errors=True)["stdout"].split("\n") bgp_neighbors = []