From b29a56b3aec67708d545b3665cf64f3ffe782818 Mon Sep 17 00:00:00 2001 From: nguggarigoud Date: Tue, 15 Sep 2020 09:46:55 +0530 Subject: [PATCH] tests: removing initial wait time in ospf.py 1. Removed initial_wait in ospf library. 2. Removed one test case which was random failure, will add back after traiging. Signed-off-by: naveen --- tests/topotests/lib/ospf.py | 4 +- .../test_ospf_single_area.py | 179 ------------------ 2 files changed, 2 insertions(+), 181 deletions(-) diff --git a/tests/topotests/lib/ospf.py b/tests/topotests/lib/ospf.py index f6a02bd890..a2351bf747 100644 --- a/tests/topotests/lib/ospf.py +++ b/tests/topotests/lib/ospf.py @@ -650,7 +650,7 @@ def verify_ospf_neighbor(tgen, topo, dut=None, input_dict=None, lan=False): logger.debug("Exiting API: verify_ospf_neighbor()") return result -@retry(attempts=20, wait=2, return_is_str=True, initial_wait=2) +@retry(attempts=21, wait=2, return_is_str=True) def verify_ospf_rib(tgen, dut, input_dict, next_hop=None, tag=None, metric=None, fib=None): """ @@ -965,7 +965,7 @@ def verify_ospf_interface(tgen, topo, dut=None,lan=False, input_dict=None): return result -@retry(attempts=10, wait=2, return_is_str=True, initial_wait=2) +@retry(attempts=11, wait=2, return_is_str=True) def verify_ospf_database(tgen, topo, dut, input_dict): """ This API is to verify ospf lsa's by running diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py b/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py index b70c25ff1e..5a141224f1 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_single_area.py @@ -711,185 +711,6 @@ def test_ospf_hello_tc10_p0(request): write_test_footer(tc_name) -def test_ospf_dead_tc11_p0(request): - """ - OSPF timers. - - Verify OSPF interface timer dead interval functionality - """ - tc_name = request.node.name - write_test_header(tc_name) - tgen = get_topogen() - - # Don't run this test if we have any failure. - if tgen.routers_have_failure(): - pytest.skip(tgen.errors) - - global topo - step("Bring up the base config as per the topology") - reset_config_on_routers(tgen) - - step("modify dead interval from default value to some other value on r1") - - topo1 = { - "r1": { - "links": { - "r0": { - "interface": topo["routers"]["r1"]["links"]["r0"]["interface"], - "ospf": {"hello_interval": 2, "dead_interval": 8}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step( - "verify that new timer value is configured and applied using " - "the show ip ospf interface command." - ) - dut = "r1" - input_dict = {"r1": {"links": {"r0": {"ospf": {"timerDeadSecs": 8}}}}} - result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step("remove ospf on R1") - ospf_del = {"r0": {"ospf": {"delete": True}}} - result = create_router_ospf(tgen, topo, ospf_del) - assert result is True, "Testcase : Failed \n Error: {}".format(result) - - # reconfiguring deleted ospf process by resetting the configs. - reset_config_on_routers(tgen) - - step("reconfigure the default dead interval timer value to default on r1 and r2") - topo1 = { - "r0": { - "links": { - "r1": { - "interface": topo["routers"]["r0"]["links"]["r1"]["interface"], - "ospf": {"dead_interval": 40}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - topo1 = { - "r1": { - "links": { - "r0": { - "interface": topo["routers"]["r1"]["links"]["r0"]["interface"], - "ospf": {"dead_interval": 40}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step("verify that new timer value is configured.") - input_dict = {"r0": {"links": {"r1": {"ospf": {"timerDeadSecs": 40}}}}} - dut = "r0" - result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step("verify that ospf neighbours are full") - ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( - ospf_covergence - ) - - step(" Configure dead timer = 65535 on r1 and r2") - - topo1 = { - "r0": { - "links": { - "r1": { - "interface": topo["routers"]["r0"]["links"]["r1"]["interface"], - "ospf": {"dead_interval": 65535}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - topo1 = { - "r1": { - "links": { - "r0": { - "interface": topo["routers"]["r1"]["links"]["r0"]["interface"], - "ospf": {"dead_interval": 65535}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step("verify that new timer value is configured.") - input_dict = {"r0": {"links": {"r1": {"ospf": {"timerDeadSecs": 65535}}}}} - dut = "r0" - result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - step("verify that ospf neighbours are full") - ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) - assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( - ospf_covergence - ) - - step(" Try configuring timer values outside range for example 65536") - topo1 = { - "r0": { - "links": { - "r1": { - "interface": topo["routers"]["r0"]["links"]["r1"]["interface"], - "ospf": {"dead_interval": 65536}, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is not True, "Testcase {} : Failed \n Error: {}".format( - tc_name, result - ) - - step("Unconfigure the dead timer from the interface from r1 and r2.") - - topo1 = { - "r1": { - "links": { - "r0": { - "interface": topo["routers"]["r1"]["links"]["r0"]["interface"], - "ospf": {"dead_interval": 65535}, - "delete": True, - } - } - } - } - - result = create_interfaces_cfg(tgen, topo1) - assert result is True, "Testcase {} : 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": {"ospf": {"timerDeadSecs": 40}}}}} - dut = "r1" - result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) - assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - - write_test_footer(tc_name) - - def test_ospf_show_p1(request): """Verify ospf show commands with json output.""" tc_name = request.node.name -- 2.39.5