How to use perf_ntttcp method in lisa

Best Python code snippet using lisa_python

nestedperf.py

Source:nestedperf.py Github

copy

Full Screen

...242 )243 client.tools[Ip].up(self._NIC_NAME, persist=True)244 client.capability.network_interface = Synthetic()245 # run ntttcp test246 perf_ntttcp(247 result,248 server,249 client,250 server_nic_name=self._NIC_NAME,251 client_nic_name=self._NIC_NAME,252 test_case_name=inspect.stack()[1][3],253 )254 finally:255 try:256 # stop running QEMU instances257 node.tools[Qemu].delete_vm()258 # clear bridge and taps259 node.tools[Ip].delete_interface(self._BR_NAME)260 except Exception as e:261 log.debug(f"Failed to clean up vm: {e}")262 node.mark_dirty()263 @TestCaseMetadata(264 description="""265 This script runs ntttcp test on two nested VMs on different L1 guests266 connected with NAT267 """,268 priority=3,269 timeout=_TIME_OUT,270 requirement=simple_requirement(271 min_count=2,272 min_core_count=16,273 network_interface=schema.NetworkInterfaceOptionSettings(274 nic_count=search_space.IntRange(min=2),275 ),276 disk=schema.DiskOptionSettings(277 data_disk_count=search_space.IntRange(min=1),278 data_disk_size=search_space.IntRange(min=12),279 ),280 ),281 )282 def perf_nested_kvm_ntttcp_different_l1_nat(283 self,284 result: TestResult,285 variables: Dict[str, Any],286 log: Logger,287 ) -> None:288 environment = result.environment289 assert environment, "fail to get environment from testresult"290 server_l1 = cast(RemoteNode, environment.nodes[0])291 client_l1 = cast(RemoteNode, environment.nodes[1])292 # parse nested image variables293 (294 nested_image_username,295 nested_image_password,296 _,297 nested_image_url,298 ) = parse_nested_image_variables(variables)299 try:300 # setup nested vm on server in NAT configuration301 server_l2 = self._linux_setup_nat(302 node=server_l1,303 nested_vm_name="server_l2",304 guest_username=nested_image_username,305 guest_password=nested_image_password,306 guest_port=self._SERVER_HOST_FWD_PORT,307 guest_image_url=nested_image_url,308 guest_internal_ip=self._SERVER_IP_ADDR,309 guest_default_nic=self._NIC_NAME,310 bridge_name=self._BR_NAME,311 bridge_network=self._BR_NETWORK,312 bridge_cidr=self._BR_CIDR,313 bridge_gateway=self._BR_GATEWAY,314 )315 # setup nested vm on client in NAT configuration316 client_l2 = self._linux_setup_nat(317 node=client_l1,318 nested_vm_name="client_l2",319 guest_username=nested_image_username,320 guest_password=nested_image_password,321 guest_port=self._CLIENT_HOST_FWD_PORT,322 guest_image_url=nested_image_url,323 guest_internal_ip=self._CLIENT_IP_ADDR,324 guest_default_nic=self._NIC_NAME,325 bridge_name=self._BR_NAME,326 bridge_network=self._BR_NETWORK,327 bridge_cidr=self._BR_CIDR,328 bridge_gateway=self._BR_GATEWAY,329 )330 # run ntttcp test331 perf_ntttcp(332 result,333 server_l2,334 client_l2,335 server_nic_name=self._NIC_NAME,336 client_nic_name=self._NIC_NAME,337 test_case_name=inspect.stack()[1][3],338 )339 finally:340 self._linux_cleanup_nat(server_l1, self._BR_NAME, log)341 self._linux_cleanup_nat(client_l1, self._BR_NAME, log)342 @TestCaseMetadata(343 description="""344 This script runs ntttcp test on two nested VMs on different L1 guests345 connected with NAT346 """,347 priority=3,348 timeout=_TIME_OUT,349 requirement=simple_requirement(350 min_count=2,351 supported_os=[Windows],352 supported_platform_type=[AZURE, READY],353 ),354 )355 def perf_nested_hyperv_ntttcp_different_l1_nat(356 self,357 result: TestResult,358 variables: Dict[str, Any],359 log: Logger,360 ) -> None:361 environment = result.environment362 assert environment, "fail to get environment from testresult"363 server_l1 = cast(RemoteNode, environment.nodes[0])364 client_l1 = cast(RemoteNode, environment.nodes[1])365 # parse nested image variables366 (367 nested_image_username,368 nested_image_password,369 _,370 nested_image_url,371 ) = parse_nested_image_variables(variables)372 try:373 # setup nested vm on server in NAT configuration374 server_l2 = self._windows_setup_nat(375 node=server_l1,376 nested_vm_name="server_l2",377 guest_username=nested_image_username,378 guest_password=nested_image_password,379 guest_port=self._SERVER_HOST_FWD_PORT,380 guest_image_url=nested_image_url,381 )382 # setup nested vm on client in NAT configuration383 client_l2 = self._windows_setup_nat(384 node=client_l1,385 nested_vm_name="client_l2",386 guest_username=nested_image_username,387 guest_password=nested_image_password,388 guest_port=self._CLIENT_HOST_FWD_PORT,389 guest_image_url=nested_image_url,390 )391 # run ntttcp test392 perf_ntttcp(393 result,394 server_l2,395 client_l2,396 test_case_name=inspect.stack()[1][3],397 )398 finally:399 # cleanup server400 try:401 hyperv_remove_nested_vm(server_l1, "server_l2")402 except Exception as e:403 log.debug(f"Failed to clean up server vm: {e}")404 server_l1.mark_dirty()405 # cleanup client406 try:...

