[ONOS-5760] Add protected intents to FUNCintent
Change-Id: I1f0d5e02fe00de6b3cccb4d333ead09e766df6d8
diff --git a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
index 088d38d..8fa65f2 100755
--- a/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
+++ b/TestON/tests/FUNC/FUNCintentRest/dependencies/FuncIntentFunction.py
@@ -305,6 +305,7 @@
ethType="",
bandwidth="",
lambdaAlloc=False,
+ protected=False,
ipProto="",
ipSrc="",
ipDst="",
@@ -394,6 +395,7 @@
ethDst=dstMac,
bandwidth=bandwidth,
lambdaAlloc=lambdaAlloc,
+ protected=protected,
ipProto=ipProto,
ipSrc=ipSrc,
ipDst=ipDst,
@@ -436,6 +438,7 @@
ethType="",
bandwidth="",
lambdaAlloc=False,
+ protected=False,
ipProto="",
ipAddresses="",
tcp="",
@@ -575,6 +578,21 @@
main.assertReturnString += 'Link Down Failed\n'
testResult = main.FALSE
+ if protected:
+ # Check Connection
+ if utilities.retry(f=scapyCheckConnection, retValue=main.FALSE,
+ args=(main, senderNames, recipientNames, vlanId, useTCP)):
+ main.assertReturnString += 'Link down Scapy Packet Received Passed\n'
+ else:
+ main.assertReturnString += 'Link down Scapy Packet Recieved Failed\n'
+ testResult = main.FALSE
+
+ if ProtectedIntentCheck(main):
+ main.assertReturnString += 'Protected Intent Check Passed\n'
+ else:
+ main.assertReturnString += 'Protected Intent Check Failed\n'
+ testResult = main.FALSE
+
# Check intent state
if utilities.retry( f=checkIntentState, retValue=main.FALSE, args=( main, intentId ), sleep=main.checkIntentSleep ):
main.assertReturnString += 'Link Down Intent State Passed\n'
@@ -1731,3 +1749,11 @@
else:
return main.FALSE
return main.TRUE
+
+def ProtectedIntentCheck( main ):
+ intent = main.RESTs[ 0 ].intents()
+ main.log.debug(intent)
+ main.stop()
+ if "Protection" in intent:
+ return main.TRUE
+ return main.FALSE