Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def testTogglePromisc(self):
tc.set_promisc(self._bridge.devName, True)
self.assertTrue(ethtool.get_flags(self._bridge.devName) &
ethtool.IFF_PROMISC,
"Could not enable promiscuous mode.")
tc.set_promisc(self._bridge.devName, False)
self.assertFalse(ethtool.get_flags(self._bridge.devName) &
ethtool.IFF_PROMISC,
"Could not disable promiscuous mode.")
string += "UP "
if flags & ethtool.IFF_BROADCAST:
string += "BROADCAST "
if flags & ethtool.IFF_DEBUG:
string += "DEBUG "
if flags & ethtool.IFF_LOOPBACK:
string += "LOOPBACK "
if flags & ethtool.IFF_POINTOPOINT:
string += "POINTOPOINT "
if flags & ethtool.IFF_NOTRAILERS:
string += "NOTRAILERS "
if flags & ethtool.IFF_RUNNING:
string += "RUNNING "
if flags & ethtool.IFF_NOARP:
string += "NOARP "
if flags & ethtool.IFF_PROMISC:
string += "PROMISC "
if flags & ethtool.IFF_ALLMULTI:
string += "ALLMULTI "
if flags & ethtool.IFF_MASTER:
string += "MASTER "
if flags & ethtool.IFF_SLAVE:
string += "SLAVE "
if flags & ethtool.IFF_MULTICAST:
string += "MULTICAST "
if flags & ethtool.IFF_PORTSEL:
string += "PORTSEL "
if flags & ethtool.IFF_AUTOMEDIA:
string += "AUTOMEDIA "
if flags & ethtool.IFF_DYNAMIC:
string += "DYNAMIC "