diff options
author | 2016-01-10 17:24:17 +0200 | |
---|---|---|
committer | 2016-01-10 17:24:17 +0200 | |
commit | f1c78acf1648abd6c06a070ef4e6465e5478eab8 (patch) | |
tree | bf9c218903b1082e39e95037ca1274b5465cd13a | |
parent | 1d074bf3b198c1f160f6e636c21c16c9c833ce61 (diff) |
add alloc_error, queue_full, queue_drop stats report via ZMQ
regression:
update kiwi02 and trex08 benchmarks
add common "scripts_dir" variable for usage in tests
configure router with proper MTU in jumbo test
add --local flag for not connecting to remote server (useful for functional tests)
6 files changed, 49 insertions, 20 deletions
diff --git a/scripts/automation/regression/setups/kiwi02/benchmark.yaml b/scripts/automation/regression/setups/kiwi02/benchmark.yaml index 3cb05bcb..c387a994 100644 --- a/scripts/automation/regression/setups/kiwi02/benchmark.yaml +++ b/scripts/automation/regression/setups/kiwi02/benchmark.yaml @@ -78,8 +78,8 @@ test_routing_imix_64 : exp_latency : 1 test_routing_imix : - multiplier : 36 - cores : 4 + multiplier : 35 + cores : 2 cpu_to_core_ratio : 8900 exp_latency : 1 @@ -90,8 +90,8 @@ test_static_routing_imix : dual_port_mask : 1.0.0.0 client_destination_mask : 255.0.0.0 server_destination_mask : 255.0.0.0 - multiplier : 36 - cores : 4 + multiplier : 35 + cores : 2 cpu_to_core_ratio : 3766666 exp_latency : 1 diff --git a/scripts/automation/regression/setups/trex08/benchmark.yaml b/scripts/automation/regression/setups/trex08/benchmark.yaml index 3676abf3..e821149d 100644 --- a/scripts/automation/regression/setups/trex08/benchmark.yaml +++ b/scripts/automation/regression/setups/trex08/benchmark.yaml @@ -34,4 +34,22 @@ test_ipv6_simple : cpu2core_dev : 0.07 +test_rx_check_sfr: + multiplier : 80 + cores : 7 + rx_sample_rate : 128 +test_rx_check_sfr_ipv6_disabled: + multiplier : 80 + cores : 7 + rx_sample_rate : 128 + +test_rx_check_http: + multiplier : 99000 + cores : 3 + rx_sample_rate : 128 + +test_rx_check_http_ipv6_disabled: + multiplier : 99000 + cores : 3 + rx_sample_rate : 128
\ No newline at end of file diff --git a/scripts/automation/regression/trex_unit_test.py b/scripts/automation/regression/trex_unit_test.py index f38eb04e..a844aa2a 100755 --- a/scripts/automation/regression/trex_unit_test.py +++ b/scripts/automation/regression/trex_unit_test.py @@ -60,9 +60,6 @@ def get_trex_path(): raise Exception('Could not determine trex_under_test folder, try setting env.var. TREX_UNDER_TEST') return latest_build_path -DAEMON_STOP_COMMAND = 'cd %s; ./trex_daemon_server stop; sleep 1; ./trex_daemon_server stop;' % get_trex_path() -DAEMON_START_COMMAND = DAEMON_STOP_COMMAND + 'sleep 1; rm /var/log/trex/trex_daemon_server.log; ./trex_daemon_server start; sleep 2; ./trex_daemon_server show' - def _start_stop_trex_remote_server(trex_data, command): # start t-rex server as daemon process # subprocess.call(["/usr/bin/python", "trex_daemon_server", "restart"], cwd = trex_latest_build) @@ -116,9 +113,9 @@ class CTRexTestConfiguringPlugin(Plugin): parser.add_option('--kill-running', '--kill_running', action="store_true", default = False, dest="kill_running", help="Kills running TRex process on remote server (useful for regression).") - parser.add_option('--dave', action="store_true", default = False, - dest="dave", - help="Dave's setup (temporary workaround flag, remove it ASAP).") + parser.add_option('--local', action="store_true", default = False, + dest="local", + help="Don't connect to remote server for runnning daemon (useful for functional tests).") def configure(self, options, conf): if CTRexScenario.setup_dir and options.config_path: @@ -137,22 +134,22 @@ class CTRexTestConfiguringPlugin(Plugin): self.verbose_mode = options.verbose_mode self.clean_config = False if options.skip_clean_config else True self.server_logs = options.server_logs - self.dave = options.dave + self.local = options.local if options.log_path: self.loggerPath = options.log_path def begin (self): - # launch t-rex server on relevant setup - if not self.dave: - start_trex_remote_server(self.configuration.trex, self.kill_running) - # initialize CTRexScenario global testing class, to be used by all tests CTRexScenario.configuration = self.configuration CTRexScenario.benchmark = self.benchmark CTRexScenario.modes = set(self.modes) CTRexScenario.server_logs = self.server_logs - CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'], verbose = self.verbose_mode) + + # launch TRex daemon on relevant setup + if not self.local: + start_trex_remote_server(self.configuration.trex, self.kill_running) + CTRexScenario.trex = CTRexClient(trex_host = self.configuration.trex['trex_name'], verbose = self.verbose_mode) if 'loopback' not in self.modes: CTRexScenario.router_cfg = dict( config_dict = self.configuration.router, forceImageReload = self.load_image, @@ -166,7 +163,7 @@ class CTRexTestConfiguringPlugin(Plugin): def finalize(self, result): CTRexScenario.is_init = False - if not self.dave: + if not self.local: stop_trex_remote_server(self.configuration.trex) @@ -199,6 +196,9 @@ if __name__ == "__main__": long_test = False xml_name = 'unit_test.xml' CTRexScenario.report_dir = 'reports' + CTRexScenario.scripts_dir = get_trex_path() + DAEMON_STOP_COMMAND = 'cd %s; ./trex_daemon_server stop; sleep 1; ./trex_daemon_server stop;' % CTRexScenario.scripts_dir + DAEMON_START_COMMAND = DAEMON_STOP_COMMAND + 'sleep 1; rm /var/log/trex/trex_daemon_server.log; ./trex_daemon_server start; sleep 2; ./trex_daemon_server show' setup_dir = os.getenv('SETUP_DIR', '').rstrip('/') CTRexScenario.setup_dir = check_setup_path(setup_dir) if not CTRexScenario.setup_dir: diff --git a/scripts/automation/regression/unit_tests/trex_general_test.py b/scripts/automation/regression/unit_tests/trex_general_test.py index 92ece30f..efe24711 100755 --- a/scripts/automation/regression/unit_tests/trex_general_test.py +++ b/scripts/automation/regression/unit_tests/trex_general_test.py @@ -55,6 +55,7 @@ class CTRexScenario(): trex_version = None report_dir = 'reports' # logger = None + scripts_dir = None #scenario = CTRexScenario() @@ -150,7 +151,7 @@ class CTRexGeneral_Test(unittest.TestCase): def assert_gt(self, v1, v2, s): if not v1 > v2: - error='ERROR {big} > {small} {str}'.format(big = v1, small = v2, str = s) + error='ERROR {big} < {small} {str}'.format(big = v1, small = v2, str = s) self.fail(error) def check_results_eq (self,res,name,val): @@ -232,6 +233,14 @@ class CTRexGeneral_Test(unittest.TestCase): if ( (trex_drops/trex_tx_pckt) > 0.001) and (trex_drop_rate > 0.0): # deliberately mask kickoff drops when T-Rex first initiated self.fail('Number of packet drops larger than 0.1% of all traffic') + # check queue full, queue drop, allocation error + m_total_alloc_error = trex_res.get_last_value("trex-global.data.m_total_alloc_error") + m_total_queue_full = trex_res.get_last_value("trex-global.data.m_total_queue_full") + m_total_queue_drop = trex_res.get_last_value("trex-global.data.m_total_queue_drop") + self.assert_gt( 999, m_total_alloc_error, 'Got allocation errors. (%s), please review multiplier and templates configuration.' % m_total_alloc_error) + self.assert_gt( max(9999, trex_tx_pckt / 1000 ), m_total_queue_full, 'Too much queue_full (%s), please review multiplier.' % m_total_queue_full) + self.assert_gt( 999, m_total_queue_drop, 'Too much queue_drop (%s), please review multiplier.' % m_total_queue_drop) + # # check T-Rex expected counters #trex_exp_rate = trex_res.get_expected_tx_rate().get('m_tx_expected_bps') #assert trex_exp_rate is not None diff --git a/scripts/automation/regression/unit_tests/trex_imix_test.py b/scripts/automation/regression/unit_tests/trex_imix_test.py index f5ebeb30..770edbb9 100755 --- a/scripts/automation/regression/unit_tests/trex_imix_test.py +++ b/scripts/automation/regression/unit_tests/trex_imix_test.py @@ -169,8 +169,7 @@ class CTRexIMIX_Test(CTRexGeneral_Test): def test_jumbo(self): if not self.is_loopback: - self.skip('Verify drops in router') # TODO: verify and remove ASAP - self.router.configure_basic_interfaces() + self.router.configure_basic_interfaces(mtu = 9216) self.router.config_pbr(mode = "config") mult = self.get_benchmark_param('multiplier') diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp index d3dcb0c5..aba15c28 100755 --- a/src/main_dpdk.cpp +++ b/src/main_dpdk.cpp @@ -2319,6 +2319,9 @@ void CGlobalStats::dump_json(std::string & json){ json+=GET_FIELD(m_tx_expected_cps); json+=GET_FIELD(m_tx_expected_pps); json+=GET_FIELD(m_tx_expected_bps); + json+=GET_FIELD(m_total_alloc_error); + json+=GET_FIELD(m_total_queue_full); + json+=GET_FIELD(m_total_queue_drop); json+=GET_FIELD(m_rx_drop_bps); json+=GET_FIELD(m_active_flows); json+=GET_FIELD(m_open_flows); |