Commit e7529d2a authored by Najam UI Hassan's avatar Najam UI Hassan Committed by Giacomo Bernini
Browse files

templating, minor bugs fix and new testcases added

parent 1b6f45dd
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -97,7 +97,6 @@ PATCH Individual Performance Subscription - Method not implemented
    Check HTTP Response Status Code Is    405
    Check Postcondition Performance Subscription is Unmodified (Implicit)


*** Keywords ***
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
+38 −13
Original line number Diff line number Diff line
*** Settings ***
Library           String
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt   
Resource          environment/pmJobs.txt
@@ -129,11 +130,11 @@ GET information about multiple Performance Monitoring Jobs to get Paged Response
    [Documentation]    Test ID: 8.3.2.1.10
    ...    Test title: GET information about multiple Performance Monitoring Jobs to get Paged Response
    ...    Test objective: The objective is to retrieve information about the performance monitoring jobs to get paged response
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions:  
    ...    Applicability: none
    ...    Post-Conditions:  none
    GET all NFV-MANO Performance Monitoring Jobs
    Check HTTP Response Status Code Is    200
    Check LINK in Header 
@@ -142,17 +143,30 @@ GET information about multiple Performance Monitoring Jobs for Bad Request Respo
    [Documentation]    Test ID: 8.3.2.1.11
    ...    Test title: GET information about multiple Performance Monitoring Jobs for Bad Request Response too big
    ...    Test objective: The objective is to test that GET method fail retrieving status information about performance monitoring jobs when Response is too big, and perform the JSON schema validation of the failed operation HTTP response
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    ...    Applicability: none
    ...    Post-Conditions: none
    GET all NFV-MANO Performance Monitoring Jobs
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is    ProblemDetails
    
Get information about multiple Performance Monitoring Jobs with malformed authorization token
GET information about multiple Performance Monitoring Jobs with "fields" and "exclude_default" attribute selector
    [Documentation]    Test ID: 8.3.2.1.12
    ...    Test title: GET all NFV-MANO Performance Monitoring Jobs with "fields" and "exclude_default" attribute selector
    ...    Test objective: The objective is to retrieve all performance monitoring jobs with fields and exclude default attribute selector, and perform the JSON schema validation of the HTTP response.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: none
    ...    Post-Conditions: none
    GET NFV-MANO 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

Get information about multiple Performance Monitoring Jobs with malformed authorization token
    [Documentation]    Test ID: 8.3.2.1.13
    ...    Test title: Get information about multiple Performance Monitoring Jobs with malformed authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Performance Monitoring Jobs fails when using malformed authorization token
    ...    Pre-conditions: none
@@ -164,7 +178,7 @@ Get information about multiple Performance Monitoring Jobs with malformed author
    Check HTTP Response Status Code Is    400

Get information about multiple Performance Monitoring Jobs without authorization token
    [Documentation]    Test ID: 8.3.2.1.13
    [Documentation]    Test ID: 8.3.2.1.14
    ...    Test title: Get information about multiple Performance Monitoring Jobs without authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Performance Monitoring Jobs fails when omitting the authorization token
    ...    Pre-conditions: none
@@ -176,7 +190,7 @@ Get information about multiple Performance Monitoring Jobs without authorization
    Check HTTP Response Status Code Is    401

GET information about multiple Performance Monitoring Jobs with expired or revoked authorization token
    [Documentation]    Test ID: 8.3.2.1.14
    [Documentation]    Test ID: 8.3.2.1.15
    ...    Test title: GET information about multiple Performance Monitoring Jobs with expired or revoked authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Performance Monitoring Jobs fails when using expired or revoked authorization token
    ...    Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO
@@ -188,7 +202,7 @@ GET information about multiple Performance Monitoring Jobs with expired or revok
    Check HTTP Response Status Code Is    401

PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
    [Documentation]    Test ID: 8.3.2.1.15
    [Documentation]    Test ID: 8.3.2.1.16
    ...    Test title: PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not allowed to modify NFV-MANO Performance Monitoring Jobs
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
@@ -200,7 +214,7 @@ PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
    Check HTTP Response Status Code Is    405
    
PATCH all NFV-MANO Performance Monitoring Jobs - (Method not implemented)
    [Documentation]    Test ID: 8.3.2.1.16
    [Documentation]    Test ID: 8.3.2.1.17
    ...    Test title: PATCH all NFV-MANO Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not allowed to update NFV-MANO Performance Monitoring Jobs
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
@@ -212,7 +226,7 @@ PATCH all NFV-MANO Performance Monitoring Jobs - (Method not implemented)
    Check HTTP Response Status Code Is    405
    
DELETE all NFV-MANO Performance Monitoring Jobs - Method not implemented
    [Documentation]    Test ID: 8.3.2.1.17
    [Documentation]    Test ID: 8.3.2.1.18
    ...    Test title: DELETE all NFV-MANO Performance Monitoring Jobs - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not allowed to update NFV-MANO Performance Monitoring Jobs
    ...    Pre-conditions: A NFV-MANO instance is instantiated. One or more NFV-MANO performance jobs are set in the NFV-MANO.
