summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYaroslav Brustinov <ybrustin@cisco.com>2017-03-08 01:25:25 +0200
committerYaroslav Brustinov <ybrustin@cisco.com>2017-03-08 01:25:25 +0200
commitdb0cc224d615a096e147b630a60b50e21a99c445 (patch)
tree47775d343c6db0ef5feb26958ee418a99d2f23f2
parent5927d1dd045f17d4a618c5e50dd9d32bdbd4cbbb (diff)
Regression: fix Python3 list of ports, update trex21 benchmark, other minor changes
Change-Id: Iad785f8c505af487e201751ad8a8bfb03205cb73 Signed-off-by: Yaroslav Brustinov <ybrustin@cisco.com>
-rw-r--r--scripts/automation/regression/setups/trex21/benchmark.yaml4
-rw-r--r--scripts/automation/regression/stateless_tests/stl_client_test.py36
-rw-r--r--scripts/automation/regression/stateless_tests/stl_rx_test.py2
-rwxr-xr-xscripts/automation/regression/trex_unit_test.py7
-rwxr-xr-xscripts/automation/trex_control_plane/server/trex_server.py1
5 files changed, 23 insertions, 27 deletions
diff --git a/scripts/automation/regression/setups/trex21/benchmark.yaml b/scripts/automation/regression/setups/trex21/benchmark.yaml
index b366b3fb..8d77ae34 100644
--- a/scripts/automation/regression/setups/trex21/benchmark.yaml
+++ b/scripts/automation/regression/setups/trex21/benchmark.yaml
@@ -153,3 +153,7 @@ test_CPU_benchmark:
bw_per_core : 1
+test_all_profiles :
+ mult : "0.3%"
+ skip : [mac]
+
diff --git a/scripts/automation/regression/stateless_tests/stl_client_test.py b/scripts/automation/regression/stateless_tests/stl_client_test.py
index eb046e38..b9e17487 100644
--- a/scripts/automation/regression/stateless_tests/stl_client_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_client_test.py
@@ -172,11 +172,11 @@ class STLClient_Test(CStlGeneral_Test):
# cont. with duration should be quite percise - 5% error is relaxed enough
- assert get_error_in_percentage(stats[self.tx_port]['opackets'], golden) < 0.05
- assert get_error_in_percentage(stats[self.rx_port]['ipackets'], golden) < 0.05
+ assert get_error_in_percentage(golden, stats[self.tx_port]['opackets']) < 0.05
+ assert get_error_in_percentage(golden, stats[self.rx_port]['ipackets']) < 0.05
- assert get_error_in_percentage(stats[self.rx_port]['opackets'], golden) < 0.05
- assert get_error_in_percentage(stats[self.tx_port]['ipackets'], golden) < 0.05
+ assert get_error_in_percentage(golden, stats[self.rx_port]['opackets']) < 0.05
+ assert get_error_in_percentage(golden, stats[self.tx_port]['ipackets']) < 0.05
self.c.remove_all_streams(ports = [self.tx_port, self.rx_port])
@@ -244,23 +244,17 @@ class STLClient_Test(CStlGeneral_Test):
skip_tests = self.get_benchmark_param('skip',default=[])
try:
- print("\n");
-
-
for profile in self.profiles:
+ print('\nProfile: %s' % profile[len(CTRexScenario.scripts_path):]);
- skip=False
- if skip_tests:
- for skip_test in skip_tests:
- if skip_test in profile:
- skip=True;
- break;
+ skip = False
+ for skip_test in skip_tests:
+ if skip_test in profile:
+ skip = True
+ break
if skip:
- print("skipping testing profile due to config file {0}...\n".format(profile))
- continue;
-
-
- print("now testing profile {0}...\n".format(profile))
+ print(' * Skip due to config file...')
+ continue
p1 = STLProfile.load(profile, port_id = self.tx_port)
p2 = STLProfile.load(profile, port_id = self.rx_port)
@@ -271,16 +265,16 @@ class STLClient_Test(CStlGeneral_Test):
if p1.has_custom_mac_addr() or p2.has_custom_mac_addr():
if self.is_virt_nics:
- print("\n*** profile needs promiscuous mode but running on virtual NICs - skipping... ***\n")
+ print(" * Skip due to Virtual NICs and promiscuous mode requirement...")
continue
elif self.is_vf_nics:
- print("\n*** profile needs promiscuous mode but running on VF - skipping... ***\n")
+ print(" * Skip due to VF NICs and promiscuous mode requirement...")
continue
else:
self.c.set_port_attr(ports = [self.tx_port, self.rx_port], promiscuous = True)
if p1.has_flow_stats() or p2.has_flow_stats():
- print("\n*** profile needs RX caps - skipping... ***\n")
+ print(" * Skip due to RX caps requirement")
continue
self.c.add_streams(p1, ports = self.tx_port)
diff --git a/scripts/automation/regression/stateless_tests/stl_rx_test.py b/scripts/automation/regression/stateless_tests/stl_rx_test.py
index 67352542..4e15e03b 100644
--- a/scripts/automation/regression/stateless_tests/stl_rx_test.py
+++ b/scripts/automation/regression/stateless_tests/stl_rx_test.py
@@ -540,7 +540,7 @@ class STLRX_Test(CStlGeneral_Test):
def _run_fcs_stream (self,is_vm):
""" this test send 1 64 byte packet with latency and check that all counters are reported as 64 bytes"""
try:
- ports = CTRexScenario.stl_ports_map['map'].keys()
+ ports = list(CTRexScenario.stl_ports_map['map'].keys())
for lat in [True, False]:
print("\nSending from ports: {0}, has latency: {1} ".format(ports, lat))
self.send_1_burst(ports, lat, 100)
diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py
index 6d7f26f6..f915448d 100755
--- a/scripts/automation/regression/trex_unit_test.py
+++ b/scripts/automation/regression/trex_unit_test.py
@@ -483,12 +483,11 @@ class CTRexTestConfiguringPlugin(Plugin):
fatal('Could not restart TRex daemon server')
print('Restarted.')
+ if not self.no_daemon:
if self.kill_running:
client.kill_all_trexes()
- else:
- if client.get_trex_cmds():
- fatal('TRex is already running')
- if not self.no_daemon:
+ elif client.get_trex_cmds():
+ fatal('TRex is already running. Use --kill-running flag to kill it.')
try:
client.check_server_connectivity()
except Exception as e:
diff --git a/scripts/automation/trex_control_plane/server/trex_server.py b/scripts/automation/trex_control_plane/server/trex_server.py
index bcbec069..ecc72bd0 100755
--- a/scripts/automation/trex_control_plane/server/trex_server.py
+++ b/scripts/automation/trex_control_plane/server/trex_server.py
@@ -42,7 +42,6 @@ logger = logging.getLogger('TRexServer')
class CTRexServer(object):
"""This class defines the server side of the RESTfull interaction with TRex"""
- DEFAULT_TREX_PATH = '/auto/proj-pcube-b/apps/PL-b/tools/bp_sim2/v1.55/' #'/auto/proj-pcube-b/apps/PL-b/tools/nightly/trex_latest'
TREX_START_CMD = './t-rex-64'
DEFAULT_FILE_PATH = '/tmp/trex_files/'