2 Documentation Verify SMO get security error response while issuing APIs with incorrect token
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}
18 ${SMO_TOKEN_DATA_INVALID} ${ocloud.oran_o2_app.smo_token_data}[10:]${ocloud.oran_o2_app.smo_token_data}[:10]
22 s1, Issue API Request without Authorization Bearer Token Header
23 [documentation] This test case verifies Issue API Request without Authorization Bearer Token Header
24 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors
27 # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
28 Expect Response Body ${CURDIR}/schemas/client_errors_properties.json
29 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
30 # Output Schema response body ${CURDIR}/schemas/.output/client_errors_properties.json
32 log ${res} level=DEBUG
33 Integer response status 401
34 # Object response body
36 s2, Issue API Request with Authorization Bearer Token Header and invalid token
37 [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and invalid token
38 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors
41 Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA_INVALID}"}
42 Expect Response Body ${CURDIR}/schemas/client_errors_properties.json
43 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=(resourceTypeId,WrongAttrName)
45 log ${res} level=DEBUG
46 Integer response status 401
47 # Object response body
49 s3, Issue API Request with Authorization Bearer Token Header and valid token
50 [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and valid token
51 [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors
54 Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
55 Expect Response Body ${CURDIR}/schemas/ocloud_properties.json
56 ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1
57 # Output Schema response body ${CURDIR}/schemas/.output/ocloud_properties.json
59 log ${res} level=DEBUG
60 Integer response status 200
66 Set Headers {"accept": "application/json"}
67 Set Headers {"Content-Type": "application/json"}
68 # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}