Skip to content
Snippets Groups Projects
Commit 6bd22292 authored by Bob Lantz's avatar Bob Lantz
Browse files

Added checks for tun and ofdatapath kernel modules.

parent eddef947
No related branches found
No related tags found
No related merge requests found
...@@ -85,7 +85,8 @@ def checkRun( cmd ): ...@@ -85,7 +85,8 @@ def checkRun( cmd ):
def quietRun( cmd ): def quietRun( cmd ):
"Run a command, routing stderr to stdout, and return the output." "Run a command, routing stderr to stdout, and return the output."
popen = Popen( cmd.split( ' '), stdout=PIPE, stderr=STDOUT) if isinstance( cmd, str ): cmd = cmd.split( ' ' )
popen = Popen( cmd, stdout=PIPE, stderr=STDOUT)
# We can't use Popen.communicate() because it uses # We can't use Popen.communicate() because it uses
# select(), which can't handle # select(), which can't handle
# high file descriptor numbers! poll() can, however. # high file descriptor numbers! poll() can, however.
...@@ -722,12 +723,18 @@ def init(): ...@@ -722,12 +723,18 @@ def init():
# Perhaps we should do so automatically! # Perhaps we should do so automatically!
if os.getuid() != 0: if os.getuid() != 0:
print "*** Mininet must run as root."; exit( 1 ) print "*** Mininet must run as root."; exit( 1 )
# Check for kernel modules
tun = quietRun( [ 'sh', '-c', 'lsmod | grep tun' ] )
ofdatapath = quietRun( [ 'sh', '-c', 'lsmod | grep ofdatapath' ] )
if tun == '':
print "*** tun not found: user datapath not supported"
if ofdatapath == '':
print "*** ofdatapath not found: kernel datapath not supported"
fixLimits() fixLimits()
if __name__ == '__main__': if __name__ == '__main__':
init() init()
# for kernel in [ False, True ]: for kernel in [ False, True ]:
# TreeNet( depth=3, fanout=4, kernel=kernel).run( pingTest ) TreeNet( depth=2, fanout=2).run( pingTestVerbose )
TreeNet( depth=2, fanout=32).run( Cli ) LinearNet( switchCount=10 ).run( iperfTest)
# LinearNet( switchCount=100 ).run( iperfTest) # GridNet( 2, 2 ).run( Cli )
# GridNet( 2, 2 ).run( Cli ) \ No newline at end of file
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment