def test_ospf_p2p_tc3_p0(request): """OSPF IFSM -Verify state change events on p2p network.""" 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("Verify that OSPF is subscribed to multi cast services " "(All SPF, all DR Routers).") step("Verify that interface is enabled in ospf.") step("Verify that config is successful.") dut = "r0" input_dict = { "r0": { "links": { "r3": { "ospf": { "mcastMemberOspfAllRouters": True, "ospfEnabled": True } } } } } 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("Delete the ip address") topo1 = { "r0": { "links": { "r3": { "ipv4": topo["routers"]["r0"]["links"]["r3"]["ipv4"], "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "delete": True, } } } } result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Change the ip on the R0 interface") topo_modify_change_ip = deepcopy(topo) intf_ip = topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["ipv4"] topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["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) step("Verify that interface is enabled in ospf.") dut = "r0" input_dict = { "r0": { "links": { "r3": { "ospf": { "ipAddress": topo_modify_change_ip["routers"]["r0"]["links"]["r3"] ["ipv4"].split("/")[0], "ipAddressPrefixlen": int(topo_modify_change_ip["routers"]["r0"]["links"] ["r3"]["ipv4"].split("/")[1]), } } } } } 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("Modify the mask on the R0 interface") ip_addr = topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["ipv4"] mask = topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["ipv4"] step("Delete the ip address") topo1 = { "r0": { "links": { "r3": { "ipv4": ip_addr, "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "delete": True, } } } } result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Change the ip on the R0 interface") topo_modify_change_ip = deepcopy(topo) intf_ip = topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["ipv4"] topo_modify_change_ip["routers"]["r0"]["links"]["r3"]["ipv4"] = str( IPv4Address(frr_unicode(intf_ip.split("/")[0])) + 3) + "/{}".format(int(intf_ip.split("/")[1]) + 1) build_config_from_json(tgen, topo_modify_change_ip, save_bkup=False) step("Verify that interface is enabled in ospf.") dut = "r0" input_dict = { "r0": { "links": { "r3": { "ospf": { "ipAddress": topo_modify_change_ip["routers"]["r0"]["links"]["r3"] ["ipv4"].split("/")[0], "ipAddressPrefixlen": int(topo_modify_change_ip["routers"]["r0"]["links"] ["r3"]["ipv4"].split("/")[1]), } } } } } result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) topo1 = { "r0": { "links": { "r3": { "ipv4": topo_modify_change_ip["routers"]["r0"]["links"]["r3"] ["ipv4"], "interface": topo_modify_change_ip["routers"]["r0"]["links"]["r3"] ["interface"], "delete": True, } } } } result = create_interfaces_cfg(tgen, topo1) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) build_config_from_json(tgen, topo, save_bkup=False) step("Change the area id on the interface") input_dict = { "r0": { "links": { "r3": { "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "ospf": { "area": "0.0.0.0" }, "delete": True, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) input_dict = { "r0": { "links": { "r3": { "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "ospf": { "area": "0.0.0.1" }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) step("Verify that interface is enabled in ospf.") dut = "r0" input_dict = { "r0": { "links": { "r3": { "ospf": { "area": "0.0.0.1", "ospfEnabled": True } } } } } result = verify_ospf_interface(tgen, topo, dut=dut, input_dict=input_dict) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) input_dict = { "r0": { "links": { "r3": { "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "ospf": { "area": "0.0.0.1" }, "delete": True, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) input_dict = { "r0": { "links": { "r3": { "interface": topo["routers"]["r0"]["links"]["r3"]["interface"], "ospf": { "area": "0.0.0.0" }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) # Api call verify whether BGP is converged ospf_covergence = verify_ospf_neighbor(tgen, topo) assert ospf_covergence is True, "setup_module :Failed \n Error:" " {}".format( ospf_covergence) write_test_footer(tc_name)
def test_ospf_lan_tc1_p0(request): """ OSPF Hello protocol - Verify DR BDR Elections """ 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("Verify that DR BDR DRother are elected in the LAN.") input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "DR" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r0" result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Verify that all the routers are in FULL state with DR and BDR " "in the topology") input_dict = { "r1": { "ospf": { "neighbors": { "r0": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r1" 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 pririty 100 on R0 and clear ospf neighbors " "on all the routers.") input_dict = { "r0": { "links": { "s1": { "interface": topo["routers"]["r0"]["links"]["s1"]["interface"], "ospf": { "priority": 100 }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) step("Clear ospf neighbours in all routers") for rtr in ["r0", "r1", "r2", "r3"]: clear_ospf(tgen, rtr) step("Verify that DR election is triggered and R0 is elected as DR") input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r0" 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 pririty 150 on R0 and clear ospf neighbors " "on all the routers.") input_dict = { "r0": { "links": { "s1": { "interface": topo["routers"]["r0"]["links"]["s1"]["interface"], "ospf": { "priority": 150 }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) step("Clear ospf neighbours in all routers") for rtr in ["r0", "r1"]: clear_ospf(tgen, rtr) step("Verify that DR election is triggered and R0 is elected as DR") input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r0" 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 0 on R0 & Clear ospf nbrs on all the routers") input_dict = { "r0": { "links": { "s1": { "interface": topo["routers"]["r0"]["links"]["s1"]["interface"], "ospf": { "priority": 0 }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) step("Clear ospf neighbours in all routers") for rtr in ["r1"]: clear_ospf(tgen, rtr) step("Verify that DR election is triggered and R0 is elected as DRother") input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "DR" }, "r2": { "state": "2-Way", "role": "DROther" }, "r3": { "state": "2-Way", "role": "DROther" }, } } } } dut = "r0" 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 to default on R0 and Clear ospf neighbors" " on all the routers") input_dict = { "r0": { "links": { "s1": { "interface": topo["routers"]["r0"]["links"]["s1"]["interface"], "ospf": { "priority": 100 }, } } } } result = create_interfaces_cfg(tgen, input_dict) assert result is True, "Testcase {} :Failed \n Error: {}".format( tc_name, result) step("Clear ospf neighbours in all routers") for rtr in ["r0", "r1"]: clear_ospf(tgen, rtr) step("Verify that DR election is triggered and R0 is elected as DR") input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r0" result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Shut interface on R0") dut = "r0" intf = topo["routers"]["r0"]["links"]["s1"]["interface"] shutdown_bringup_interface(tgen, dut, intf, False) result = verify_ospf_neighbor(tgen, topo, dut, lan=True, expected=False) assert ( result is not True ), "Testcase {} : Failed \n " "r0: OSPF neighbors-hip is up \n Error: {}".format( tc_name, result) step("No Shut interface on R0") dut = "r0" intf = topo["routers"]["r0"]["links"]["s1"]["interface"] shutdown_bringup_interface(tgen, dut, intf, True) input_dict = { "r0": { "ospf": { "neighbors": { "r1": { "state": "Full", "role": "DR" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } step("Verify that after no shut ospf neighbours are full on R0.") result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Clear ospf on DR router in the topology.") clear_ospf(tgen, "r0") step("Verify that BDR is getting promoted to DR after clear.") step("Verify that all the nbrs are in FULL state with the elected DR.") result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Change the ip on LAN intf on R0 to other ip from the same subnet.") topo_modify_change_ip = deepcopy(topo) intf_ip = topo_modify_change_ip["routers"]["r0"]["links"]["s1"]["ipv4"] topo_modify_change_ip["routers"]["r0"]["links"]["s1"]["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) step("Verify that OSPF is in FULL state with other routers with " "newly configured IP.") result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Change the ospf router id on the R0 and clear ip ospf interface.") change_rid = {"r0": {"ospf": {"router_id": "100.1.1.100"}}} result = create_router_ospf(tgen, topo, change_rid) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) topo["routers"]["r0"]["ospf"]["router_id"] = "100.1.1.100" step("Reload the FRR router") stop_router(tgen, "r0") start_router(tgen, "r0") step("Verify that OSPF is in FULL state with other routers with" " newly configured router id.") input_dict = { "r1": { "ospf": { "neighbors": { "r0": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r1" result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) step("Reconfigure the original router id and clear ip ospf interface.") change_rid = {"r0": {"ospf": {"router_id": "100.1.1.0"}}} result = create_router_ospf(tgen, topo, change_rid) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) topo["routers"]["r0"]["ospf"]["router_id"] = "100.1.1.0" step("Reload the FRR router") # stop/start -> restart FRR router and verify stop_router(tgen, "r0") start_router(tgen, "r0") step("Verify that OSPF is enabled with router id previously configured.") input_dict = { "r1": { "ospf": { "neighbors": { "r0": { "state": "Full", "role": "Backup" }, "r2": { "state": "Full", "role": "DROther" }, "r3": { "state": "Full", "role": "DROther" }, } } } } dut = "r1" result = verify_ospf_neighbor(tgen, topo, dut, input_dict, lan=True) assert result is True, "Testcase {} : Failed \n Error: {}".format( tc_name, result) write_test_footer(tc_name)
def verify_ospf_rib(tgen, dut, input_dict, next_hop=None, tag=None, metric=None, fib=None): """ This API is to verify ospf routes by running show ip ospf route command. Parameters ---------- * `tgen` : Topogen object * `dut`: device under test * `input_dict` : Input dict data, required when configuring from testcase * `next_hop` : next to be verified * `tag` : tag to be verified * `metric` : metric to be verified * `fib` : True if the route is installed in FIB. Usage ----- input_dict = { "r1": { "static_routes": [ { "network": ip_net, "no_of_ip": 1, "routeType": "N" } ] } } result = verify_ospf_rib(tgen, dut, input_dict,next_hop=nh) Returns ------- True or False (Error Message) """ logger.info("Entering lib API: verify_ospf_rib()") result = False router_list = tgen.routers() additional_nexthops_in_required_nhs = [] found_hops = [] for routerInput in input_dict.keys(): for router, rnode in router_list.items(): if router != dut: continue logger.info("Checking router %s RIB:", router) # Verifying RIB routes command = "show ip ospf route" found_routes = [] missing_routes = [] if ("static_routes" in input_dict[routerInput] or "prefix" in input_dict[routerInput]): if "prefix" in input_dict[routerInput]: static_routes = input_dict[routerInput]["prefix"] else: static_routes = input_dict[routerInput]["static_routes"] for static_route in static_routes: cmd = "{}".format(command) cmd = "{} json".format(cmd) ospf_rib_json = run_frr_cmd(rnode, cmd, isjson=True) # Verifying output dictionary ospf_rib_json is not empty if bool(ospf_rib_json) is False: errormsg = ("[DUT: {}] No routes found in OSPF route " "table".format(router)) return errormsg network = static_route["network"] no_of_ip = static_route.setdefault("no_of_ip", 1) _tag = static_route.setdefault("tag", None) _rtype = static_route.setdefault("routeType", None) # Generating IPs for verification ip_list = generate_ips(network, no_of_ip) st_found = False nh_found = False for st_rt in ip_list: st_rt = str(ipaddr.IPNetwork(frr_unicode(st_rt))) _addr_type = validate_ip_address(st_rt) if _addr_type != "ipv4": continue if st_rt in ospf_rib_json: st_found = True found_routes.append(st_rt) if fib and next_hop: if type(next_hop) is not list: next_hop = [next_hop] for mnh in range(0, len(ospf_rib_json[st_rt])): if ("fib" in ospf_rib_json[st_rt][mnh] ["nexthops"][0]): found_hops.append([ rib_r["ip"] for rib_r in ospf_rib_json[st_rt] [mnh]["nexthops"] ]) if found_hops[0]: missing_list_of_nexthops = set( found_hops[0]).difference(next_hop) additional_nexthops_in_required_nhs = set( next_hop).difference(found_hops[0]) if additional_nexthops_in_required_nhs: logger.info( "Nexthop " "%s is not active for route %s in " "RIB of router %s\n", additional_nexthops_in_required_nhs, st_rt, dut, ) errormsg = ( "Nexthop {} is not active" " for route {} in RIB of router" " {}\n".format( additional_nexthops_in_required_nhs, st_rt, dut, )) return errormsg else: nh_found = True elif next_hop and fib is None: if type(next_hop) is not list: next_hop = [next_hop] found_hops = [ rib_r["ip"] for rib_r in ospf_rib_json[st_rt]["nexthops"] ] if found_hops: missing_list_of_nexthops = set( found_hops).difference(next_hop) additional_nexthops_in_required_nhs = set( next_hop).difference(found_hops) if additional_nexthops_in_required_nhs: logger.info( "Missing nexthop %s for route" " %s in RIB of router %s\n", additional_nexthops_in_required_nhs, st_rt, dut, ) errormsg = ( "Nexthop {} is Missing for " "route {} in RIB of router {}\n". format( additional_nexthops_in_required_nhs, st_rt, dut, )) return errormsg else: nh_found = True if _rtype: if "routeType" not in ospf_rib_json[st_rt]: errormsg = ( "[DUT: {}]: routeType missing" " for route {} in OSPF RIB \n".format( dut, st_rt)) return errormsg elif _rtype != ospf_rib_json[st_rt][ "routeType"]: errormsg = ( "[DUT: {}]: routeType mismatch" " for route {} in OSPF RIB \n".format( dut, st_rt)) return errormsg else: logger.info("[DUT: {}]: Found routeType {}" " for route {}".format( dut, _rtype, st_rt)) if tag: if "tag" not in ospf_rib_json[st_rt]: errormsg = ("[DUT: {}]: tag is not" " present for" " route {} in RIB \n".format( dut, st_rt)) return errormsg if _tag != ospf_rib_json[st_rt]["tag"]: errormsg = ("[DUT: {}]: tag value {}" " is not matched for" " route {} in RIB \n".format( dut, _tag, st_rt, )) return errormsg if metric is not None: if "type2cost" not in ospf_rib_json[st_rt]: errormsg = ("[DUT: {}]: metric is" " not present for" " route {} in RIB \n".format( dut, st_rt)) return errormsg if metric != ospf_rib_json[st_rt]["type2cost"]: errormsg = ("[DUT: {}]: metric value " "{} is not matched for " "route {} in RIB \n".format( dut, metric, st_rt, )) return errormsg else: missing_routes.append(st_rt) if nh_found: logger.info("[DUT: {}]: Found next_hop {} for all OSPF" " routes in RIB".format(router, next_hop)) if len(missing_routes) > 0: errormsg = "[DUT: {}]: Missing route in RIB, " "routes: {}".format( dut, missing_routes) return errormsg if found_routes: logger.info( "[DUT: %s]: Verified routes in RIB, found" " routes are: %s\n", dut, found_routes, ) result = True logger.info("Exiting lib API: verify_ospf_rib()") return result
def test_ospf_authentication_md5_tc29_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 message-digest cmd." ) r1_ospf_auth = { "r1": { "links": { "r2": { "ospf": { "authentication": "message-digest", "authentication-key": "ospf", "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) 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, "setup_module :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." ) r2_ospf_auth = { "r2": { "links": { "r1": { "ospf": { "authentication": "message-digest", "authentication-key": "ospf", "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) 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, "setup_module :Failed \n Error:" " {}".format( ospf_covergence ) step( "Disable message-digest authentication on R2 using no ip ospf " "authentication message-digest password cmd." ) r2_ospf_auth = { "r2": { "links": { "r1": { "ospf": { "authentication": "message-digest", "authentication-key": "ospf", "message-digest-key": "10", "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, "setup_module :Failed \n Error:" " {}".format( ospf_covergence ) step("Again On R2 enable ospf on interface with message-digest auth") r2_ospf_auth = { "r2": { "links": { "r1": { "ospf": { "authentication": "message-digest", "authentication-key": "ospf", "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) 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, "setup_module :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, "setup_module :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, "setup_module :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") r1_ospf_auth = { "r1": { "links": { "r2": { "ospf": { "authentication": "message-digest", "authentication-key": "ospf", "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) 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, "setup_module :Failed \n Error:" " {}".format( ospf_covergence ) write_test_footer(tc_name)