@@ -295,6 +309,15 @@ GET NFV-MANO Performance Monitoring Jobs with fields attribute selector
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET NFV-MANO Performance Monitoring Jobs with fields and exclude_default attribute selector
    Log    Trying to get all NFV-MANO Packages present in the NFV-MANO, using filter params
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as NFV-MANO is not supporting 'fields'
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": "${AUTHORIZATION}"}
    GET    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs?exclude_default&fields=${fields}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET NFV-MANO Performance Monitoring Jobs with exclude_fields attribute selector
    Log    Trying to get all NFV-MANO Packages present in the NFV-MANO, using filter params
    Pass Execution If    ${FIELD_USAGE} == 0    Skipping test as NFV-MANO is not supporting 'fields'
@@ -326,7 +349,9 @@ Send Post Request Create new NFV-MANO 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}/${apiMajorVersion}/pm_jobs    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
+13 −10
Original line number Diff line number Diff line
*** Settings ***
Library           String
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Library           REST    ${NFVMANO_SCHEMA}://${NFVMANO_HOST}:${NFVMANO_PORT}    ssl_verify=false
@@ -44,11 +45,11 @@ GET Performance Management Subscriptions with Paged Response
    ...    Pre-conditions:  An instance is instantiated. At least one performance subscription is available.
    ...    Reference: clauseclause 6.5.8.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    ...    Applicability: none
    ...    Post-Conditions: none
    Get all Performance Subscriptions
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    Check HTTP Response Header Contains Link

GET Performance Subscriptions with invalid attribute-based filter
    [Documentation]    Test ID: 8.3.2.6.4
@@ -198,7 +199,7 @@ Check HTTP Response Status Code Is
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 
    
Check LINK in Header
Check HTTP Response Header Contains Link
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}
    
@@ -209,7 +210,6 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK  


Check HTTP Response Body Is Empty
    Should Be Empty    ${response['body']}    
    Log    No json schema is provided. Validation OK  
@@ -247,8 +247,9 @@ Send Post Request for Performance Subscription
    Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    ${body_request}=    Get File    jsons/subscriptions.json
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body_request}
    ${template}=    Get File    jsons/subscriptions.json
    ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Run Keyword If    ${NFVMANO_CHECKS_NOTIF_ENDPOINT} == 1
@@ -256,7 +257,8 @@ Send Post Request for Performance Subscription

Check HTTP Response Body PmSubscription Attributes Values Match the Issued Subscription
    Log    Check Response matches subscription
    ${body}=    Get File    jsons/subscriptions.json
    ${template}=    Get File    jsons/subscriptions.json
     ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    ${subscription}=    evaluate    json.loads('''${body}''')    json
    Should Be Equal As Strings    ${response['body']['callbackUri']}    ${subscription['callbackUri']}
    
@@ -273,8 +275,9 @@ Send Post Request for Duplicated Performance Subscription
    Set headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    Set headers    {"Accept": "${ACCEPT_JSON}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    ${body_request}=    Get File    jsons/subscriptions.json
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body_request}
    ${template}=    Get File    jsons/subscriptions.json
     ${body}=        Format String   ${template}     callback_uri=${callback_uri}    callback_endpoint=${callback_endpoint}
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
+8 −9
Original line number Diff line number Diff line
*** Settings ***
Library           String
Library           JSONSchemaLibrary    schemas/
Resource          environment/variables.txt    # Generic Parameters
Library           JSONLibrary
@@ -60,7 +61,7 @@ GET Performance Threshold with Paged Response
    ...    Post-Conditions: none
    GET all Performance Thresholds
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    Check HTTP Response Header Contains Link
    
GET Performance Thresholds - Invalid attribute-based filter
    [Documentation]    Test ID: 8.3.2.4.5
@@ -155,8 +156,9 @@ Send Post Request Create new Performance Threshold
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization": ${AUTHORIZATION}"}
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Content-Type": "${CONTENT_TYPE_JSON}"}
    ${request}=    Get File    jsons/CreateThresholdRequest.json
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${request}
    ${template}=    Get File    jsons/CreateThresholdRequest.json
    ${body}=        Format String   ${template}     objectInstanceIds=${objectInstanceIds} 
    POST    ${apiRoot}/${apiName}/${apiMajorVersion}/thresholds    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

@@ -221,9 +223,6 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
    
Check LINK in Header
Check HTTP Response Header Contains Link
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}
 No newline at end of file


+3 −1
Original line number Diff line number Diff line
@@ -34,3 +34,5 @@ ${MOCK_SERVER_JAR} ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.
${subscriptionId}    17563e75-0e14-4bd7-94b4-6bbb869c79aa

${response}    

${objectInstanceIds}    daca910b0-00d4f1a2b675d-604257e42
 No newline at end of file
Loading