aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/IPv4Util.py
diff options
context:
space:
mode:
authorMatej Klotton <mklotton@cisco.com>2016-02-22 18:12:15 +0100
committerGerrit Code Review <gerrit@fd.io>2016-02-29 14:01:31 +0000
commit1254d80a0b64985de2816eff5ef79e3e22cde972 (patch)
treeeff46d4a02b80e8aa849eb876fcfc6b502668e1d /resources/libraries/python/IPv4Util.py
parent84c4bb50e13685176751e90bd67ce02730061032 (diff)
Add VXLAN test
Change-Id: Id1d37fda2697fbfb7aa7a79318f8316b80e96963 Signed-off-by: Matej Klotton <mklotton@cisco.com>
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}"')