]> git.puffer.fish Git - mirror/frr.git/commitdiff
tests: OSPFv3 hello tests investigation, make assert output unique 16415/head
authorNathan Bahr <nbahr@atcorp.com>
Wed, 17 Jul 2024 16:10:53 +0000 (11:10 -0500)
committerNathan Bahr <nbahr@atcorp.com>
Wed, 17 Jul 2024 17:37:06 +0000 (12:37 -0500)
These failing tests are hard to track down. Added numbering to each assert
to easily tell where the test fails.

Signed-off-by: Nathan Bahr <nbahr@atcorp.com>
tests/topotests/ospfv3_basic_functionality/test_ospfv3_single_area.py

index 15e0f5316ea0f22c47709575133078351950e9a7..d981a84597b3c2a6f47295e4995d8ba33527ccbe 100644 (file)
@@ -388,6 +388,11 @@ def test_ospfv3_hello_tc10_p0(request):
     step("Bring up the base config as per the topology")
     reset_config_on_routers(tgen)
 
+    ospf_covergence = verify_ospf6_neighbor(tgen)
+    assert (
+        ospf_covergence is True
+    ), "Testcase {} [01]: Reset Failed \n Error:  {}".format(tc_name, ospf_covergence)
+
     step("modify hello timer from default value to some other value on r1")
 
     topo1 = {
@@ -402,7 +407,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [02]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step(
         "verify that new timer value is configured and applied using "
@@ -422,7 +429,9 @@ def test_ospfv3_hello_tc10_p0(request):
         }
     }
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [03]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("modify hello timer from default value to r1 hello timer on r2")
 
@@ -438,7 +447,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [04]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that new timer value is configured.")
     input_dict = {
@@ -455,12 +466,14 @@ def test_ospfv3_hello_tc10_p0(request):
     }
     dut = "r0"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [05]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that ospf neighbours are  full")
     ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
-    assert ospf_covergence is True, "Testcase Failed \n Error:  {}".format(
-        ospf_covergence
+    assert ospf_covergence is True, "Testcase {} [06]: Failed \n Error:  {}".format(
+        tc_name, ospf_covergence
     )
 
     step("reconfigure the default hello timer value to default on r1 and r2")
@@ -477,7 +490,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [07]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     topo1 = {
         "r1": {
@@ -491,7 +506,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [08]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that new timer value is configured.")
     input_dict = {
@@ -508,12 +525,14 @@ def test_ospfv3_hello_tc10_p0(request):
     }
     dut = "r0"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [09]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that ospf neighbours are  full")
     ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
-    assert ospf_covergence is True, "Testcase Failed \n Error:  {}".format(
-        ospf_covergence
+    assert ospf_covergence is True, "Testcase {} [10]: Failed \n Error:  {}".format(
+        tc_name, ospf_covergence
     )
 
     step("reconfigure the default hello timer value to default on r1 and r2")
@@ -530,7 +549,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [11]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     topo1 = {
         "r1": {
@@ -544,7 +565,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [12]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that new timer value is configured.")
     input_dict = {
@@ -561,12 +584,14 @@ def test_ospfv3_hello_tc10_p0(request):
     }
     dut = "r0"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [13]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that ospf neighbours are  full")
     ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
-    assert ospf_covergence is True, "Testcase Failed \n Error:  {}".format(
-        ospf_covergence
+    assert ospf_covergence is True, "Testcase {} [14]: Failed \n Error:  {}".format(
+        tc_name, ospf_covergence
     )
 
     step("configure hello timer = 1 on r1 and r2")
@@ -582,7 +607,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [15]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     topo1 = {
         "r1": {
@@ -596,7 +623,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [16]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that new timer value is configured.")
     input_dict = {
@@ -613,12 +642,14 @@ def test_ospfv3_hello_tc10_p0(request):
     }
     dut = "r0"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [17]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that ospf neighbours are  full")
     ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
-    assert ospf_covergence is True, "Testcase Failed \n Error:  {}".format(
-        ospf_covergence
+    assert ospf_covergence is True, "Testcase {} [18]: Failed \n Error:  {}".format(
+        tc_name, ospf_covergence
     )
 
     step(" Configure hello timer = 65535")
@@ -634,7 +665,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [19]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     topo1 = {
         "r1": {
@@ -648,7 +681,9 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [20]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that new timer value is configured.")
     input_dict = {
@@ -665,11 +700,13 @@ def test_ospfv3_hello_tc10_p0(request):
     }
     dut = "r0"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [21]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("verify that ospf neighbours are  full")
     ospf_covergence = verify_ospf6_neighbor(tgen, topo, dut=dut)
-    assert ospf_covergence is True, "Testcase {} : Failed \n Error: {}".format(
+    assert ospf_covergence is True, "Testcase {} [22]: Failed \n Error: {}".format(
         tc_name, ospf_covergence
     )
     step(" Try configuring timer values outside range for example 65536")
@@ -687,7 +724,7 @@ def test_ospfv3_hello_tc10_p0(request):
     result = create_interfaces_cfg(tgen, topo1)
     assert (
         result is not True
-    ), "Testcase {} : Failed \n Create interface failed. Error: {}".format(
+    ), "Testcase {} [23]: Failed \n Create interface failed. Error: {}".format(
         tc_name, result
     )
 
@@ -706,13 +743,17 @@ def test_ospfv3_hello_tc10_p0(request):
     }
 
     result = create_interfaces_cfg(tgen, topo1)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [24]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     step("Verify that timer value is deleted from intf &  set to default value 40 sec.")
     input_dict = {"r1": {"links": {"r0": {"ospf6": {"timerIntervalsConfigHello": 10}}}}}
     dut = "r1"
     result = verify_ospf6_interface(tgen, topo, dut=dut, input_dict=input_dict)
-    assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
+    assert result is True, "Testcase {} [25]: Failed \n Error: {}".format(
+        tc_name, result
+    )
 
     write_test_footer(tc_name)