Commit 91f8fa35 authored by AHMADABB's avatar AHMADABB
Browse files

SOL3 grants

parent bc3f5d8d
Loading
Loading
Loading
Loading
+10 −10
Original line number Original line Diff line number Diff line
@@ -41,15 +41,15 @@ Requests a grant for a particular VNF lifecycle operation - Asynchronous mode
    Check HTTP Response Body Json Schema Is    grant
    Check HTTP Response Body Json Schema Is    grant
    Wait Until Keyword Succeeds    2 min   10 sec    Get an individual grant - Successful
    Wait Until Keyword Succeeds    2 min   10 sec    Get an individual grant - Successful


Request a new Grant - Forbidden
Requests a grant for a particular VNF lifecycle operation - Forbidden 
    [Documentation]    Test ID: 7.3.2.1.3
    [Documentation]    Test ID: 7.3.2.1.3
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Forbidden 
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Forbidden 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation and check the content of the problem details data structure returned
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation and check the content of the problem details data structure returned
    ...    Pre-conditions: The grant should not be accorded
    ...    Pre-conditions: The grant should not be accorded
    ...    Reference: section 9.4.2.3.2 - SOL003 v2.4.1
    ...    Reference: section 9.4.2.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    Send Request a new Grant Forbiden
    Send Request a new Grant Forbiden
    Check HTTP Response Status Code Is    403
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check HTTP Response Body Json Schema Is    ProblemDetails
@@ -57,7 +57,7 @@ Request a new Grant - Forbidden
GET Grants - Method not implemented
GET Grants - Method not implemented
    [Documentation]    Test ID: 7.3.2.1.4
    [Documentation]    Test ID: 7.3.2.1.4
    ...    Test title: GET Grants - Method not implemented
    ...    Test title: GET Grants - Method not implemented
    ...    Test objective: The objective is to test that GET method is not allowed to for Life cycle operation granting 
    ...    Test objective: The objective is to test that GET method is not allowed for Life cycle operation granting 
    ...    Pre-conditions: none
    ...    Pre-conditions: none
    ...    Reference: section 9.4.2.3.2 - SOL003 v2.4.1
    ...    Reference: section 9.4.2.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
@@ -69,7 +69,7 @@ GET Grants - Method not implemented
PUT Grants - Method not implemented
PUT Grants - Method not implemented
     [Documentation]    Test ID: 7.3.2.1.5
     [Documentation]    Test ID: 7.3.2.1.5
    ...    Test title: PUT Grants - Method not implemented
    ...    Test title: PUT Grants - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to for Life cycle operation granting 
    ...    Test objective: The objective is to test that PUT method is not allowed for Life cycle operation granting 
    ...    Pre-conditions: none
    ...    Pre-conditions: none
    ...    Reference: section 9.4.2.3.3 - SOL003 v2.4.1
    ...    Reference: section 9.4.2.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
@@ -81,7 +81,7 @@ PUT Grants - Method not implemented
PATCH Grants - Method not implemented
PATCH Grants - Method not implemented
    [Documentation]    Test ID: 7.3.2.1.6
    [Documentation]    Test ID: 7.3.2.1.6
    ...    Test title: PATCH Grants - Method not implemented
    ...    Test title: PATCH Grants - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to for Life cycle operation granting  
    ...    Test objective: The objective is to test that PATCH method is not allowed for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Pre-conditions: none
    ...    Reference: section 9.4.2.3.4 - SOL003 v2.4.1
    ...    Reference: section 9.4.2.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
@@ -93,7 +93,7 @@ PATCH Grants - Method not implemented
DELETE Grants - Method not implemented
DELETE Grants - Method not implemented
    [Documentation]    Test ID: 7.3.2.1.7
    [Documentation]    Test ID: 7.3.2.1.7
    ...    Test title: DELETE Grants - Method not implemented
    ...    Test title: DELETE Grants - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to for Life cycle operation granting  
    ...    Test objective: The objective is to test that DELETE method is not allowed for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Pre-conditions: none
    ...    Reference: section 9.4.2.3.5 - SOL003 v2.4.1
    ...    Reference: section 9.4.2.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
@@ -182,7 +182,7 @@ Get Grants
    Set Suite Variable    &{response}    ${body}
    Set Suite Variable    &{response}    ${body}
    
    
