Files
mininet/examples/treeping64.py
T
Brandon Heller 2e089b5e4a pep8: Fix E127 continuation line over-indented
There are a bunch of these remaining, but I don't think the right course is
to 'fix' all of them to make pep8 happy, but instead to either change
the test in pep8 to consider that a continuation line may itself
be continued halfway, OR, to change the code in these lines to be more
readable by removing the need for all those nested continuations.

Personally, I find multiply-broken lines (aka nested continuations) really
hard to read.
2012-11-13 17:17:51 -08:00

33 lines
950 B
Python
Executable File

#!/usr/bin/python
"Create a 64-node tree network, and test connectivity using ping."
from mininet.log import setLogLevel
from mininet.node import UserSwitch, OVSKernelSwitch # , KernelSwitch
from mininet.topolib import TreeNet
def treePing64():
"Run ping test on 64-node tree networks."
results = {}
switches = { # 'reference kernel': KernelSwitch,
'reference user': UserSwitch,
'Open vSwitch kernel': OVSKernelSwitch }
for name in switches:
print "*** Testing", name, "datapath"
switch = switches[ name ]
network = TreeNet( depth=2, fanout=8, switch=switch )
result = network.run( network.pingAll )
results[ name ] = result
print
print "*** Tree network ping results:"
for name in switches:
print "%s: %d%% packet loss" % ( name, results[ name ] )
print
if __name__ == '__main__':
setLogLevel( 'info' )
treePing64()