Best Python code snippet using lisa_python
nestedperf.py
Source:nestedperf.py  
...474                bridge_cidr=self._BR_CIDR,475                bridge_gateway=self._BR_GATEWAY,476            )477            # run netperf test478            perf_tcp_pps(result, "singlepps", server_l2, client_l2)479        finally:480            self._linux_cleanup_nat(server_l1, self._BR_NAME, log)481            self._linux_cleanup_nat(client_l1, self._BR_NAME, log)482    def _linux_setup_nat(483        self,484        node: RemoteNode,485        nested_vm_name: str,486        guest_username: str,487        guest_password: str,488        guest_port: int,489        guest_image_url: str,490        guest_internal_ip: str,491        guest_default_nic: str,492        bridge_name: str,...common.py
Source:common.py  
...141    finally:142        for lagscope in [client_lagscope, server_lagscope]:143            lagscope.restore_busy_poll()144    return latency_perf_messages145def perf_tcp_pps(146    test_result: TestResult,147    test_type: str,148    server: Optional[RemoteNode] = None,149    client: Optional[RemoteNode] = None,150) -> None:151    # Either server and client are set explicitly or we use the first two nodes152    # from the environment. We never combine the two options. We need to specify153    # server and client explicitly for nested VM's which are not part of the154    # `environment` and are created during the test.155    if server is not None or client is not None:156        assert server is not None, "server need to be specified, if client is set"157        assert client is not None, "client need to be specified, if server is set"158    else:159        environment = test_result.environment...networkperf.py
Source:networkperf.py  
...70            network_interface=Synthetic(),71        ),72    )73    def perf_tcp_single_pps_synthetic(self, result: TestResult) -> None:74        perf_tcp_pps(result, "singlepps")75    @TestCaseMetadata(76        description="""77        This test case uses sar to test sriov network PPS (Packets Per Second)78         when running netperf with single port.79        """,80        priority=3,81        timeout=PPS_TIMEOUT,82        requirement=simple_requirement(83            min_count=2,84            network_interface=Sriov(),85        ),86    )87    def perf_tcp_single_pps_sriov(self, result: TestResult) -> None:88        perf_tcp_pps(result, "singlepps")89    @TestCaseMetadata(90        description="""91        This test case uses sar to test synthetic network PPS (Packets Per Second)92         when running netperf with multiple ports.93        """,94        priority=3,95        timeout=PPS_TIMEOUT,96        requirement=simple_requirement(97            min_count=2,98            network_interface=Synthetic(),99        ),100    )101    def perf_tcp_max_pps_synthetic(self, result: TestResult) -> None:102        perf_tcp_pps(result, "maxpps")103    @TestCaseMetadata(104        description="""105        This test case uses sar to test sriov network PPS (Packets Per Second)106         when running netperf with multiple ports.107        """,108        priority=3,109        timeout=PPS_TIMEOUT,110        requirement=simple_requirement(111            min_count=2,112            network_interface=Sriov(),113        ),114    )115    def perf_tcp_max_pps_sriov(self, result: TestResult) -> None:116        perf_tcp_pps(result, "maxpps")117    @TestCaseMetadata(118        description="""119        This test case uses ntttcp to test synthetic tcp network throughput for120         128 connections.121        """,122        priority=2,123        timeout=TIMEOUT,124        requirement=simple_requirement(125            min_count=2,126            network_interface=Synthetic(),127        ),128    )129    def perf_tcp_ntttcp_128_connections_synthetic(self, result: TestResult) -> None:130        perf_ntttcp(result, connections=[128])...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!!
