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

added authorization testcases

parent 08e8d76a
Loading
Loading
Loading
Loading
+67 −3
Original line number Diff line number Diff line
@@ -151,9 +151,44 @@ GET information about multiple Performance Monitoring Jobs for Bad Request Respo
    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
    [Documentation]    Test ID: 8.3.2.1.12
    ...    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
    ...    Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The NFV-MANO entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Performance Monitoring Jobs with malformed authorization token
    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
    ...    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
    ...    Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [3] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The NFV-MANO entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Performance Monitoring Jobs without authorization token
    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
    ...    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
    ...    Reference: clause 6.5.3.3.2 - ETSI GS NFV-SOL 009 [3] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The NFV-MANO entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Performance Monitoring Jobs with expired or revoked authorization token
    Check HTTP Response Status Code Is    401

PUT all NFV-MANO Performance Monitoring Jobs - Method not implemented
    [Documentation]    Test ID: 8.3.2.1.12
    [Documentation]    Test ID: 8.3.2.1.15
    ...    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.
@@ -165,7 +200,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.13
    [Documentation]    Test ID: 8.3.2.1.16
    ...    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.
@@ -177,7 +212,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.14
    [Documentation]    Test ID: 8.3.2.1.17
    ...    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.
@@ -198,6 +233,35 @@ GET all NFV-MANO Performance Monitoring Jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET Performance Monitoring Jobs with malformed authorization token
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as NFVO is not supporting authentication
    Log    The GET method queries using invalid token
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Authorization": "${BAD_AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Performance Monitoring Jobs without authorization token
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as it is not supporting authentication
    Log    The GET method queries omitting token
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Performance Monitoring Jobs with expired or revoked authorization token
    Pass Execution If    ${AUTH_USAGE} == 0    Skipping test as it is not supporting authentication
    Log    The GET method queries  using invalid token
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
    Set Headers    {"Authorization": "${NEG_AUTHORIZATION}"}
    Log    Execute Query and validate response
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/pm_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET NFV-MANO Performance Monitoring Jobs with attribute-based filter
    Log    Trying to get all PM Jobs present in the NFV-MANO, using filter params
    Set Headers    {"Accept": "${ACCEPT_JSON}"}
+1 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ ${NFVMANO_SCHEMA} https

${AUTHORIZATION}    Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${NEG_AUTHORIZATION}    Bearer negativetoken
${BAD_AUTHORIZATION}    Bear sometoken

${CONTENT_TYPE_JSON}    application/json
${ACCEPT_JSON}    application/json
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="Easter" type="library" format="ROBOT" generated="20200820 10:23:51">
<keywordspec name="Easter" type="library" format="ROBOT" generated="20200914 07:50:43">
<version></version>
<scope>global</scope>
<namedargs>yes</namedargs>
+1 −1
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<keywordspec name="Reserved" type="library" format="ROBOT" generated="20200820 10:23:51">
<keywordspec name="Reserved" type="library" format="ROBOT" generated="20200914 07:50:43">
<version></version>
<scope>global</scope>
<namedargs>yes</namedargs>