Commit f769b0e9 authored by Hammad Zafar's avatar Hammad Zafar Committed by Giacomo Bernini
Browse files

New resource added in PolicyManagement-API

parent d7457006
Loading
Loading
Loading
Loading
+53 −1
Original line number Diff line number Diff line
@@ -494,3 +494,55 @@ Check Postcondition Individual Policy is Not Deleted
    Log    Check Postcondition individual policy is not deleted
    GET individual Policy
    Check HTTP Response Status Code Is    200
    
POST Selected Version of an Individual Policy
    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}/${apiVersion}/policies/${policyId}/selected_version
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
	
GET Selected Version of an Individual Policy
    log    Trying to get information about the selected version of an individual policy
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/policies/${policyId}/selected_version  
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
PUT Selected Version of an Individual Policy
    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}/${apiVersion}/policies/${policyId}/selected_version
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
	
PATCH Selected Version of an Individual Policy
    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}/${apiVersion}/policies/${policyId}/selected_version
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

DELETE Selected Version of an Individual Policy
    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}/${apiVersion}/policies/${policyId}/selected_version
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  

Check HTTP Content-Type Is Set
    Log    Checking that the Content-Type HTTP header is set according to the type of policy content.
    GET individual Policy
    ${PolicyContentType}=    Get Value From Json    ${response['headers']}    $..Content-Type
    GET Selected Version of an Individual Policy
    ${HTTPContentType}=    Get Value From Json    ${response['headers']}    $..Content-Type
    Should be equal as strings    ${HTTPContentType}    ${PolicyContentType}
 No newline at end of file
+91 −0
Original line number Diff line number Diff line
*** Settings ***
Resource   environment/variables.txt 
Resource   PolicyManagementKeywords.robot  

*** Test Cases ***
POST Selected Version of an Individual Policy - Method not implemented
    [Documentation]    Test ID: 10.3.1.4.1
    ...    Test title: POST Selected Version of an Individual Policy - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented for this resource.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.5.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    405

GET Information about the Selected Version of an Individual Policy - Successful
     [Documentation]    Test ID: 10.3.1.4.2
    ...    Test title: GET Information about the Selected Version of an Individual Policy - Successful
    ...    Test objective: The objective is to test The GET method fetches the content of the selected version of an individual policy.
    ...    Pre-conditions: Individual policy is available in the NFV-MANO.
    ...    Reference: Clause 5.5.4.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    200
    Check HTTP Content-Type Is Set
    
GET Information about the Selected Version of an Individual Policy - NOT FOUND
     [Documentation]    Test ID: 10.3.1.4.3
    ...    Test title: GET Information about the Selected Version of an Individual Policy - NOT FOUND
    ...    Test objective: The objective is to test that the information about the selected version of an individual policy fails when using an invalid resource identifier.
    ...    Pre-conditions: The API producer did not find the current representation for the target resource.
    ...    Reference: Clause 5.5.4.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
GET Information about the Selected Version of an Individual Policy - CREATED STATE
     [Documentation]    Test ID: 10.3.1.4.4
    ...    Test title: GET Information about the Selected Version of an Individual Policy - NOT FOUND
    ...    Test objective: The objective is to test that the information about the selected version of an individual policy is not retrieved when it is in CREATED state.
    ...    Pre-conditions: The individual policy is in CREATED state.
    ...    Reference: Clause 5.5.4.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

PUT Selected Version of an individual policy - Method not implemented
     [Documentation]    Test ID: 10.3.1.4.5
    ...    Test title: PUT Selected Version of an individual policy - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented for this resource.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.4.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    PUT Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    405

PATCH Selected Version of an individual policy - Method not implemented 
     [Documentation]    Test ID: 10.3.1.4.6
    ...    Test title: PATCH Selected Version of an individual policy - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented for this resource.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.4.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    405

DELETE Selected Version of an individual policy - Method not implemented 
     [Documentation]    Test ID: 10.3.1.4.7
    ...    Test title: DELETE Selected Version of an individual policy - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented for this resource.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.4.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    DELETE Selected Version of an Individual Policy
    Check HTTP Response Status Code Is    405