Merge "[CORD-3242] Use ndsend to discover IPv6 hosts"
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 826fc8c..5318ffb 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -385,8 +385,8 @@
                                         ":     " +
                                         str( response ) )
                         # NOTE: Send ctrl-c to make sure pingall is done
-                        self.handle.send( "\x03" )
-                        self.handle.expect( "Interrupt" )
+                        self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+                        self.handle.send( "" )
                         self.handle.expect( "mininet>" )
                         break
                 pattern = "Results\:"
@@ -397,8 +397,8 @@
                     return returnValue
                 else:
                     # NOTE: Send ctrl-c to make sure pingall is done
-                    self.handle.send( "\x03" )
-                    self.handle.expect( "Interrupt" )
+                    self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+                    self.handle.send( "" )
                     self.handle.expect( "mininet>" )
                     return main.FALSE
             else:
@@ -490,9 +490,9 @@
             main.log.exception( self.name + ": TIMEOUT exception" )
             response = self.handle.before
             # NOTE: Send ctrl-c to make sure command is stopped
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
             response += self.handle.before + self.handle.after
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             response += self.handle.before + self.handle.after
             main.log.debug( response )
@@ -558,9 +558,9 @@
             main.log.exception( self.name + ": TIMEOUT exception" )
             response = self.handle.before
             # NOTE: Send ctrl-c to make sure command is stopped
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
             response += self.handle.before + self.handle.after
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             response += self.handle.before + self.handle.after
             main.log.debug( response )
@@ -622,9 +622,9 @@
             main.log.exception( self.name + ": TIMEOUT exception" )
             response = self.handle.before
             # NOTE: Send ctrl-c to make sure command is stopped
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
             response += self.handle.before + self.handle.after
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             response += self.handle.before + self.handle.after
             main.log.debug( response )
@@ -686,9 +686,9 @@
             main.log.exception( self.name + ": TIMEOUT exception" )
             response = self.handle.before
             # NOTE: Send ctrl-c to make sure command is stopped
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
             response += self.handle.before + self.handle.after
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             response += self.handle.before + self.handle.after
             main.log.debug( response )
@@ -1353,8 +1353,8 @@
             main.log.error( self.name + " response: " +
                             repr( self.handle.before ) )
             # NOTE: Send ctrl-c to make sure iperf is done
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             return main.FALSE
         except pexpect.EOF:
@@ -1388,8 +1388,8 @@
         except pexpect.TIMEOUT:
             main.log.error( self.name + ": TIMEOUT exception found" )
             main.log.error( self.name + " response: " + repr( self.handle.before ) )
-            self.handle.send( "\x03" )
-            self.handle.expect( "Interrupt" )
+            self.exitFromCmd( [ "Interrupt", "mininet>" ] )
+            self.handle.send( "" )
             self.handle.expect( "mininet>" )
             return main.FALSE
         except pexpect.EOF: