X-Git-Url: https://gerrit.fd.io/r/gitweb?p=csit.git;a=blobdiff_plain;f=resources%2Flibraries%2Fpython%2FIPv4Util.py;fp=resources%2Flibraries%2Fpython%2FIPv4Util.py;h=3b500ab1d95974b3129d40b9e56cdfde0abc5e80;hp=3dec3d8e608e36764bb5d250142db71b9fc9fcb6;hb=1254d80a0b64985de2816eff5ef79e3e22cde972;hpb=84c4bb50e13685176751e90bd67ce02730061032 diff --git a/resources/libraries/python/IPv4Util.py b/resources/libraries/python/IPv4Util.py index 3dec3d8e60..3b500ab1d9 100644 --- a/resources/libraries/python/IPv4Util.py +++ b/resources/libraries/python/IPv4Util.py @@ -35,6 +35,26 @@ class IPv4Util(object): interface, ip_address)) get_node(node).arp_ping(ip_address, interface) + @staticmethod + @keyword('Node "${node}" interface "${port}" has IPv4 address "${address}"' + ' with prefix length "${prefix_length}"') + def set_interface_address(node, interface, address, length): + """See IPv4Node.set_ip for more information. + + :param node: Node where IP address should be set to. + :param interface: Interface name + :param address: IP address + :param length: prefix length + :type node: dict + :type interface: str + :type address: str + :type length: int + """ + log.debug('Node {} interface {} has IPv4 address {} with prefix ' + 'length {}'.format(Topology.get_node_hostname(node), + interface, address, length)) + get_node(node).set_ip(interface, address, int(length)) + @staticmethod @keyword('Node "${node}" routes to IPv4 network "${network}" with prefix ' 'length "${prefix_length}" using interface "${interface}" via '