From 7e9d3f2b5026a24eb46105cfa14419fcc78ba146 Mon Sep 17 00:00:00 2001 From: "lip.z" Date: Sat, 2 Aug 2014 20:18:06 +0800 Subject: [PATCH 1/5] fix Singleton.__call__ error fix Singleton.__call__ error --- mininet/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mininet/log.py b/mininet/log.py index 09a664a..5f96569 100644 --- a/mininet/log.py +++ b/mininet/log.py @@ -69,7 +69,7 @@ class Singleton( type ): def __call__( cls, *args, **kw ): if cls.instance is None: cls.instance = super( Singleton, cls ).__call__( *args, **kw ) - return cls.instance + return cls.instance class MininetLogger( Logger, object ): From db0f36f4315c8cea9ebdb81d6a60d05ce6b6fc5b Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Wed, 13 Aug 2014 19:49:08 -0700 Subject: [PATCH 2/5] Fixing Node.monitor() to read entire prompt marker. Applying @cdburkard fix to #322 --- mininet/node.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index d5b3036..a69eda6 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -261,6 +261,9 @@ class Node( object ): # Look for PID marker = chr( 1 ) + r'\d+\r\n' if findPid and chr( 1 ) in data: + # Marker can be read in chunks; continue until all of it is read + while not re.findall( marker, data ): + data += self.read( 1024 ) markers = re.findall( marker, data ) if markers: self.lastPid = int( markers[ 0 ][ 1: ] ) From e67539752e0920ce4a8fdfc5b924e2d327b52207 Mon Sep 17 00:00:00 2001 From: Brian O'Connor Date: Thu, 14 Aug 2014 15:38:31 -0700 Subject: [PATCH 3/5] updaing build.py to use 12.04.5 and extract kernel using noload --- util/vm/build.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/vm/build.py b/util/vm/build.py index ad454f0..a921aaa 100755 --- a/util/vm/build.py +++ b/util/vm/build.py @@ -61,10 +61,10 @@ Prompt = '\$ ' # Shell prompt that pexpect will wait for isoURLs = { 'precise32server': 'http://mirrors.kernel.org/ubuntu-releases/12.04/' - 'ubuntu-12.04.3-server-i386.iso', + 'ubuntu-12.04.5-server-i386.iso', 'precise64server': 'http://mirrors.kernel.org/ubuntu-releases/12.04/' - 'ubuntu-12.04.3-server-amd64.iso', + 'ubuntu-12.04.5-server-amd64.iso', 'quantal32server': 'http://mirrors.kernel.org/ubuntu-releases/12.10/' 'ubuntu-12.10-server-i386.iso', @@ -238,7 +238,7 @@ def extractKernel( image, flavor, imageDir=VMImageDir ): # Assume kernel is in partition 1/boot/vmlinuz*generic for now part = nbd + 'p1' mnt = mkdtemp() - srun( 'mount -o ro %s %s' % ( part, mnt ) ) + srun( 'mount -o ro,noload %s %s' % ( part, mnt ) ) kernsrc = glob( '%s/boot/vmlinuz*generic' % mnt )[ 0 ] initrdsrc = glob( '%s/boot/initrd*generic' % mnt )[ 0 ] srun( 'cp %s %s' % ( initrdsrc, initrd ) ) From 604ad455ee56b83aaeea08fd3aa2475c4c1f1487 Mon Sep 17 00:00:00 2001 From: cody burkard Date: Mon, 18 Aug 2014 23:24:18 -0700 Subject: [PATCH 4/5] kill all child processes to avoid race condition and no controller shutdown --- mininet/node.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mininet/node.py b/mininet/node.py index a69eda6..a5ad2bd 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -205,7 +205,7 @@ class Node( object ): def terminate( self ): "Send kill signal to Node and clean up after it." if self.shell: - os.killpg( self.pid, signal.SIGKILL ) + os.killpg( self.pid, signal.SIGHUP ) self.cleanup() def stop( self ): @@ -1269,11 +1269,6 @@ class Controller( Node ): ' 1>' + cout + ' 2>' + cout + '&' ) self.execed = False - def stop( self ): - "Stop controller." - self.cmd( 'kill %' + self.command ) - self.terminate() - def IP( self, intf=None ): "Return IP address of the Controller" if self.intfs: From c9b844a7218468a5a8872262415d145346ff9381 Mon Sep 17 00:00:00 2001 From: cody burkard Date: Mon, 18 Aug 2014 23:51:29 -0700 Subject: [PATCH 5/5] added controller.stop() back in --- mininet/node.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index a5ad2bd..997f4f8 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -1269,6 +1269,11 @@ class Controller( Node ): ' 1>' + cout + ' 2>' + cout + '&' ) self.execed = False + def stop( self ): + "Stop controller." + self.cmd( 'kill %' + self.command ) + self.terminate() + def IP( self, intf=None ): "Return IP address of the Controller" if self.intfs: