code check
This commit is contained in:
@@ -21,8 +21,7 @@ if 'PYTHONPATH' in os.environ:
|
|||||||
sys.path = os.environ[ 'PYTHONPATH' ].split( ':' ) + sys.path
|
sys.path = os.environ[ 'PYTHONPATH' ].split( ':' ) + sys.path
|
||||||
|
|
||||||
from mininet.clean import cleanup
|
from mininet.clean import cleanup
|
||||||
from mininet.cli import CLI
|
import mininet.cli
|
||||||
CLI # workaround for pylint "CLI unused" error
|
|
||||||
from mininet.log import lg, LEVELS, info, debug, warn, error, output
|
from mininet.log import lg, LEVELS, info, debug, warn, error, output
|
||||||
from mininet.net import Mininet, MininetWithControlNet, VERSION
|
from mininet.net import Mininet, MininetWithControlNet, VERSION
|
||||||
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
|
from mininet.node import ( Host, CPULimitedHost, Controller, OVSController,
|
||||||
@@ -102,9 +101,11 @@ def allTest( net ):
|
|||||||
net.start()
|
net.start()
|
||||||
net.ping()
|
net.ping()
|
||||||
net.iperf()
|
net.iperf()
|
||||||
def nullTest( net ):
|
|
||||||
|
def nullTest( _net ):
|
||||||
"Null 'test' (does nothing)"
|
"Null 'test' (does nothing)"
|
||||||
pass
|
pass
|
||||||
|
|
||||||
TESTS.update( all=allTest, none=nullTest, build=nullTest )
|
TESTS.update( all=allTest, none=nullTest, build=nullTest )
|
||||||
|
|
||||||
# Map to alternate spellings of Mininet() methods
|
# Map to alternate spellings of Mininet() methods
|
||||||
@@ -343,7 +344,6 @@ class MininetRunner( object ):
|
|||||||
opts.switch )
|
opts.switch )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
topo = buildTopo( TOPOS, opts.topo )
|
topo = buildTopo( TOPOS, opts.topo )
|
||||||
switch = customClass( SWITCHES, opts.switch )
|
switch = customClass( SWITCHES, opts.switch )
|
||||||
host = customClass( HOSTS, opts.host )
|
host = customClass( HOSTS, opts.host )
|
||||||
@@ -374,8 +374,7 @@ class MininetRunner( object ):
|
|||||||
host, switch, link = RemoteHost, RemoteOVSSwitch, RemoteLink
|
host, switch, link = RemoteHost, RemoteOVSSwitch, RemoteLink
|
||||||
Net = partial( MininetCluster, servers=servers,
|
Net = partial( MininetCluster, servers=servers,
|
||||||
placement=PLACEMENT[ opts.placement ] )
|
placement=PLACEMENT[ opts.placement ] )
|
||||||
global CLI
|
mininet.cli.CLI = ClusterCLI
|
||||||
CLI = ClusterCLI
|
|
||||||
|
|
||||||
mn = Net( topo=topo,
|
mn = Net( topo=topo,
|
||||||
switch=switch, host=host, controller=controller, link=link,
|
switch=switch, host=host, controller=controller, link=link,
|
||||||
@@ -387,6 +386,8 @@ class MininetRunner( object ):
|
|||||||
if opts.ensure_value( 'nat', False ):
|
if opts.ensure_value( 'nat', False ):
|
||||||
mn.addNAT( *opts.nat_args, **opts.nat_kwargs ).configDefault()
|
mn.addNAT( *opts.nat_args, **opts.nat_kwargs ).configDefault()
|
||||||
|
|
||||||
|
CLI = mininet.cli.CLI
|
||||||
|
|
||||||
if opts.pre:
|
if opts.pre:
|
||||||
CLI( mn, script=opts.pre )
|
CLI( mn, script=opts.pre )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user