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

Individual Subscription resource added in SOL012 PM-API

parent e95d3b85
Loading
Loading
Loading
Loading
+79 −0
Original line number Original line Diff line number Diff line
*** Settings ***
Resource   environment/variables.txt 
Resource   PolicyManagementKeywords.robot  

*** Test Cases ***
POST Individual Subscription - Method not implemented
    [Documentation]    Test ID: 10.3.1.7.1
    ...    Test title: POST Individual Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.8.3.1 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Individual Subscription
    Check HTTP Response Status Code Is    405

GET Information about an individual subscription - Successful
     [Documentation]    Test ID: 10.3.1.7.2
    ...    Test title: GET Information about an individual subscription - Successful
    ...    Test objective: The objective is to test the retrieval of Policy Management subscription and perform a JSON schema validation of the returned subscription data structure
    ...    Pre-conditions: At least one policy management subscription is available in the NFV-MANO.
    ...    Reference: Clause 5.5.8.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PolicySubscription

PUT an individual subscription - Method not implemented
     [Documentation]    Test ID: 10.3.1.7.3
    ...    Test title: PUT an individual subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.8.3.3 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    PUT Individual Subscription
    Check HTTP Response Status Code Is    405

PATCH an individual subscription - Method not implemented
     [Documentation]    Test ID: 10.3.1.7.4
    ...    Test title: PATCH an individual subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.5.8.3.4 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Individual Subscription
    Check HTTP Response Status Code Is    405
    
DELETE an individual subscription
     [Documentation]    Test ID: 10.3.1.7.5
    ...    Test title: DELETE an individual subscription
    ...    Test objective: The objective is to test that DELETE method deletes an individual subscription
    ...    Pre-conditions: At least one policy management subscription is available in the NFV-MANO.
    ...    Reference: Clause 5.5.8.3.5 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: The Policy Management subscription is not available anymore in the NFV-MANO.
    DELETE Individual Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition Individual Subscription is Deleted
    
GET Information about an individual subscription - NOT FOUND
     [Documentation]    Test ID: 10.3.1.7.6
    ...    Test title: GET Information about an individual subscription - NOT FOUND
    ...    Test objective: The objective is to test that the retrieval of individual Policy Management subscription fails when using an invalid resource identifier.
    ...    Pre-conditions: At least one Policy Management subscription is available in the NFV-MANO.
    ...    Reference: Clause 5.5.8.3.2 - ETSI GS NFV-SOL 012 [7] v3.4.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual subscription
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails
 No newline at end of file
+48 −1
Original line number Original line Diff line number Diff line
@@ -222,7 +222,6 @@ Get subscriptions with exclude_default and fields attribute selector
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
	
	
	
PUT subscriptions
PUT subscriptions
    Log    Trying to perform a PUT. 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}"}  
@@ -250,3 +249,51 @@ DELETE subscriptions
	${outputResponse}=    Output    response
	${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	Set Global Variable    ${response}    ${outputResponse}


POST Individual Subscription
    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}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
	
GET Individual subscription
    log    Trying to get information about an individual subscription
    Set Headers    {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}  
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
PUT Individual Subscription
    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}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}  
	
PATCH Individual Subscription
    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}/subscriptions/${subscriptionId}
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}
	
DELETE Individual subscription
    log    Trying to delete an individual subscription
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Delete    ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${subscriptionId}    
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse}

Check Postcondition Individual Subscription is Deleted
    Log    Check Postcondition Subscription is deleted
    GET individual Subscription
    Check HTTP Response Status Code Is    404 
+16 −16
Original line number Original line Diff line number Diff line
@@ -4,7 +4,7 @@ Resource PolicyManagementKeywords.robot


*** Test Cases ***
*** Test Cases ***
POST Create a new subscription
POST Create a new subscription
    [Documentation]    Test ID: 10.3.1.2.1
    [Documentation]    Test ID: 10.3.1.6.1
    ...    Test title: POST Create a new subscription
    ...    Test title: POST Create a new subscription
    ...    Test objective: The objective is to test that POST method creates a subscription.
    ...    Test objective: The objective is to test that POST method creates a subscription.
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -18,7 +18,7 @@ POST Create a new subscription
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
        
        
POST Create a new Subscription - DUPLICATION NOT ALLOWED
POST Create a new Subscription - DUPLICATION NOT ALLOWED
    [Documentation]    Test ID: 10.3.1.2.2
    [Documentation]    Test ID: 10.3.1.6.2
    ...    Test title: POST Create a new subscription - DUPLICATION NOT ALLOWED
    ...    Test title: POST Create a new subscription - DUPLICATION NOT ALLOWED
    ...    Test objective: The objective is to test that POST method cannot create a duplicate subscription. 
    ...    Test objective: The objective is to test that POST method cannot create a duplicate subscription. 
    ...    Pre-conditions: A subscription shall already exist. 
    ...    Pre-conditions: A subscription shall already exist. 
