diff options
| author | Acee <aceelindem@gmail.com> | 2023-05-18 10:43:52 -0400 |
|---|---|---|
| committer | Acee <aceelindem@gmail.com> | 2023-05-22 15:51:41 -0400 |
| commit | 0d8ef0477ca02ead3ce9b6dd63f6943fd2b02dec (patch) | |
| tree | 6695da96b114a226a7d63990f0e1d623b874fcce /tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py | |
| parent | 4d7f6295c6487b438d50280c1d7ddfe490d4749c (diff) | |
ospfd: OSPF P2MP Delayed Reflooding configuration
Currently, delayed reflooding on P2MP interfaces for LSAs received
from neighbors on the interface is unconditionally (see commit
c706f0e32ba8aa8780a0618b6fbba364c383ae05). In some cases, this
change wasn't desirable and this feature makes delayed reflooding
configurable for P2MP interfaces via the CLI command:
"ip ospf network point-to-multipoint delay-reflood" in interface
submode.
Signed-off-by: Acee <aceelindem@gmail.com>
Diffstat (limited to 'tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py')
| -rw-r--r-- | tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py | 179 |
1 files changed, 179 insertions, 0 deletions
diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py b/tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py index 4f797743e7..a90d7dbdc0 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_p2mp.py @@ -363,6 +363,185 @@ def test_ospf_p2mp_tc1_p0(request): write_test_footer(tc_name) +def test_ospf_p2mp_tc_delay_reflood(request): + """OSPF IFSM -Verify "delay-reflood" parameter in p2mp network.""" + tc_name = request.node.name + write_test_header(tc_name) + tgen = get_topogen() + r0 = tgen.gears["r0"] + + # Don't run this test if we have any failure. + if tgen.routers_have_failure(): + pytest.skip(tgen.errors) + + global topo + + step("Verify for interface with network type P2MP that delay-reflood is configured") + r0.vtysh_multicmd( + "conf t\ninterface r0-r1-eth0\nip ospf network point-to-multipoint delay-reflood" + ) + + dut = "r0" + input_dict = { + "r0": { + "links": { + "r1": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": True, + } + }, + "r2": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + "r3": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + } + } + } + result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) + assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) + delay_reflood_cfg = ( + tgen.net["r0"] + .cmd( + 'vtysh -c "show running" | grep "^ ip ospf network point-to-multipoint delay-reflood"' + ) + .rstrip() + ) + + assertmsg = "delay-reflood' configuration applied, but not present in configuration" + assert ( + delay_reflood_cfg == " ip ospf network point-to-multipoint delay-reflood" + ), assertmsg + + step("Verify for interface with network type P2MP that delay-reflood is removed") + r0.vtysh_multicmd( + "conf t\ninterface r0-r1-eth0\nip ospf network point-to-multipoint" + ) + + input_dict = { + "r0": { + "links": { + "r1": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + "r2": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + "r3": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + } + } + } + result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) + assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) + + delay_reflood_cfg = ( + tgen.net["r0"] + .cmd( + 'vtysh -c "show running" | grep "^ ip ospf network point-to-multipoint delay-reflood"' + ) + .rstrip() + ) + assertmsg = ( + "delay-reflood' configuration removed, but still present in configuration" + ) + assert ( + delay_reflood_cfg != " ip ospf network point-to-multipoint delay-reflood" + ), assertmsg + + step( + "Verify for interface with network type P2MP that delay-reflood is removed with removal of network type" + ) + r0.vtysh_multicmd( + "conf t\ninterface r0-r1-eth0\nip ospf network point-to-multipoint delay-reflood" + ) + r0.vtysh_multicmd( + "conf t\ninterface r0-r1-eth0\nno ip ospf network point-to-multipoint" + ) + r0.vtysh_multicmd( + "conf t\ninterface r0-r1-eth0\nip ospf network point-to-multipoint" + ) + + input_dict = { + "r0": { + "links": { + "r1": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + "r2": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + "r3": { + "ospf": { + "mcastMemberOspfAllRouters": True, + "ospfEnabled": True, + "networkType": "POINTOMULTIPOINT", + "p2mpDelayReflood": False, + } + }, + } + } + } + result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) + assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) + + delay_reflood_cfg = ( + tgen.net["r0"] + .cmd( + 'vtysh -c "show running" | grep "^ ip ospf network point-to-multipoint delay-reflood"' + ) + .rstrip() + ) + assertmsg = ( + "delay-reflood' configuration removed, but still present in configuration" + ) + assert ( + delay_reflood_cfg != " ip ospf network point-to-multipoint delay-reflood" + ), assertmsg + + write_test_footer(tc_name) + + @retry(retry_timeout=30) def verify_ospf_json(tgen, dut, input_dict, cmd="show ip ospf database json"): del tgen |
