[ONOS-7029] Investigate and fix the PLATdockertest
Change-Id: Ib0cc83b722e9cc22fcadd3986e9047a5a6b89429
diff --git a/TestON/drivers/common/api/controller/onosrestdriver.py b/TestON/drivers/common/api/controller/onosrestdriver.py
index 3e17dea..312f1f1 100755
--- a/TestON/drivers/common/api/controller/onosrestdriver.py
+++ b/TestON/drivers/common/api/controller/onosrestdriver.py
@@ -327,9 +327,10 @@
"from topo file" )
port = self.port
query = "/" + str( appName ) + "/active"
- response = self.send( method="DELETE",
- url="/applications" + query,
- ip = ip, port = port )
+ self.send( method="DELETE",
+ url="/applications" + query,
+ ip = ip, port = port )
+ response = self.getApp( appName, ip, port )
if response:
output = response[ 1 ]
app = {} if output == "" else json.loads( output )
@@ -360,7 +361,7 @@
main.log.exception( self.name + ": Uncaught exception!" )
main.cleanAndExit()
- def getApp( self, appName, project="org.onosproject.", ip="DEFAULT",
+ def getApp( self, appName, ip="DEFAULT",
port="DEFAULT" ):
"""
Decription:
@@ -380,14 +381,12 @@
main.log.warn( "No port given, reverting to port " +
"from topo file" )
port = self.port
- query = "/" + project + str( appName )
+ query = "/" + str( appName )
response = self.send( url="/applications" + query,
ip = ip, port = port )
if response:
if 200 <= response[ 0 ] <= 299:
- output = response[ 1 ]
- a = json.loads( output )
- return a
+ return response
else:
main.log.error( "Error with REST request, response was: " +
str( response ) )
diff --git a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
index a64ad3a..9cbe929 100755
--- a/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
+++ b/TestON/tests/PLAT/PLATdockertest/PLATdockertest.py
@@ -36,7 +36,7 @@
def __init__( self ):
self.default = ''
- global DOCKERREPO, DOCKERTAG
+ global DOCKERREPO, DOCKERTAG, INITDOCKERTAG
global IPlist
global CTIDlist
global NODElist
@@ -82,6 +82,8 @@
if imageTagCounter < len( imageTagList ):
DOCKERTAG = imageTagList[imageTagCounter]
+ if not imageTagCounter:
+ INITDOCKERTAG = DOCKERTAG
imageTagCounter += 1
main.case("Set case test params for onos image {}".format( DOCKERTAG ))
@@ -387,6 +389,7 @@
if matchObj:
wordsToRemove = re.compile("latest|- PASS|- FAIL|- No Result")
testCaseName = wordsToRemove.sub("", matchObj.group(1))
+ testCaseName = testCaseName.replace( INITDOCKERTAG,'' )
testCaseList.append(testCaseName)
testCaseCounter += 1
if matchObj: