aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--resources/libraries/python/IPv6Setup.py17
-rw-r--r--resources/templates/vat/sw_interface_ip6nd_ra_config.vat1
2 files changed, 7 insertions, 11 deletions
diff --git a/resources/libraries/python/IPv6Setup.py b/resources/libraries/python/IPv6Setup.py
index 0798a98f4d..86c8876e89 100644
--- a/resources/libraries/python/IPv6Setup.py
+++ b/resources/libraries/python/IPv6Setup.py
@@ -17,7 +17,7 @@ from ssh import SSH
from ipaddress import IPv6Network
from topology import NodeType, Topology
from constants import Constants
-from VatExecutor import VatTerminal
+from VatExecutor import VatTerminal, VatExecutor
from robot.api import logger
@@ -213,16 +213,11 @@ class IPv6Setup(object):
:type node: dict
:type interface: str
"""
- ssh = SSH()
- ssh.connect(node)
-
- cmd = '{c}'.format(c=Constants.VAT_BIN_NAME)
- cmd_input = 'exec ip6 nd {0} ra-surpress-link-layer'.format(
- interface)
- (ret_code, _, _) = ssh.exec_command_sudo(cmd, cmd_input)
- if int(ret_code) != 0:
- raise Exception("'{0}' failed on {1}".format(cmd_input,
- node['host']))
+ sw_if_index = Topology.get_interface_sw_index(node, interface)
+ VatExecutor.cmd_from_template(node,
+ 'sw_interface_ip6nd_ra_config.vat',
+ sw_if_id=sw_if_index,
+ param='surpress')
def vpp_all_ra_supress_link_layer(self, nodes):
"""Supress ICMPv6 router advertisement message for link scope address
diff --git a/resources/templates/vat/sw_interface_ip6nd_ra_config.vat b/resources/templates/vat/sw_interface_ip6nd_ra_config.vat
new file mode 100644
index 0000000000..09c7320ca7
--- /dev/null
+++ b/resources/templates/vat/sw_interface_ip6nd_ra_config.vat
@@ -0,0 +1 @@
+sw_interface_ip6nd_ra_config sw_if_index {sw_if_id} {param}