Merge pull request #121 from pingping-lin/master
let the timeout value configurable
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index c7e25e0..808fe7c 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -188,7 +188,8 @@
main.cleanup()
main.exit()
- def startOnosCli( self, ONOSIp, karafTimeout="" ):
+ def startOnosCli( self, ONOSIp, karafTimeout="",
+ commandlineTimeout=10, onosStartTimeout=60 ):
"""
karafTimeout is an optional argument. karafTimeout value passed
by user would be used to set the current karaf shell idle timeout.
@@ -206,7 +207,7 @@
try:
self.handle.sendline( "" )
x = self.handle.expect( [
- "\$", "onos>" ], timeout=10 )
+ "\$", "onos>" ], commandlineTimeout)
if x == 1:
main.log.info( "ONOS cli is already running" )
@@ -216,7 +217,7 @@
self.handle.sendline( "onos -w " + str( ONOSIp ) )
i = self.handle.expect( [
"onos>",
- pexpect.TIMEOUT ], timeout=60 )
+ pexpect.TIMEOUT ], onosStartTimeout )
if i == 0:
main.log.info( str( ONOSIp ) + " CLI Started successfully" )
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index a0a1b44..9734027 100644
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -98,7 +98,7 @@
response = main.FALSE
return response
- def onosPackage( self ):
+ def onosPackage( self, opTimeout=30 ):
"""
Produce a self-contained tar.gz file that can be deployed
and executed on any platform with Java 7 JRE.
@@ -106,7 +106,7 @@
try:
self.handle.sendline( "onos-package" )
self.handle.expect( "onos-package" )
- self.handle.expect( "tar.gz", timeout=30 )
+ self.handle.expect( "tar.gz", opTimeout )
handle = str( self.handle.before )
main.log.info( "onos-package command returned: " +
handle )
@@ -153,7 +153,7 @@
main.cleanup()
main.exit()
- def cleanInstall( self ):
+ def cleanInstall( self, mciTimeout=600 ):
"""
Runs mvn clean install in the root of the ONOS directory.
This will clean all ONOS artifacts then compile each module
@@ -180,7 +180,7 @@
'BUILD\sSUCCESS',
'onos\$', #TODO: fix this to be more generic?
'ONOS\$',
- pexpect.TIMEOUT ], timeout=600 )
+ pexpect.TIMEOUT ], mciTimeout )
if i == 0:
main.log.error( self.name + ":There is insufficient memory \
for the Java Runtime Environment to continue." )
diff --git a/TestON/tests/SdnIpTest/SdnIpTest.py b/TestON/tests/SdnIpTest/SdnIpTest.py
index b95bfe0..3a766dd 100644
--- a/TestON/tests/SdnIpTest/SdnIpTest.py
+++ b/TestON/tests/SdnIpTest/SdnIpTest.py
@@ -48,13 +48,13 @@
# else:
# main.log.warn( "Did not pull new code so skipping mvn " +
# "clean install" )
- cleanInstallResult = main.ONOSbench.cleanInstall()
+ cleanInstallResult = main.ONOSbench.cleanInstall( mciTimeout= 1000 )
main.ONOSbench.getVersion( report=True )
#cellResult = main.ONOSbench.setCell( cellName )
#verifyResult = main.ONOSbench.verifyCell()
main.step( "Creating ONOS package" )
- packageResult = main.ONOSbench.onosPackage()
+ packageResult = main.ONOSbench.onosPackage( opTimeout=500 )
main.step( "Installing ONOS package" )
onos1InstallResult = main.ONOSbench.onosInstall( options="-f",
@@ -63,13 +63,14 @@
main.step( "Checking if ONOS is up yet" )
#time.sleep( 300 )
for i in range( 2 ):
- onos1Isup = main.ONOSbench.isup( ONOS1Ip )
+ onos1Isup = main.ONOSbench.isup( ONOS1Ip, timeout=420 )
if onos1Isup:
break
if not onos1Isup:
main.log.report( "ONOS1 didn't start!" )
- cliResult = main.ONOScli.startOnosCli( ONOS1Ip )
+ cliResult = main.ONOScli.startOnosCli( ONOS1Ip,
+ commandlineTimeout=100, onosStartTimeout=600)
case1Result = ( cleanInstallResult and packageResult and
cellResult and verifyResult and