Full Screen

Full Screen

performance.py

Source:performance.py Github

copy

Full Screen

...297 for lagscope in [server_lagscope, client_lagscope]:298 lagscope.kill()299 lagscope.restore_busy_poll()300 else:301 ntttcp_messages = perf_ntttcp(302 test_result=test_result,303 udp_mode=False,304 connections=[1],305 test_case_name=inspect.stack()[2].function,306 )307 return float(308 # The type is always TCP message, because the above line set udp309 # to False. Ignore type error here, because UDP message has no310 # latency metrics.311 sum(x.latency_us for x in ntttcp_messages) # type: ignore312 / len(ntttcp_messages)313 )314 def _execute_rx_drop_test(315 self,...

Full Screen

Full Screen

networkperf.py

Source:networkperf.py Github

copy

Full Screen

...126 network_interface=Synthetic(),127 ),128 )129 def perf_tcp_ntttcp_128_connections_synthetic(self, result: TestResult) -> None:130 perf_ntttcp(result, connections=[128])131 @TestCaseMetadata(132 description="""133 This test case uses ntttcp to test synthetic tcp network throughput.134 """,135 priority=3,136 timeout=TIMEOUT,137 requirement=simple_requirement(138 min_count=2,139 network_interface=Synthetic(),140 ),141 )142 def perf_tcp_ntttcp_synthetic(self, result: TestResult) -> None:143 perf_ntttcp(result)144 @TestCaseMetadata(145 description="""146 This test case uses ntttcp to test sriov tcp network throughput.147 """,148 priority=3,149 timeout=TIMEOUT,150 requirement=simple_requirement(151 min_count=2,152 network_interface=Sriov(),153 ),154 )155 def perf_tcp_ntttcp_sriov(self, result: TestResult) -> None:156 perf_ntttcp(result)157 @TestCaseMetadata(158 description="""159 This test case uses ntttcp to test synthetic udp network throughput.160 """,161 priority=3,162 timeout=TIMEOUT,163 requirement=simple_requirement(164 min_count=2,165 network_interface=Synthetic(),166 ),167 )168 def perf_udp_1k_ntttcp_synthetic(self, result: TestResult) -> None:169 perf_ntttcp(result, udp_mode=True)170 @TestCaseMetadata(171 description="""172 This test case uses ntttcp to test sriov udp network throughput.173 """,174 priority=3,175 timeout=TIMEOUT,176 requirement=simple_requirement(177 min_count=2,178 network_interface=Sriov(),179 ),180 )181 def perf_udp_1k_ntttcp_sriov(self, result: TestResult) -> None:182 perf_ntttcp(result, udp_mode=True)183 @TestCaseMetadata(184 description="""185 This test case uses iperf3 to test synthetic tcp network throughput.186 """,187 priority=3,188 timeout=TIMEOUT,189 requirement=simple_requirement(190 min_count=2,191 network_interface=Synthetic(),192 ),193 )194 def perf_tcp_iperf_synthetic(self, result: TestResult) -> None:195 perf_iperf(196 result,...

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