Add expectedState variable to Intent class for intent checks
Change-Id: I77d3c90c0da757c2cab0ebf17c5765a6c3b8000e
diff --git a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
index 699a17d..6831811 100644
--- a/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
+++ b/TestON/tests/CHOTestMonkey/dependencies/elements/ONOSElement.py
@@ -33,6 +33,7 @@
self.default = ''
self.type = 'INTENT'
self.id = id
+ self.expectedState = 'INSTALLED'
def isHostIntent( self ):
return self.type == 'INTENT_HOST'
@@ -40,12 +41,26 @@
def isPointIntent( self ):
return self.type == 'INTENT_POINT'
+ def isFailed( self ):
+ return self.expectedState == 'FAILED'
+
+ def isInstalled( self ):
+ return self.expectedState == 'INSTALLED'
+
+ def setFailed( self ):
+ self.expectedState = 'FAILED'
+
+ def setInstalled( self ):
+ self.expectedState = 'INSTALLED'
+
class HostIntent( Intent ):
def __init__( self, id, hostA, hostB ):
Intent.__init__( self, id )
self.type = 'INTENT_HOST'
self.hostA = hostA
self.hostB = hostB
+ self.deviceA = hostA.device
+ self.deviceB = hostB.device
def __str__( self ):
return "ID: " + self.id