Add O2 IMS compliance automation test scripts.
[it/test.git] / test_scripts / O2IMS_Compliance_Test / o2ims_compliance / 7.3.6_SMO_gets_405_while_sending_O2ims_APIs_with_unsupported_method.robot
1 *** Settings ***
2 Documentation  Verify SMO get 405 while sending o2ims APIs with unsupported method
3 # Library  REST       ssl_verify=False    loglevel=DEBUG
4 Library  REST       ssl_verify=False
5 Variables              ${EXECDIR}${/}test_configs.yaml
6
7 Suite Setup            Set REST Headers
8
9 *** Variables ***
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}
15
16 ${ORAN_O2IMS_ENDPOINT}  ${ocloud.oran_o2_app.api.protocol}://${ORAN_HOST_EXTERNAL_IP}:${ORAN_SERVICE_NODE_PORT}
17
18
19 *** Test Cases ***
20 s1, Operate resourceTypes with unsupported method
21     [documentation]  This test case verifies Operate resourceTypes with unsupported method
22     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
23
24     # Clear Expectations
25     # Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
26     # ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
27     # # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
28     # # Clear Expectations
29     # log      ${res}   level=DEBUG
30     # Integer  response status    405
31     # Object   response body
32
33     # ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
34     # # Clear Expectations
35     # log      ${res}   level=DEBUG
36     # Integer  response status    405
37     # Object   response body
38
39     # ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
40     # # Clear Expectations
41     # log      ${res}   level=DEBUG
42     # Integer  response status    405
43     # Object   response body
44
45     # ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
46     # # Clear Expectations
47     # log      ${res}   level=DEBUG
48     # Integer  response status    405
49     # Object   response body
50
51     ${resourceTypeId}   input   3d19af47-e20d-40f9-ae74-f8cc988a045f
52     Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
53     ${res}     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
54     # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
55     Clear Expectations
56     log      ${res}   level=DEBUG
57     Integer  response status    404
58
59     ${resouceTypeData}      input   {'description': 'An ethernet resource of the physical server', 'name': '5af55345-enp61s0f0', 'parentId': '5af55345-134a-406c-93b6-c5e10318afa5', 'resourceId': '016977ee-c0c3-4e5d-9e53-2bf1d6448aa5', 'resourcePoolId': 'ce2eec13-24b0-4cca-aa54-548be6cc985b','resourceTypeId': '3d19af47-e20d-40f9-ae74-f8cc988a045f'}
60
61     ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}       ${resouceTypeData}
62     # Clear Expectations
63     log      ${res}   level=DEBUG
64     Integer  response status    405
65     Object   response body
66
67     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,pserver)
68     ${resourceTypeId}      output   $[0].resourceTypeId
69     ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
70     # Clear Expectations
71     log      ${res}   level=DEBUG
72     Integer  response status    405
73     Object   response body
74
75     ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
76     # Clear Expectations
77     log      ${res}   level=DEBUG
78     Integer  response status    405
79     Object   response body
80
81     ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
82     # Clear Expectations
83     log      ${res}   level=DEBUG
84     Integer  response status    405
85     Object   response body
86
87
88
89 # s2, Operate resourcePool with unsupported method
90 #     [documentation]  This test case verifies Operate resourcePool with unsupported method
91 #     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
92
93 s2, Operate Ocloud with unsupported method
94     [documentation]  This test case verifies Operate Ocloud with unsupported method
95     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
96
97     Clear Expectations
98     # Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
99     ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
100     # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
101     # Clear Expectations
102     log      ${res}   level=DEBUG
103     Integer  response status    405
104     Object   response body
105
106     # ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1
107
108     ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
109     # Clear Expectations
110     log      ${res}   level=DEBUG
111     Integer  response status    405
112     Object   response body
113
114     ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
115     # Clear Expectations
116     log      ${res}   level=DEBUG
117     Integer  response status    405
118     Object   response body
119
120     ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
121     # Clear Expectations
122     log      ${res}   level=DEBUG
123     Integer  response status    405
124     Object   response body
125
126
127 *** Keywords ***
128 Set REST Headers
129     Set Headers     {"accept": "application/json"}
130     Set Headers     {"Content-Type": "application/json"}
131     Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}