Make mn -w wait indefinitely and add --twait option (#1036)
Background: In Mininet 2.2, waitConnected() waits forever by default. We are going to preserve this behavior for 2.3. Therefore, the --wait/-w option will wait forever. This is used in the tests to make sure that all switches have connected to their controllers. A new --twait/-t <int> option has been added for timed waits. The API for Mininet(....waitConnected=False/True) is preserved, but you can now pass in an integer wait time. False means do not wait at all. True means wait forever. I have elected for now to preserve None also meaning wait forever as it was in 2.2, but note that you should probably use the boolean True/False instead.
This commit is contained in:
@@ -290,6 +290,9 @@ class MininetRunner( object ):
|
||||
help='prints the version and exits' )
|
||||
opts.add_option( '--wait', '-w', action='store_true',
|
||||
default=False, help='wait for switches to connect' )
|
||||
opts.add_option( '--twait', '-t', action='store', type='int',
|
||||
dest='wait',
|
||||
help='timed wait (s) for switches to connect' )
|
||||
opts.add_option( '--cluster', type='string', default=None,
|
||||
metavar='server1,server2...',
|
||||
help=( 'run on multiple servers (experimental!)' ) )
|
||||
|
||||
Reference in New Issue
Block a user