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

added authentication tests

parent a4f4cc7f
Loading
Loading
Loading
Loading
+30 −1
Original line number Original line Diff line number Diff line
@@ -778,3 +778,32 @@ Check Postcondition Peer Entity Resource is created
Check HTTP Response Header Contains Location
Check HTTP Response Header Contains Location
    ${loc}=    Get Value From Json    ${response['headers']}    $..Location
    ${loc}=    Get Value From Json    ${response['headers']}    $..Location
    Should Not Be Empty    ${loc}
    Should Not Be Empty    ${loc}
    
GET Peer Entity 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}/peer_entities
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Peer Entity 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}/peer_entities
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Peer Entity 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}/peer_entities
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
+40 −3
Original line number Original line Diff line number Diff line
@@ -154,8 +154,45 @@ GET Peer Entity with Paged Response
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    Check LINK in Header
    
    
PUT Peer Entities - Method not implemented
Get Peer Entity with malformed authorization token
    [Documentation]    Test ID: 8.3.1.8.12
    [Documentation]    Test ID: 8.3.1.8.12
    ...    Test title: Get Peer Entity with malformed authorization token
    ...    Test objective: The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when using malformed authorization token.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The Peer Entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Peer Entity with malformed authorization token
    Check HTTP Response Status Code Is    400

Get Peer Entity without authorization token
    [Documentation]    Test ID: 8.3.1.8.13
    ...    Test title: Get Peer Entity without authorization token
    ...    Test objective: The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when omitting the authorization token.
    ...    Pre-conditions: none
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The Peer Entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Peer Entity without authorization token
    Check HTTP Response Status Code Is    401

GET information about multiple alarms with expired or revoked authorization token
    [Documentation]    Test ID: 8.3.1.8.14
    ...    Test title: GET information about multiple alarms with expired or revoked authorization token
    ...    Test objective: The objective is to test that the retrieval of information and configuration in the producer NFV-MANO functional entity with regards to multiple peer entities fails when using expired or revoked authorization token.
    ...    Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO
    ...    Reference: clause 5.5.13.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: The Peer Entity requires the usage of access tokens for authorizing the API requests.
    ...    Post-Conditions: none
    GET Peer Entity with expired or revoked authorization token
    Check HTTP Response Status Code Is    401


PUT Peer Entities - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.15
    ...    Test title: PUT Peer Entities - Method not implemented
    ...    Test title: PUT Peer Entities - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Test objective: The objective is to test that PUT method is not implemeted.
    ...    Pre-conditions: none
    ...    Pre-conditions: none
@@ -167,7 +204,7 @@ PUT Peer Entities - Method not implemented
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405
    
    
PATCH Peer Entities - Method not implemented
PATCH Peer Entities - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.13
    [Documentation]    Test ID: 8.3.1.8.16
    ...    Test title: PATCH Peer Entities - Method not implemented
    ...    Test title: PATCH Peer Entities - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemeted.
    ...    Test objective: The objective is to test that PATCH method is not implemeted.
    ...    Pre-conditions:none
    ...    Pre-conditions:none
@@ -179,7 +216,7 @@ PATCH Peer Entities - Method not implemented
    Check HTTP Response Status Code Is    405
    Check HTTP Response Status Code Is    405


DELETE Peer Entities - Method not implemented
DELETE Peer Entities - Method not implemented
    [Documentation]    Test ID: 8.3.1.8.14
    [Documentation]    Test ID: 8.3.1.8.17
    ...    Test title: DELETE Peer Entities - Method not implemented
    ...    Test title: DELETE Peer Entities - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Test objective: The objective is to test that DELETE method is not implemeted.
    ...    Pre-conditions: none
    ...    Pre-conditions: none
+2 −1
Original line number Original line Diff line number Diff line
@@ -3,9 +3,10 @@ ${NFVMANOHOST} localhost
${NFVMANO_PORT}      8080    
${NFVMANO_PORT}      8080    
${NFVMANO_SCHEMA}    https
${NFVMANO_SCHEMA}    https



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


${CONTENT_TYPE_JSON}    application/json
${CONTENT_TYPE_JSON}    application/json
${ACCEPT_JSON}    application/json
${ACCEPT_JSON}    application/json