summaryrefslogtreecommitdiffstats
path: root/scripts/automation
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
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')
-rw-r--r--scripts/automation/regression/stateless_tests/stl_client_test.py5
-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
3 files changed, 22 insertions, 4 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_client_test.py b/scripts/automation/regression/stateless_tests/stl_client_test.py
index 73dac734..2b425101 100644
--- a/scripts/automation/regression/stateless_tests/stl_client_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_client_test.py
@@ -295,7 +295,10 @@ class STLClient_Test(CStlGeneral_Test):
self.c.resume(ports = [self.tx_port, self.rx_port])
time.sleep(100 / 1000.0)
- self.c.stop(ports = [self.tx_port, self.rx_port])
+ if CTRexScenario.setup_name == 'trex07':
+ self.c.stop(ports = [self.tx_port, self.rx_port], rx_delay_ms = 100)
+ else:
+ self.c.stop(ports = [self.tx_port, self.rx_port])
stats = self.c.get_stats()
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'