def _ibHackedSpeed(nic_name): """If the nic is an InfiniBand device, return a speed of 10000 Mbps. This is only needed until the kernel reports ib*/speed, see https://bugzilla.redhat.com/show_bug.cgi?id=1101314 """ try: return 10000 if drv_name(nic_name) == 'ib_ipoib' else 0 except IOError: return 0
def testUtf8BridgeEthtoolDrvinfo(self): self.assertEqual( ipwrapper.drv_name(self._bridge.devName.decode('utf8')), ipwrapper.LinkType.BRIDGE)
def testBridgeEthtoolDrvinfo(self): self.assertEqual(ipwrapper.drv_name(self._bridge.devName), ipwrapper.LinkType.BRIDGE)