5dbc9788a4025a0898fe90a4ff196a7db66d7ee4
[it/test.git] /
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 ${RESOURCETYPE_NAME}        ${ocloud.oran_o2_app.resourcetype_name}
18
19
20 *** Test Cases ***
21 s1, Operate resourceTypes with unsupported method
22     [documentation]  This test case verifies Operate resourceTypes with unsupported method
23     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
24
25     # Clear Expectations
26     # Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
27     # ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
28     # # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
29     # # Clear Expectations
30     # log      ${res}   level=DEBUG
31     # Integer  response status    405
32     # Object   response body
33
34     # ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
35     # # Clear Expectations
36     # log      ${res}   level=DEBUG
37     # Integer  response status    405
38     # Object   response body
39
40     # ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
41     # # Clear Expectations
42     # log      ${res}   level=DEBUG
43     # Integer  response status    405
44     # Object   response body
45
46     # ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes
47     # # Clear Expectations
48     # log      ${res}   level=DEBUG
49     # Integer  response status    405
50     # Object   response body
51
52     ${resourceTypeId}   input   3d19af47-e20d-40f9-ae74-f8cc988a045f
53     Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
54     ${res}     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
55     # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
56     Clear Expectations
57     log      ${res}   level=DEBUG
58     Integer  response status    404
59
60     ${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'}
61
62     ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}       ${resouceTypeData}
63     # Clear Expectations
64     log      ${res}   level=DEBUG
65     Integer  response status    405
66     Object   response body
67
68     GET   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes?filter=(eq,name,${RESOURCETYPE_NAME})
69     ${resourceTypeId}      output   $[0].resourceTypeId
70     ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
71     # Clear Expectations
72     log      ${res}   level=DEBUG
73     Integer  response status    405
74     Object   response body
75
76     ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
77     # Clear Expectations
78     log      ${res}   level=DEBUG
79     Integer  response status    405
80     Object   response body
81
82     ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/resourceTypes/${resourceTypeId}
83     # Clear Expectations
84     log      ${res}   level=DEBUG
85     Integer  response status    405
86     Object   response body
87
88
89
90 # s2, Operate resourcePool with unsupported method
91 #     [documentation]  This test case verifies Operate resourcePool with unsupported method
92 #     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
93
94 s2, Operate Ocloud with unsupported method
95     [documentation]  This test case verifies Operate Ocloud with unsupported method
96     [tags]  ORAN_Compliance     ORAN_O2     ORAN_O2IMS     ORAN_O2IMS_Unsupported_Method
97
98     Clear Expectations
99     # Expect Response Body        ${CURDIR}/schemas/unsupported_method_properties.json
100     ${res}     POST   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
101     # Output Schema   response body   ${CURDIR}/schemas/.output/unsupported_method_properties.json
102     # Clear Expectations
103     log      ${res}   level=DEBUG
104     Integer  response status    405
105     Object   response body
106
107     # ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1
108
109     ${res}     PUT   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
110     # Clear Expectations
111     log      ${res}   level=DEBUG
112     Integer  response status    405
113     Object   response body
114
115     ${res}     PATCH   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
116     # Clear Expectations
117     log      ${res}   level=DEBUG
118     Integer  response status    405
119     Object   response body
120
121     ${res}     DELETE   ${ORAN_O2IMS_ENDPOINT}/o2ims-infrastructureInventory/v1/
122     # Clear Expectations
123     log      ${res}   level=DEBUG
124     Integer  response status    405
125     Object   response body
126
127
128 *** Keywords ***
129 Set REST Headers
130     Set Headers     {"accept": "application/json"}
131     Set Headers     {"Content-Type": "application/json"}
132     Set Headers     {"Authorization": "Bearer ${SMO_TOKEN_DATA}"}
133     Set Client Cert   ${CURDIR}/../certs/client.pem