aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPv4Util.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/IPv4Util.py')
-rw-r--r--resources/libraries/python/IPv4Util.py20
1 files changed, 20 insertions, 0 deletions
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
@@ -36,6 +36,26 @@ class IPv4Util(object):
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 '
'"${gateway}"')