@@ -34,7 +34,7 @@ POST Create a new Subscription - DUPLICATION NOT ALLOWED


    
    
POST Create a new Subscription - UNPROCESSABLE ENTITY
POST Create a new Subscription - UNPROCESSABLE ENTITY
    [Documentation]    Test ID: 10.3.1.2.3
    [Documentation]    Test ID: 10.3.1.6.3
    ...    Test title: POST Create a new Subscription - UNPROCESSABLE ENTITY
    ...    Test title: POST Create a new Subscription - UNPROCESSABLE ENTITY
    ...    Test objective: The objective is to test that correct error code is generated when data in the request body cannot be processed. 
    ...    Test objective: The objective is to test that correct error code is generated when data in the request body cannot be processed. 
    ...    Pre-conditions: Request body contains invalid schema.
    ...    Pre-conditions: Request body contains invalid schema.
@@ -47,7 +47,7 @@ POST Create a new Subscription - UNPROCESSABLE ENTITY
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check HTTP Response Body Json Schema Is    ProblemDetails
        
        
GET Subscriptions
GET Subscriptions
    [Documentation]    Test ID: 10.3.1.2.4
    [Documentation]    Test ID: 10.3.1.6.4
    ...    Test title: GET Subscriptions
    ...    Test title: GET Subscriptions
    ...    Test objective: The objective is to test that GET method retrieves the list of existing subscriptions
    ...    Test objective: The objective is to test that GET method retrieves the list of existing subscriptions
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -60,7 +60,7 @@ GET Subscriptions
    Check HTTP Response Body Json Schema Is  subscriptions
    Check HTTP Response Body Json Schema Is  subscriptions


GET Subscription - Filter
GET Subscription - Filter
    [Documentation]    Test ID: 10.3.1.2.5
    [Documentation]    Test ID: 10.3.1.6.5
    ...    Test title: GET Subscription - Filter
    ...    Test title: GET Subscription - Filter
    ...    Test objective: The objective is GET the list of active subscriptions using a filter
    ...    Test objective: The objective is GET the list of active subscriptions using a filter
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -73,7 +73,7 @@ GET Subscription - Filter
    Check HTTP Response Body Json Schema Is  subscriptions
    Check HTTP Response Body Json Schema Is  subscriptions
    
    
GET subscriptions - Bad Request Invalid attribute-based filtering parameters
GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    [Documentation]    Test ID: 10.3.1.2.6
    [Documentation]    Test ID: 10.3.1.6.6
    ...    Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    ...    Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    ...    Test objective: The objective is GET the list of active subscriptions using an invalid filter
    ...    Test objective: The objective is GET the list of active subscriptions using an invalid filter
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -86,7 +86,7 @@ GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check HTTP Response Body Json Schema Is    ProblemDetails


GET subscriptions - Bad Request Response too Big
GET subscriptions - Bad Request Response too Big
    [Documentation]    Test ID: 10.3.1.2.7
    [Documentation]    Test ID: 10.3.1.6.7
    ...    Test title: GET subscriptions - Bad Request Response too Big
    ...    Test title: GET subscriptions - Bad Request Response too Big
    ...    Test objective: The objective is test that the retrieval of active subscriptions list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Test objective: The objective is test that the retrieval of active subscriptions list fails because response is too big, and perform the JSON schema validation of the failed operation HTTP response.
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -99,7 +99,7 @@ GET subscriptions - Bad Request Response too Big
    Check HTTP Response Body Json Schema Is    ProblemDetails
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
    
GET subscriptions with "all_fields" attribute selector
GET subscriptions with "all_fields" attribute selector
    [Documentation]    Test ID: 10.3.1.2.8
    [Documentation]    Test ID: 10.3.1.6.8
    ...    Test title: GET subscriptions with "all_fields" attribute selector
    ...    Test title: GET subscriptions with "all_fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "all_fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "all_fields" attribute selector
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -112,7 +112,7 @@ GET subscriptions with "all_fields" attribute selector
    Check HTTP Response Body Json Schema Is   subscriptions 
    Check HTTP Response Body Json Schema Is   subscriptions 


GET subscriptions with "exclude_default" attribute selector
GET subscriptions with "exclude_default" attribute selector
    [Documentation]    Test ID: 10.3.1.2.9
    [Documentation]    Test ID: 10.3.1.6.9
    ...    Test title: GET subscriptions with "exclude_default" attribute selector
    ...    Test title: GET subscriptions with "exclude_default" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default"s attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default"s attribute selector
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -125,7 +125,7 @@ GET subscriptions with "exclude_default" attribute selector
    Check HTTP Response Body Json Schema Is   subscriptions
    Check HTTP Response Body Json Schema Is   subscriptions


