b72bd1f3e8717d7fc78c6b60104a1fc3d6afd779
[it/test.git] / ric_robot_suite / helm / nanobot / configmap-src / public / testsuites / ete.robot
1 #   Copyright (c) 2019 AT&T Intellectual Property.
2 #   Copyright (c) 2020 HCL Technologies Limited. 
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15  
16 *** Settings ***
17 Documentation     Executes the End To End Test cases
18 ...
19 Resource         /robot/resources/appmgr_interface.robot
20 Resource         /robot/resources/negative_appmgr_tests.robot
21 Resource         /robot/resources/e2mgr_interface.robot
22 Resource         /robot//resources/dashboard_interface.robot
23 Resource         /robot/resources/global_properties.robot
24 Resource         /robot/resources/ric/ric_utils.robot
25  
26  
27 Library   Collections
28 Library   OperatingSystem
29 Library   RequestsLibrary
30 Library   KubernetesEntity  ${GLOBAL_RICPLT_NAMESPACE}
31 Library   String
32 *** Variables ***
33 ${TEST_XAPPNAME}      ${GLOBAL_TEST_XAPP}
34 ${TEST_NODE_B_NAME}   ${GLOBAL_TEST_NODEB_NAME}
35 ${TEST_NODE_B_IP}     ${GLOBAL_TEST_NODEB_ADDRESS}
36 ${TEST_NODE_B_PORT}   ${GLOBAL_TEST_NODEB_PORT}
37 ${ricxapp_POD_NAME}   ${GLOBAL_XAPP_NAMESPACE}-${GLOBAL_XAPP}
38 ${TEST_XAPP_ONBOARDER}  ${GLOBAL_TEST_XAPP_ONBOARDER}
39 *** Test Cases ***
40 Test XApp Manager Health
41     [Tags]  etetests  xapptests
42     Run AppMgr Health Check
43  
44 Ensure RIC Xapp Onboarder is deployed and available
45     [Tags]  etetests  xapptests
46     ${controllerName} = Set Variable    ${GLOBAL_TEST_XAPP_ONBOARDER}
47     ${cType}  ${name} = split String  ${controllerName} |
48     ${ctrl} =  Run Keyword      ${cType}        ${name}
49     Should Be Equal      ${ctrl.status.replicas}          ${ctrl.status.ready_replicas}
50
51 Ensure E2Sim is deployed and available
52     [Tags]  etetests  xapptests
53     ${ctrl} =   Run Keyword     deployment      ${Global_RAN_DEPLOYMENT}        ${Global_RAN_NAMESPACE}
54     Should Be Equal      ${ctrl.status.replicas}          ${ctrl.status.ready_replicas}
55  
56 #Before doing this kept configfile.json in to shared path and create url
57 #onboard the xapp using onboard link
58 Deploy An XApp
59     [Tags]  etetests  xapptests  intrusive
60     Deploy XApp       ${TEST_XAPPNAME}
61  
62 Retrieve The Deployed XApp
63     [Tags]  etetests  xapptests
64     Get XApp By Name  ${TEST_XAPPNAME}
65  
66 Attempt To Deploy A Duplicate XApp
67     [Tags]  etetests  xapptests  intrusive
68     Deploy Duplicate XApp And Expect Error
69  
70 Attempt To Undeploy An Already Undeployed XApp
71     [Tags]  etetests  xapptests  intrusive
72     Undeploy Nondeployed XApp And Expect Error
73  
74 Attempt To Request A Nonexistent XApp
75     [Tags]  etetests  xapptests  intrusive
76     Request Nonexistent XApp And Expect Error
77  
78 Get All NodeBs Via E2Mgr
79     [Tags]   e2mgrtest   etetests   e2setup   x2setup   ci_tests
80     Run E2Mgr Get All NodeBs Request
81
82 # disabled below 3 testcases due to x2 setup related APIs deprecated
83 # webservices interface specification deprecated
84 #Setup RAN Via E2Mgr X2
85 #[Tags]   disabled
86 ##[Tags]   e2setup   x2setup
87 #Run E2Mgr Setup NodeB X2   ${TEST_NODE_B_NAME}    ${TEST_NODE_B_IP}   ${TEST_NODE_B_PORT}
88 #Wait Until Keyword Succeeds   20s   5s   Check NodeB Status    ${TEST_NODE_B_NAME}
89 #Setup RAN Via E2Mgr Endc
90 #[Tags]   disabled
91 ##[Tags]   e2setup   x2setup
92 #Run E2Mgr Setup NodeB Endc   ${TEST_NODE_B_NAME}    ${TEST_NODE_B_IP}   ${TEST_NODE_B_PORT}
93 #Wait Until Keyword Succeeds   20s   5s   Check NodeB Status    ${TEST_NODE_B_NAME}
94 #Get NodeB via E2Mgr
95 #[Tags]   disabled
96 #[Tags]   e2setup   x2setup
97 #Run E2Mgr Get NodeB Request   ${TEST_NODE_B_NAME}
98
99 ###Not tested dashboard related
100 Setup RAN Via Dashboard Endc
101     [Tags]   e2setup_dash
102     Run Dashboard Setup NodeB Endc   ${TEST_NODE_B_NAME}    ${TEST_NODE_B_IP}   ${TEST_NODE_B_PORT}
103     Wait Until Keyword Succeeds   20s   5s   Dashboard Check NodeB Status    ${TEST_NODE_B_NAME}
104  
105 Setup RAN Via Dashboard X2
106     [Tags]   x2setup_dash
107     Run Dashboard Setup NodeB X2    ${TEST_NODE_B_NAME}    ${TEST_NODE_B_IP}   ${TEST_NODE_B_PORT}
108     Wait Until Keyword Succeeds   20s   5s   Dashboard Check NodeB Status    ${TEST_NODE_B_NAME}
109  
110 Get NodeB via Dashboard
111     [Tags]   e2setup_dash   x2setup_dash
112     Run Dashboard Get NodeB Request   ${TEST_NODE_B_NAME}
113  
114 Get All NodeBs via Dashboard
115     [Tags]   e2setup_dash   x2setup_dash    ci_tests
116     Run Dashboard Get All NodeBs Request
117 ###############
118 Verifying E2setup Request From E2sim
119     [Tags]  etetests  xapptests
120     ${ric_xapp_pod} =   Run Keyword     RetrievePodsForDeployment       ${ricxapp_POD_NAME}     ${GLOBAL_XAPP_NAMESPACE}
121     ${ric_xapp_pod1} =  Set Variable    ${ric_xapp_pod[0]}
122     Set Global Variable ${ric_xapp_pod1}
123     ${e2simpod} =       Run Keyword     RetrievePodsForDeployment       ${Global_RAN_DEPLOYMENT}        ${Global_RAN_NAMESPACE}
124     ${e2simpod1} =      Set Variable    ${e2simpod[0]}
125     Set Global Variable ${e2simpod1}
126     ${setupres_recv} =  Run     kubectl logs ${e2simpod1} -n ${Global_RAN_NAMESPACE} | grep "SETUP"
127     Log To Console      Subscription Received: ${setupres_recv}
128     Should Match Regexp         ${setupres_recv}       Received SETUP-RESPONSE-SUCCESS
129
130 Verifying Subscription Request From Xapp
131    [Tags]  etetests  xapptests
132    sleep        100
133    Log To Console      "Sending Subscription Message from Xapp"
134    ${subname} =        Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Subscription SUCCESSFUL"
135    Should Match Regexp         ${subname}      Subscription.*SUCCESSFUL
136    ${sub_sent} =       Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Message Sent: RMR State = RMR_OK"
137    Log To Console      Subscription Sent: ${sub_sent}
138    Should Match Regexp         ${sub_sent}     RMR_OK
139  
140 Verifying Subscription Response From E2sim
141    [Tags]  etetests  xapptests
142    Log To Console      "Receiving Subscription Message from RAN"
143    ${subrcv} =  Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Received subscription message of type"
144    Log To Console       Subscription Received: ${subrcv}
145    Should Match Regexp         ${subrcv}       Received subscription message
146  
147 Verifying Ric Indication From E2sim
148    [Tags]  etetests  xapptests
149    Log To Console      "Sending Indication Message from E2sim"
150    ${indication_sent} =        Run      kubectl logs ${e2simpod1} -n ${Global_RAN_NAMESPACE} | grep "Indication"
151    Log To Console       Sending Indication: ${indication_sent}
152    Should Match Regexp         ${indication_sent}      sending RIC Indication
153  
154 Verifying Ric Indication on Xapp
155    [Tags]  etetests  xapptests
156    Log To Console      "Received Indication Message from RAN"
157    ${indication_rcv} =  Run     kubectl logs ${ric_xapp_pod1} -n ${GLOBAL_XAPP_NAMESPACE} | grep "Received indication message of type"
158    Log To Console       Received Indication: ${indication_rcv}
159    Should Match Regexp         ${indication_rcv}       Received indication message
160  
161 Undeploy The Deployed XApp
162     [Tags]  etetests  xapptests  intrusive
163     Undeploy XApp     ${TEST_XAPPNAME}
164