Updating test for TOST QA Pod
Add more robust topology check to Segment routing tests
Fix Typos
Include minimum flow count # in the comparision (>= vs > )
Add option for username and password in onos-app function
Don't add app prefix if it looks like it is already the full name
Change-Id: Ib4af0f72df8e7dcc5c179fafea1fd9c61d931246
(cherry picked from commit cda0902ee85041b22da8ad7638a8518914d07322)
diff --git a/TestON/drivers/common/cli/onosdriver.py b/TestON/drivers/common/cli/onosdriver.py
index a2fade7..e9cca52 100755
--- a/TestON/drivers/common/cli/onosdriver.py
+++ b/TestON/drivers/common/cli/onosdriver.py
@@ -2574,7 +2574,7 @@
return main.TRUE if onosStatus else main.FALSE
- def onosNetCfg( self, controllerIp, path, fileName, user=None, password=None):
+ def onosNetCfg( self, controllerIp, path, fileName, user=None, password=None ):
"""
Push a specified json file to ONOS through the onos-netcfg service
@@ -2967,7 +2967,8 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def onosApp( self, onosIP, option, fileName, filePath='~/onos/'):
+ def onosApp( self, onosIP, option, fileName, filePath='~/onos/',
+ appName=None, user=None, password=None ):
"""
Wrapper for onos-app script
@@ -2977,14 +2978,21 @@
[ list|install|install!|reinstall|reinstall!|activate|deactivate|uninstall ]
- fileName - The name of the app file
Optional Arguments:
+ - appName - The name of the app, some options require this
- filePath - The location of the file
+ - user - ONOS cli user
+ - password - ONOS cli password
Returns main.TRUE on successfully executing the command, and main.FALSE if
there is an error.
"""
# FIXME: Not all options may work, more testing is required, only tested with install(!)
try:
- cmd = "onos-app %s %s %s/%s" % ( onosIP, option, filePath, fileName )
+ cmd = "onos-app %s %s %s %s/%s" % ( onosIP, option, appName if "reinstall" in option else "", filePath, fileName )
+ if user:
+ cmd += " -u %s" % user
+ if password:
+ cmd += " -p %s" % password
main.log.info( self.name + ": Sending: " + cmd )
self.handle.sendline( cmd )
self.handle.expect( self.prompt )