Cleanec up pingall function in mininet
diff --git a/TestON/drivers/common/cli/emulator/mininetclidriver.py b/TestON/drivers/common/cli/emulator/mininetclidriver.py
index 9336590..5b7da13 100644
--- a/TestON/drivers/common/cli/emulator/mininetclidriver.py
+++ b/TestON/drivers/common/cli/emulator/mininetclidriver.py
@@ -248,7 +248,7 @@
topoDict = self.numSwitchesN_links( *topoArgList )
return topoDict
- def pingall( self, timeout=300, shortCircuit = False ,numFailedPings = 1):
+ def pingall( self, timeout=300, shortCircuit=False, numFailedPings=1):
"""
Verifies the reachability of the hosts using pingall command.
Optional parameter timeout allows you to specify how long to
@@ -272,6 +272,7 @@
prompt="mininet>",
timeout=int( timeout ) )
else:
+ response = ""
self.handle.sendline( "pingall" )
i = self.handle.expect( [ "mininet>","X",
pexpect.EOF,
@@ -284,9 +285,7 @@
main.log.info( self.name +
": Cannot ping some of the hosts")
failedPings = 1
- main.log.info( self.name + ": failed to ping " +
- str( failedPings ) + " host" )
- while failedPings != numFailedPings:
+ while failedPings < numFailedPings:
j = self.handle.expect( [ "mininet>","X",
pexpect.EOF,
pexpect.TIMEOUT ],
@@ -296,9 +295,6 @@
break
if j == 1:
failedPings = failedPings + 1
- main.log.info( self.name + ": failed to ping "
- + str( failedPings ) + " host" )
-
if j == 2:
main.log.error( self.name +
": EOF exception found" )
@@ -314,8 +310,8 @@
str( self.handle.before ) )
break
- main.log.info( self.name + ": Cannot ping "
- + str( failedPings ) +" hosts")
+ main.log.info( self.name + ": failed to ping " +
+ str( failedPings ) + " host" )
main.log.info( str( self.handle.before ) )
response = str( self.handle.before )
if i == 2: