Newer
Older
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Get subscriptions
Log Get the list of active subscriptions
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Log Execute Query and validate response
Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Get subscriptions - filter
Log Get the list of active subscriptions using a filter
Set Headers {"Accept": "${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${sub_filter}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Get subscriptions - invalid filter
Log Get the list of active subscriptions using an invalid filter
Set Headers {"Accept": "${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?${sub_filter_invalid}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Get subscriptions with all_fields attribute selector
Log Get the list of active subscriptions, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?exclude_default
${output}= Output response
Set Suite Variable ${response} ${output}
Get subscriptions with exclude_default attribute selector
Log Get the list of active subscriptions, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?exclude_default
${output}= Output response
Set Suite Variable ${response} ${output}
Get subscriptions with fields attribute selector
Log Get the list of active subscriptions, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
Get subscriptions with exclude_fields attribute selector
Log Get the list of active subscriptions, using fields
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions?exclude_fields=${fields}
${output}= Output response
Set Suite Variable ${response} ${output}
PUT subscriptions
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
PATCH subscriptions
log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
DELETE subscriptions
log Trying to perform a DELETE. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Post Create Individual subscription
log Trying to perform a POST. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Get Individual subscription
log Trying to get information about an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Put Individual subscription
log Trying to perform a PUT. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Put ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Patch Individual subscription
log Trying to perform a PATCH. This method should not be implemented
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Patch ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Delete Individual subscription
log Try to delete an individual subscription
Set Headers {"Accept":"${ACCEPT}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Delete ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Put Notification subscription
log Trying to perform a PUT. This method should not be implemented
Put ${callback_endpoint}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Patch Notification subscription
log Trying to perform a PATCH. This method should not be implemented
Patch ${callback_endpoint}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
Delete Notification subscription
log Trying to perform a DELETE. This method should not be implemented
Delete ${callback_endpoint}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
POST Operation occurrence
log The POST method delivers a notification from the server to the client.
${json}= Get File schemas/NsLcmOperationOccurrenceNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle NSLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
POST Id creation
log The POST method delivers a notification from the server to the client.
${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
POST Id deletion
log The POST method delivers a notification from the server to the client.
${json}= Get File schemas/vnfIdentifierCreationNotification.schema.json
${BODY}= evaluate json.loads('''${json}''') json
Log Creating mock request and response to handle vnfLcmOperationOccurrenceNotification
&{req}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON_SCHEMA" body=${BODY}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Log Verifying results
Verify Mock Expectation ${req}
Log Cleaning the endpoint
Clear Requests ${callback_endpoint}
GET test endpoint
log The GET method allows the server to test the notification endpoint
&{req}= Create Mock Request Matcher GET ${callback_endpoint}
&{rsp}= Create Mock Response headers="Content-Type: application/json" status_code=204
Create Mock Expectation ${req} ${rsp}
Sleep ${sleep_interval}
Verify Mock Expectation ${req}
Giacomo Bernini
committed
Clear Requests ${callback_endpoint}
Check HTTP Response Header Contain Link
${linkURL}= Get Value From Json ${response['headers']} $..Link
Giacomo Bernini
committed
Should Not Be Empty ${linkURL}