How to use _validate_core_counts_are_equal method in lisa

Best Python code snippet using lisa_python

dpdkperf.py

Source:dpdkperf.py Github

copy

Full Screen

...318 ) -> None:319 environment = test_result.environment320 assert environment, "fail to get environment from testresult"321 # run build + validation to populate results322 self._validate_core_counts_are_equal(test_result)323 try:324 if use_queues:325 send_kit, receive_kit = verify_dpdk_send_receive_multi_txrx_queue(326 environment,327 log,328 variables,329 pmd,330 use_max_nics=use_max_nics,331 use_service_cores=service_cores,332 )333 else:334 send_kit, receive_kit = verify_dpdk_send_receive(335 environment,336 log,337 variables,338 pmd,339 use_max_nics=use_max_nics,340 use_service_cores=service_cores,341 )342 except UnsupportedPackageVersionException as err:343 raise SkippedException(err)344 # gather the performance data into message format345 result_messages = self._create_pps_performance_results(346 send_kit, receive_kit, test_result, f"perf_dpdk_{pmd}"347 )348 # pass result messages to notifier349 for message in result_messages:350 notifier.notify(message)351 def _create_pps_performance_results(352 self,353 send_kit: DpdkTestResources,354 receive_kit: DpdkTestResources,355 test_result: TestResult,356 test_case_name: str,357 ) -> Tuple[NetworkPPSPerformanceMessage, NetworkPPSPerformanceMessage]:358 sender_fields: Dict[str, Any] = {}359 receiver_fields: Dict[str, Any] = {}360 # shared results fields361 for result_fields in [sender_fields, receiver_fields]:362 result_fields["tool"] = constants.NETWORK_PERFORMANCE_TOOL_DPDK_TESTPMD363 result_fields["test_type"] = "performance"364 # send side fields365 sender = send_kit.testpmd366 sender_fields["role"] = "sender"367 sender_fields["tx_pps_maximum"] = sender.get_max_tx_pps()368 sender_fields["tx_pps_average"] = sender.get_mean_tx_pps()369 sender_fields["tx_pps_minimum"] = sender.get_min_tx_pps()370 # receive side fields371 receiver = receive_kit.testpmd372 receiver_fields["role"] = "receiver/forwarder"373 receiver_fields["rx_pps_maximum"] = receiver.get_max_rx_pps()374 receiver_fields["rx_pps_average"] = receiver.get_mean_rx_pps()375 receiver_fields["rx_pps_minimum"] = receiver.get_min_rx_pps()376 send_results = create_perf_message(377 NetworkPPSPerformanceMessage,378 send_kit.node,379 test_result,380 test_case_name,381 sender_fields,382 )383 receive_results = create_perf_message(384 NetworkPPSPerformanceMessage,385 receive_kit.node,386 test_result,387 test_case_name,388 receiver_fields,389 )390 return send_results, receive_results391 def _validate_core_counts_are_equal(self, test_result: TestResult) -> None:392 environment = test_result.environment393 assert environment, "fail to get environment from testresult"394 core_counts = [395 n.tools[Lscpu].get_core_count() for n in environment.nodes.list()396 ]397 assert_that(core_counts).described_as(398 "Nodes contain different core counts, DPDK Suite expects sender "399 "and receiver to have same core count."...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run lisa automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful