summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-01-03 15:17:58 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-01-03 15:17:58 +0200
commit04ecbc54655938241a5e753bdc770d20e1ec5289 (patch)
treee72a79b6d0b5326bc123f90b00bba6a124be0d21 /scripts/automation/trex_control_plane/stl/trex_stl_lib
parent39da7bf1856b1ee32e40d4275b4e89d8f97907dd (diff)
Stateless API: increase delay in remove rx filters to 100ms in case of virtual NICs.
Regression: increase delay in remove rx filters in trex07 to 100ms in test_all_profiles test. Change-Id: Ia7dda25c94aeadcaae0b16023f6ea2957a99906f Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib')
-rwxr-xr-xscripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py16
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py5
2 files changed, 18 insertions, 3 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
index e163d516..e20de3da 100755
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
@@ -2342,7 +2342,7 @@ class STLClient(object):
@__api_check(True)
- def stop (self, ports = None, rx_delay_ms = 10):
+ def stop (self, ports = None, rx_delay_ms = None):
"""
Stop port(s)
@@ -2376,6 +2376,12 @@ class STLClient(object):
if not rc:
raise STLError(rc)
+ if rx_delay_ms is None:
+ if self.ports[ports[0]].is_virtual(): # assume all ports have same type
+ rx_delay_ms = 100
+ else:
+ rx_delay_ms = 10
+
# remove any RX filters
rc = self._remove_rx_filters(ports, rx_delay_ms = rx_delay_ms)
if not rc:
@@ -2847,7 +2853,7 @@ class STLClient(object):
@__api_check(True)
- def wait_on_traffic (self, ports = None, timeout = None, rx_delay_ms = 10):
+ def wait_on_traffic (self, ports = None, timeout = None, rx_delay_ms = None):
"""
.. _wait_on_traffic:
@@ -2891,6 +2897,12 @@ class STLClient(object):
if timer.has_expired():
raise STLTimeoutError(timeout)
+ if rx_delay_ms is None:
+ if self.ports[ports[0]].is_virtual(): # assume all ports have same type
+ rx_delay_ms = 100
+ else:
+ rx_delay_ms = 10
+
# remove any RX filters
rc = self._remove_rx_filters(ports, rx_delay_ms = rx_delay_ms)
if not rc:
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index 07587b9f..8b6b2e2e 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -930,7 +930,10 @@ class Port(object):
def get_rx_filter_mode (self):
return self.__attr['rx_filter_mode']
-
+
+ def is_virtual(self):
+ return self.info.get('is_virtual')
+
def is_l3_mode (self):
return self.get_layer_cfg()['ipv4']['state'] != 'none'