From da8aebf2e722f2c441a03b300de71f9143d010a3 Mon Sep 17 00:00:00 2001 From: Juraj Sloboda Date: Tue, 23 Feb 2016 15:03:13 +0100 Subject: 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 --- resources/libraries/python/topology.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'resources/libraries/python/topology.py') 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,13 +348,30 @@ 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') -- cgit 1.2.3-korg