diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2021-03-08 09:32:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-08 09:32:09 +0200 |
| commit | f79d311b3e0ea744cad115978b10bad2661afea9 (patch) | |
| tree | 4e6e1e7e976f2211616095f15077442719b4fb9a /tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py | |
| parent | df29adc0f1b41be0d4c74eb1c5c975dbe11bda99 (diff) | |
| parent | 5cbb02ebde5deb71f9db5a23697087d79507a3f2 (diff) | |
Merge pull request #8180 from kuldeepkash/topojson_framework
tests: Improve error/assert message logging
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py')
| -rw-r--r-- | tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py | 30 |
1 files changed, 18 insertions, 12 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py index 441368e8fa..adf82a5e85 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_ecmp.py @@ -259,17 +259,19 @@ def test_ospf_ecmp_tc16_p0(request): shutdown_bringup_interface(tgen, dut, intf, False) result = verify_ospf_rib(tgen, dut, input_dict, next_hop=nh, expected=False) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: OSPF routes are present \n Error: {}".format( tc_name, result - ) + )) protocol = "ospf" result = verify_rib( tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh, expected=False ) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: routes are still present \n Error: {}".format( tc_name, result - ) + )) for intfr in range(1, 7): intf = topo["routers"]["r1"]["links"]["r0-link{}".format(intfr)]["interface"] @@ -324,9 +326,10 @@ def test_ospf_ecmp_tc16_p0(request): result = verify_ospf_rib( tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False ) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: OSPF routes are present \n Error: {}".format( tc_name, result - ) + )) protocol = "ospf" result = verify_rib( @@ -339,9 +342,10 @@ def test_ospf_ecmp_tc16_p0(request): attempts=5, expected=False, ) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: routes are still present \n Error: {}".format( tc_name, result - ) + )) step("Re configure the static route in R0.") dut = "r0" @@ -428,9 +432,10 @@ def test_ospf_ecmp_tc17_p0(request): result = verify_ospf_rib( tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False ) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: OSPF routes are present \n Error: {}".format( tc_name, result - ) + )) protocol = "ospf" result = verify_rib( @@ -443,9 +448,10 @@ def test_ospf_ecmp_tc17_p0(request): attempts=5, expected=False, ) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( + assert result is not True, ("Testcase {} : Failed \n " + "r1: routes are still present \n Error: {}".format( tc_name, result - ) + )) step("Reconfigure the static route in R0.Change ECMP value to 2.") dut = "r0" |
