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

Fixes to various tests

parent 4505bd1e
Loading
Loading
Loading
Loading
+1 −2
Original line number Original line Diff line number Diff line
@@ -522,8 +522,7 @@ Send DELETE Request for VNFD in individual VNF Package


Check Postcondition VNFD Exist
Check Postcondition VNFD Exist
    Log    Checking that vnf pacakge still exists
    Log    Checking that vnf pacakge still exists
    Set Headers    {"Accept": "${ACCEPT_PLAIN}"}
    Set Headers    {"Accept": "${ACCEPT_PLAIN}, ${ACCEPT_ZIP}"}
    Set Headers    {"Accept": "${ACCEPT_ZIP}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
    GET    ${apiRoot}/${apiName}/${apiVersion}/vnf_packages/${vnfPkgZipVNFD}/vnfd
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
+6 −3
Original line number Original line Diff line number Diff line
@@ -115,7 +115,8 @@ Configure Notification Alarm List Rebuilt Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    Log  Creating mock request and response to handle status notification
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{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}
    Create Mock Expectation  ${notification_request}  ${notification_response}


Configure Notification Alarm Handler
Configure Notification Alarm Handler
@@ -125,7 +126,8 @@ Configure Notification Alarm Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    Log  Creating mock request and response to handle status notification
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{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}
    Create Mock Expectation  ${notification_request}  ${notification_response}


Configure Notification Alarm Cleareance Handler
Configure Notification Alarm Cleareance Handler
@@ -135,7 +137,8 @@ Configure Notification Alarm Cleareance Handler
    ${BODY}=    evaluate    json.dumps(${json})    json
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle status notification
    Log  Creating mock request and response to handle status notification
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{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}
    Create Mock Expectation  ${notification_request}  ${notification_response}
  
  
Configure Notification Forward
Configure Notification Forward
+2 −2
Original line number Original line Diff line number Diff line
@@ -21,8 +21,8 @@ NS Instance Creation
    POST New nsInstance
    POST New nsInstance
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is    NsIdentifierCreationNotification
    Check HTTP Response Body Json Schema Is    NsInstance
    Check resource not_instantiated
    Check resource not_instantiated    1
    
    
NS Instance Creation with DISABLED nsd
NS Instance Creation with DISABLED nsd
    [Documentation]    Test ID: 5.3.2.18.2
    [Documentation]    Test ID: 5.3.2.18.2
+0 −1
Original line number Original line Diff line number Diff line
@@ -19,5 +19,4 @@ NS Instance Deletion
    Check resource not_instantiated
    Check resource not_instantiated
    DELETE IndividualNSInstance
    DELETE IndividualNSInstance
    Check HTTP Response Status Code Is    204
    Check HTTP Response Status Code Is    204
    Check HTTP Response Body Json Schema Is    NsIdentifierDeletionNotification
    Check Instance Deleted
    Check Instance Deleted
+27 −15
Original line number Original line Diff line number Diff line
@@ -16,8 +16,7 @@ Initialize System
    Create Mock Session  ${callback_uri}:${callback_port} 
    Create Mock Session  ${callback_uri}:${callback_port} 
    
    
Check Operation Occurrence Id
Check Operation Occurrence Id
    ${occid}=    Get Value From Json    ${response['headers']['Location']}  ${response}
    Set Global Variable    @{nsLcmOpOccId}    ${response['headers']['Location']}
    Set Global Variable    @{nsLcmOpOccId}    ${occid}
    Should Not Be Empty    ${nsLcmOpOccId}
    Should Not Be Empty    ${nsLcmOpOccId}
    
    
Create Sessions
Create Sessions
@@ -84,6 +83,8 @@ Check Operation Notification
    ${json}=	Get File	schemas/${element}.schema.json
    ${json}=	Get File	schemas/${element}.schema.json
    Configure Notification Forward    ${element}    ${callback_endpoint}    ${callback_endpoint_fwd}
    Configure Notification Forward    ${element}    ${callback_endpoint}    ${callback_endpoint_fwd}
    Configure Notification Status Handler    ${callback_endpoint_fwd}    ${status}
    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}
    Wait Until Keyword Succeeds    2 min   10 sec   Verify Mock Expectation    ${notification_request}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint}
    Clear Requests    ${callback_endpoint_fwd}
    Clear Requests    ${callback_endpoint_fwd}
@@ -98,18 +99,23 @@ Configure Notification Forward
    
    
Configure Notification Status Handler
Configure Notification Status Handler
    [Arguments]    ${endpoint}    ${status}=""
    [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
    ${BODY}=    evaluate    json.dumps(${json})    json
    Log  Creating mock request and response to handle ${endpoint}
    Log  Creating mock request and response to handle ${endpoint}
    &{notification_request}=  Create Mock Request Matcher	POST  ${endpoint}  body_type="JSON"    body=${BODY}
    &{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}    
    Create Mock Expectation  ${notification_request}  ${notification_response}    
        
        
Check resource operationState is
Check resource operationState is
    [Arguments]    ${state} 
    [Arguments]    ${state} 
    String    ${response['body']['operationState']}   ${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    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -117,10 +123,16 @@ Check resource instantiated
    String    response body nsState    INSTANTIATED
    String    response body nsState    INSTANTIATED


Check resource not_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    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    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
    String    response body nsState     NOT_INSTANTIATED


Check operation resource state is FAILED_TEMP    
Check operation resource state is FAILED_TEMP    
@@ -165,7 +177,7 @@ Check Postcondition NS Instance is not created
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    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
    Integer    response status    404
    
    
Check HTTP Response Status Code Is
Check HTTP Response Status Code Is
@@ -178,7 +190,7 @@ Check Postcondition NS Instance is deleted
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    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
    Integer    response status    404
    
    
Check Postcondition NS Instance is not modified
Check Postcondition NS Instance is not modified
@@ -323,7 +335,7 @@ POST IndividualNSInstance
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    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
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	Set Global Variable    ${response}    ${outputResponse} 
	
	
@@ -412,7 +424,7 @@ GET Instantiate NSInstance
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${template}=    Get File    jsons/InstantiateNs.json
    ${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}
    Post    ${apiRoot}/${apiName}/${apiVersion}/ns_instances/${nsInstanceId}/instantiate    ${body}
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -935,7 +947,7 @@ POST subscriptions
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${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}    
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -947,7 +959,7 @@ POST subscriptions DUPLICATION
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${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}    
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
@@ -959,7 +971,7 @@ POST subscriptions NO DUPLICATION
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Set Headers  {"Content-Type": "${CONTENT_TYPE}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ${template}=    Get File    jsons/LccnSubscriptionRequest.json
    ${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}    
    Post    ${apiRoot}/${apiName}/${apiVersion}/subscriptions    ${body}    
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}
Loading