X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test_scripts%2FO2IMS_Compliance_Test%2Fo2ims_compliance%2F7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot;fp=test_scripts%2FO2IMS_Compliance_Test%2Fo2ims_compliance%2F7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot;h=331f74da8ead57bda00839c7e4853f16ed233d1b;hb=323e652696ceb2746ea571cf9854b1b4cfb56ce5;hp=0000000000000000000000000000000000000000;hpb=41edb24f29769f7ba8a083666e3858edc56ee1ef;p=it%2Ftest.git diff --git a/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot new file mode 100644 index 0000000..331f74d --- /dev/null +++ b/test_scripts/O2IMS_Compliance_Test/o2ims_compliance/7.3.8_SMO_get_security_error_response_while_issuing_APIs_with_incorrect_token.robot @@ -0,0 +1,68 @@ +*** Settings *** +Documentation Verify SMO get security error response while issuing APIs with incorrect token +# Library REST ssl_verify=False loglevel=DEBUG +Library REST ssl_verify=False +Variables ${EXECDIR}${/}test_configs.yaml + +Suite Setup Set REST Headers + +*** Variables *** +${ORAN_HOST_EXTERNAL_IP} ${ocloud.oran_o2_app.api.host} +${ORAN_SERVICE_NODE_PORT} ${ocloud.oran_o2_app.api.node_port} +${GLOBAL_OCLOUD_ID1} ${ocloud.oran_o2_app.g_ocloud_id} +${SMO_TOKEN_DATA} ${ocloud.oran_o2_app.smo_token_data} +${globalLocationId} ${ocloud.oran_o2_app.g_location_id} + +${ORAN_O2IMS_ENDPOINT} ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT} + +${SMO_TOKEN_DATA_INVALID} ${ocloud.oran_o2_app.smo_token_data}[10:]${ocloud.oran_o2_app.smo_token_data}[:10] + + +*** Test Cases *** +s1, Issue API Request without Authorization Bearer Token Header + [documentation] This test case verifies Issue API Request without Authorization Bearer Token Header + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/ + # Output Schema response body ${CURDIR}/schemas/.output/client_errors_properties.json + # Clear Expectations + log ${res} level=DEBUG + Integer response status 401 + # Object response body + +s2, Issue API Request with Authorization Bearer Token Header and invalid token + [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and invalid token + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA_INVALID}"} + Expect Response Body ${CURDIR}/schemas/client_errors_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?fields=(resourceTypeId,WrongAttrName) + # Clear Expectations + log ${res} level=DEBUG + Integer response status 401 + # Object response body + +s3, Issue API Request with Authorization Bearer Token Header and valid token + [documentation] This test case verifies Issue API Request with Authorization Bearer Token Header and valid token + [tags] ORAN_Compliance ORAN_O2 ORAN_O2IMS ORAN_O2IMS_Client_Errors + + # Clear Expectations + Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"} + Expect Response Body ${CURDIR}/schemas/ocloud_properties.json + ${res} GET ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1 + # Output Schema response body ${CURDIR}/schemas/.output/ocloud_properties.json + Clear Expectations + log ${res} level=DEBUG + Integer response status 200 + Object response body + + +*** Keywords *** +Set REST Headers + Set Headers {"accept": "application/json"} + Set Headers {"Content-Type": "application/json"} + # Set Headers {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}