mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
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 <nguggarigoud@vmware.com>
This commit is contained in:
parent
035267a374
commit
b29a56b3ae
@ -650,7 +650,7 @@ def verify_ospf_neighbor(tgen, topo, dut=None, input_dict=None, lan=False):
|
|||||||
logger.debug("Exiting API: verify_ospf_neighbor()")
|
logger.debug("Exiting API: verify_ospf_neighbor()")
|
||||||
return result
|
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,
|
def verify_ospf_rib(tgen, dut, input_dict, next_hop=None,
|
||||||
tag=None, metric=None, fib=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
|
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):
|
def verify_ospf_database(tgen, topo, dut, input_dict):
|
||||||
"""
|
"""
|
||||||
This API is to verify ospf lsa's by running
|
This API is to verify ospf lsa's by running
|
||||||
|
@ -711,185 +711,6 @@ def test_ospf_hello_tc10_p0(request):
|
|||||||
write_test_footer(tc_name)
|
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):
|
def test_ospf_show_p1(request):
|
||||||
"""Verify ospf show commands with json output."""
|
"""Verify ospf show commands with json output."""
|
||||||
tc_name = request.node.name
|
tc_name = request.node.name
|
||||||
|
Loading…
Reference in New Issue
Block a user