aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/topology.py
diff options
context:
space:
mode:
authorJuraj Sloboda <jsloboda@cisco.com>2016-02-23 15:03:13 +0100
committerStefan Kobza <skobza@cisco.com>2016-03-07 18:40:42 +0100
commitda8aebf2e722f2c441a03b300de71f9143d010a3 (patch)
tree386aa3af6c6050df29b4b0e850b1098d60b4c7f1 /resources/libraries/python/topology.py
parent8120dcdc84da7ff1dee097240bc1ecf18914397c (diff)
Modify sweep ping test cases
- Write separate sweep ping test cases for jumbo frames - Compute sweep ping end size from reported MTU on DUT interface - Set MTU on TG according to MTU on DUT interface - Log VPP packet traces on IPv4 and IPv6 tests failure - Remove VM_ENV tag from sweep ping test cases for jumbo frames Change-Id: I47aa7977bcff9c4366c67578aef542924a1d055b Signed-off-by: Juraj Sloboda <jsloboda@cisco.com>
Diffstat (limited to 'resources/libraries/python/topology.py')
-rw-r--r--resources/libraries/python/topology.py24
1 files changed, 20 insertions, 4 deletions
diff --git a/resources/libraries/python/topology.py b/resources/libraries/python/topology.py
index e2c069fc98..75542ad070 100644
--- a/resources/libraries/python/topology.py
+++ b/resources/libraries/python/topology.py
@@ -257,6 +257,7 @@ class Topology(object):
format(ifc, if_mac))
ifc['name'] = interface_dict["interface_name"]
ifc['vpp_sw_index'] = interface_dict["sw_if_index"]
+ ifc['mtu'] = interface_dict["mtu"]
def update_vpp_interface_data_on_node(self, node):
"""Update vpp generated interface data for a given node in DICT__nodes
@@ -347,14 +348,31 @@ class Topology(object):
"""
for port in node['interfaces'].values():
port_name = port.get('name')
- if port_name is None:
- continue
if port_name == interface:
return port.get('vpp_sw_index')
return None
@staticmethod
+ def get_interface_mtu(node, interface):
+ """Get interface MTU.
+
+ Returns physical layer MTU (max. size of Ethernet frame).
+ :param node: Node to get interface MTU on.
+ :param interface: Interface name.
+ :type node: dict
+ :type interface: str
+ :return: MTU or None if not found.
+ :rtype: int
+ """
+ for port in node['interfaces'].values():
+ port_name = port.get('name')
+ if port_name == interface:
+ return port.get('mtu')
+
+ return None
+
+ @staticmethod
def get_interface_mac_by_port_key(node, port_key):
"""Get MAC address for the interface based on port key.
@@ -382,8 +400,6 @@ class Topology(object):
"""
for port in node['interfaces'].values():
port_name = port.get('name')
- if port_name is None:
- continue
if port_name == interface:
return port.get('mac_address')