intf = topo["routers"]["r0"]["links"]["s1"]["interface"]
shutdown_bringup_interface(tgen, dut, intf, False)
- result = verify_ospf_neighbor(tgen, topo, dut, lan=True)
+ result = verify_ospf_neighbor(tgen, topo, dut, lan=True, expected=False)
assert result is not True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result
)
# Global variables
topo = None
+
+# number of retries.
+nretry = 5
+
# Reading the data from JSON File for topology creation
jsonFile = "{}/ospf_rte_calc.json".format(CWD)
try:
# ##################################
-@pytest.mark.precommit
def test_ospf_redistribution_tc5_p0(request):
"""Test OSPF intra area route calculations."""
tc_name = request.node.name
result = verify_rib(tgen, "ipv4", dut, input_dict, protocol=protocol, next_hop=nh)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
- step("Delete the ip address on newly configured loopback of R0")
+ step("Delete the ip address on newly configured interface of R0")
topo1 = {
"r0": {
"links": {
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
dut = "r1"
- result = verify_ospf_rib(
- tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False
- )
+ for num in range(0, nretry):
+ result = verify_ospf_rib(
+ tgen, dut, input_dict, next_hop=nh, expected=False)
+ if result is not True:
+ break
+
assert result is not True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result
)
assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result)
dut = "r1"
- result = verify_ospf_rib(
- tgen, dut, input_dict, next_hop=nh, attempts=5, expected=False
- )
+ for num in range(0, nretry):
+ result = verify_ospf_rib(
+ tgen, dut, input_dict, next_hop=nh, expected=False)
+ if result is not True:
+ break
assert result is not True, "Testcase {} : Failed \n Error: {}".format(
tc_name, result
)
input_dict,
protocol=protocol,
next_hop=nh,
- attempts=5,
expected=False,
)
assert result is not True, "Testcase {} : Failed \n Error: {}".format(