Pass code check
This commit is contained in:
committed by
Brian O'Connor
parent
f796f01f38
commit
9d14c841d7
@@ -31,9 +31,12 @@ class SingleSwitchOptionsTopo(Topo):
|
|||||||
host = self.addHost('h%s' % (h + 1))
|
host = self.addHost('h%s' % (h + 1))
|
||||||
self.addLink(host, switch)
|
self.addLink(host, switch)
|
||||||
|
|
||||||
|
# Tell pylint not to complain about calls to other class
|
||||||
|
# pylint: disable=E1101
|
||||||
|
|
||||||
class testOptionsTopoCommon( object ):
|
class testOptionsTopoCommon( object ):
|
||||||
"Verify ability to create networks with host and link options (common code)."
|
"""Verify ability to create networks with host and link options
|
||||||
|
(common code)."""
|
||||||
|
|
||||||
switchClass = None # overridden in subclasses
|
switchClass = None # overridden in subclasses
|
||||||
|
|
||||||
@@ -41,7 +44,8 @@ class testOptionsTopoCommon( object ):
|
|||||||
"Generic topology-with-options test runner."
|
"Generic topology-with-options test runner."
|
||||||
mn = Mininet( topo=SingleSwitchOptionsTopo( n=n, hopts=hopts,
|
mn = Mininet( topo=SingleSwitchOptionsTopo( n=n, hopts=hopts,
|
||||||
lopts=lopts ),
|
lopts=lopts ),
|
||||||
host=CPULimitedHost, link=TCLink, switch=self.switchClass )
|
host=CPULimitedHost, link=TCLink,
|
||||||
|
switch=self.switchClass )
|
||||||
dropped = mn.run( mn.ping )
|
dropped = mn.run( mn.ping )
|
||||||
self.assertEqual( dropped, 0 )
|
self.assertEqual( dropped, 0 )
|
||||||
|
|
||||||
@@ -107,7 +111,8 @@ class testOptionsTopoCommon( object ):
|
|||||||
REPS = 1
|
REPS = 1
|
||||||
lopts = { 'loss': LOSS_PERCENT, 'use_htb': True }
|
lopts = { 'loss': LOSS_PERCENT, 'use_htb': True }
|
||||||
mn = Mininet( topo=SingleSwitchOptionsTopo( n=N, lopts=lopts ),
|
mn = Mininet( topo=SingleSwitchOptionsTopo( n=N, lopts=lopts ),
|
||||||
host=CPULimitedHost, link=TCLink, switch=self.switchClass )
|
host=CPULimitedHost, link=TCLink,
|
||||||
|
switch=self.switchClass )
|
||||||
# Drops are probabilistic, but the chance of no dropped packets is
|
# Drops are probabilistic, but the chance of no dropped packets is
|
||||||
# 1 in 100 million with 4 hops for a link w/99% loss.
|
# 1 in 100 million with 4 hops for a link w/99% loss.
|
||||||
dropped_total = 0
|
dropped_total = 0
|
||||||
@@ -123,24 +128,28 @@ class testOptionsTopoCommon( object ):
|
|||||||
hopts = { 'cpu': 0.5 / N }
|
hopts = { 'cpu': 0.5 / N }
|
||||||
self.runOptionsTopoTest( N, hopts=hopts, lopts=lopts )
|
self.runOptionsTopoTest( N, hopts=hopts, lopts=lopts )
|
||||||
|
|
||||||
|
# pylint: enable=E1101
|
||||||
|
|
||||||
class testOptionsTopoOVSKernel( testOptionsTopoCommon, unittest.TestCase ):
|
class testOptionsTopoOVSKernel( testOptionsTopoCommon, unittest.TestCase ):
|
||||||
"Verify ability to create networks with host and link options (OVS kernel switch)."
|
"""Verify ability to create networks with host and link options
|
||||||
|
(OVS kernel switch)."""
|
||||||
switchClass = OVSSwitch
|
switchClass = OVSSwitch
|
||||||
|
|
||||||
@unittest.skip( 'Skipping OVS user switch test for now' )
|
@unittest.skip( 'Skipping OVS user switch test for now' )
|
||||||
class testOptionsTopoOVSUser( testOptionsTopoCommon, unittest.TestCase ):
|
class testOptionsTopoOVSUser( testOptionsTopoCommon, unittest.TestCase ):
|
||||||
"Verify ability to create networks with host and link options (OVS user switch)."
|
"""Verify ability to create networks with host and link options
|
||||||
|
(OVS user switch)."""
|
||||||
switchClass = partial( OVSSwitch, datapath='user' )
|
switchClass = partial( OVSSwitch, datapath='user' )
|
||||||
|
|
||||||
@unittest.skipUnless( quietRun( 'which ivs-ctl' ), 'IVS is not installed' )
|
@unittest.skipUnless( quietRun( 'which ivs-ctl' ), 'IVS is not installed' )
|
||||||
class testOptionsTopoIVS( testOptionsTopoCommon, unittest.TestCase ):
|
class testOptionsTopoIVS( testOptionsTopoCommon, unittest.TestCase ):
|
||||||
"Verify ability to create networks with host and link options (IVS switch)."
|
"Verify ability to create networks with host and link options (IVS)."
|
||||||
switchClass = IVSSwitch
|
switchClass = IVSSwitch
|
||||||
|
|
||||||
@unittest.skipUnless( quietRun( 'which ofprotocol' ),
|
@unittest.skipUnless( quietRun( 'which ofprotocol' ),
|
||||||
'Reference user switch is not installed' )
|
'Reference user switch is not installed' )
|
||||||
class testOptionsTopoUserspace( testOptionsTopoCommon, unittest.TestCase ):
|
class testOptionsTopoUserspace( testOptionsTopoCommon, unittest.TestCase ):
|
||||||
"Verify ability to create networks with host and link options (Userspace switch)."
|
"Verify ability to create networks with host and link options (UserSwitch)."
|
||||||
switchClass = UserSwitch
|
switchClass = UserSwitch
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ from mininet.topo import SingleSwitchTopo, LinearTopo
|
|||||||
from mininet.log import setLogLevel
|
from mininet.log import setLogLevel
|
||||||
from mininet.util import quietRun
|
from mininet.util import quietRun
|
||||||
|
|
||||||
|
# Tell pylint not to complain about calls to other class
|
||||||
|
# pylint: disable=E1101
|
||||||
|
|
||||||
class testSingleSwitchCommon( object ):
|
class testSingleSwitchCommon( object ):
|
||||||
"Test ping with single switch topology (common code)."
|
"Test ping with single switch topology (common code)."
|
||||||
@@ -31,6 +33,8 @@ class testSingleSwitchCommon( object ):
|
|||||||
dropped = mn.run( mn.ping )
|
dropped = mn.run( mn.ping )
|
||||||
self.assertEqual( dropped, 0 )
|
self.assertEqual( dropped, 0 )
|
||||||
|
|
||||||
|
# pylint: enable=E1101
|
||||||
|
|
||||||
class testSingleSwitchOVSKernel( testSingleSwitchCommon, unittest.TestCase ):
|
class testSingleSwitchOVSKernel( testSingleSwitchCommon, unittest.TestCase ):
|
||||||
"Test ping with single switch topology (OVS kernel switch)."
|
"Test ping with single switch topology (OVS kernel switch)."
|
||||||
switchClass = OVSSwitch
|
switchClass = OVSSwitch
|
||||||
@@ -51,6 +55,9 @@ class testSingleSwitchUserspace( testSingleSwitchCommon, unittest.TestCase ):
|
|||||||
switchClass = UserSwitch
|
switchClass = UserSwitch
|
||||||
|
|
||||||
|
|
||||||
|
# Tell pylint not to complain about calls to other class
|
||||||
|
# pylint: disable=E1101
|
||||||
|
|
||||||
class testLinearCommon( object ):
|
class testLinearCommon( object ):
|
||||||
"Test all-pairs ping with LinearNet (common code)."
|
"Test all-pairs ping with LinearNet (common code)."
|
||||||
|
|
||||||
@@ -62,6 +69,8 @@ class testLinearCommon( object ):
|
|||||||
dropped = mn.run( mn.ping )
|
dropped = mn.run( mn.ping )
|
||||||
self.assertEqual( dropped, 0 )
|
self.assertEqual( dropped, 0 )
|
||||||
|
|
||||||
|
# pylint: enable=E1101
|
||||||
|
|
||||||
|
|
||||||
class testLinearOVSKernel( testLinearCommon, unittest.TestCase ):
|
class testLinearOVSKernel( testLinearCommon, unittest.TestCase ):
|
||||||
"Test all-pairs ping with LinearNet (OVS kernel switch)."
|
"Test all-pairs ping with LinearNet (OVS kernel switch)."
|
||||||
|
|||||||
Reference in New Issue
Block a user