aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorMatus Fabian <matfabia@cisco.com>2016-02-24 15:49:15 +0100
committerMatus Fabian <matfabia@cisco.com>2016-02-24 15:50:06 +0100
commitafe018f552088c2bafbbf3e2e9bd7734db70e283 (patch)
treeff46b337c430551726cb7bf62c60076be163acb0 /resources
parent705d285dff5ef8f678a0f89f2afed91eec7e6966 (diff)
vpp_ra_supress_link_layer run VAT tempalte
Change-Id: I7385650a1c9502b430c9f8022f8c298be52deba8 Signed-off-by: Matus Fabian <matfabia@cisco.com>
Diffstat (limited to 'resources')
-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}