From 8fb208222938c1e0cafb13596d2d40c9c446325b Mon Sep 17 00:00:00 2001 From: Christian Hopps Date: Fri, 31 Mar 2023 16:39:11 +0000 Subject: [PATCH] tests: when verifying a route is missing use expected=False Prior to this the full retry cycle was run with a "passing" negative result each time through Previous runtime ~5 minutes New runtime ~20 seconds. Signed-off-by: Christian Hopps --- tests/topotests/mgmt_tests/test_yang_mgmt.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/topotests/mgmt_tests/test_yang_mgmt.py b/tests/topotests/mgmt_tests/test_yang_mgmt.py index 06c18d7dfa..921b4e622c 100644 --- a/tests/topotests/mgmt_tests/test_yang_mgmt.py +++ b/tests/topotests/mgmt_tests/test_yang_mgmt.py @@ -217,7 +217,9 @@ def test_mgmt_commit_check(request): ] } } - result = verify_rib(tgen, "ipv4", dut, input_dict_4, protocol=protocol) + result = verify_rib( + tgen, "ipv4", dut, input_dict_4, protocol=protocol, expected=False + ) assert ( result is not True ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) @@ -319,7 +321,9 @@ def test_mgmt_commit_abort(request): ] } } - result = verify_rib(tgen, "ipv4", dut, input_dict_4, protocol=protocol) + result = verify_rib( + tgen, "ipv4", dut, input_dict_4, protocol=protocol, expected=False + ) assert ( result is not True ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) @@ -372,7 +376,7 @@ def test_mgmt_delete_config(request): assert ( result is True ), "Testcase {} : Failed" "Error: Routes is missing in RIB".format(tc_name) - + step("Mgmt delete config") raw_config = { "r1": { @@ -387,7 +391,9 @@ def test_mgmt_delete_config(request): assert result is True, "Testcase {} : Failed Error: {}".format(tc_name, result) step("Verify that the route is deleted from RIB") - result = verify_rib(tgen, "ipv4", dut, input_dict_4, protocol=protocol) + result = verify_rib( + tgen, "ipv4", dut, input_dict_4, protocol=protocol, expected=False + ) assert ( result is not True ), "Testcase {} : Failed" "Error: Routes is still present in RIB".format(tc_name) @@ -461,7 +467,9 @@ def test_mgmt_chaos_stop_start_frr(request): dut = "r1" protocol = "static" input_dict_4 = {"r1": {"static_routes": [{"network": "192.1.11.200/32"}]}} - result = verify_rib(tgen, "ipv4", dut, input_dict_4, protocol=protocol) + result = verify_rib( + tgen, "ipv4", dut, input_dict_4, protocol=protocol, expected=False + ) assert ( result is not True ), "Testcase {} : Failed" "Error: Routes still present in RIB".format(tc_name) -- 2.39.5