Adding more simultaneous failure cases to SRRouting

- Cases 601, 640, 641
- Some style fixes
- Refactoring out some common functionality from SR library functions
- Adding more support for configuring cluster size in SR tests
- Make sleeps in SR library functions configurable
- Increase some small timeout values that cause intermitent problems due
  to increased latencies

Change-Id: Ic66c637467d7d47e92224c9017df86162f320318
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index c5ee51d..a0a64e9 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -473,7 +473,7 @@
                     # Current host pings all other hosts specified
                     pingCmd = str( host ) + cmd + str( temp )
                     self.handle.sendline( pingCmd )
-                    self.handle.expect( "mininet>", timeout=wait + 1 )
+                    self.handle.expect( "mininet>", timeout=wait + 5 )
                     response = self.handle.before
                     if re.search( ',\s0\%\spacket\sloss', response ):
                         pingResponse += str( " h" + str( temp[ 1: ] ) )
@@ -536,7 +536,7 @@
                     while failedPings <= acceptableFailed:
                         main.log.debug( "Pinging from " + str( host ) + " to " + str( temp ) )
                         self.handle.sendline( pingCmd )
-                        self.handle.expect( "mininet>", timeout=wait + 1 )
+                        self.handle.expect( "mininet>", timeout=wait + 5 )
                         response = self.handle.before
                         if re.search( ',\s0\%\spacket\sloss', response ):
                             pingResponse += " " + str( temp )
@@ -606,9 +606,9 @@
                     discoveryResult = main.FALSE
                 if cmd:
                     self.handle.sendline( "{} ip neigh flush all".format( host ) )
-                    self.handle.expect( "mininet>", timeout=wait + 1 )
+                    self.handle.expect( "mininet>" )
                     self.handle.sendline( cmd )
-                    self.handle.expect( "mininet>", timeout=wait + 1 )
+                    self.handle.expect( "mininet>", timeout=wait + 5 )
             return discoveryResult
         except pexpect.TIMEOUT:
             main.log.exception( self.name + ": TIMEOUT exception" )
@@ -655,7 +655,7 @@
                     while failedPings <= acceptableFailed:
                         main.log.debug( "Pinging from " + str( host ) + " to " + str( temp ) )
                         self.handle.sendline( pingCmd )
-                        self.handle.expect( "mininet>", timeout=wait + 1 )
+                        self.handle.expect( "mininet>", timeout=wait + 5 )
                         response = self.handle.before
                         if re.search( ',\s0\%\spacket\sloss', response ):
                             pingResponse += " " + str( temp )
@@ -707,7 +707,7 @@
             main.log.info( "Sending: " + command )
             self.handle.sendline( command )
             i = self.handle.expect( [ command, pexpect.TIMEOUT ],
-                                    timeout=wait + 1 )
+                                    timeout=wait + 5 )
             if i == 1:
                 main.log.error(
                     self.name +
@@ -752,7 +752,7 @@
             main.log.info( "Sending: " + command )
             self.handle.sendline( command )
             i = self.handle.expect( [ command, pexpect.TIMEOUT ],
-                                    timeout=wait + 1 )
+                                    timeout=wait + 5 )
             if i == 1:
                 main.log.error(
                     self.name +
@@ -806,7 +806,7 @@
                 i = self.handle.expect( [ self.hostPrompt,
                                           '\*\*\* Unknown command: ' + pingCmd,
                                           pexpect.TIMEOUT ],
-                                        timeout=wait + 1 )
+                                        timeout=wait + 5 )
                 # For some reason we need to send something
                 # Otherwise ping results won't be read by handle
                 self.handle.sendline( "" )