Add VXLAN test
[csit.git] / resources / libraries / python / IPv4Util.py
index 3dec3d8..3b500ab 100644 (file)
@@ -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 '