Put Grants
Put Grants
    Log    Trying to perform a GET. This method should not be implemented
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/grants
    Put    ${apiRoot}/${apiName}/${apiVersion}/grants
@@ -190,7 +190,7 @@ Put Grants
    Set Suite Variable    &{response}    ${body}
    Set Suite Variable    &{response}    ${body}
    
    
Patch Grants
Patch Grants
    Log    Trying to perform a GET. This method should not be implemented
    Log    Trying to perform a PATCH. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/grants
    Patch    ${apiRoot}/${apiName}/${apiVersion}/grants
@@ -199,7 +199,7 @@ Patch Grants
    
    
    
    
Delete Grants
Delete Grants
    Log    Trying to perform a GET. This method should not be implemented
    Log    Trying to perform a DELETE. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/grants
    Delete    ${apiRoot}/${apiName}/${apiVersion}/grants
+138 −67
Original line number Original line Diff line number Diff line
@@ -8,102 +8,173 @@ Documentation This resource represents an individual grant. The client can us
...    It is determined by means outside the scope of the present document, such as configuration or policy,
...    It is determined by means outside the scope of the present document, such as configuration or policy,
...    how long an individual grant is available.
...    how long an individual grant is available.


*** Variables ***
${response}    {}

*** Test Cases ***
*** Test Cases ***
Post Individual Grant - Method not implemented
Post Individual Grant - Method not implemented
    log    Trying to perform a POST. This method should not be implemented
    [Documentation]    Test ID: 7.3.2.2.1
    Set Headers  {"Accept":"${ACCEPT}"}
    ...    Test title: Post Individual Grant - Method not implemented
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    ...    Test objective: The objective is to test that POST method is not allowed for Life cycle operation granting  
    Post    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}  
    ...    Pre-conditions: none
    Log    Validate Status code
    ...    Reference: section 9.4.2.3.4 - SOL003 v2.4.1
    Integer    response status    405
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Post individual Grant
    Check HTTP Response Status Code Is    405


Get an individual grant - Successful
Get an individual grant - Successful
    [Documentation]    Test ID: 9.4.3.1
    [Documentation]    Test ID: 7.3.2.2.2
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Successful
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Successful  and perform a JSON schema validation on the returned grant data structure
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Pre-conditions: The related grant information is available to the VNFM
    ...    Pre-conditions: The related grant information is available to the VNFM
    ...    Reference: section 9.4.3 - SOL003 v2.4.1
    ...    Reference: section 9.4.3.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    log    Trying to read an individual grant
    Get individual grant success
    Set Headers    {"Accept":"${ACCEPT}"}  
    Check HTTP Response Status Code Is    200
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Check HTTP Response Body Json Schema Is    grant
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    Integer    response status    200
    ${contentType}=    Output    response headers Content-Type
    Should Contain    ${contentType}    ${CONTENT_TYPE}
    ${result}=    Output    response body
    Validate Json    grant.schema.json    ${result}
    Log    Validation OK
    
    
Get an individual grant - Process ongoing
Get an individual grant - Process ongoing
    [Tags]    no-synchronous-mode
    [Tags]    no-synchronous-mode
    [Documentation]    Test ID: 9.4.3.2
    [Documentation]    Test ID: 7.3.2.2.3
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Process ongoing
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - Process ongoing
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Pre-conditions: The process of creating the grant is ongoing, no grant is available yet.
    ...    Pre-conditions: The process of creating the grant is ongoing, no grant is available yet.
    ...    Reference: section 9.4.3 - SOL003 v2.4.1
    ...    Reference: section 9.4.3.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    log    Trying to read an individual grant
    Get individual grant on-going
    Pass Execution If    ${SYNC_MODE} == 1   Skipping. Synchronous mode is supported    
    Check HTTP Response Status Code Is    202
    Set Headers    {"Accept":"${ACCEPT}"}  
    Check HTTP Response Body Json Schema Is    grant
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    Integer    response status    202
    
    
Get an individual grant - grant rejected
Get an individual grant - grant rejected
    [Tags]    no-synchronous-mode
    [Tags]    no-synchronous-mode
    [Documentation]    Test ID: 9.4.3.3
    [Documentation]    Test ID: 7.3.2.2.4
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - grant rejected
    ...    Test title: Requests a grant for a particular VNF lifecycle operation - grant rejected
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Test objective: The objective is to request a grant for a particular VNF lifecycle operation 
    ...    Pre-conditions: The related grant is rejected
    ...    Pre-conditions: The related grant is rejected
    ...    Reference: section 9.4.3 - SOL003 v2.4.1
    ...    Reference: section 9.4.3.3.2 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: 
    ...    Applicability: none
    ...    Post-Conditions: 
    ...    Post-Conditions: none
    Get individual grant rejected
    Check HTTP Response Status Code Is    403
	Check HTTP Response Body Json Schema Is    ProblemDetails

