Use separate module for ip address object
[csit.git] / resources / libraries / python / TestConfig.py
index 5c624e2..6366f2e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2019 Cisco and/or its affiliates.
+# Copyright (c) 2020 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -19,6 +19,7 @@ from robot.api import logger
 from resources.libraries.python.Constants import Constants
 from resources.libraries.python.InterfaceUtil import InterfaceUtil, \
     InterfaceStatusFlags
+from resources.libraries.python.IPAddress import IPAddress
 from resources.libraries.python.IPUtil import IPUtil
 from resources.libraries.python.PapiExecutor import PapiSocketExecutor
 from resources.libraries.python.topology import Topology
@@ -346,9 +347,11 @@ class TestConfig:
             for i in range(0, vxlan_count):
                 dst_ip = dst_ip_start + i * ip_step
                 commands.append(
-                    f"ip_neighbor_add_del sw_if_index {idx_vxlan_if} "
-                    f"dst {dst_ip} "
-                    f"mac {Topology.get_interface_mac(op_node, op_node_if)}\n"
+                    f"exec ip neighbor "
+                    f"{Topology.get_interface_name(node, node_vxlan_if)} "
+                    f"{dst_ip} "
+                    f"{Topology.get_interface_mac(op_node, op_node_if)} static "
+                    f"\n"
                 )
                 commands.append(
                     f"ip_route_add_del "
@@ -421,9 +424,9 @@ class TestConfig:
                 args1[u"neighbor"][u"ip_address"] = \
                     str(dst_ip_start + i * ip_step)
                 args2[u"route"][u"prefix"][u"address"][u"un"] = \
-                    IPUtil.union_addr(dst_ip_start + i * ip_step)
+                    IPAddress.union_addr(dst_ip_start + i * ip_step)
                 args2[u"route"][u"paths"][0][u"nh"][u"address"] = \
-                    IPUtil.union_addr(dst_ip_start + i * ip_step)
+                    IPAddress.union_addr(dst_ip_start + i * ip_step)
                 args3[u"rx_sw_if_index"] = Topology.get_interface_sw_index(
                     node, f"vxlan_tunnel{i+1}"
                 )