VnfLcmMntOperationKeywords.robot 124 KB
Newer Older
Hammad Zafar's avatar
Hammad Zafar committed
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot   
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}        

GET VNF State Snapshot - Complete
    log    Trying to fetch the complete contents of an VNF State Snapshot
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

GET VNF State Snapshot - Range Request
    Pass Execution If    ${VNFM_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    log    Trying to get information about an VNF State Snapshot using a range request
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    Set Headers    {"Range":"${range}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

GET VNF State Snapshot - Invalid Range
    Pass Execution If    ${VNFM_RANGE_OK} == 0    Skipping this test as NFVO is not able to handle partial Requests.
    log    Trying to get information about a VNF State Snapshot with invalid range
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    Set Headers    {"Range":"${erroneousRange}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
	
GET VNF State Snapshot - Conflict in State
    Log    Trying to get information about a VNF State Snapshot whose creation process is not completed
    Set Headers    {"Accept":"${ACCEPT_OCTET}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId_creationIncomplete}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

PUT VNF State Snapshot
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

PATCH VNF State Snapshot
    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_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

DELETE VNF State Snapshot
    log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/vnf_snapshots/${vnfSnapshotInfoId}/vnf_state_snapshot 		
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 

Check HTTP Content-Type Header Is Set
    Log    Check Content-Type HTTP Header
    Should Contain    ${response['headers']}    Content-Type
    Should Be Equal As Strings    ${response['headers']['Content-Type']}    ${CONTENT_TYPE_OCTET} 
    Log    Content type validated
    
Check HTTP Content-Range Header Is Set
    Log    Check Content-Range HTTP Header
    Should Contain    ${response['headers']}    Content-Range
    Should Be Equal As Strings    ${response['headers']['Content-Range']}    ${range}/${full_length}
    Log    Header Content-Range is present
    
Check HTTP Content-Length Header Is Set
    Log    Check Content-Range HTTP Header
    Should Contain    ${response['headers']}    Content-Length
    Should Be Equal As Strings    ${response['headers']['Content-Length']}    ${full_length}
    Log    Header Content-Length is present