Commit f834ebff authored by Sana Zulfiqar's avatar Sana Zulfiqar Committed by Giacomo Bernini
Browse files

Added tests for PM Jobs

parent c3c3d35d
Loading
Loading
Loading
Loading
+23 −10
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ GET individual NS Performance Job
    ...    Test title: Get individual NS Performance Job
    ...    Test objective: The objective is to test the retrieval of an individual NS Performance monitoring job and perform a JSON schema and content validation of the collected job data structure
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -25,7 +25,7 @@ GET individual NS Performance Job with invalid resource identifier
    ...    Test title: Get individual NS Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual NS Performance monitoring job fails when using an invalid resource identifier, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -38,7 +38,7 @@ DELETE Individual NS Performance Job with invalid resource identifier
    ...    Test title: Delete individual NS Performance Job with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual NS Performance monitoring job fails when using an invalid resource identifier
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -50,7 +50,7 @@ POST Individual NS Performance Job - Method not implemented
    ...    Test title: POST Individual NS Performance Job - method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new NS Performance Monitoring Job
    ...    Pre-conditions: none
    ...    Reference: Clause 7.4.3.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.1 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -62,7 +62,7 @@ PUT Individual NS Performance Job - Method not implemented
    ...    Test title: PUT Individual NS Performance Job - method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing NS Performance Monitoring Job
    ...    Pre-conditions: none
    ...    Reference: Clause 7.4.3.3.3 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.3 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -74,7 +74,7 @@ PATCH Individual NS Performance Job
    ...    Test title: PATCH Individual NS Performance Job 
    ...    Test objective: The objective is to test that PATCH method modify an existing new NS Performance Monitoring Job
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 6.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: Resource modified
@@ -87,7 +87,7 @@ DELETE Individual NS Performance Job
    ...    Test title: Delete Individual NS Performance Job
    ...    Test objective: The objective is to test the deletion of an individual NS Performance monitoring job
    ...    Pre-conditions: A NS instance is instantiated. One or more NS Performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.3.3.5 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS Performance Job is no more available in the NFVO    
@@ -99,11 +99,24 @@ PATCH Individual NS Performance Job - Precondition failed
    [Documentation]    Test ID: 5.3.4.2.8
    ...    Test title: PATCH Individual NS Performance Job - Precondition failed
    ...    Test objective: The objective is to attempt to Modify an individual NS Performance job fails, where the precondition was not met
    ...    Pre-conditions: The related job already exsisit
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Pre-conditions: The related job already exist
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The resource is not modified
    Send Patch request for individual NS Performance Job
    Check HTTP Response Status Code Is    412
    Check HTTP Response Body Json Schema Is     ProblemDetails
    
