45fe861d45e89773cf5a5d2d84e7757b53612d11
[ric-plt/rtmgr.git] / tst / robot / Multiple_E2T_tests.txt
1 *** Settings ***
2 Suite Setup       Suite Setup
3 Suite Teardown    Suite Teardown
4 Test Timeout      6 minutes
5 Library           SSHLibrary
6 Library           String
7 Library           Collections
8
9 *** Variables ***
10 ${NEAR_RT_RIC_PLT_VM_USERNAME}    root    # User name of Near-RT RIC Platform VM
11 ${NEAR_RT_RIC_PLT_VM_PASSWORD}    root    # Password of Near-RT RIC Platform VM
12 ${NEAR_RT_RIC_PLT_VM_IP}    10.53.73.29    # IP Address of the Near-RT RIC Platform VM
13 ${NEAR_RT_RIC_PLT_HOST_IP}    10.43.8.136
14 ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME}    deployment-ricplt-rtmgr-994cd9b46-x4bf2
15 ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME}    deployment-ricplt-e2mgr-7596586d98-vpxbp
16 ${NEAR_RT_RIC_PLT_RTMGR_SERVICE_NAME}    service-ricplt-rtmgr-http
17 ${NEAR_RT_RIC_PLT_E2MGR_SERVICE_NAME}    service-ricplt-e2mgr-http
18
19 *** Test Cases ***
20 r3_multiple_e2t_instances_support_scenario1
21     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
22     ...
23     ...    Scenario 1 [ Positive Case] :
24     ...
25     ...    Step1 : \ Create a standalone E2T instance and verify whether its added in datastore(SDL file)
26     ...              Check also routes for 1090 and 1101 are mapped
27     ...
28     ...    Step2 : \ Associate R1,R2 and R3 to newly created E2T instance one and verify whether its updated in RanList.
29     ...
30     ...    Step3 : \ Disassociate R1 and R3 only from E2T instance and verify R2 exists & R1 and R3 removed from RanList
31     ...
32     ...    Step4 : \ Delete E2T instance once and verify the instance and R2 is removed from datastore(SDL file)
33     ...             Check also routes are demapped for message types 1090 and 1101
34     [Tags]    RICPLT_MultipleE2T
35     ##Scenario1 execution
36     ##1: Create one E2T Instnace
37     Log    "1. Create one E2T instance "
38     ##Delete If it exists already
39     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
40     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
41     log    ${cmd_output}
42     ##2: Verify the file /db/rt.json file whether E2T instance is updated with proper details.
43     Log    "2. Verify the file /db/rt.json file whether E2T instance is updated with proper details."
44     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json | json_pp
45     log    ${cmd_output}
46     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
47     log    ${cmd_output1}
48     Run Keyword    Should Contain    ${cmd_output}    "name" : "E2TERMINST"
49     Run Keyword    Should Contain    ${cmd_output}    "ranlist" : []
50     Run Keyword    Should Contain    ${cmd_output}    "fqdn" : "10.105.143.108:38000"
51     Run Keyword    Should Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
52         Run Keyword    Should Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
53     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|0
54
55     ##3: Associate R1,R2,R3 to E2T1
56     Log    "3. Associate R1,R2,R3 to E2T1"
57     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/associate-ran-to-e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R1\\", \\"R2\\", \\"R3\\" ] }]"
58     log    ${cmd_output}
59     ##4: Verify the file /db/rt.json whether RANs are associated succsessfully.
60     Log    "4. Verify the file /db/rt.json whether RANs are associated succsessfully. "
61     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json
62     log    ${cmd_output}
63     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME}  --tail=12 | grep meid
64     log    ${cmd_output1}
65     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
66     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
67     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R1","R2","R3"]
68     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R1 R2 R3
69         Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
70     ##5: Disassociate R1, R3 from E2T1
71     Log    "5. Disassociate R1 and R3 from E2T1"
72     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/dissociate-ran" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R1\\", \\"R3\\" ] }]"
73     log    ${cmd_output}
74     ##6: Verify the file /db/rt.json whether R1 and R3 are removed & R2 exists in Ran List.
75     Log    "6: Verify the file /db/rt.json whether R1 and R3 are removed & R2 exists in Ran List."
76     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json
77     log    ${cmd_output}
78     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12  | grep meid
79     log    ${cmd_output1}
80     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
81     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
82     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R2"]
83     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R1 R3
84         Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1 
85     ##7: Delete E2T Instance
86     Log    "7. Delete E2T instance "
87     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
88     ##8: Verify the file /db/rt.json file whether E2T instance is removed.
89     Log    "8. Verify the file /db/rt.json file whether E2T instance is removed"
90     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json | json_pp
91     log    ${cmd_output}
92     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
93     log    ${cmd_output1}
94     Run Keyword    Should Not Contain    ${cmd_output}    "ranlist" : []
95     Run Keyword    Should Not Contain    ${cmd_output}    "fqdn" : "10.105.143.108:38000"
96     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R2
97         Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1 
98     Run Keyword    Should Not Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
99         Run Keyword    Should Not Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
100
101 r3_multiple_e2t_instances_support_scenario2
102     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
103     ...
104     ...    Scenario 2 [ Positive Case] :
105     ...
106     ...    Step1 : \ Create an E2T instance along with RANList R1,R2 and verify whether its added in datastore(SDL file)
107     ...
108     ...    Step2 : \ Associate R3 and R4 to newly created E2T instance one and verify whether its updated in RanList.
109     ...
110     ...    Step3 : \ Disassociate all the RAN's from E2T instance and verify the same
111     ...
112     ...    Step4 : \ Delete E2T instance once and verify the instance removed from datastore(SDL file)
113     [Tags]    RICPLT_MultipleE2T
114     ##Scenario1 execution
115     ##1: Create one E2T Instnace
116     Log    "1. Create one E2T instance "
117     ##Delete If it exists already
118     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
119     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R1\\", \\"R2\\" ]}"
120     log    ${cmd_output}
121     ##2: Verify the file /db/rt.json file whether E2T instance is updated with proper details.
122     Log    "2. Verify the file /db/rt.json file whether E2T instance is updated with proper details."
123     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
124     log    ${cmd_output}
125     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
126     log    ${cmd_output1}
127     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
128     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R1","R2"]
129     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
130     Run Keyword    Should Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
131         Run Keyword    Should Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
132     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R1 R2
133     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
134     ##3.Associate new RAN's R3,R4 to E2T1"
135     Log    "3. Associate R3,R4 to E2T1"
136     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/associate-ran-to-e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R3\\", \\"R4\\" ] }]"
137     log    ${cmd_output}
138     ##4: Verify the file /db/rt.json whether RANs are associated succsessfully.
139     Log    "4. Verify the file /db/rt.json whether RANs are associated succsessfully. "
140     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json
141     log    ${cmd_output}
142     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
143     log    ${cmd_output1}
144     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
145     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
146     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
147     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R1","R2","R3","R4"]
148     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R3 R4
149     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
150     ##5: Disassociate all RAN's from E2T1
151         Log    "5. Disassociate all RAN's from E2T1"
152     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/dissociate-ran" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\" }]"
153     log    ${cmd_output}
154     ##6: Verify the file /db/rt.json whether R1,R2,R3 and R4 are removed.
155     Log    "6: Verify the file /db/rt.json whether R1 R2 R3 and R4 are removed in Ran List."
156     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json
157     log    ${cmd_output}
158     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
159     log    ${cmd_output1}
160     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
161     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
162     Run Keyword    Should Contain    ${cmd_output}    "ranlist":[]
163     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R1 R2 R3 R4
164     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
165     ##7: Delete E2T Instance
166     Log    "7. Delete E2T instance "
167     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
168     ##8: Verify the file /db/rt.json file whether E2T instance is removed.
169     Log    "8. Verify the file /db/rt.json file whether E2T instance is removed"
170     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json | json_pp
171     log    ${cmd_output}
172     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
173     log    ${cmd_output1}
174     Run Keyword    Should Not Contain    ${cmd_output}    "ranlist" : []
175     Run Keyword    Should Not Contain    ${cmd_output}    "fqdn" : "10.105.143.108:38000"
176     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|0
177     Run Keyword    Should Not Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
178         Run Keyword    Should Not Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
179
180 r3_multiple_e2t_instances_support_scenario3
181     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
182     ...
183     ...    Scenario 3 [ Positive Case] :
184     ...
185     ...    Step1 : \ Create an E2T instance along with RANList R1,R2 and verify whether its added in datastore(SDL file)
186     ...
187     ...    Step2 : \ Delete E2T instance by providing the RAN list and verify the instance removed from datastore(SDL file)
188     [Tags]    RICPLT_MultipleE2T
189     ##Scenario1 execution
190     ##1: Create one E2T Instnace
191     Log    "1. Create one E2T instance "
192     ##Delete If it exists already
193     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\":\\"10.105.143.108:38000\\"}"
194     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R1\\", \\"R2\\" ]}"
195     log    ${cmd_output}
196     ##2: Verify the file /db/rt.json file whether E2T instance is updated with proper details.
197     Log    "2. Verify the file /db/rt.json file whether E2T instance is updated with proper details."
198     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
199     log    ${cmd_output}
200     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
201     log    ${cmd_output1}
202     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
203     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R1","R2"]
204     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
205     Run Keyword    Should Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
206     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R1 R2
207     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
208     ##3: Delete E2T Instance
209     Log    "7. Delete E2T instance "
210     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelistTobeDissociated\\": [ \\"R1\\", \\"R2\\" ]}"
211     ##8: Verify the file /db/rt.json file whether E2T instance is removed.
212     Log    "8. Verify the file /db/rt.json file whether E2T instance is removed"
213     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json | json_pp
214     log    ${cmd_output}
215     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
216     log    ${cmd_output1}
217     Run Keyword    Should Not Contain    ${cmd_output}    "ranlist" : []
218     Run Keyword    Should Not Contain    ${cmd_output}    "fqdn" : "10.105.143.108:38000"
219     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
220     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R1 R2
221     Run Keyword    Should Not Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
222         Run Keyword    Should Not Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38000
223
224
225 r3_multiple_e2t_instances_support_scenario4
226     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
227     ...
228     ...    Scenario 4 [ Positive Case] :
229     ...
230     ...    Step1 : \ Create two E2T instances E2T1 and E2T2 along with RANList R11 and R21 respectively, verify whether its added in datastore(SDL file)
231     ...
232     ...    Step2 : \ Associate R12 and R22 to newly created E2T1 and E2T2 instance respectively and verify whether its updated in RanList.
233     ...
234     ...    Step3 : \ Disassociate all the RAN's from E2T1 instance and R23  R21 from E2T2 instance and verify the same
235     ...
236     ...    Step4 : \ Delete E2T2 instance and associate R22 to E2T1 instance and verify the from datastore(SDL file)
237     [Tags]    RICPLT_MultipleE2T
238     ##Scenario1 execution
239     ##1: Create one E2T Instnace
240     Log    "1. Create E2T instances "
241     ##Delete If it exists already
242     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
243     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\"}"
244     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R11\\" ]}"
245     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\", \\"ranNamelist\\": [ \\"R21\\" ]}"
246     log    ${cmd_output}
247     ##2: Verify the file /db/rt.json file whether E2T instance is updated with proper details.
248     Log    "2. Verify the file /db/rt.json file whether E2T instance is updated with proper details."
249     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
250     log    ${cmd_output}
251     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=35 | grep meid
252     log    ${cmd_output1}
253     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
254     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R11"]
255     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
256     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R21"]
257     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38001"
258 #Run Keyword    Should Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38001,10.105.143.108:38000
259 #Run Keyword    Should Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38001,10.105.143.108:38000
260     Run Keyword    Should Contain X Times    ${cmd_output1}    10.105.143.108:38000    4
261         Run Keyword    Should Contain X Times   ${cmd_output1}    10.105.143.108:38001    6
262     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38001|R21
263     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|1
264     ##3.Associate RAN's R12 to E2T1 and R22 to E2T2"
265     Log    "3. Associate R12 to E2T1 and R22 to E2T2"
266     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/associate-ran-to-e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R12\\" ] }]"
267     log    ${cmd_output}
268     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/associate-ran-to-e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38001\\", \\"ranNamelist\\": [ \\"R22\\" ] }]"
269     log    ${cmd_output}
270     ##4: Verify the file /db/rt.json whether RANs are associated succsessfully.
271     Log    "4. Verify the file /db/rt.json whether RANs are associated succsessfully. "
272     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
273     log    ${cmd_output}
274     ##5. Associate R13 and R23 in a single curl command to E2T1 and E2T2 respectively
275     Log    "5. Associate R13 and R23 in a single curl command to E2T1 and E2T2 respectively"
276     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/associate-ran-to-e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R13\\"] }, { \\"E2TAddress\\": \\"10.105.143.108:38001\\",\\"ranNamelist\\": [ \\"R23\\"] }]"
277     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
278     log    ${cmd_output}
279     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=25 | grep meid
280     log    ${cmd_output1}
281     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
282     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R11","R12","R13"]
283     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
284     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R21","R22","R23"]
285     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38001"
286     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R13
287     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38001|R23
288     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|2
289     ##6: Disassociate all RAN's from E2T1 R21 and R23 from E2T2
290         Log    "6: Disassociate all RAN's from E2T1 R21 and R23 from E2T2"
291     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/dissociate-ran" -H "accept: application/json" -H "Content-Type: application/json" -d "[ { \\"E2TAddress\\": \\"10.105.143.108:38000\\" } ,{ \\"E2TAddress\\": \\"10.105.143.108:38001\\", \\"ranNamelist\\": [ \\"R21\\", \\"R23\\" ] }]"
292     log    ${cmd_output}
293     ##7: Verify the file /db/rt.json whether R1,R2,R3 and R4 are removed.
294     Log    "7: Verify the file /db/rt.json whether R1 R2 R3 and R4 are removed in Ran List."
295     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json
296     log    ${cmd_output}
297     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=20 | grep meid
298     log    ${cmd_output1}
299     Run Keyword    Should Contain    ${cmd_output}    "name":"E2TERMINST"
300     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
301     Run Keyword    Should Contain    ${cmd_output}    "ranlist":[]
302     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38001"
303     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R22"]
304     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R11 R12 R13
305         Run Keyword    Should Contain    ${cmd_output1}    mme_del|R21 R23
306     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|2
307     ##8: Delete E2T2 Instance and Associate R22 to E2T1
308     Log    "8. Delete E2T2 instance and Associate R22 to E2T1"
309     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\", \\"ranAssocList\\": [ { \\"E2TAddress\\": \\"10.105.143.108:38000\\", \\"ranNamelist\\": [ \\"R22\\" ] } ]}" 
310         sleep    1
311     ##9: Verify the file /db/rt.json file whether E2T instance is removed.
312     Log    "9. Verify the file /db/rt.json file whether E2T instance is removed"
313     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
314     log    ${cmd_output}
315     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
316     log    ${cmd_output1}
317     Run Keyword    Should Not Contain    ${cmd_output}    "ranlist" : []
318     Run Keyword    Should Contain    ${cmd_output}    "fqdn":"10.105.143.108:38000"
319     Run Keyword    Should Not Contain    ${cmd_output}    "fqdn" : "10.105.143.108:38001"
320     Run Keyword    Should Contain    ${cmd_output}    "ranlist":["R22"]
321     Run Keyword    Should Contain    ${cmd_output1}    mme_del|R22
322     Run Keyword    Should Contain    ${cmd_output1}    mme_ar|10.105.143.108:38000|R22
323     Run Keyword    Should Contain    ${cmd_output1}    meid_map|end|2
324
325
326 r3_multiple_e2t_instances_support_scenario5
327     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
328     ...
329     ...    Scenario 5 [ Positive Case] :
330     ...
331     ...    Step1 : \ Create two E2T instance and verify whether its added in datastore(SDL file)
332     ...              Check also routes for 1090 and 1101 are mapped
333     ...
334     ...    Step2 : \ Remove one E2T instance and check that message types 1090 and 1101 still present.
335     ...
336     ...    Step3 : \ Remove second E2T and verify message types 1090 and 1101 are also removed 
337     ...
338     [Tags]    RICPLT_MultipleE2T
339     ##Scenario1 execution
340     ##1: Create one E2T Instnace
341     Log    "1. Create E2T instances "
342     ##Delete If it exists already
343     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}"
344     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\"}"
345     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\" }"
346     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -X POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\" }"
347     log    ${cmd_output}
348     ##2: Verify the file /db/rt.json file whether E2T instance is updated with proper details.
349     Log    "2. Verify the file /db/rt.json file whether E2T instance is updated with proper details."
350     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
351     log    ${cmd_output}
352     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=35 | grep meid
353     log    ${cmd_output1}
354     Run Keyword    Should Contain X Times    ${cmd_output1}    10.105.143.108:38000    4
355         Run Keyword    Should Contain X Times   ${cmd_output1}    10.105.143.108:38001    4
356     ##3: Delete E2T1 Instance 
357     Log    "3. Delete E2T1 instance"
358     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38000\\"}" 
359     ##4: Verify the file /db/rt.json file whether E2T instance is removed.
360     Log    "3. Verify the file /db/rt.json file whether E2T instance is removed"
361     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
362     log    ${cmd_output}
363     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
364     log    ${cmd_output1}
365     Run Keyword    Should Contain    ${cmd_output1}    mse|1090,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38001
366         Run Keyword    Should Contain    ${cmd_output1}    mse|1101,service-ricplt-e2mgr-rmr.ricplt:3801|-1|10.105.143.108:38001
367     ##4: Delete E2T2 Instance 
368     Log    "4. Delete E2T2 instance"
369     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} -- curl -X DELETE "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"10.105.143.108:38001\\"}" 
370     ##4: Verify the file /db/rt.json file whether E2T instance is removed.
371     Log    "4. Verify the file /db/rt.json file whether E2T instance is removed"
372     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} cat /db/rt.json 
373     log    ${cmd_output}
374     ${cmd_output1}    Execute command    kubectl logs -n ricplt ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME} --tail=12 | grep meid
375     log    ${cmd_output1}
376     Run Keyword    Should Not Contain    ${cmd_output1}    mse|1090
377         Run Keyword    Should Not Contain    ${cmd_output1}    mse|1101
378
379 r3_multiple_e2t_instances_support_scenario6
380     [Documentation]    This Test case covers the checks of Multiple E2T instance support feature
381     ...
382     ...    Scenario 6 [ Positive Case] :
383     ...
384     ...    Step1 : \ Create of  E2T instance with invalid fqdn fails
385         ...
386     [Tags]    RICPLT_MultipleE2T
387     ##Scenario1 execution
388     ##1: Create one E2T Instnace
389     Log    "1. Create E2T instances "
390     ##Delete If it exists already
391     ${cmd_output}    Execute command    kubectl exec -n ricplt ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME} \ -- curl -i POST "http://service-ricplt-rtmgr-http:3800/ric/v1/handles/e2t" -H "accept: application/json" -H "Content-Type: application/json" -d "{ \\"E2TAddress\\": \\"dummy.e2t.com:12345\\" }"
392     log    ${cmd_output}
393     Run Keyword    Should Contain    ${cmd_output}    400 Bad Request 
394
395 *** Keywords ***
396 Login_RIC_Platform_VM
397     [Arguments]    ${alias_name}=ricplt
398     SSHLibrary.Open Connection    ${NEAR_RT_RIC_PLT_VM_IP}    22
399     SSHLibrary.Login    ${NEAR_RT_RIC_PLT_VM_USERNAME}    ${NEAR_RT_RIC_PLT_VM_PASSWORD}
400
401 Suite Setup
402     ##Added place holder now
403     Login_RIC_Platform_VM
404         check_ric_platform_services
405
406 Suite Teardown
407     Close Connection
408
409 Wait For routing manager service
410     [Arguments]    ${maxcount}=10    ${count}=1
411     FOR    ${count}    IN RANGE    1    ${maxcount}
412     ${cmd_output}    Execute command    kubectl get pod -n ricplt | grep -i deployment-ricplt-rtmgr
413     ${status}=    Run Keyword And Ignore Error    Should Contain    ${cmd_output}    Running
414     ${ready}=    Run Keyword And Ignore Error    Should Contain    ${cmd_output}    1/1
415     Log    ${status}
416     Log    ${ready}
417     Run Keyword If    ("${status[0]}" == "PASS") and ("${ready[0]}" == "PASS")    Exit For Loop
418     ##Run Keyword And Ignore Error    Execute command
419     Sleep    2
420     END
421     Log    "Max retry count reached, seems routing manager is not running successfully"
422     Run Keyword    Should Contain    ${cmd_output}    Running
423     Run Keyword    Should Contain    ${cmd_output}    1/1
424
425 check_ric_platform_services
426     ##check whether required servcies are up and running.
427     Log    "Checking the status of Routing manager POD"
428     Wait For routing manager service    10    1
429     ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME}    Execute command    kubectl get pod -n ricplt | grep -i deployment-ricplt-rtmgr | awk '{ print $1}'
430     ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME}    Execute command    kubectl get pod -n ricplt | grep -i deployment-ricplt-e2mgr | awk '{ print $1}'
431     Set Suite Variable    ${NEAR_RT_RIC_PLT_RTMGR_POD_NAME}
432         Set Suite Variable    ${NEAR_RT_RIC_PLT_E2MGR_POD_NAME}
433