Revision f4d9e05d examples/treePing64.py

View differences:

examples/treePing64.py
1 1
#!/usr/bin/python
2 2

  
3
"Create a 64-node tree network, and test connectivity using pingTest."
3
"Create a 64-node tree network, and test connectivity using ping."
4 4
   
5 5
from mininet import init, TreeNet, pingTestVerbose
6 6

  
7
def bigTreePing64():
7
def treePing64():
8 8
   results = {}
9

  
10
   print "*** Testing Mininet with kernel and user datapath"
9
   datapaths = [ 'kernel', 'user' ]
10
   
11
   print "*** Testing Mininet with kernel and user datapaths"
11 12
   
12
   for datapath in [ 'kernel', 'user' ]:
13
   for datapath in datapaths:
13 14
      k = datapath == 'kernel'
14
      results[ datapath ] = []
15
      for switchCount in range( 1, 4 ):
16
         network = TreeNet( depth=3, fanout=4, kernel=k )
17
         testResult = network.run( pingTestVerbose )
18
         results[ datapath ] += testResult
19
         
20
   print "*** Test results:", results
21
      
15
      network = TreeNet( depth=2, fanout=8, kernel=k )
16
      result = network.run( pingTestVerbose )
17
      results[ datapath ] = result
18
   
19
   print  
20
   print "*** TreeNet ping results:"
21
   for datapath in datapaths:
22
      print "%s:" % datapath, results[ datapath ]
23
   print
24
   
22 25
if __name__ == '__main__':
23 26
   init()
24
   bigTreePing64()
27
   treePing64()
25 28

  

Also available in: Unified diff