Add xterm support
This commit is contained in:
+1
-8
@@ -15,6 +15,7 @@ from subprocess import Popen, PIPE
|
||||
import re
|
||||
|
||||
from mininet.util import quietRun
|
||||
from mininet.xterm import cleanUpScreens
|
||||
|
||||
def sh( cmd ):
|
||||
"Print a command and send it to the shell"
|
||||
@@ -22,14 +23,6 @@ def sh( cmd ):
|
||||
return Popen( [ '/bin/sh', '-c', cmd ],
|
||||
stdout=PIPE ).communicate()[ 0 ]
|
||||
|
||||
def cleanUpScreens():
|
||||
"Remove moldy old screen sessions."
|
||||
r = r'(\d+.[hsc]\d+)'
|
||||
output = sh( 'screen -ls' ).split( '\n' )
|
||||
for line in output:
|
||||
m = re.search( r, line )
|
||||
if m is not None:
|
||||
quietRun( 'screen -S ' + m.group( 1 ) + ' -X kill' )
|
||||
|
||||
def cleanup():
|
||||
"""Clean up junk which might be left over from old runs;
|
||||
|
||||
+4
-2
@@ -85,7 +85,7 @@ class MininetRunner(object):
|
||||
opts.add_option('--test', type = 'choice', choices = TESTS,
|
||||
default = TESTS[0],
|
||||
help = '[' + ' '.join(TESTS) + ']')
|
||||
opts.add_option('--xterm', '-x', action = 'store_true',
|
||||
opts.add_option('--xterms', '-x', action = 'store_true',
|
||||
default = False, help = 'spawn xterms for each node')
|
||||
opts.add_option('--verbosity', '-v', type = 'choice',
|
||||
choices = LEVELS.keys(), default = 'info',
|
||||
@@ -117,7 +117,9 @@ class MininetRunner(object):
|
||||
controller = CONTROLLERS[self.options.controller]
|
||||
|
||||
controller_params = ControllerParams(0x0a000000, 8) # 10.0.0.0/8
|
||||
mn = Mininet(topo, switch, host, controller, controller_params)
|
||||
xterms = self.options.xterms
|
||||
mn = Mininet(topo, switch, host, controller, controller_params,
|
||||
xterms = xterms)
|
||||
|
||||
test = self.options.test
|
||||
if test != 'build':
|
||||
|
||||
Reference in New Issue
Block a user