+
+
+
+##### E2setup Verification using E2MGR API
+Get All NodeBs Via E2Mgr
+ [Tags] e2mgrtest etetests e2setup x2setup
+ ${log} = Run E2Mgr Get All NodeBs Request
+ FOR ${item} IN @{log.json()}
+ Log To Console ${item}
+ ${json}= Set variable ${item['globalNbId']["plmnId"]}
+ Should Be Equal ${json} ${GLOBAL_PLMNID}
+ END
+
+Get All E2T Via E2Mgr
+ [Tags] e2mgrtests etetests e2setup x2setup
+ ${log} = Run E2Mgr Get All E2T Request
+ Log To Console ${log}
+
+Get NodeB Request Via E2Mgr
+ [Tags] e2mgrtests etetests e2setup x2setup
+ Run E2Mgr Get NodeB Request ${GLOBAL_GNBID}
+
+
+#######Subscription verification between Bouncer Xapp and E2sim
+RetriveLog From XAPP
+ [Tags] etetests xapptests intrusive
+ ${podname} = Run Keyword RetrievePodsForDeployment ${GLOBAL_XAPP_DEPLOYMENT} namespace=ricxapp
+ Log To Console ${podname}
+ ${ric_xapp_pod1} = Set Variable ${podname[0]}
+ Log To Console ${ric_xapp_pod1}
+ ${log1} = Run keyword RetrieveLogForPod ${ric_xapp_pod1} namespace=ricxapp
+ ${stringLog} Convert To String ${log1}
+ Set Global Variable ${stringLog}
+ Set Global Variable ${log1}
+
+Verifying Subscription Request From Xapp
+ [Tags] etetests xapptests
+ Sleep 80
+ Log To Console "Sending Subscription Message from Xapp"
+ Should Match Regexp ${stringLog} Transmitted subscription request
+
+Verifying Subscription Response From E2sim
+ [Tags] etetests xapptests
+ Log To Console "Received Subscription Message from RAN"
+ Should Match Regexp ${stringLog} Received subscription message of type = 12011
+
+#######RIC Indication and Control flow verification betwwen Bouncer xapp and E2sim
+Verifying RIC Indication on Xapp
+ [Tags] etetests xapptests
+ Log To Console "Received Indication Message from RAN"
+ Should Match Regexp ${stringLog} Received indication message of type = 12050
+
+Verifying Control message on Xapp
+ [Tags] etetests xapptests
+ Log To Console "Verified Controll message"
+ Should Match Regexp ${stringLog} Bouncer Control OK
+
+Calculating Timestamp for subscription request on Xapp
+ [Tags] etetests xapptests
+ ${result_subreq} = Set Variable 0
+ Set Global Variable ${result_subreq}
+ FOR ${item} IN @{log1}
+ ${itemString} Convert To String ${item}
+ ${contains}= Run Keyword And Return Status Should Contain ${itemString} Transmitted subscription request
+ ${status}= Run Keyword If ${contains} Keyword Check subreq ${itemString} ELSE Keyword Check No subreq
+ END
+ Log To Console ${result_subreq}
+ Should Match ${result_subreq} 1
+
+Calculating Timestamp for subscription response on Xapp
+ [Tags] etetests xapptests
+ ${result_subres} = Set Variable 0
+ Set Global Variable ${result_subres}
+ FOR ${item} IN @{log1}
+ ${itemString} Convert To String ${item}
+ ${contains}= Run Keyword And Return Status Should Contain ${itemString} Received subscription message of type = 12011
+ ${status}= Run Keyword If ${contains} Keyword Check subres ${itemString} ELSE Keyword Check No subres
+
+ END
+ Log To Console ${result_subres}
+ Should Match ${result_subres} 1
+
+
+Latecncy Check on RoundTripTime Subscription Request and Response
+ [Tags] etetests xapptests
+ ${timediff} = Evaluate ${timestampval2} - ${timestampval1}
+ Log To Console ${timediff}
+
+
+RetriveLog From GNB
+ [Tags] etetests xapptests intrusive
+ ${e2simpodname} = Run Keyword RetrievePodsForDeployment ${Global_RAN_DEPLOYMENT} namespace=${Global_RAN_NAMESPACE}
+ Log To Console ${e2simpodname}
+ ${e2sim_pod1} = Set Variable ${e2simpodname[0]}
+ Log To Console ${e2sim_pod1}
+ ${e2sim_log} = Run keyword RetrieveLogForPod ${e2sim_pod1} namespace=${Global_RAN_NAMESPACE}
+ ${e2simstringLog} Convert To String ${e2sim_log}
+ Set Global Variable ${e2simstringLog}
+ Set Global Variable ${e2sim_log}
+
+Calculating Timestamp for Indication Messagae from E2SIM
+ [Tags] etetests xapptests
+ ${result_ind1} = Set Variable 0
+ Set Global Variable ${result_ind1}
+ @{IndMessgList}= Create List
+ Set Global Variable ${IndMessgList}
+ FOR ${item} IN @{e2sim_log}
+ ${itemString} Convert To String ${item}
+ ${contains}= Run Keyword And Return Status Should Contain ${itemString} Sent RIC Indication at time
+ ${status}= Run Keyword If ${contains} Keyword Check IndMessage ${itemString} ELSE Keyword Check No IndMsg
+ END
+ Log To Console ${result_Ind1}
+ Log To Console ${IndMessgList}
+ Should Match ${result_Ind1} 1
+
+Calculating Timestamp for Control Messages From Xapp to E2sim
+ [Tags] etetests xapptests
+ ${result_ctrl1} = Set Variable 0
+ Set Global Variable ${result_ctrl1}
+ @{ContMessgList}= Create List
+ Set Global Variable ${ContMessgList}
+ FOR ${item} IN @{e2sim_log}
+ ${itemString} Convert To String ${item}
+ ${contains}= Run Keyword And Return Status Should Contain ${itemString} Received RIC Control Msg at time
+ ${status}= Run Keyword If ${contains} Keyword Check ControlMsg ${itemString} ELSE Keyword Check No CtrlMsg
+
+ END
+ Log To Console ${result_ctrl1}
+ Log To Console ${ContMessgList}
+ Should Match ${result_ctrl1} 1
+
+
+Latecncy Check on RoundTripTime Indication message and Control message
+ [Tags] etetests xapptests
+ ${index} = Set Variable 0
+ @{Timediff1}= Create List
+ FOR ${item} IN @{ContMessgList}
+ ${timediff} = Evaluate ${ContMessgList}[${index}] - ${IndMessgList}[${index}]
+ Append To List ${Timediff1} ${timediff}
+ ${index}= Evaluate ${index} + 1
+ END
+ Log To Console ${Timediff1}
+
+
+Undeploy The Deployed XApp
+ [Tags] etetests xapptests intrusive
+ Undeploy XApp ${TEST_XAPPNAME}
+