PUT an individual grant - Method not implemented
    [Documentation]    Test ID: 7.3.2.2.5
    ...    Test title: PUT an individual grant - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: section 9.4.3.3.3 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT individual Grant
    Check HTTP Response Status Code Is    405

PATCH an individual grant - Method not implemented
    [Documentation]    Test ID: 7.3.2.2.6
    ...    Test title: PATCH an individual grant - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: section 9.4.3.3.4 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Patch individual Grant
    Check HTTP Response Status Code Is    405
    
DELETE an individual grant - Method not implemented
    [Documentation]    Test ID: 7.3.2.2.7
    ...    Test title: DELETE an individual grant - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to for Life cycle operation granting  
    ...    Pre-conditions: none
    ...    Reference: section 9.4.3.3.5 - SOL003 v2.4.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none 
    Delete individual Grant
    Check HTTP Response Status Code Is    405

*** Keywords ***
Get individual grant rejected
    log    Trying to read an individual grant
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    ${body}=    Output    response
    Set Suite Variable    &{response}    ${body}
Get individual grant on-going
    log    Trying to read an individual grant
    log    Trying to read an individual grant
    Set Headers    {"Accept":"${ACCEPT}"}  
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    ${body}=    Output    response
    Integer    response status    403
    Set Suite Variable    &{response}    ${body}
    ${problemDetails}=    Output    response body
    Validate Json    ProblemDetails.schema.json    ${problemDetails}
    Log    Validation OK
    
    
PUT an individual grant - Method not implemented
Get individual grant success
    log    Trying to perform a PUT. This method should not be implemented
    log    Trying to read an individual grant
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    ${body}=    Output    response
    Set Suite Variable    &{response}    ${body}
    
Check resource existance
    Set Headers    {"Accept":"${ACCEPT}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 
    Integer    response status    200
    
Post individual Grant
    log    Trying to read an individual grant
    Pass Execution If    ${SYNC_MODE} == 1   Skipping. Synchronous mode is supported    
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    ${body}=    Output    response
    Set Suite Variable    &{response}    ${body}
    
Put individual Grant
    Log    Trying to perform a GET. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Put    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Put    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    ${body}=    Output    response
    Integer    response status    405
    Set Suite Variable    &{response}    ${body}
    
    
PATCH an individual grant - Method not implemented
Patch individual Grant
    log    Trying to perform a PATCH. This method should not be implemented
    Log    Trying to perform a GET. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    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}"}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Patch    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    ${body}=    Output    response
    Integer    response status    405
    Set Suite Variable    &{response}    ${body}
    
    
DELETE an individual grant - Method not implemented
Delete individual Grant
    log    Trying to perform a PATCH. This method should not be implemented
    Log    Trying to perform a GET. This method should not be implemented
    Set Headers  {"Accept":"${ACCEPT}"} 
    Set Headers  {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}
    Log    Validate Status code
    ${body}=    Output    response
    Integer    response status    405
    Set Suite Variable    &{response}    ${body}
    
    
*** Keywords ***
Check HTTP Response Status Code Is
Check resource existance
    [Arguments]    ${expected_status}    
    Set Headers    {"Accept":"${ACCEPT}"}
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Log    Status code validated
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId} 

    Integer    response status    200
Check HTTP Response Header Contains
 No newline at end of file
    [Arguments]    ${CONTENT_TYPE}
    Should Contain    ${response['headers']}    ${CONTENT_TYPE}
    Log    Header is present
    
Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    ${schema} =    Catenate    ${input}    .schema.json
    Validate Json    ${schema}    ${response[0]['body']}
 No newline at end of file