aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
Diffstat (limited to 'resources')
-rw-r--r--resources/libraries/python/IPUtil.py20
-rw-r--r--resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py59
2 files changed, 59 insertions, 20 deletions
diff --git a/resources/libraries/python/IPUtil.py b/resources/libraries/python/IPUtil.py
index ed38272645..f3c037fdf0 100644
--- a/resources/libraries/python/IPUtil.py
+++ b/resources/libraries/python/IPUtil.py
@@ -139,6 +139,26 @@ class IPUtil(object):
raise RuntimeError(
'Could not set IP for interface, reason:{}'.format(stderr))
+ @staticmethod
+ def set_linux_interface_route(node, interface, route, namespace=None):
+ """Set route via interface in linux.
+
+ :param node: Node where to execute command.
+ :param interface: Interface in namespace.
+ :param route: Route to be added via interface.
+ :param namespace: Execute command in namespace. Optional parameter.
+ :type node: dict
+ :type interface: str
+ :type route: str
+ :type namespace: str
+ """
+ if namespace is not None:
+ cmd = 'ip netns exec {} ip route add {} dev {}'.format(
+ namespace, route, interface)
+ else:
+ cmd = 'ip route add {} dev {}'.format(route, interface)
+ exec_cmd_no_error(node, cmd, sudo=True)
+
def convert_ipv4_netmask_prefix(network):
"""Convert network mask to equivalent network prefix length or vice versa.
diff --git a/resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py b/resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py
index cd1b6383e6..f3754e228b 100644
--- a/resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py
+++ b/resources/test_data/lisp/ipv4_lispgpe_ipv4/ipv4_lispgpe_ipv4.py
@@ -22,33 +22,52 @@ duts_locator_set = {'locator_name': locator_name,
'weight': 1}
# IPv4 Lisp static mapping configuration
-dut1_to_dut2_ip4 = '6.0.3.1'
-dut2_to_dut1_ip4 = '6.0.3.2'
-dut1_to_tg_ip4 = '6.0.1.1'
-dut2_to_tg_ip4 = '6.0.2.1'
-tg1_ip4 = '6.0.1.2'
-tg2_ip4 = '6.0.2.2'
+tg1_ip4 = '6.0.1.1'
+dut1_to_tg_ip4 = '6.0.1.2'
+
+dut1_vif1_ip4 = '6.0.2.1'
+vm1_vif1_ip4 = '6.0.2.2'
+
+vm1_vif2_ip4 = '6.0.3.1'
+dut1_vif2_ip4 = '6.0.3.2'
+
+dut1_to_dut2_ip4 = '6.0.4.1'
+dut2_to_dut1_ip4 = '6.0.4.2'
+
+dut2_to_tg_ip4 = '6.0.5.1'
+tg2_ip4 = '6.0.5.2'
+
+src_ip_range = '6.0.1.0'
+dst_ip_range = '6.0.5.0'
+
+vm1_vif1_mac = '52:54:00:00:04:01'
+vm1_vif2_mac = '52:54:00:00:04:02'
prefix4 = 24
dut1_to_dut2_ip4_static_adjacency = {'vni': 0,
- 'deid': '6.0.2.0',
- 'seid': '6.0.1.0',
- 'rloc': '6.0.3.2',
- 'prefix': 24}
+ 'deid': dst_ip_range,
+ 'seid': src_ip_range,
+ 'rloc': dut2_to_dut1_ip4,
+ 'prefix': prefix4}
dut2_to_dut1_ip4_static_adjacency = {'vni': 0,
- 'deid': '6.0.1.0',
- 'seid': '6.0.2.0',
- 'rloc': '6.0.3.1',
- 'prefix': 24}
+ 'deid': src_ip_range,
+ 'seid': dst_ip_range,
+ 'rloc': dut1_to_dut2_ip4,
+ 'prefix': prefix4}
dut1_ip4_eid = {'locator_name': locator_name,
'vni': 0,
- 'eid': '6.0.1.0',
- 'prefix': 24}
+ 'eid': src_ip_range,
+ 'prefix': prefix4}
dut2_ip4_eid = {'locator_name': locator_name,
'vni': 0,
- 'eid': '6.0.2.0',
- 'prefix': 24}
+ 'eid': dst_ip_range,
+ 'prefix': prefix4}
+
+dut1_fib_table = 1
+dut2_fib_table = 2
+
+sock1 = "/tmp/sock1"
+sock2 = "/tmp/sock2"
-dut1_fib_table = '1'
-dut2_fib_table = '2'
+bid = 10