PATCH Individual NS Performance Job - Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.2.9
    ...    Test title: PATCH Individual NS Performance Job - Unprocessable Entity
    ...    Test objective: The objective is to test that PATCH method cannot modify an exsisting individual PM job resource when a request contains syntactically correct data but the data cannot be processed.
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.3.3.4 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send Patch request for individual NS Performance Job with unprocessable entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails
+21 −0
Original line number Diff line number Diff line
@@ -97,6 +97,17 @@ Send Post Request Create new NS Performance Monitoring Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Send POST request for NS Performance Monitoring Job with unprocessable entity
    Log    trying to create a new NS PM Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}    callback_uri=${unreachable_callback_uri}:${callback_port}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send PUT Request for all NS Performance Monitoring Jobs 
    Log    Trying to perform a PUT. This method should not be implemented
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
@@ -244,6 +255,16 @@ Send Patch request for individual NS Performance Job
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Send Patch request for individual NS Performance Job with unprocessable entity
    Set Headers  {"Accept":"${ACCEPT_JSON}"} 
    Set Headers  {"Content-Type": "${CONTENT_TYPE_PATCH}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    ${template}=    Get File    jsons/PmJobModifications.json
    ${body}=        Format String   ${template}    callback_uri=${unreachable_callback_uri}:${callback_port}
    PATCH    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs/${pmJobId}     ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition NS Performance Job is not Created
    Log    Trying to get a new Pm Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+29 −16
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ GET all NS Performance Monitoring Jobs
    ...    Test title: GET all NS Performance Monitoring Jobs
    ...    Test objective: The objective is to test the retrieval of all the available NS performance monitoring jobs and perform a JSON schema and content validation of the collected jobs data structure
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -27,7 +27,7 @@ GET NS Performance Monitoring Jobs with attribute-based filter
    ...    Test title: GET all NS Performance Monitoring Jobs with attribute-based filter
    ...    Test objective: The objective is to test the retrieval of NS performance monitoring jobs using attribute-based filter, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued attribute-based filter
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -41,7 +41,7 @@ GET all NS Performance Monitoring Jobs with "all_fields" attribute selector
    ...    Test title: GET all NS Performance Monitoring Jobs with "all_fields" attribute selector
    ...    Test objective: The objective is to test the retrieval of all NS performance monitoring jobs "all_fields" attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued "all_fileds" selector
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -55,7 +55,7 @@ GET all NS Performance Monitoring Jobs with "exclude_default" attribute selector
    ...    Test title: GET all NS Performance Monitoring Jobs with "exclude_default" attribute selector
    ...    Test objective: The objective is to test the retrieval of all NS performance monitoring jobs "exclude_default" attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued "exclude_default" selector
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -69,7 +69,7 @@ GET all NS Performance Monitoring Jobs with "fields" attribute selector
    ...    Test title: GET all NS Performance Monitoring Jobs with "fields" attribute selector
    ...    Test objective: The objective is to test the retrieval of all NS performance monitoring jobs "fields" attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued "include" selector
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports the use of "include" attribute selector
    ...    Post-Conditions: none
@@ -83,7 +83,7 @@ GET all NS Performance Monitoring Jobs with "exclude" attribute selector
    ...    Test title: GET all NS Performance Monitoring Jobs with exclude_fields attribute selector
    ...    Test objective: The objective is to test the retrieval of all NS performance monitoring jobs "exclude" attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued "exclude" selector
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports the use of "exclude" attribute selector
    ...    Post-Conditions: none
@@ -97,7 +97,7 @@ GET NS Performance Monitoring Jobs with invalid attribute-based filter
    ...    Test title: GET NS Performance Monitoring Jobs with invalid attribute-based filter
    ...    Test objective: The objective is to test that the retrieval of NS performance monitoring jobs fails when using invalid attribute-based filter, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -110,7 +110,7 @@ GET NS Performance Monitoring Jobs with invalid resource endpoint
    ...    Test title: GET NS Performance Monitoring Jobs with invalid resource endpoint
    ...    Test objective: The objective is to test that the retrieval of NS performance monitoring jobs fails when using invalid resource endpoint
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -123,7 +123,7 @@ Create new NS Performance Monitoring Job
    ...    Test title:  Create a new NS Performance Monitoring Job
    ...    Test objective: The objective is to test the creation of a new NS performance monitoring job and perform the JSON schema validation of the returned job data structure
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.1 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: The NS Performance Job is successfully created on the NFVO
@@ -137,7 +137,7 @@ PUT all NS Performance Monitoring Jobs - Method not implemented
    ...    Test title: PUT all NS Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify NS Performance Monitoring Jobs
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.3 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -149,7 +149,7 @@ PATCH all NS Performance Monitoring Jobs - Method not implemented
    ...    Test title: PATCH all NS Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update NS Performance Monitoring Jobs
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.4 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.4 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -161,7 +161,7 @@ DELETE all NS Performance Monitoring Jobs - Method not implemented
    ...    Test title: DELETE all NS Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to delete NS Performance Monitoring Jobs
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.5 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.5 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -173,7 +173,7 @@ GET all NS Performance Monitoring Jobs as Paged Response
    ...    Test title: GET all NS Performance Monitoring Jobs as Paged Response
    ...    Test objective: The objective is to test the retrieval of all the available NS performance monitoring jobs as paged response.
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -186,7 +186,7 @@ GET NS Performance Monitoring Jobs - Bad Request Response too Big
    ...    Test title: GET NS Performance Monitoring Jobs - Bad Request Response too Big
    ...    Test objective: The objective is to test that the retrieval of NS performance monitoring jobs fails because reponse is too big, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
@@ -199,7 +199,7 @@ GET all NS Performance Monitoring Jobs with "fields" and "exclude_default" attri
    ...    Test title: GET all NS Performance Monitoring Jobs with "fields" and "exclude_default" attribute selector
    ...    Test objective: The objective is to test the retrieval of all NS performance monitoring jobs "fields" and "exclude_default" attribute selector, perform a JSON schema validation of the collected jobs data structure, and verify that the retrieved information matches the issued selector
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v2.7.1
    ...    Reference: Clause 4.3.3.2.1, 7.4.2.3.2 - ETSI GS NFV-SOL 005 [3] v3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: The NFVO supports the use of "include" attribute selector
    ...    Post-Conditions: none
@@ -207,3 +207,16 @@ GET all NS Performance Monitoring Jobs with "fields" and "exclude_default" attri
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested selector
    
POST new NS Performance Monitoring Job - Unprocessable Entity
    [Documentation]    Test ID: 5.3.4.1.16
    ...    Test title: POST new NS Performance Monitoring Job - Unprocessable Entity
    ...    Test objective:  The objective is to test the creation of a new NS performance monitoring job fails when a request contains syntactically correct data but the data cannot be processed.
    ...    Pre-conditions: A NS instance is instantiated. One or more NS performance jobs are set in the NFVO.
    ...    Reference: clause 7.4.2.3.1 - ETSI GS NFV-SOL 005 [3] V3.3.1
    ...    Config ID: Config_prod_NFVO
    ...    Applicability: none
    ...    Post-Conditions: none
    Send POST request for NS Performance Monitoring Job with unprocessable entity
    Check HTTP Response Status Code Is    422
    Check HTTP Response Body Json Schema Is    ProblemDetails
 No newline at end of file
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ ${testOptionalMethods} 0

${callback_port}    9091
${callback_uri}    http://172.22.1.7
${unreachable_callback_uri}    http://not-reachable-uri
${callback_endpoint}    /nspm/subscriptions
${callback_endpoint_error}    /subs_404
${sleep_interval}    20s
+2 −1
Original line number Diff line number Diff line
@@ -5,5 +5,6 @@
		"performanceMetricGroup": [],
		"collectionPeriod": {collectionPeriod},
		"reportingPeriod": {reportingPeriod}
	}}
	}},
	"callbackUri": "{callback_uri}"
}}
 No newline at end of file