Pass code check.
This commit is contained in:
@@ -17,7 +17,7 @@ def TreeNet( depth=1, fanout=2, **kwargs ):
|
||||
"Convenience function for creating tree networks."
|
||||
topo = TreeTopo( depth, fanout )
|
||||
return Mininet( topo, **kwargs )
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'info' )
|
||||
init()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
#!/usr/bin/python
|
||||
|
||||
"Create a 64-node tree network, and test connectivity using ping."
|
||||
|
||||
from mininet.cli import CLI
|
||||
|
||||
from mininet.log import setLogLevel
|
||||
from mininet.net import init, Mininet
|
||||
from mininet.node import KernelSwitch, UserSwitch, OVSKernelSwitch
|
||||
@@ -12,8 +11,10 @@ def TreeNet( depth=1, fanout=2, **kwargs ):
|
||||
"Convenience function for creating tree networks."
|
||||
topo = TreeTopo( depth, fanout )
|
||||
return Mininet( topo, **kwargs )
|
||||
|
||||
|
||||
def treePing64():
|
||||
"Run ping test on 64-node tree networks."
|
||||
|
||||
results = {}
|
||||
switches = { 'reference kernel': KernelSwitch,
|
||||
'reference user': UserSwitch,
|
||||
@@ -26,13 +27,13 @@ def treePing64():
|
||||
result = network.run( network.pingAll )
|
||||
results[ name ] = result
|
||||
|
||||
print
|
||||
print
|
||||
print "*** Tree network ping results:"
|
||||
for name in switches.keys():
|
||||
print "%s: %d%% packet loss" % ( name, results[ name ] )
|
||||
print
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
setLogLevel( 'info' )
|
||||
init()
|
||||
treePing64()
|
||||
setLogLevel( 'info' )
|
||||
init()
|
||||
treePing64()
|
||||
|
||||
+3
-3
@@ -170,9 +170,9 @@ def makeListCompatible( fn ):
|
||||
setattr( newfn, '__doc__', fn.__doc__ )
|
||||
return newfn
|
||||
|
||||
info, output, warn, error, debug = (
|
||||
lg.info, lg.output, lg.warn, lg.error, lg.debug ) = [
|
||||
makeListCompatible( f ) for f in
|
||||
info, output, warn, error, debug = (
|
||||
lg.info, lg.output, lg.warn, lg.error, lg.debug ) = [
|
||||
makeListCompatible( f ) for f in
|
||||
lg.info, lg.output, lg.warn, lg.error, lg.debug ]
|
||||
|
||||
setLogLevel = lg.setLogLevel
|
||||
|
||||
Reference in New Issue
Block a user