]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tests: Fix generate support bundle issue for test_route_map_topo1
authorKuldeep Kashyap <kashyapk@vmware.com>
Thu, 24 Jun 2021 22:16:27 +0000 (15:16 -0700)
committerKuldeep Kashyap <kashyapk@vmware.com>
Thu, 24 Jun 2021 22:26:59 +0000 (15:26 -0700)
1. There was a false condition, which was causing support bundle to be generated.
Issue is fixed.

Signed-off-by: Kuldeep Kashyap <kashyapk@vmware.com>
tests/topotests/bgp_route_map/test_route_map_topo1.py

index 0158e24d313567ab6ca14022d2534b38d481cb84..74172501dbabdda74f1ceded88c435835d5b0476 100644 (file)
 # OF THIS SOFTWARE.
 #
 
-#################################
-# TOPOLOGY
-#################################
-"""
-
-                    +-------+
-           +------- |  R2   |
-          |         +-------+
-         |               |
-     +-------+           |
-     |  R1   |           |
-     +-------+           |
-        |                |
-        |           +-------+          +-------+
-        +---------- |  R3   |----------|  R4   |
-                    +-------+          +-------+
-
-"""
-
-#################################
-# TEST SUMMARY
-#################################
-"""
-Following tests are covered to test route-map functionality:
-TC_34:
-    Verify if route-maps is applied in both inbound and
-    outbound direction to same neighbor/interface.
-TC_36:
-    Test permit/deny statements operation in route-maps with a
-    permutation and combination of permit/deny in prefix-lists
-TC_35:
-    Test multiple sequence numbers in a single route-map for different
-    match/set clauses.
-TC_37:
-    Test add/remove route-maps with multiple set
-    clauses and without any match statement.(Set only)
-TC_38:
-    Test add/remove route-maps with multiple match
-    clauses and without any set statement.(Match only)
-"""
-
 import sys
 import json
 import time
@@ -91,6 +50,7 @@ from lib.common_config import (
     create_bgp_community_lists,
     interface_status,
     create_route_maps,
+    create_static_routes,
     create_prefix_lists,
     verify_route_maps,
     check_address_types,
@@ -107,6 +67,46 @@ from lib.bgp import (
 )
 from lib.topojson import build_topo_from_json, build_config_from_json
 
+#################################
+# TOPOLOGY
+#################################
+"""
+
+                    +-------+
+           +------- |  R2   |
+          |         +-------+
+         |               |
+     +-------+           |
+     |  R1   |           |
+     +-------+           |
+        |                |
+        |           +-------+          +-------+
+        +---------- |  R3   |----------|  R4   |
+                    +-------+          +-------+
+
+"""
+
+#################################
+# TEST SUMMARY
+#################################
+"""
+Following tests are covered to test route-map functionality:
+TC_34:
+    Verify if route-maps is applied in both inbound and
+    outbound direction to same neighbor/interface.
+TC_36:
+    Test permit/deny statements operation in route-maps with a
+    permutation and combination of permit/deny in prefix-lists
+TC_35:
+    Test multiple sequence numbers in a single route-map for different
+    match/set clauses.
+TC_37:
+    Test add/remove route-maps with multiple set
+    clauses and without any match statement.(Set only)
+TC_38:
+    Test add/remove route-maps with multiple match
+    clauses and without any set statement.(Match only)
+"""
 
 # Global variables
 bgp_convergence = False
@@ -475,8 +475,8 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request):
         result = verify_rib(
             tgen, adt, dut, input_dict_2, protocol=protocol, expected=False
         )
-        assert result is not True, "Testcase {} : Failed \n"
-        "routes are not present in rib \n Error: {}".format(tc_name, result)
+        assert result is not True, ("Testcase {} : Failed \n"
+        "routes are not present in rib \n Error: {}".format(tc_name, result))
         logger.info("Expected behaviour: {}".format(result))
 
         # Verifying RIB routes
@@ -495,8 +495,8 @@ def test_route_map_inbound_outbound_same_neighbor_p0(request):
         result = verify_rib(
             tgen, adt, dut, input_dict, protocol=protocol, expected=False
         )
-        assert result is not True, "Testcase {} : Failed \n "
-        "routes are not present in rib \n Error: {}".format(tc_name, result)
+        assert result is not True, ("Testcase {} : Failed \n "
+        "routes are not present in rib \n Error: {}".format(tc_name, result))
         logger.info("Expected behaviour: {}".format(result))
 
     write_test_footer(tc_name)
@@ -687,14 +687,17 @@ def test_route_map_with_action_values_combination_of_prefix_action_p0(
         }
 
         # tgen.mininet_cli()
-        result = verify_rib(
-            tgen, adt, dut, input_dict_2, protocol=protocol, expected=False
-        )
         if "deny" in [prefix_action, rmap_action]:
-            assert result is not True, "Testcase {} : Failed \n "
-            "Routes are still present \n Error: {}".format(tc_name, result)
+            result = verify_rib(
+                tgen, adt, dut, input_dict_2, protocol=protocol, expected=False
+            )
+            assert result is not True, ("Testcase {} : Failed \n "
+            "Routes are still present \n Error: {}".format(tc_name, result))
             logger.info("Expected behaviour: {}".format(result))
         else:
+            result = verify_rib(
+                tgen, adt, dut, input_dict_2, protocol=protocol
+            )
             assert result is True, "Testcase {} : Failed \n Error: {}".format(
                 tc_name, result
             )