Commit 06017656 authored by Frank Bryden's avatar Frank Bryden
Browse files

Fixes to various tests


Signed-off-by: Frank Bryden's avatarFrank Bryden <Frank.Bryden@etsi.org>
parent 4505bd1e
......@@ -522,8 +522,7 @@ Send DELETE Request for VNFD in individual VNF Package
Check Postcondition VNFD Exist
Log Checking that vnf pacakge still exists
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Set Headers {"Accept": "${ACCEPT_PLAIN}, ${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
Check HTTP Response Status Code Is 200
......
......@@ -115,7 +115,8 @@ Configure Notification Alarm List Rebuilt Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Alarm Handler
......@@ -125,7 +126,8 @@ Configure Notification Alarm Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Alarm Cleareance Handler
......@@ -135,7 +137,8 @@ Configure Notification Alarm Cleareance Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Forward
......
......@@ -21,8 +21,8 @@ NS Instance Creation
POST New nsInstance
Check HTTP Response Status Code Is 201
Check HTTP Response Header Contains Location
Check HTTP Response Body Json Schema Is NsIdentifierCreationNotification
Check resource not_instantiated
Check HTTP Response Body Json Schema Is NsInstance
Check resource not_instantiated 1
NS Instance Creation with DISABLED nsd
[Documentation] Test ID: 5.3.2.18.2
......
......@@ -19,5 +19,4 @@ NS Instance Deletion
Check resource not_instantiated
DELETE IndividualNSInstance
Check HTTP Response Status Code Is 204
Check HTTP Response Body Json Schema Is NsIdentifierDeletionNotification
Check Instance Deleted
......@@ -16,8 +16,7 @@ Initialize System
Create Mock Session ${callback_uri}:${callback_port}
Check Operation Occurrence Id
${occid}= Get Value From Json ${response['headers']['Location']} ${response}
Set Global Variable @{nsLcmOpOccId} ${occid}
Set Global Variable @{nsLcmOpOccId} ${response['headers']['Location']}
Should Not Be Empty ${nsLcmOpOccId}
Create Sessions
......@@ -84,6 +83,8 @@ Check Operation Notification
${json}= Get File schemas/${element}.schema.json
Configure Notification Forward ${element} ${callback_endpoint} ${callback_endpoint_fwd}
Configure Notification Status Handler ${callback_endpoint_fwd} ${status}
${BODY}= evaluate json.dumps(${json}) json
&{notification_request}= Create Mock Request Matcher POST ${callback_endpoint} body_type="JSON" body=${BODY}
Wait Until Keyword Succeeds 2 min 10 sec Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
Clear Requests ${callback_endpoint_fwd}
......@@ -98,29 +99,40 @@ Configure Notification Forward
Configure Notification Status Handler
[Arguments] ${endpoint} ${status}=""
Run Keyword If ${status}!="" set to dictionary ${json["notificationStatus"]} dp=${status}
${json}= evaluate {"notificationStatus": {}}
Run Keyword If '${status}' != "" set to dictionary ${json["notificationStatus"]} dp=${status}
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle ${endpoint}
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary "Content-Type"="application/json"
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Check resource operationState is
[Arguments] ${state}
String ${response['body']['operationState']} ${state}
Check resource instantiated
Check resource Instantiated
Wait Until Keyword Succeeds 2 min 10 sec Probe resource Instantiated
Probe resource Instantiated
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
String response body nsState INSTANTIATED
Check resource not_instantiated
Wait Until Keyword Succeeds 2 min 10 sec Probe resource not_instantiated
Probe resource not_instantiated
[Arguments] ${fresh_resource}=0
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
Log ${fresh_resource}
${instanceId}= Set Variable If ${fresh_resource} == 0 ${nsInstanceId} ${response['body']['id']}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${instanceId}
String response body nsState NOT_INSTANTIATED
Check operation resource state is FAILED_TEMP
......@@ -165,7 +177,7 @@ Check Postcondition NS Instance is not created
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nonExistentNsId}
Integer response status 404
Check HTTP Response Status Code Is
......@@ -178,7 +190,7 @@ Check Postcondition NS Instance is deleted
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
Get ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${disabledNsdId}
Integer response status 404
Check Postcondition NS Instance is not modified
......@@ -323,7 +335,7 @@ POST IndividualNSInstance
Set Headers {"Accept":"${ACCEPT}"}
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nonExistentNsId}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -412,7 +424,7 @@ GET Instantiate NSInstance
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/InstantiateNs.json
${body}= Format String ${template} nsFlavourId=${nsFlavourId}
${body}= Format String ${template} nsFlavourId=${nsFlavourId} vimAccountId=${vimAccountId} nsdId=${nsdId}
Post ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -935,7 +947,7 @@ POST subscriptions
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint} callbackPort=${callback_port} nsdId=${nsdId}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -947,7 +959,7 @@ POST subscriptions DUPLICATION
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint} callbackPort=${callback_port} nsdId=${nsdId}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......@@ -959,7 +971,7 @@ POST subscriptions NO DUPLICATION
Set Headers {"Content-Type": "${CONTENT_TYPE}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"}
${template}= Get File jsons/LccnSubscriptionRequest.json
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint}
${body}= Format String ${template} callbackUri=${callback_uri} callbackEndpoint=${callback_endpoint} callbackPort=${callback_port} nsdId=${nsdId}
Post ${apiRoot}/${apiName}/${apiVersion}/subscriptions ${body}
${outputResponse}= Output response
Set Global Variable ${response} ${outputResponse}
......
......@@ -98,7 +98,8 @@ Configure Notification NS LCM Operation Occurrence Start Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers}= Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Check NS LCM Operation Occurrence Result Notification Http POST Request Body Json Schema Is
......@@ -120,7 +121,8 @@ Configure Notification NS LCM Operation Occurrence Result Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers}= Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Check NS Identifier Creation Notification Http POST Request Body Json Schema Is
......@@ -142,7 +144,8 @@ Configure Notification NS Identifier Creation Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers}= Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Check NS Identifier Deletion Notification Http POST Request Body Json Schema Is
......@@ -164,7 +167,8 @@ Configure Notification NS Identifier Deletion Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers}= Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Check NS LCM Operation Occurrence Start Notification Http POST Request Body notificationStatus attribute Is
......
{{
"nsFlavourId": {nsFlavourId}
"nsdId": "{nsdId}",
"nsName": "postmanNS",
"vimAccountId": "{vimAccountId}"
}}
\ No newline at end of file
......@@ -352,7 +352,7 @@ GET all Performance Thresholds
GET Performance Thresholds with attribute-based filter
Log Trying to get thresholds present in the NFVO with filter
Set Headers {"Accept": "${ACCEPT_JSON}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/thresholds?${FILTER_OK_Threshold}
${output}= Output response
Set Suite Variable ${response} ${output}
......@@ -739,13 +739,13 @@ Send Delete request for individual NS Performance Subscription with invalid reso
Set Suite Variable ${response} ${output}
Send Post request for individual NS Performance Subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
POST ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${newSubscriptionId}
${output}= Output response
Set Suite Variable ${response} ${output}
Send Put request for individual NS Performance Subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${origOutput}= Output response
Set Suite Variable ${origResponse} ${origOutput}
......@@ -754,7 +754,7 @@ Send Put request for individual NS Performance Subscription
Set Suite Variable ${response} ${output}
Send Patch request for individual NS Performance Subscription
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": ${AUTHORIZATION}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}
${origOutput}= Output response
Set Suite Variable ${origResponse} ${origOutput}
......@@ -798,8 +798,9 @@ Create Sessions
Check Notification Endpoint
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
......
......@@ -87,7 +87,8 @@ Configure Notification Performance Information Available Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Threshold Crossed Handler
......@@ -97,7 +98,8 @@ Configure Notification Threshold Crossed Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Forward
......
......@@ -121,7 +121,7 @@ DELETE Individual VNF Package
... Applicability: none
... Post-Conditions: The VNF Package is not available anymore in the NFVO
Send DELETE Request for individual VNF Package
Check HTTP Response Status Code Is 405
Check HTTP Response Status Code Is 204
Check Postcondition VNF Package is Deleted
DELETE Individual VNF Package in operational state ENABLED
......
......@@ -119,8 +119,10 @@ Configure Notification Onboarding Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Set Suite Variable ${notification_request} ${notification_request}
Configure Notification Delete Handler
[Arguments] ${endpoint} ${type} ${change}
......@@ -129,7 +131,8 @@ Configure Notification Delete Handler
${BODY}= evaluate json.dumps(${json}) json
Log Creating mock request and response to handle status notification
&{notification_request}= Create Mock Request Matcher POST ${endpoint} body_type="JSON" body=${BODY}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Configure Notification Change Status Handler
......
......@@ -420,10 +420,11 @@ Send DELETE Request for VNFD in individual VNF Package
Check Postcondition VNFD Exist
Log Checking that vnf pacakge still exists
Set Headers {"Accept": "${ACCEPT_PLAIN}"}
Set Headers {"Accept": "${ACCEPT_ZIP}"}
Set Headers {"Accept": "${ACCEPT_PLAIN}, ${ACCEPT_ZIP}"}
Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization": "${AUTHORIZATION}"}
GET ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is 200
GET Individual VNF Package Content
......@@ -929,7 +930,8 @@ Check HTTP Response Body Subscription Identifier matches the requested Subscript
Check Notification Endpoint
&{notification_request}= Create Mock Request Matcher GET ${callback_endpoint}
&{notification_response}= Create Mock Response headers="Content-Type: application/json" status_code=204
&{headers} = Create Dictionary Content-Type=application/json
&{notification_response}= Create Mock Response headers=${headers} status_code=204
Create Mock Expectation ${notification_request} ${notification_response}
Wait Until Keyword Succeeds ${total_polling_time} ${polling_interval} Verify Mock Expectation ${notification_request}
Clear Requests ${callback_endpoint}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment