Added karaf shell timeoout parameter to start_onos_cli. This is needed for CHO tests as
CLI session to some ONOS instances timeout during tests when Idle for >180 seconds.
Did not include too much of exception handling for this to keep it simple (main function already
has required exception handling) this small piece of code would be hit only when karaf timeout
value is passed. There are couple of other ways to set this value, but going with this simple
approach for now. These changes were verified in CHO test environment with out issue.
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index 406e037..ded9602 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -172,7 +172,7 @@
main.cleanup()
main.exit()
- def start_onos_cli(self, ONOS_ip):
+ def start_onos_cli(self, ONOS_ip, karafTimeout=""):
try:
self.handle.sendline("")
x = self.handle.expect([
@@ -190,6 +190,11 @@
if i == 0:
main.log.info(str(ONOS_ip)+" CLI Started successfully")
+ if karafTimeout:
+ self.handle.sendline("config:property-set -p org.apache.karaf.shell sshIdleTimeout "+karafTimeout)
+ self.handle.expect("\$")
+ self.handle.sendline("onos -w "+str(ONOS_ip))
+ self.handle.expect("onos>")
return main.TRUE
else:
#If failed, send ctrl+c to process and try again
@@ -201,6 +206,11 @@
if i == 0:
main.log.info(str(ONOS_ip)+" CLI Started "+
"successfully after retry attempt")
+ if karafTimeout:
+ self.handle.sendline("config:property-set -p org.apache.karaf.shell sshIdleTimeout "+karafTimeout)
+ self.handle.expect("\$")
+ self.handle.sendline("onos -w "+str(ONOS_ip))
+ self.handle.expect("onos>")
return main.TRUE
else:
main.log.error("Connection to CLI "+\