diff options
Diffstat (limited to 'tests/topotests/ospf_basic_functionality')
5 files changed, 717 insertions, 57 deletions
diff --git a/tests/topotests/ospf_basic_functionality/ospf_lan.json b/tests/topotests/ospf_basic_functionality/ospf_lan.json index 126934c344..54863382b2 100644 --- a/tests/topotests/ospf_basic_functionality/ospf_lan.json +++ b/tests/topotests/ospf_basic_functionality/ospf_lan.json @@ -18,7 +18,7 @@ "ospf": { "area": "0.0.0.3", "hello_interval": 1, - "dead_interval": 4, + "dead_interval": 10, "priority": 98 } }, @@ -27,7 +27,7 @@ "ospf": { "area": "0.0.0.3", "hello_interval": 1, - "dead_interval": 4, + "dead_interval": 10, "priority": 99 } }, @@ -36,7 +36,7 @@ "ospf": { "area": "0.0.0.3", "hello_interval": 1, - "dead_interval": 4, + "dead_interval": 10, "priority": 0 } }, @@ -45,7 +45,7 @@ "ospf": { "area": "0.0.0.3", "hello_interval": 1, - "dead_interval": 4, + "dead_interval": 10, "priority": 0 } } @@ -135,4 +135,4 @@ } } } -}
\ No newline at end of file +} diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py index 9d7a15833c..0531e81d44 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_asbr_summary_topo1.py @@ -84,8 +84,8 @@ SUMMARY = {"ipv4": ["11.0.0.0/8", "12.0.0.0/8", "11.0.0.0/24"]} """ TOPOOLOGY = Please view in a fixed-width font such as Courier. - +---+ A0 +---+ - +R1 +------------+R2 | + +---+ A0 +---+ + |R1 +------------+R2 | +-+-+- +--++ | -- -- | | -- A0 -- | @@ -94,8 +94,8 @@ TOPOOLOGY = | -- -- | | -- -- | +-+-+- +-+-+ - +R0 +-------------+R3 | - +---+ A0 +---+ + |R0 +-------------+R3 | + +---+ A0 +---+ TESTCASES = 1. OSPF summarisation functionality. @@ -977,7 +977,7 @@ def test_ospf_type5_summary_tc42_p0(request): ip = topo["routers"]["r0"]["links"]["r3"]["ipv4"] - ip_net = str(ipaddress.ip_interface(u"{}".format(ip)).network) + ip_net = str(ipaddress.ip_interface("{}".format(ip)).network) ospf_summ_r1 = { "r0": { "ospf": {"summary-address": [{"prefix": ip_net.split("/")[0], "mask": "8"}]} @@ -1519,7 +1519,7 @@ def test_ospf_type5_summary_tc45_p0(request): step("Repeat steps 1 to 10 of summarisation in non Back bone area.") reset_config_on_routers(tgen) - step("Change the area id on the interface on R0") + step("Change the area id on the interface on R0 to R1 from 0.0.0.0 to 0.0.0.1") input_dict = { "r0": { "links": { @@ -1549,7 +1549,7 @@ def test_ospf_type5_summary_tc45_p0(request): result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) - step("Change the area id on the interface ") + step("Change the area id on the interface on R1 to R0 from 0.0.0.0 to 0.0.0.1") input_dict = { "r1": { "links": { diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py index 88219b8400..8dd103013b 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_authentication.py @@ -64,7 +64,9 @@ TOPOOLOGY = TESTCASES = 1. Verify ospf authentication with Simple password authentication. 2. Verify ospf authentication with MD5 authentication. -3. Verify ospf authentication with different authentication methods. +3. Verify ospf authentication with MD5 keychain authentication. +4. Verify ospf authentication with SHA256 keychain authentication. +5. Verify ospf authentication with different authentication methods. """ @@ -535,7 +537,477 @@ def test_ospf_authentication_md5_tc29_p1(request): write_test_footer(tc_name) -def test_ospf_authentication_different_auths_tc30_p1(request): +def test_ospf_authentication_md5_keychain_tc30_p1(request): + """ + OSPF Authentication - Verify ospf authentication with MD5 authentication. + + """ + tc_name = request.node.name + write_test_header(tc_name) + tgen = get_topogen() + global topo + step("Bring up the base config.") + reset_config_on_routers(tgen) + step( + "Configure ospf with on R1 and R2, enable ospf on R1 interface " + "connected to R2 with message-digest authentication using ip " + "ospf authentication key-chain cmd." + ) + + router1 = tgen.gears["r1"] + router2 = tgen.gears["r2"] + + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm md5""" + ) + + r1_ospf_auth = { + "r1": { + "links": { + "r2": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r1_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verify that the neighbour is not FULL between R1 and R2.") + # wait for dead time expiry. + sleep(6) + dut = "r1" + ospf_covergence = verify_ospf_neighbor( + tgen, topo, dut=dut, expected=False, retry_timeout=6 + ) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step( + "On R2 enable ospf on interface with message-digest authentication" + " using ip ospf authentication message-digest password cmd." + ) + + router2.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm md5""" + ) + + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 " + "using show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step( + "Disable message-digest authentication on R2 using no ip ospf " + "authentication key-chain cmd." + ) + + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + "del_action": True, + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verify on R1 ,nbr is deleted for R2 after dead interval expiry") + # wait till the dead timer expiry + sleep(6) + dut = "r2" + ospf_covergence = verify_ospf_neighbor( + tgen, topo, dut=dut, expected=False, retry_timeout=10 + ) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Again On R2 enable ospf on interface with key-chain auth") + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 using" + " show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Shut no shut interface on R1") + dut = "r1" + intf = topo["routers"]["r1"]["links"]["r2"]["interface"] + shutdown_bringup_interface(tgen, dut, intf, False) + + dut = "r2" + step( + "Verify that the neighbour is not FULL between R1 and R2 using " + "show ip ospf neighbor cmd." + ) + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + dut = "r1" + shutdown_bringup_interface(tgen, dut, intf, True) + + step( + "Verify that the neighbour is FULL between R1 and R2 using " + "show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Change Ip address on R1 and R2") + + topo_modify_change_ip = deepcopy(topo) + + intf_ip = topo_modify_change_ip["routers"]["r1"]["links"]["r2"]["ipv4"] + + topo_modify_change_ip["routers"]["r1"]["links"]["r2"]["ipv4"] = str( + IPv4Address(frr_unicode(intf_ip.split("/")[0])) + 3 + ) + "/{}".format(intf_ip.split("/")[1]) + + build_config_from_json(tgen, topo_modify_change_ip, save_bkup=False) + + reset_config_on_routers(tgen, routerName="r1") + dut = "r1" + intf = topo["routers"]["r1"]["links"]["r2"]["interface"] + shutdown_bringup_interface(tgen, dut, intf, False) + shutdown_bringup_interface(tgen, dut, intf, True) + clear_ospf(tgen, "r1") + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm md5""" + ) + r1_ospf_auth = { + "r1": { + "links": { + "r2": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r1_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 with new " + "ip address using show ip ospf " + ) + + dut = "r1" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + write_test_footer(tc_name) + + +def test_ospf_authentication_sha256_keychain_tc32_p1(request): + """ + OSPF Authentication - Verify ospf authentication with MD5 authentication. + + """ + tc_name = request.node.name + write_test_header(tc_name) + tgen = get_topogen() + global topo + step("Bring up the base config.") + reset_config_on_routers(tgen) + step( + "Configure ospf with on R1 and R2, enable ospf on R1 interface " + "connected to R2 with message-digest authentication using ip " + "ospf authentication key-chain cmd." + ) + + router1 = tgen.gears["r1"] + router2 = tgen.gears["r2"] + + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm hmac-sha-256""" + ) + + r1_ospf_auth = { + "r1": { + "links": { + "r2": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r1_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verify that the neighbour is not FULL between R1 and R2.") + # wait for dead time expiry. + sleep(6) + dut = "r1" + ospf_covergence = verify_ospf_neighbor( + tgen, topo, dut=dut, expected=False, retry_timeout=6 + ) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step( + "On R2 enable ospf on interface with message-digest authentication" + " using ip ospf authentication message-digest password cmd." + ) + + router2.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm hmac-sha-256""" + ) + + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 " + "using show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step( + "Disable message-digest authentication on R2 using no ip ospf " + "authentication key-chain cmd." + ) + + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + "del_action": True, + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step("Verify on R1 ,nbr is deleted for R2 after dead interval expiry") + # wait till the dead timer expiry + sleep(6) + dut = "r2" + ospf_covergence = verify_ospf_neighbor( + tgen, topo, dut=dut, expected=False, retry_timeout=10 + ) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Again On R2 enable ospf on interface with key-chain auth") + r2_ospf_auth = { + "r2": { + "links": { + "r1": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r2_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 using" + " show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Shut no shut interface on R1") + dut = "r1" + intf = topo["routers"]["r1"]["links"]["r2"]["interface"] + shutdown_bringup_interface(tgen, dut, intf, False) + + dut = "r2" + step( + "Verify that the neighbour is not FULL between R1 and R2 using " + "show ip ospf neighbor cmd." + ) + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut, expected=False) + assert ospf_covergence is not True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + dut = "r1" + shutdown_bringup_interface(tgen, dut, intf, True) + + step( + "Verify that the neighbour is FULL between R1 and R2 using " + "show ip ospf neighbor cmd." + ) + + dut = "r2" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + step("Change Ip address on R1 and R2") + + topo_modify_change_ip = deepcopy(topo) + + intf_ip = topo_modify_change_ip["routers"]["r1"]["links"]["r2"]["ipv4"] + + topo_modify_change_ip["routers"]["r1"]["links"]["r2"]["ipv4"] = str( + IPv4Address(frr_unicode(intf_ip.split("/")[0])) + 3 + ) + "/{}".format(intf_ip.split("/")[1]) + + build_config_from_json(tgen, topo_modify_change_ip, save_bkup=False) + + reset_config_on_routers(tgen, routerName="r1") + dut = "r1" + intf = topo["routers"]["r1"]["links"]["r2"]["interface"] + shutdown_bringup_interface(tgen, dut, intf, False) + shutdown_bringup_interface(tgen, dut, intf, True) + clear_ospf(tgen, "r1") + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm hmac-sha-256""" + ) + r1_ospf_auth = { + "r1": { + "links": { + "r2": { + "ospf": { + "authentication": "key-chain", + "keychain": "auth", + } + } + } + } + } + result = config_ospf_interface(tgen, topo, r1_ospf_auth) + assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + + step( + "Verify that the neighbour is FULL between R1 and R2 with new " + "ip address using show ip ospf " + ) + + dut = "r1" + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) + + write_test_footer(tc_name) + + +def test_ospf_authentication_different_auths_tc35_p1(request): """ OSPF Authentication - Verify ospf authentication with different authentication methods. @@ -553,6 +1025,9 @@ def test_ospf_authentication_different_auths_tc30_p1(request): "ospf authentication message-digest cmd." ) + router1 = tgen.gears["r1"] + router2 = tgen.gears["r2"] + r1_ospf_auth = { "r1": { "links": { @@ -769,16 +1244,23 @@ def test_ospf_authentication_different_auths_tc30_p1(request): ospf_covergence ) - step("Enable Md5 authentication on the interface") + step("Enable SHA-256 authentication on the interface") + + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm hmac-sha-256""" + ) r1_ospf_auth = { "r1": { "links": { "r2": { "ospf": { - "authentication": "message-digest", - "authentication-key": "ospf", - "message-digest-key": "10", + "authentication": "key-chain", + "keychain": "auth", } } } @@ -787,14 +1269,21 @@ def test_ospf_authentication_different_auths_tc30_p1(request): result = config_ospf_interface(tgen, topo, r1_ospf_auth) assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + router2.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string ospf + cryptographic-algorithm hmac-sha-256""" + ) + r2_ospf_auth = { "r2": { "links": { "r1": { "ospf": { - "authentication": "message-digest", - "authentication-key": "ospf", - "message-digest-key": "10", + "authentication": "key-chain", + "keychain": "auth", } } } @@ -814,39 +1303,27 @@ def test_ospf_authentication_different_auths_tc30_p1(request): ospf_covergence ) - step("Change the MD5 authentication password") + step("Change the SHA-256 authentication password") - r1_ospf_auth = { - "r1": { - "links": { - "r2": { - "ospf": { - "authentication": "message-digest", - "authentication-key": "OSPFv4", - "message-digest-key": "10", - } - } - } - } - } - result = config_ospf_interface(tgen, topo, r1_ospf_auth) - assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + router1.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string OSPFv4 + cryptographic-algorithm hmac-sha-512""" + ) - r2_ospf_auth = { - "r2": { - "links": { - "r1": { - "ospf": { - "authentication": "message-digest", - "authentication-key": "OSPFv4", - "message-digest-key": "10", - } - } - } - } - } - result = config_ospf_interface(tgen, topo, r2_ospf_auth) - assert result is True, "Testcase {} :Failed \n Error: {}".format(tc_name, result) + router2.vtysh_cmd( + """configure terminal + key chain auth + key 10 + key-string OSPFv4 + cryptographic-algorithm hmac-sha-512""" + ) + ospf_covergence = verify_ospf_neighbor(tgen, topo, dut=dut) + assert ospf_covergence is True, "Testcase Failed \n Error {}".format( + ospf_covergence + ) write_test_footer(tc_name) diff --git a/tests/topotests/ospf_basic_functionality/test_ospf_lan.py b/tests/topotests/ospf_basic_functionality/test_ospf_lan.py index e4a032018c..1358027f21 100644 --- a/tests/topotests/ospf_basic_functionality/test_ospf_lan.py +++ b/tests/topotests/ospf_basic_functionality/test_ospf_lan.py @@ -196,8 +196,10 @@ def test_ospf_lan_tc1_p0(request): result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Configure DR priority 100 on R0 and clear ospf neighbors " - "on all the routers.") + step( + "Configure DR priority 100 on R0 and clear ospf neighbors " + "on all the routers." + ) input_dict = { "r0": { @@ -233,8 +235,10 @@ def test_ospf_lan_tc1_p0(request): result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format(tc_name, result) - step("Configure DR priority 150 on R0 and clear ospf neighbors " - "on all the routers.") + step( + "Configure DR priority 150 on R0 and clear ospf neighbors " + "on all the routers." + ) input_dict = { "r0": { @@ -489,7 +493,7 @@ def test_ospf_lan_tc2_p0(request): "s1": { "ospf": { "priority": 98, - "timerDeadSecs": 4, + "timerDeadSecs": 10, "area": "0.0.0.3", "mcastMemberOspfDesignatedRouters": True, "mcastMemberOspfAllRouters": True, 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 |