GET subscriptions with "fields" attribute selector
GET subscriptions with "fields" attribute selector
    [Documentation]    Test ID: 10.3.1.2.10
    [Documentation]    Test ID: 10.3.1.6.10
    ...    Test title: GET subscriptions with "fields" attribute selector
    ...    Test title: GET subscriptions with "fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "fields" attribute selector
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -138,7 +138,7 @@ GET subscriptions with "fields" attribute selector
    Check HTTP Response Body Json Schema Is   subscriptions
    Check HTTP Response Body Json Schema Is   subscriptions


GET subscriptions with "exclude_fields" attribute selector
GET subscriptions with "exclude_fields" attribute selector
    [Documentation]    Test ID: 10.3.1.2.11
    [Documentation]    Test ID: 10.3.1.6.11
    ...    Test title: GET subscriptions with "exclude_fields" attribute selector
    ...    Test title: GET subscriptions with "exclude_fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_fields" attribute selector
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -151,7 +151,7 @@ GET subscriptions with "exclude_fields" attribute selector
    Check HTTP Response Body Json Schema Is   subscriptions  
    Check HTTP Response Body Json Schema Is   subscriptions  
        
        
GET Subscriptions as Paged Response
GET Subscriptions as Paged Response
    [Documentation]    Test ID: 10.3.1.2.12
    [Documentation]    Test ID: 10.3.1.6.12
    ...    Test title: GET Subscriptions as Paged Response
    ...    Test title: GET Subscriptions as Paged Response
    ...    Test objective: The objective is to test that GET method  retrieve the list of existing subscriptions as paged response.
    ...    Test objective: The objective is to test that GET method  retrieve the list of existing subscriptions as paged response.
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -164,7 +164,7 @@ GET Subscriptions as Paged Response
    Check HTTP Response Header Contains Link
    Check HTTP Response Header Contains Link
        
        
PUT subscriptions - Method not implemented
PUT subscriptions - Method not implemented
     [Documentation]    Test ID: 10.3.1.2.13
     [Documentation]    Test ID: 10.3.1.6.13
    ...    Test title: PUT subscriptions - Method not implemented
    ...    Test title: PUT subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -176,7 +176,7 @@ PUT subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


PATCH subscriptions - Method not implemented
PATCH subscriptions - Method not implemented
    [Documentation]    Test ID: 10.3.1.2.14
    [Documentation]    Test ID: 10.3.1.6.14
    ...    Test title: PATCH subscriptions - Method not implemented
    ...    Test title: PATCH subscriptions - Method not implemented
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Test objective: The objective is to test that PUT method cannot modify a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -188,7 +188,7 @@ PATCH subscriptions - Method not implemented
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


DELETE subscriptions - Method not implemented
DELETE subscriptions - Method not implemented
    [Documentation]    Test ID: 10.3.1.2.15
    [Documentation]    Test ID: 10.3.1.6.15
    ...    Test title: DELETE subscriptions - Method not implemented
    ...    Test title: DELETE subscriptions - Method not implemented
    ...    Test objective: The objective is to test that DELETE method cannot delete a NS instance usage subscription
    ...    Test objective: The objective is to test that DELETE method cannot delete a NS instance usage subscription
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -201,7 +201,7 @@ DELETE subscriptions - Method not implemented
    Check Postcondition Subscriptions Exist
    Check Postcondition Subscriptions Exist
    
    
GET subscriptions with "exclude_default" and "fields" attribute selector
GET subscriptions with "exclude_default" and "fields" attribute selector
    [Documentation]    Test ID: 10.3.1.2.16
    [Documentation]    Test ID: 10.3.1.6.16
    ...    Test title: GET subscriptions with "exclude_default" and "fields" attribute selector
    ...    Test title: GET subscriptions with "exclude_default" and "fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default" and "fields" attribute selector
    ...    Test objective: The objective is to retrieve the list of active subscriptions with "exclude_default" and "fields" attribute selector
    ...    Pre-conditions: 
    ...    Pre-conditions: 
+7 −0
Original line number Original line Diff line number Diff line
{
  "id": "",
  "timeStamp": "",
  "status": "START",
  "callbackUri": "http://127.0.0.1/subscribe",
  "_links": ""
}
 No newline at end of file
+1 −2
Original line number Original line Diff line number Diff line
@@ -4,6 +4,5 @@
    "policyIds": "",
    "policyIds": "",
    "changeTypes": "CREATE_POLICY"
    "changeTypes": "CREATE_POLICY"
  },
  },
  "callbackUri": "http://127.0.0.1/subscribe",
  "callbackUri": "http://127.0.0.1/subscribe"
  "authentication": ""  
}
}
 No newline at end of file