Best Python code snippet using lisa_python
features.py
Source:features.py
...500 device_list = lspci.get_devices()501 return any("Virtual Function" in device.device_info for device in device_list)502 # nd stands for network direct503 # example SKU: Standard_H16mr504 def is_over_nd(self) -> bool:505 dmesg = self._node.tools[Dmesg]506 return "hvnd_try_bind_nic" in dmesg.get_output()507 def _initialize(self, *args: Any, **kwargs: Any) -> None:508 super()._initialize(*args, **kwargs)509 self._initialize_information(self._node)510class NetworkInterface(AzureFeatureMixin, features.NetworkInterface):511 """512 This Network interface feature is mainly to associate Azure513 network interface options settings.514 """515 @classmethod516 def settings_type(cls) -> Type[schema.FeatureSettings]:517 return schema.NetworkInterfaceOptionSettings518 def _initialize(self, *args: Any, **kwargs: Any) -> None:...
infinibandsuit.py
Source:infinibandsuit.py
...87 try:88 infiniband = node.features[Infiniband]89 except (UnsupportedDistroException, UnsupportedKernelException) as err:90 raise SkippedException(err)91 if not infiniband.is_over_nd():92 raise SkippedException("Inifiniband over ND was not detected.")93 waagent = node.tools[Waagent]94 assert_that(waagent.is_rdma_enabled()).described_as(95 "Found waagent configuration of OS.EnableRDMA=y "96 "was missing or commented out"97 ).is_true()98 log.debug("Verified waagent config OS.EnableRDMA=y set successfully")99 modprobe = node.tools[Modprobe]100 expected_modules = ["mlx5_ib", "hv_networkdirect"]101 for module in expected_modules:102 assert_that(modprobe.is_module_loaded(module)).described_as(103 f"Module {module} is not loaded."104 ).is_true()105 @TestCaseMetadata(...
infiniband.py
Source:infiniband.py
...56 def is_over_sriov(self) -> bool:57 raise NotImplementedError58 # nd stands for network direct59 # example SKU: Standard_H16mr60 def is_over_nd(self) -> bool:61 raise NotImplementedError62 def _is_legacy_device(self) -> bool:63 lspci = self._node.tools[Lspci]64 device_list = lspci.get_devices()65 return any("ConnectX-3" in device.device_info for device in device_list)66 def get_ib_interfaces(self) -> List[IBDevice]:67 """Gets the list of Infiniband devices68 excluding any ethernet devices69 and get their corresponding network interface70 Returns list of IBDevice(ib_device_name, nic_name, ip_addr)71 Example IBDevice("mlx5_ib0", "ib0", "172.16.1.23")"""72 ib_devices = []73 device_info = self._get_ib_device_info()74 for device in device_info:...
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!!