Commit 2135fca5 authored by Najam UI Hassan's avatar Najam UI Hassan
Browse files

templating and minor bugs fix added

parent 1df2ac74
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@ DELETE Individual VNF Performance Job with invalid resource identifier
    ...    Post-Conditions: none
    Send Delete request for individual VNF Performance Job with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

POST Individual VNF Performance Job - Method not implemented
    [Documentation]    Test ID: 7.3.4.2.5
@@ -67,10 +68,9 @@ POST Individual VNF Performance Job - Method not implemented
    ...    Reference: Clause 6.4.3.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Job is not created on the VNFM
    ...    Post-Conditions: none
    Send Post request for individual VNF Performance Job
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Job is not Created

PUT Individual VNF Performance Job - Method not implemented
    [Documentation]    Test ID: 7.3.4.2.6
@@ -80,10 +80,9 @@ PUT Individual VNF Performance Job - Method not implemented
    ...    Reference: Clause 6.4.3.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Job is not modified by the operation
    ...    Post-Conditions: none
    Send Put request for individual VNF Performance Job
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Job is Unmodified (Implicit)

PATCH Individual VNF Performance Job
    [Documentation]    Test ID: 7.3.4.2.7
+5 −28
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@ Get Individual Performance Report with invalid resource endpoint
    ...    Post-Conditions: none
    Get Individual Performance Report with invalid resource endpoint
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

POST Individual Performance Report - Method not implemented
    [Documentation]    Test ID: 7.3.4.3.3
@@ -39,10 +40,9 @@ POST Individual Performance Report - Method not implemented
    ...    Reference: Clause 6.4.4.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF performance report is not created on the VNFM
    ...    Post-Conditions: none
    Send Post request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Individual Performance Report is not Created

PUT Individual Performance Report - Method not implemented
    [Documentation]    Test ID: 7.3.4.3.4
@@ -52,10 +52,9 @@ PUT Individual Performance Report - Method not implemented
    ...    Reference: Clause 6.4.4.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF performance report is not modified by the operation
    ...    Post-Conditions: none
    Send Put request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Individual Performance Report is Unmodified (Implicit)

PATCH Individual Performance Report - Method not implemented
    [Documentation]    Test ID: 7.3.4.3.5
@@ -65,10 +64,9 @@ PATCH Individual Performance Report - Method not implemented
    ...    Reference: Clause 6.4.4.3.4 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF performance report is not modified by the operation
    ...    Post-Conditions: none
    Send Patch request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Individual Performance Report is Unmodified (Implicit)

DELETE Individual Performance Report - Method not implemented
    [Documentation]    Test ID: 7.3.4.3.6
@@ -78,10 +76,9 @@ DELETE Individual Performance Report - Method not implemented
    ...    Reference: Clause 6.4.4.3.5 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF performance report is not deleted by the operation
    ...    Post-Conditions: none
    Send Delete request for Individual Performance Report
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Individual Performance Report Exists

*** Keywords ***
Get Individual Performance Report
@@ -134,26 +131,6 @@ Send Delete request for Individual Performance Report
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Check Postcondition VNF Individual Performance Report Exists
    Log    Checking that report still exists
    Get Individual Performance Report

Check Postcondition VNF Individual Performance Report is not Created
    Log    Trying to get a new report
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs/${pmJobId}/reports/${newReportId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    404

Check Postcondition VNF Individual Performance Report is Unmodified (Implicit)
    Log    Check Postcondition VNF PM job is not modified
    Get Individual Performance Report
    Log    Check Response matches original VNF report
    ${report}=    evaluate    json.loads('''${response['body']}''')    json
    Should Be Equal    ${origResponse['body']['entries'][0]['objectInstanceId']}    ${report['entries'][0]['objectInstanceId']}

Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}
    ${status}=    Convert To Integer    ${expected_status}    
+0 −100
Original line number Diff line number Diff line
*** Settings ***
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Library           REST    ${VNFM_SCHEMA}://${VNFM_HOST}:${VNFM_PORT}    ssl_verify=false
Library           OperatingSystem
Library           JSONLibrary
Resource          environment/individualSubscription.txt
Resource          VNFPerformanceManagementKeywords.robot

*** Test Cases ***
GET Individual VNF Performance Subscription
    [Documentation]    Test ID: 7.3.4.7.1
    ...    Test title: GET Individual VNF Performance Subscription
    ...    Test objective: The objective is to test the retrieval of individual VNF performance subscription and perform a JSON schema and content validation of the returned subscription data structure
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    Get Individual VNF Performance Subscription
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmSubscription
    Check HTTP Response Body Subscription Identifier matches the requested Subscription

GET Individual VNF Performance Subscription with invalid resource identifier
    [Documentation]    Test ID: 7.3.4.7.2
    ...    Test title: GET Individual VNF Performance Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the retrieval of an individual VNF performance subscription fails when using an invalid resource identifier
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none
    GET individual VNF Performance Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

DELETE Individual VNF Performance Subscription
    [Documentation]    Test ID: 7.3.4.7.3
    ...    Test title: DELETE Individual VNF Performance Subscription
    ...    Test objective: The objective is to test the deletion of an individual VNF performance subscription
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.5 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Subscription is not available anymore in the VNFM    
    Send Delete request for individual VNF Performance Subscription
    Check HTTP Response Status Code Is    204
    Check Postcondition VNF Performance Subscription is Deleted

