2 Documentation Verify general aspects of o2ims APIs
3 # Library REST ssl_verify=False loglevel=DEBUG
4 Library REST ssl_verify=False
5 Variables ${EXECDIR}${/}test_configs.yaml
7 Suite Setup Set REST Headers
10 ${ORAN_HOST_EXTERNAL_IP} ${ocloud.oran_o2_app.api.host}
11 ${ORAN_SERVICE_NODE_PORT} ${ocloud.oran_o2_app.api.node_port}
12 ${GLOBAL_OCLOUD_ID1} ${ocloud.oran_o2_app.g_ocloud_id}
13 ${SMO_TOKEN_DATA} ${ocloud.oran_o2_app.smo_token_data}
14 ${globalLocationId} ${ocloud.oran_o2_app.g_location_id}
16 ${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT}
20 s1, query ApiVersionInformation of o2ims infrastructureInventory services
21 [documentation] This test case verifies query ApiVersionInformation of o2ims infrastructureInventory services
22 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect
25 # Expect Response Body ${CURDIR}/schemas/api_versions_properties.json
26 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/api_versions
27 # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json
29 log ${res} level=DEBUG
30 Integer response status 200
33 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/api_versions
34 # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json
36 log ${res} level=DEBUG
37 Integer response status 200
40 s2, query ApiVersionInformation of o2ims infrastructureMonitoring services
41 [documentation] This test case verifies query ApiVersionInformation of o2ims infrastructureMonitoring services
42 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect
45 # Expect Response Body ${CURDIR}/schemas/api_versions_properties.json
46 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/api_versions
48 log ${res} level=DEBUG
49 Integer response status 200
52 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureMonitoring/v1/api_versions
53 # Output Schema response body ${CURDIR}/schemas/.output/api_versions_properties.json
55 log ${res} level=DEBUG
56 Integer response status 200
59 s3, query Resources with nextpage_opaque_marker
60 [documentation] This test case verifies query Resources with nextpage_opaque_marker
61 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect
64 GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools
65 ${resourcePoolId} output $[0].resourcePoolId
67 # Expect Response Body ${CURDIR}/schemas/resources_properties.json
68 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?nextpage_opaque_marker=2
71 Integer response status 200
73 Array $ minItems=1 uniqueItems=true
75 s4, query Resources with filters
76 [documentation] This test case verifies query Resources with filters
77 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect
81 GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver)
82 ${resourceTypeId} output $[0].resourceTypeId
84 GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools
85 ${resourcePoolId} output $[0].resourcePoolId
87 # Expect Response Body ${CURDIR}/schemas/resources_properties.json
88 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(eq,resourceTypeId,${resourceTypeId})
91 Integer response status 200
93 Array $ minItems=1 uniqueItems=true
95 FOR ${resource} IN @{resources}
96 Should Be Equal ${resource}[resourceTypeId] ${resourceTypeId}
100 ${substring1} input "Intel Corporation"
101 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources?filter=(cont,description,${substring1})
103 log ${res} level=INFO
104 Integer response status 200
106 Array $ minItems=1 uniqueItems=true
107 @{resources} output $
108 FOR ${resource} IN @{resources}
109 should contain ${resource}[description] ${substring1}
112 # filters combination
114 GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver_ethernet)
115 ${resourceTypeId} output $[0].resourceTypeId
117 GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools
118 ${resourcePoolId} output $[0].resourcePoolId
120 ${substring1} input "Intel Corporation"
121 # Expect Response Body ${CURDIR}/schemas/resources_properties.json
122 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourcePools/${resourcePoolId}/resources {"filter": "(eq,resourceTypeId,${resourceTypeId});(cont,description,${substring1})"}
124 log ${res} level=INFO
125 Integer response status 200
127 Array $ minItems=1 uniqueItems=true
128 @{resources} output $
129 FOR ${resource} IN @{resources}
130 Should Be Equal ${resource}[resourceTypeId] ${resourceTypeId}
131 Should Contain ${resource}[description] ${substring1}
134 s5, query Resources with attribute selector
135 [documentation] This test case verifies query Resources with attribute selector
136 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_GeneralAspect
139 Expect Response Body ${CURDIR}/schemas/resourceTypes_properties.json
140 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?all_fields
142 log ${res} level=INFO
143 Integer response status 200
145 Array $ minItems=1 uniqueItems=true
147 Expect Response Body ${CURDIR}/schemas/resourceTypes_field2_properties.json
148 ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=extensions
150 log ${res2} level=INFO
151 Integer response status 200
153 Array $ minItems=1 uniqueItems=true
155 Expect Response Body ${CURDIR}/schemas/resourceTypes_field3_properties.json
156 ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?exclude_fields=extensions
158 log ${res2} level=INFO
159 Integer response status 200
161 Array $ minItems=1 uniqueItems=true
163 Expect Response Body ${CURDIR}/schemas/resourceTypes_field4_properties.json
164 ${res2} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?exclude_default
166 log ${res2} level=INFO
167 Integer response status 200
169 Array $ minItems=1 uniqueItems=true
173 Set Headers {"accept": "application/json"}
174 Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}