Best Python code snippet using lisa_python
features.py
Source:features.py  
...494        value = raw_capabilities.get("RdmaEnabled", None)495        if value and eval(value) is True:496            return schema.FeatureSettings.create(cls.name())497        return None498    def is_over_sriov(self) -> bool:499        lspci = self._node.tools[Lspci]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 Azure...infinibandsuit.py
Source:infinibandsuit.py  
...43        try:44            infiniband = node.features[Infiniband]45        except (UnsupportedDistroException, UnsupportedKernelException) as err:46            raise SkippedException(err)47        assert_that(infiniband.is_over_sriov()).described_as(48            "Based on VM SKU information we expected Infiniband over SR-IOV,"49            " but no matching devices were found."50        ).is_true()51        waagent = node.tools[Waagent]52        assert_that(waagent.is_rdma_enabled()).described_as(53            "Found waagent configuration of OS.EnableRDMA=y "54            "was missing or commented out"55        ).is_true()56        log.debug("Verified waagent config OS.EnableRDMA=y set successfully")57        modprobe = node.tools[Modprobe]58        expected_modules = [59            "mlx5_ib",60            "ib_uverbs",61            "ib_core",...infiniband.py
Source:infiniband.py  
...52        return FEATURE_NAME_INFINIBAND53    @classmethod54    def can_disable(cls) -> bool:55        return True56    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)...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!!
