diff options
6 files changed, 37 insertions, 56 deletions
diff --git a/scripts/automation/regression/stateless_tests/stl_examples_test.py b/scripts/automation/regression/stateless_tests/stl_examples_test.py index d8b85dfc..71fc3287 100755 --- a/scripts/automation/regression/stateless_tests/stl_examples_test.py +++ b/scripts/automation/regression/stateless_tests/stl_examples_test.py @@ -10,14 +10,12 @@ class STLExamples_Test(CStlGeneral_Test): def explicitSetUp(self): # examples connect by their own if self.is_connected(): - self.recover_after_trex_210_issue() CTRexScenario.stl_trex.disconnect() def explicitTearDown(self): # connect back at end of tests if not self.is_connected(): self.stl_trex.connect() - self.recover_after_trex_210_issue() def test_stl_examples(self): examples_dir = '../trex_control_plane/stl/examples' diff --git a/scripts/automation/regression/stateless_tests/stl_general_test.py b/scripts/automation/regression/stateless_tests/stl_general_test.py index 3a22e596..5ae2b326 100644 --- a/scripts/automation/regression/stateless_tests/stl_general_test.py +++ b/scripts/automation/regression/stateless_tests/stl_general_test.py @@ -6,10 +6,6 @@ from trex_stl_lib.api import * import time from nose.tools import nottest -def setUpModule(): - if CTRexScenario.stl_trex.is_connected(): - CStlGeneral_Test.recover_after_trex_210_issue() - class CStlGeneral_Test(CTRexGeneral_Test): """This class defines the general stateless testcase of the TRex traffic generator""" @@ -20,21 +16,6 @@ class CStlGeneral_Test(CTRexGeneral_Test): if CTRexScenario.stl_init_error: self.skip(CTRexScenario.stl_init_error) - # workaround of http://trex-tgn.cisco.com/youtrack/issue/trex-210 - @staticmethod - def recover_after_trex_210_issue(): - return - for i in range(20): - try: - stl_map_ports(CTRexScenario.stl_trex) - break - except: - CTRexScenario.stl_trex.disconnect() - time.sleep(0.5) - CTRexScenario.stl_trex.connect() - # verify problem is solved - stl_map_ports(CTRexScenario.stl_trex) - def connect(self, timeout = 100): # need delay and check only because TRex process might be still starting sys.stdout.write('Connecting') diff --git a/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py b/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py index 905882fe..14ef36f7 100755 --- a/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py +++ b/scripts/automation/regression/stateless_tests/trex_client_pkg_test.py @@ -3,9 +3,6 @@ from .stl_general_test import CStlGeneral_Test, CTRexScenario from misc_methods import run_command from nose.plugins.attrib import attr -def setUpModule(): - CStlGeneral_Test.unzip_client_package() - @attr('client_package') class CTRexClientPKG_Test(CStlGeneral_Test): """This class tests TRex client package""" @@ -14,14 +11,13 @@ class CTRexClientPKG_Test(CStlGeneral_Test): CStlGeneral_Test.setUp(self) # examples connect by their own if CTRexScenario.stl_trex.is_connected(): - self.recover_after_trex_210_issue() CTRexScenario.stl_trex.disconnect() + CStlGeneral_Test.unzip_client_package() def tearDown(self): # connect back at end of tests if not CTRexScenario.stl_trex.is_connected(): CTRexScenario.stl_trex.connect() - self.recover_after_trex_210_issue() CStlGeneral_Test.tearDown(self) def run_client_package_stl_example(self, python_version): diff --git a/scripts/automation/regression/trex.py b/scripts/automation/regression/trex.py index 7286b166..aad8f041 100644 --- a/scripts/automation/regression/trex.py +++ b/scripts/automation/regression/trex.py @@ -38,7 +38,6 @@ class CTRexScenario: is_copied = False GAManager = None no_daemon = False - router_image = None debug_image = False test = None diff --git a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py index e46a4ee3..ecf6083b 100755 --- a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py +++ b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py @@ -73,6 +73,8 @@ class CTRexClient(object): sets a verbose output on supported class method. default value : **False** + trex_args : string + additional arguments passed to TRex. For example, "-w 3 --no-watchdog" :raises: socket errors, in case server could not be reached. @@ -82,22 +84,23 @@ class CTRexClient(object): self.trex_host = socket.gethostbyname(trex_host) except: # give it another try self.trex_host = socket.gethostbyname(trex_host) - self.trex_daemon_port = trex_daemon_port - self.master_daemon_port = master_daemon_port - self.trex_zmq_port = trex_zmq_port - self.seq = None - self._last_sample = time.time() - self.__default_user = get_current_user() - self.verbose = verbose - self.result_obj = CTRexResult(max_history_size, filtered_latency_amount) - self.decoder = JSONDecoder() - self.history = jsonrpclib.history.History() - self.master_daemon_path = "http://{hostname}:{port}/".format( hostname = self.trex_host, port = master_daemon_port ) - self.master_daemon = jsonrpclib.Server(self.master_daemon_path, history = self.history) - self.trex_server_path = "http://{hostname}:{port}/".format( hostname = self.trex_host, port = trex_daemon_port ) - self.server = jsonrpclib.Server(self.trex_server_path, history = self.history) - self.debug_image = debug_image - self.trex_args = trex_args + self.trex_daemon_port = trex_daemon_port + self.master_daemon_port = master_daemon_port + self.trex_zmq_port = trex_zmq_port + self.seq = None + self._last_sample = time.time() + self.__default_user = get_current_user() + self.verbose = verbose + self.result_obj = CTRexResult(max_history_size, filtered_latency_amount) + self.decoder = JSONDecoder() + self.history = jsonrpclib.history.History() + self.master_daemon_path = "http://{hostname}:{port}/".format( hostname = self.trex_host, port = master_daemon_port ) + self.master_daemon = jsonrpclib.Server(self.master_daemon_path, history = self.history) + self.trex_server_path = "http://{hostname}:{port}/".format( hostname = self.trex_host, port = trex_daemon_port ) + self.server = jsonrpclib.Server(self.trex_server_path, history = self.history) + self.debug_image = debug_image + self.trex_args = trex_args + self.sample_to_run_finish = self.sample_until_finish # alias for legacy def add (self, x, y): @@ -579,9 +582,9 @@ class CTRexClient(object): # this could come from provided method 'condition_func' raise - def sample_to_run_finish (self, time_between_samples = 1): + def sample_until_finish (self, time_between_samples = 1): """ - Automatically sets automatically sampling of TRex data with sampling rate described by time_between_samples until TRex run finished. + Automatically samples TRex data with sampling rate described by time_between_samples until TRex run finishes. :parameters: time_between_samples : int @@ -637,12 +640,12 @@ class CTRexClient(object): """ # make sure TRex is running. raise exceptions here if any self.wait_until_kickoff_finish() - elapsed_time = 0 + end_time = time.time() + sample_time while self.is_running(): - if elapsed_time >= sample_time: + if time.time() < end_time: + time.sleep(time_between_samples) + else: return self.get_result_obj() - time.sleep(time_between_samples) - elapsed_time += time_between_samples raise UserWarning("TRex has stopped at %s seconds (before expected %s seconds)\nTry increasing test duration or decreasing sample_time" % (elapsed_time, sample_time)) def get_result_obj (self, copy_obj = True): @@ -1387,11 +1390,17 @@ class CTRexResult(object): # handle latency data if self.latency_checked: - latency_per_port = self.get_last_value("trex-latecny-v2.data", "port-") + # fix typos, by "pointer" + if 'trex-latecny-v2' in latest_dump and 'trex-latency-v2' not in latest_dump: + latest_dump['trex-latency-v2'] = latest_dump['trex-latecny-v2'] + if 'trex-latecny' in latest_dump and 'trex-latency' not in latest_dump: + latest_dump['trex-latency'] = latest_dump['trex-latecny'] + + latency_per_port = self.get_last_value("trex-latency-v2.data", "port-") self._max_latency = self.__get_filtered_max_latency(latency_per_port, self.filtered_latency_amount) - avg_latency = self.get_last_value("trex-latecny.data", "avg-") + avg_latency = self.get_last_value("trex-latency.data", "avg-") self._avg_latency = CTRexResult.__avg_all_and_rename_keys(avg_latency) - avg_win_latency_list = self.get_value_list("trex-latecny.data", "avg-") + avg_win_latency_list = self.get_value_list("trex-latency.data", "avg-") self._avg_window_latency = CTRexResult.__calc_latency_win_stats(avg_win_latency_list) tx_pkts = CTRexResult.__get_value_by_path(latest_dump, "trex-global.data.m_total_tx_pkts") diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index 1e206f27..a2bfefe3 100644 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -5542,11 +5542,10 @@ void CTRexExtendedDriverBase40G::get_extended_stats(CPhyEthIF * _if,CPhyEthIFSta stats->f_ibytes = 0; - stats->ierrors = stats1.ierrors + stats1.imissed + stats1.ibadcrc + + stats->ierrors = stats1.imissed + stats1.ibadcrc + stats1.ibadlen + stats1.ierrors + stats1.oerrors + - stats1.imcasts + stats1.rx_nombuf + stats1.tx_pause_xon + stats1.rx_pause_xon + @@ -5616,11 +5615,10 @@ void CTRexExtendedDriverBase1GVm::get_extended_stats(CPhyEthIF * _if,CPhyEthIFSt stats->f_ibytes = 0; - stats->ierrors = stats1.ierrors + stats1.imissed + stats1.ibadcrc + + stats->ierrors = stats1.imissed + stats1.ibadcrc + stats1.ibadlen + stats1.ierrors + stats1.oerrors + - stats1.imcasts + stats1.rx_nombuf + stats1.tx_pause_xon + stats1.rx_pause_xon + |