From 2b35a2caeb3055fdaec9cc5a7519445b7da84d51 Mon Sep 17 00:00:00 2001 From: James Page Date: Thu, 12 Jul 2012 10:08:37 +0100 Subject: [PATCH] Override remote controller check to ensure that remote controller is contactable --- mininet/node.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index b441d96..d201dff 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -1073,3 +1073,12 @@ class RemoteController( Controller ): def stop( self ): "Overridden to do nothing." return + + def checkListening( self ): + "Ensure that the remote controller is accessible" + listening = self.cmd( "echo A | telnet -e A %s %d" % + ( self.ip, self.port ) ) + if 'Unable' in listening: + raise Exception( "Unable to contact the remote controller" + " at %s:%d\n" % (self.ip, self.port)) +