summaryrefslogtreecommitdiffstats
path: root/scripts/automation
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-03-13 11:01:55 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-03-13 11:01:55 +0200
commitdbff547f4d9360d3c48c7b269255234cd31271df (patch)
tree1bbee86b5a4d9d54fa20140f96ea62b7474f8db2 /scripts/automation
parentc8d1f318e2d322626e401c9599ba75006d2e8e6c (diff)
i40e fix of workaround of stuck counters + regression test
Change-Id: I251cb8d346461ccfa4eee8abfda113410160a602 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
Diffstat (limited to 'scripts/automation')
-rwxr-xr-xscripts/automation/regression/misc_methods.py12
-rw-r--r--scripts/automation/regression/setups/trex08/config.yaml1
-rw-r--r--scripts/automation/regression/setups/trex09/config.yaml1
-rw-r--r--scripts/automation/regression/stateless_tests/stl_rx_test.py27
-rwxr-xr-xscripts/automation/regression/trex_unit_test.py3
5 files changed, 36 insertions, 8 deletions
diff --git a/scripts/automation/regression/misc_methods.py b/scripts/automation/regression/misc_methods.py
index d879b038..e8859779 100755
--- a/scripts/automation/regression/misc_methods.py
+++ b/scripts/automation/regression/misc_methods.py
@@ -129,15 +129,13 @@ def load_complete_config_file (filepath):
try:
with open(filepath, 'r') as f:
config = yaml.safe_load(f)
-
+
# Handle TRex configuration
trex_config['trex_name'] = config["trex"]["hostname"]
- trex_config['trex_password'] = config["trex"].get("password")
- #trex_config['trex_is_dual'] = config["trex"]["is_dual"]
trex_config['trex_cores'] = int(config["trex"]["cores"])
- #trex_config['trex_latency'] = int(config["trex"]["latency"])
-# trex_config['trex_version_path'] = config["trex"]["version_path"]
trex_config['modes'] = config['trex'].get('modes', [])
+ for key, val in config['trex'].items():
+ trex_config[key] = val
if 'loopback' not in trex_config['modes']:
trex_config['router_interface'] = config["router"]["ip_address"]
@@ -225,10 +223,10 @@ def load_benchmark_config_file (filepath):
"""
# create response dictionary
- benchmark_config = {}
+ benchmark_config = {}
try:
- with open(filepath, 'r') as f:
+ with open(filepath) as f:
benchmark_config = yaml.safe_load(f)
except Exception as inst:
diff --git a/scripts/automation/regression/setups/trex08/config.yaml b/scripts/automation/regression/setups/trex08/config.yaml
index affe9bc9..8199a6dc 100644
--- a/scripts/automation/regression/setups/trex08/config.yaml
+++ b/scripts/automation/regression/setups/trex08/config.yaml
@@ -37,4 +37,5 @@ trex:
hostname : csi-trex-08
cores : 7
modes : ['loopback']
+ trex_add_args : '--x710-reset-threshold 10000000'
diff --git a/scripts/automation/regression/setups/trex09/config.yaml b/scripts/automation/regression/setups/trex09/config.yaml
index 724de6e7..7eb23743 100644
--- a/scripts/automation/regression/setups/trex09/config.yaml
+++ b/scripts/automation/regression/setups/trex09/config.yaml
@@ -36,3 +36,4 @@ trex:
hostname : csi-trex-09
cores : 2
modes : ['loopback']
+ trex_add_args : '--x710-reset-threshold 10000000'
diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py
index 4e15e03b..347c8e8b 100644
--- a/scripts/automation/regression/stateless_tests/stl_rx_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py
@@ -100,6 +100,7 @@ class STLRX_Test(CStlGeneral_Test):
self.cap = cap
drv_name = port_info['driver']
+ self.drv_name = drv_name
if drv_name == 'net_ixgbe':
self.ipv6_support = False
else:
@@ -613,3 +614,29 @@ class STLRX_Test(CStlGeneral_Test):
except STLError as e:
assert False , '{0}'.format(e)
+
+
+ # counters get stuck in i40e when they are getting to limit.
+ # this test checks our workaround to this issue
+ def test_x710_counters_wraparound(self):
+ if self.drv_name != 'net_i40e':
+ self.skip('Test is only for i40e.')
+
+ percent = min(20, self.speed * 0.8) # 8G at X710 and 20G at XL710
+ total_pkts = 300000000 # send 300 million packets to ensure getting to threshold of reset several times
+
+ s1 = STLStream(name = 'wrapping_stream',
+ packet = self.pkt,
+ flow_stats = STLFlowStats(pg_id = 5),
+ mode = STLTXSingleBurst(total_pkts = total_pkts,
+ percentage = percent))
+
+ # add both streams to ports
+ self.c.add_streams([s1], ports = [self.tx_port])
+
+ print("\ninjecting {0} packets on port {1}\n".format(total_pkts, self.tx_port))
+
+ exp = {'pg_id': 5, 'total_pkts': total_pkts, 'pkt_len': s1.get_pkt_len()}
+
+ self.__rx_iteration( [exp] )
+
diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py
index f915448d..8c07498a 100755
--- a/scripts/automation/regression/trex_unit_test.py
+++ b/scripts/automation/regression/trex_unit_test.py
@@ -394,11 +394,12 @@ class CTRexTestConfiguringPlugin(Plugin):
CTRexScenario.server_logs = self.server_logs
CTRexScenario.debug_image = options.debug_image
CTRexScenario.json_verbose = self.json_verbose
+ additional_args = self.configuration.trex.get('trex_add_args', '')
if not self.no_daemon:
CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'],
verbose = self.json_verbose,
debug_image = options.debug_image,
- trex_args = options.trex_args)
+ trex_args = options.trex_args + ' ' + additional_args)
if self.pkg or self.restart_daemon:
if not CTRexScenario.trex.check_master_connectivity():