From fb7658c8cab3d58f6c1c9a9849ed1e9588f89009 Mon Sep 17 00:00:00 2001 From: Bob Lantz <rlantz@cs.stanford.edu> Date: Mon, 14 Dec 2009 13:38:10 -0800 Subject: [PATCH] Since execing controller/ofprotocol was broken, reverting to just running in background. This should eliminate ofprotocol bogons living on past the end of a test. --- mininet.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mininet.py b/mininet.py index bbe41e80..30c57c7c 100755 --- a/mininet.py +++ b/mininet.py @@ -247,13 +247,13 @@ def __init__( self, name, kernel=True ): def start( self, controller='controller', args='ptcp:' ): "Start <controller> <args> on controller, logging to /tmp/cN.log" cout = '/tmp/' + self.name + '.log' - self.cmdPrint( 'exec ' + controller + ' ' + args + + self.cmdPrint( controller + ' ' + args + ' 1> ' + cout + ' 2> ' + cout + ' &' ) - self.execed = True + self.execed = False # XXX Until I fix it def stop( self, controller='controller' ): "Stop controller cprog on controller" + self.cmd( "kill %" + controller ) self.terminate() - # self.cmd( "kill %" + controller ) class Switch( Node ): """A Switch is a Node that is running (or has execed) @@ -286,9 +286,9 @@ def startKernelDatapath( self, controller): self.cmdPrint( 'dpctl adddp ' + self.dp ) self.cmdPrint( 'dpctl addif ' + self.dp + ' ' + ' '.join( self.intfs ) ) # Become protocol daemon - self.cmdPrint( 'exec ofprotocol' + + self.cmdPrint( 'ofprotocol' + ' ' + self.dp + ' tcp:127.0.0.1 1> ' + ofplog + ' 2>' + ofplog + ' &' ) - self.execed = True + self.execed = False # XXX until I fix it def stopKernelDatapath( self ): "Terminate a switch using OpenFlow reference kernel datapath." quietRun( 'dpctl deldp ' + self.dp ) @@ -299,7 +299,7 @@ def stopKernelDatapath( self ): for intf in self.intfs: quietRun( 'ip link del ' + intf ) sys.stdout.write( '.' ) ; flush() - self.terminate() + self.cmd( 'kill %ofprotocol') def start( self, controller ): if self.dp is None: self.startUserDatapath( controller ) else: self.startKernelDatapath( controller ) -- GitLab