DELETE Individual VNF Performance Subscription with invalid resource identifier
    [Documentation]    Test ID: 7.3.4.7.4
    ...    Test title: DELETE Individual VNF Performance Subscription with invalid resource identifier
    ...    Test objective: The objective is to test that the deletion of an individual VNF performance subscription fails when using an invalid resource identifier
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.5 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: none   
    Send Delete request for individual VNF Performance Subscription with invalid resource identifier
    Check HTTP Response Status Code Is    404

POST Individual VNF Performance Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.4.7.5
    ...    Test title: POST Individual VNF Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that POST method is not allowed to create a new VNF Performance Subscription
    ...    Pre-conditions: A VNF instance is instantiated
    ...    Reference: Clause 6.4.8.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Subscription is not created on the VNFM
    Send Post request for individual VNF Performance Subscription
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Subscription is not Created

PUT Individual VNF Performance Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.4.7.6
    ...    Test title: PUT Individual VNF Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to update an existing VNF Performance subscription
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance subscription is not modified by the operation
    Send Put request for individual VNF Performance Threshold
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Subscription is Unmodified (Implicit)

PATCH Individual VNF Performance Subscription - Method not implemented
    [Documentation]    Test ID: 7.3.4.7.7
    ...    Test title: PATCH Individual VNF Performance Subscription - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify an existing VNF Performance subscription
    ...    Pre-conditions: A VNF instance is instantiated. At least one VNF performance subscription is available in the VNFM.
    ...    Reference: Clause 6.4.8.3.4 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance subscription is not modified by the operation
    Send Patch request for individual VNF Performance Threshold
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Subscription is Unmodified (Implicit)
+4 −13
Original line number Diff line number Diff line
@@ -32,6 +32,7 @@ GET Individual Threshold with invalid resource identifier
    ...    Post-Conditions: none
    GET individual VNF Performance Threshold with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

DELETE Individual Threshold
    [Documentation]    Test ID: 7.3.4.5.3
@@ -57,6 +58,7 @@ DELETE Individual Threshold with invalid resource identifier
    ...    Post-Conditions: none   
    Send Delete request for individual VNF Performance Threshold with invalid resource identifier
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is   ProblemDetails

POST Individual Threshold - Method not implemented
    [Documentation]    Test ID: 7.3.4.5.5
@@ -66,10 +68,9 @@ POST Individual Threshold - Method not implemented
    ...    Reference: Clause 6.4.6.3.1 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Threshold is not created on the VNFM
    ...    Post-Conditions: none
    Send Post request for individual VNF Performance Threshold
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Threshold is not Created

PUT Individual Threshold - Method not implemented
    [Documentation]    Test ID: 7.3.4.5.6
@@ -79,10 +80,9 @@ PUT Individual Threshold - Method not implemented
    ...    Reference: Clause 6.4.6.3.3 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: none
    ...    Post-Conditions: The VNF Performance Threshold is not modified by the operation
    ...    Post-Conditions: none
    Send Put request for individual VNF Performance Threshold
    Check HTTP Response Status Code Is    405
    Check Postcondition VNF Performance Threshold is Unmodified (Implicit)

PATCH Individual Threshold
    [Documentation]    Test ID: 7.3.4.5.7
@@ -177,15 +177,6 @@ Check Postcondition VNF Performance Threshold is Unmodified (Implicit)
    Should Be Equal    ${origresponse['body']['id']}    ${threshold.id}
    Should Be Equal    ${origresponse['body']['criteria']}    ${threshold.criteria}

Check Postcondition VNF Performance Threshold is not Created
    Log    Trying to get a new Threshold
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/thresholds/${newThresholdId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    404

Check Postcondition VNF Performance Threshold is Deleted
    Log    Check Postcondition Threshold is deleted
    GET individual VNF Performance Threshold
+25 −1
Original line number Diff line number Diff line
@@ -195,6 +195,20 @@ GET VNF Performance Monitoring Jobs - Bad Request Response too Big
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   ProblemDetails
    
GET all VNF Performance Monitoring Jobs with fields and exclude_default attribute selector
    [Documentation]    Test ID: 7.3.4.1.15
    ...    Test title: GET all VNF Performance Monitoring Jobs with fields and exclude_default attribute selector
    ...    Test objective: The objective is to test the retrieval of all VNF 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 fields selector
    ...    Pre-conditions: A VNF instance is instantiated. One or more VNF performance jobs are set in the VNF.
    ...    Reference: Clause 6.4.2.3.2 - ETSI GS NFV-SOL 003 [1] v2.6.1
    ...    Config ID: Config_prod_VNFM
    ...    Applicability: The VNFM supports the use of fields and exclude_fields attribute selector
    ...    Post-Conditions: none
    GET VNF Performance Monitoring Jobs with fields and exclude_default attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   PmJobs
    Check HTTP Response Body PmJobs Matches the requested fields selector
    
*** Keywords ***
GET all VNF Performance Monitoring Jobs
    Log    Trying to get all PM Jobs present in the VNFM
@@ -237,6 +251,15 @@ GET VNF Performance Monitoring Jobs with fields attribute selector
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET VNF Performance Monitoring Jobs with fields and exclude_default attribute selector
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs?fields=${fields}&exclude_default
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET VNF Performance Monitoring Jobs with exclude_fields attribute selector
    Log    Trying to get all VNF Packages present in the VNFM, using filter params
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as VNFM is not supporting 'fields'
@@ -267,7 +290,8 @@ Send Post Request Create new VNF Performance Monitoring Job
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    ${body}=    Get File    jsons/CreatePmJobRequest.json
    ${template}=    Get File    jsons/CreatePmJobRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds}
    POST    ${apiRoot}/${apiName}/${apiVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
Loading