Best Python code snippet using lisa_python
dpdktestpmd.py
Source:dpdktestpmd.py  
...356        )357        self.tx_pps_data = self.get_data_from_testpmd_output(358            self._tx_pps_key, self._last_run_output359        )360    def get_mean_rx_pps(self) -> int:361        self._check_pps_data("RX")362        return _mean(self.rx_pps_data)363    def get_mean_tx_pps(self) -> int:364        self._check_pps_data("TX")365        return _mean(self.tx_pps_data)366    def get_max_rx_pps(self) -> int:367        self._check_pps_data("RX")368        return max(self.rx_pps_data)369    def get_max_tx_pps(self) -> int:370        self._check_pps_data("TX")371        return max(self.tx_pps_data)372    def get_min_rx_pps(self) -> int:373        self._check_pps_data("RX")374        return min(self.rx_pps_data)...dpdkutil.py
Source:dpdkutil.py  
...381    results = run_testpmd_concurrent(kit_cmd_pairs, 15, log)382    # helpful to have the outputs labeled383    log.debug(f"\nSENDER:\n{results[sender]}")384    log.debug(f"\nRECEIVER:\n{results[receiver]}")385    rcv_rx_pps = receiver.testpmd.get_mean_rx_pps()386    snd_tx_pps = sender.testpmd.get_mean_tx_pps()387    log.info(f"receiver rx-pps: {rcv_rx_pps}")388    log.info(f"sender tx-pps: {snd_tx_pps}")389    # differences in NIC type throughput can lead to different snd/rcv counts390    assert_that(rcv_rx_pps).described_as(391        "Throughput for RECEIVE was below the correct order-of-magnitude"392    ).is_greater_than(2**20)393    assert_that(snd_tx_pps).described_as(394        "Throughput for SEND was below the correct order of magnitude"395    ).is_greater_than(2**20)396    return sender, receiver397def verify_dpdk_send_receive_multi_txrx_queue(398    environment: Environment,399    log: Logger,400    variables: Dict[str, Any],401    pmd: str,402    use_max_nics: bool = False,403    use_service_cores: int = 1,404) -> Tuple[DpdkTestResources, DpdkTestResources]:405    test_kits = init_nodes_concurrent(environment, log, variables, pmd)406    check_send_receive_compatibility(test_kits)407    sender, receiver = test_kits408    kit_cmd_pairs = generate_send_receive_run_info(409        pmd,410        sender,411        receiver,412        txq=4,413        rxq=4,414        use_max_nics=use_max_nics,415        use_service_cores=use_service_cores,416    )417    results = run_testpmd_concurrent(kit_cmd_pairs, 15, log)418    # helpful to have the outputs labeled419    log.debug(f"\nSENDER:\n{results[sender]}")420    log.debug(f"\nRECEIVER:\n{results[receiver]}")421    rcv_rx_pps = receiver.testpmd.get_mean_rx_pps()422    snd_tx_pps = sender.testpmd.get_mean_tx_pps()423    log.info(f"receiver rx-pps: {rcv_rx_pps}")424    log.info(f"sender tx-pps: {snd_tx_pps}")425    # differences in NIC type throughput can lead to different snd/rcv counts426    # check that throughput it greater than 1m pps as a baseline427    assert_that(rcv_rx_pps).described_as(428        "Throughput for RECEIVE was below the correct order-of-magnitude"429    ).is_greater_than(2**20)430    assert_that(snd_tx_pps).described_as(431        "Throughput for SEND was below the correct order of magnitude"432    ).is_greater_than(2**20)...dpdkperf.py
Source:dpdkperf.py  
...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,...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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
