Merge pull request #85 from opennetworkinglab/feature_uninstall
Added logic to check if an app is installed before trying to uninstall i...
diff --git a/TestON/drivers/common/cli/onosclidriver.py b/TestON/drivers/common/cli/onosclidriver.py
index aa85b8c..bfed3eb 100644
--- a/TestON/drivers/common/cli/onosclidriver.py
+++ b/TestON/drivers/common/cli/onosclidriver.py
@@ -482,15 +482,13 @@
try:
cmdStr = 'feature:list -i | grep "' + featureStr + '"'
handle = self.sendline( cmdStr )
- print "handle = ", handle
- searchStr = featureStr + " is not installed"
- if re.search( searchStr, handle ):
- main.log.info( "Feature needs to be installed before uninstalling it" )
- else:
+ if handle != '':
cmdStr = "feature:uninstall " + str( featureStr )
self.sendline( cmdStr )
# TODO: Check for possible error responses from karaf
- return main.TRUE
+ else:
+ main.log.info( "Feature needs to be installed before uninstalling it" )
+ return main.TRUE
except TypeError:
main.log.exception( self.name + ": Object not as expected" )
return None
diff --git a/TestON/tests/ProdFunc/ProdFunc.py b/TestON/tests/ProdFunc/ProdFunc.py
index 713b146..fdba3ad 100644
--- a/TestON/tests/ProdFunc/ProdFunc.py
+++ b/TestON/tests/ProdFunc/ProdFunc.py
@@ -780,11 +780,10 @@
idList = main.ONOS2.getAllDevicesId()
for id in idList:
count = main.ONOS2.FlowAddedCount( id )
- print "count = ", count
- if count != 3:
+ main.log.info("count = " +count)
+ if int(count) != 3:
case12Result = main.FALSE
break
- print "case12Result = ", case12Result
utilities.assert_equals(
expect=main.TRUE,
actual=case12Result,