How to use get_nic_driver method in lisa

Best Python code snippet using lisa_python

test_case.py

Source:test_case.py Github

copy

Full Screen

...54 pass55 def verify(self, passed, description):56 if not passed:57 raise VerifyFailure(description)58 def get_nic_driver(self, nic_name):59 if nic_name in DRIVERS.keys():60 return DRIVERS[nic_name]61 raise ValueError(nic_name)62 def get_nic_name(self, pci_id):63 for nic_name, pci in NICS.items():64 if pci_id == pci:65 return nic_name66 raise ValueError(nic_name)67 def wirespeed(self, nic, frame_size, num_ports):68 """69 Calculate bit rate. It is depended for NICs70 """71 bitrate = 1000.0 # 1Gb ('.0' forces to operate as float)72 if self.nic == "any" or self.nic == "cfg":73 driver = dts.get_nic_driver(self.dut.ports_info[0]['type'])74 nic = self.get_nic_name(self.dut.ports_info[0]['type'])75 else:76 driver = self.get_nic_driver(self.nic)77 nic = self.nic78 if driver == "ixgbe":79 bitrate *= 10 # 10 Gb NICs80 elif nic == "avoton2c5":81 bitrate *= 2.5 # 2.5 Gb NICs82 elif nic in ["fortville_spirit", "fortville_spirit_single"]:83 bitrate *= 4084 elif nic == 'fortville_eagle':85 bitrate *= 10...

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