How to use is_rdma_enabled method in lisa

Best Python code snippet using lisa_python

tools.py

Source: tools.py Github

copy

Full Screen

...82 else:83 raise LisaException(84 f"Unknown value for ResourceDisk.EnableSwap : {is_swap_enabled}"85 )86 def is_rdma_enabled(self) -> bool:87 waagent_configuration = self.get_configuration()88 is_rdma_enabled = waagent_configuration["OS.EnableRDMA"]89 if is_rdma_enabled == "y":90 return True91 elif is_rdma_enabled == "n":92 return False93 else:94 raise LisaException(f"Unknown value for OS.EnableRDMA : {is_rdma_enabled}")95 def get_distro_version(self) -> str:96 """97 This method is to get the same distro version string like WaAgent. It98 tries best to handle different python version and locations.99 """100 if self._distro_version is not None:...

Full Screen

Full Screen

test_netinfo.py

Source: test_netinfo.py Github

copy

Full Screen

...119 def test_is_rdma_enabled_true(self, mock_iface_rdma,120 mock_service_enabled):121 mock_iface_rdma.return_value = True122 mock_service_enabled.return_value = True123 self.assertTrue(netinfo.is_rdma_enabled('iface1'))124 mock_iface_rdma.assert_called_once_with('iface1')125 mock_service_enabled.assert_called_once_with()126 @mock.patch('wok.plugins.gingerbase.netinfo.is_rdma_service_enabled')127 @mock.patch('wok.plugins.gingerbase.netinfo.is_interface_rdma_capable')128 def test_is_rdma_enabled_wrong_mod(self, mock_iface_rdma,129 mock_service_enabled):130 mock_iface_rdma.return_value = False131 mock_service_enabled.return_value = True132 self.assertFalse(netinfo.is_rdma_enabled('iface1'))133 mock_iface_rdma.assert_called_once_with('iface1')134 mock_service_enabled.assert_not_called()135 @mock.patch('wok.plugins.gingerbase.netinfo.is_rdma_service_enabled')136 @mock.patch('wok.plugins.gingerbase.netinfo.is_interface_rdma_capable')137 def test_is_rdma_enabled_no_service(self, mock_iface_rdma,138 mock_service_enabled):139 mock_iface_rdma.return_value = True140 mock_service_enabled.return_value = False141 self.assertFalse(netinfo.is_rdma_enabled('iface1'))142 mock_iface_rdma.assert_called_once_with('iface1')143 mock_service_enabled.assert_called_once_with()144 @mock.patch('wok.plugins.gingerbase.netinfo.all_interfaces')145 @mock.patch('wok.plugins.gingerbase.netinfo.is_rdma_service_enabled')146 @mock.patch('wok.plugins.gingerbase.netinfo.is_interface_rdma_capable')147 def test_get_rdma_enabled_ifaces(self, mock_iface_rdma,148 mock_service_enabled, mock_all_ifaces):149 mock_all_ifaces.return_value = [150 'iface1', 'iface2', 'iface3', 'iface4'151 ]152 mock_iface_rdma.side_effect = [True, False, False, True]153 mock_service_enabled.return_value = True154 self.assertEqual(netinfo.get_rdma_enabled_interfaces(),155 ['iface1', 'iface4'])...

Full Screen

Full Screen

interfaces.py

Source: interfaces.py Github

copy

Full Screen

...74 else:75 info['nic_type'] = netinfo.get_nic_type(device)76 else:77 raise ValueError('unknown interface: %s' % name)78 info['rdma_enabled'] = netinfo.is_rdma_enabled(name)79 return info80 except ValueError:81 raise NotFoundError("GINNET0014E", {'name': name})82 def activate(self, ifacename):83 InterfacesHelper().activate_iface(ifacename)84 def deactivate(self, ifacename):85 InterfacesHelper().deactivate_iface(ifacename)86 def _mlx5_SRIOV_get_max_VF(self, iface):87 max_vf_file = '/​sys/​class/​net/​%s/​device/​sriov_totalvfs' % iface88 max_vf = None89 if os.path.isfile(max_vf_file):90 try:91 with open(max_vf_file, 'r') as vf_file:92 max_vf = vf_file.read().strip('\n')...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

How To Handle Multiple Windows In Selenium Python

Automating testing is a crucial step in the development pipeline of a software product. In an agile development environment, where there is continuous development, deployment, and maintenance of software products, automation testing ensures that the end software products delivered are error-free.

Joomla Testing Guide: How To Test Joomla Websites

Before we discuss the Joomla testing, let us understand the fundamentals of Joomla and how this content management system allows you to create and maintain web-based applications or websites without having to write and implement complex coding requirements.

Starting & growing a QA Testing career

The QA testing career includes following an often long, winding road filled with fun, chaos, challenges, and complexity. Financially, the spectrum is broad and influenced by location, company type, company size, and the QA tester’s experience level. QA testing is a profitable, enjoyable, and thriving career choice.

The Art of Testing the Untestable

It’s strange to hear someone declare, “This can’t be tested.” In reply, I contend that everything can be tested. However, one must be pleased with the outcome of testing, which might include failure, financial loss, or personal injury. Could anything be tested when a claim is made with this understanding?

How To Create Custom Menus with CSS Select

When it comes to UI components, there are two versatile methods that we can use to build it for your website: either we can use prebuilt components from a well-known library or framework, or we can develop our UI components from scratch.

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