Add O2 IMS compliance automation test scripts.
[it/test.git] / test_scripts / O2IMS_Compliance_Test / o2ims_compliance / 7.3.9_SMO_get_correct_response_while_issuing_requests_with_incorrect_APIs.robot
1 *** Settings ***
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
6
7
8 Suite Setup            Set REST Headers
9
10 *** Variables ***
11 ${ORAN_HOST_EXTERNAL_IP}    ${ocloud.oran_o2_app.api.host}
12 ${ORAN_SERVICE_NODE_PORT}   ${ocloud.oran_o2_app.api.node_port}
13 ${GLOBAL_OCLOUD_ID1}        ${ocloud.oran_o2_app.g_ocloud_id}
14 ${SMO_TOKEN_DATA}           ${ocloud.oran_o2_app.smo_token_data}
15 ${globalLocationId}         ${ocloud.oran_o2_app.g_location_id}
16
17 ${ORAN_O2IMS_ENDPOINT}  ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT}
18
19
20
21 *** Test Cases ***
22 s1, Verify query with wrong url got error code.
23     [documentation]  Verify query with wrong url got error code.
24     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Client_Errors
25
26     Clear Expectations
27     Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
28     ${res}     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagersWrongURL
29     log      ${res}   level=DEBUG
30     Integer  response status    404
31     # Object   response body
32
33 s2, Verify query with wrong api version got error code.
34     [documentation]  Verify query with wrong api version got error code.
35     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Client_Errors
36
37     Clear Expectations
38     Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
39     Expect Response Body      ${CURDIR}${/}..${/}o2ims_compliance${/}schemas${/}client_errors_properties.json
40     ${res}     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v2/deploymentManagers
41     # Clear Expectations
42     log      ${res}   level=DEBUG
43     Integer  response status    404
44     # Object   response body
45
46 s3, Verify query with wrong deploymentManagersID got error code.
47     [documentation]  Verify query with wrong deploymentManagersID got error code.
48     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Client_Errors
49
50     # Clear Expectations
51     Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
52     Expect Response Body        ${CURDIR}${/}..${/}o2ims_compliance${/}schemas${/}client_errors_properties.json
53     ${res}     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/deploymentManagers/wrongDeploymentManagerID
54     Clear Expectations
55     log      ${res}   level=DEBUG
56     Integer  response status    404
57     Object   response body
58
59
60 *** Keywords ***
61 Set REST Headers
62     Set Headers     {"accept": "application/json"}
63     Set Headers     {"Content-Type": "application/json"}
64     # Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}