aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Gelety <jgelety@cisco.com>2019-05-11 06:52:56 +0200
committerVratko Polak <vrpolak@cisco.com>2019-05-15 12:10:37 +0000
commit9fdc420129db69d20c8f603c15205f2aaf375d66 (patch)
tree8800a1ef0b94d9acbc55058320f9396c8ab7686e
parent619cbff63ab7570bb904acccd627d65f328a1e9a (diff)
Update of VPP_STABLE_VER files + quick fix for gre create tunnel
- use new vpp ref build - ubuntu 16.04: 19.08-rc0~212-gf6c7aec~b7060 - use new vpp ref build - ubuntu 18.04: 19.08-rc0~212-gf6c7aec95 - use new vpp ref build - centos7: 19.08-rc0~212_gf6c7aec~b6916 Change-Id: Ifd042fae1a46b07a5f463309f2b9cceb8054412f Signed-off-by: Jan Gelety <jgelety@cisco.com>
-rw-r--r--VPP_STABLE_VER_CENTOS2
-rw-r--r--VPP_STABLE_VER_UBUNTU2
-rw-r--r--VPP_STABLE_VER_UBUNTU_BIONIC2
-rw-r--r--resources/libraries/python/Constants.py3
-rw-r--r--resources/libraries/python/InterfaceUtil.py52
-rw-r--r--resources/templates/vat/create_gre.vat2
6 files changed, 40 insertions, 23 deletions
diff --git a/VPP_STABLE_VER_CENTOS b/VPP_STABLE_VER_CENTOS
index 27d7a1b9d9..f4d323fddd 100644
--- a/VPP_STABLE_VER_CENTOS
+++ b/VPP_STABLE_VER_CENTOS
@@ -1 +1 @@
-19.08-rc0~14_g4e08316~b6690 \ No newline at end of file
+19.08-rc0~212_gf6c7aec~b6916 \ No newline at end of file
diff --git a/VPP_STABLE_VER_UBUNTU b/VPP_STABLE_VER_UBUNTU
index 83c047246d..bfe1436bc3 100644
--- a/VPP_STABLE_VER_UBUNTU
+++ b/VPP_STABLE_VER_UBUNTU
@@ -1 +1 @@
-19.08-rc0~14-g4e08316~b6856 \ No newline at end of file
+19.08-rc0~212-gf6c7aec~b7060 \ No newline at end of file
diff --git a/VPP_STABLE_VER_UBUNTU_BIONIC b/VPP_STABLE_VER_UBUNTU_BIONIC
index 7a1d7298ca..196d1f405c 100644
--- a/VPP_STABLE_VER_UBUNTU_BIONIC
+++ b/VPP_STABLE_VER_UBUNTU_BIONIC
@@ -1 +1 @@
-19.08-rc0~14-g4e08316f3 \ No newline at end of file
+19.08-rc0~212-gf6c7aec95 \ No newline at end of file
diff --git a/resources/libraries/python/Constants.py b/resources/libraries/python/Constants.py
index 0f0003a763..72310ba8ce 100644
--- a/resources/libraries/python/Constants.py
+++ b/resources/libraries/python/Constants.py
@@ -91,6 +91,9 @@ class Constants(object):
# Core dump directory
CORE_DUMP_DIR = '/tmp'
+ # Equivalent to ~0 used in vpp code
+ BITWISE_NON_ZERO = 0xffffffff
+
# Mapping from NIC name to its bps limit.
# TODO: Implement logic to lower limits to TG NIC or software. Or PCI.
NIC_NAME_TO_LIMIT = {
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 1b1dda5726..3f268092e3 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -13,15 +13,19 @@
"""Interface util library."""
+from socket import AF_INET, AF_INET6, inet_ntop, inet_pton
+from socket import error as inet_error
from time import time, sleep
from robot.api import logger
+from resources.libraries.python.Constants import Constants
from resources.libraries.python.CpuUtils import CpuUtils
from resources.libraries.python.DUTSetup import DUTSetup
from resources.libraries.python.PapiExecutor import PapiExecutor
from resources.libraries.python.IPUtil import convert_ipv4_netmask_prefix
from resources.libraries.python.IPUtil import IPUtil
+from resources.libraries.python.PapiExecutor import PapiExecutor
from resources.libraries.python.parsers.JsonParser import JsonParser
from resources.libraries.python.ssh import SSH, exec_cmd_no_error
from resources.libraries.python.topology import NodeType, Topology
@@ -878,28 +882,38 @@ class InterfaceUtil(object):
:rtype: tuple
:raises RuntimeError: If unable to create GRE tunnel interface.
"""
- output = VatExecutor.cmd_from_template(node, "create_gre.vat",
- src=source_ip,
- dst=destination_ip)
- output = output[0]
- if output["retval"] == 0:
- sw_if_idx = output["sw_if_index"]
-
- vat_executor = VatExecutor()
- vat_executor.execute_script_json_out("dump_interfaces.vat", node)
- interface_dump_json = vat_executor.get_script_stdout()
- name = VatJsonUtil.get_interface_name_from_json(
- interface_dump_json, sw_if_idx)
+ try:
+ src_address = inet_pton(AF_INET6, source_ip)
+ dst_address = inet_pton(AF_INET6, destination_ip)
+ is_ipv6 = 1
+ except inet_error:
+ src_address = inet_pton(AF_INET, source_ip)
+ dst_address = inet_pton(AF_INET, destination_ip)
+ is_ipv6 = 0
+
+ cmd = 'gre_tunnel_add_del'
+ tunnel = dict(type=0,
+ instance=Constants.BITWISE_NON_ZERO,
+ src=src_address,
+ dst=dst_address,
+ outer_fib_id=0,
+ session_id=0)
+ args = dict(is_add=1,
+ tunnel=tunnel)
+ err_msg = 'Failed to create GRE tunnel interface on host {host}'.format(
+ host=node['host'])
+ with PapiExecutor(node) as papi_exec:
+ papi_resp = papi_exec.add(cmd, **args).get_replies(err_msg).\
+ verify_reply(err_msg=err_msg)
- if_key = Topology.add_new_port(node, "gre_tunnel")
- Topology.update_interface_sw_if_index(node, if_key, sw_if_idx)
- Topology.update_interface_name(node, if_key, name)
+ sw_if_idx = papi_resp['sw_if_index']
+ if_key = Topology.add_new_port(node, 'gre_tunnel')
+ Topology.update_interface_sw_if_index(node, if_key, sw_if_idx)
+ ifc_name = InterfaceUtil.vpp_get_interface_name(node, sw_if_idx)
+ Topology.update_interface_name(node, if_key, ifc_name)
- return name, sw_if_idx
- else:
- raise RuntimeError('Unable to create GRE tunnel on node {}.'
- .format(node))
+ return ifc_name, sw_if_idx
@staticmethod
def vpp_create_loopback(node):
diff --git a/resources/templates/vat/create_gre.vat b/resources/templates/vat/create_gre.vat
index 26cdcfb9b8..af692a76a2 100644
--- a/resources/templates/vat/create_gre.vat
+++ b/resources/templates/vat/create_gre.vat
@@ -1 +1 @@
-gre_add_del_tunnel src {src} dst {dst}
+exec create gre tunnel src {src} dst {dst}