Revision 748e35d5 mininet.py

View differences:

mininet.py
126 126
      self.ips = {}
127 127
      self.connection = {}
128 128
      self.waiting = False
129
      self.execed = False
130
   def cleanup( self ):
131
      # Help python collect its garbage
132
      self.shell = None
129 133
   # Subshell I/O, commands and control
130 134
   def read( self, max ): return os.read( self.stdout.fileno(), max )
131 135
   def write( self, data ): os.write( self.stdin.fileno(), data )
132
   def terminate( self ): os.kill( self.pid, signal.SIGKILL )
136
   def terminate( self ):
137
      self.cleanup()
138
      os.kill( self.pid, signal.SIGKILL )
133 139
   def waitReadable( self ): self.pollOut.poll()
134 140
   def sendCmd( self, cmd ):
135 141
      """Send a command, followed by a command to echo a sentinel,
......
251 257
      an OpenFlow switch."""
252 258
   def __init__( self, name, datapath=None ):
253 259
      self.dp = datapath
254
      self.execed = False
255 260
      Node.__init__( self, name, inNamespace=( datapath == None ) )
256 261
   def startUserDatapath( self, controller ):
257 262
      """Start OpenFlow reference user datapath, 
......
470 475
      print "*** Running test"
471 476
      result = test( [ controller ], switches, hosts )
472 477
      print "*** Stopping controller"
473
      controller.stop()
478
      controller.stop(); controller.terminate()
474 479
      print "*** Stopping switches"
475 480
      for switch in switches:
476
         switch.stop()
481
         switch.stop() ; switch.terminate()
482
      print "*** Stopping hosts"
483
      for host in hosts: host.terminate()
477 484
      print "*** Test complete"
478 485
      return result
479 486
   def interact( self ):

Also available in: Unified diff