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

authorization testcases added

parent 14bb2b3d
Loading
Loading
Loading
Loading
+36 −1
Original line number Original line Diff line number Diff line
@@ -113,7 +113,6 @@ GET information about Logging Jobs with "exclude_default" attribute selector
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    LoggingJobs
    Check HTTP Response Body Json Schema Is    LoggingJobs


    
GET information about Logging Jobs with "fields" attribute selector
GET information about Logging Jobs with "fields" attribute selector
    [Documentation]    Test ID: 8.3.4.1.9
    [Documentation]    Test ID: 8.3.4.1.9
    ...    Test title: GET information about Logging Jobs with fields attribute selector
    ...    Test title: GET information about Logging Jobs with fields attribute selector
@@ -166,6 +165,42 @@ GET information about Logging Jobs with Paged Response
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Contains Link
    Check HTTP Response Header Contains Link
    
    
GET information about Logging Jobs with malformed authorization token
    [Documentation]    Test ID: 8.3.1.8.13
    ...    Test title: GET information about Logging Jobs with malformed authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Logging Jobs fails when using malformed authorization token.
    ...    Pre-conditions: none
    ...    Reference: clause 8.5.3.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 Logging Jobs with malformed authorization token
    Check HTTP Response Status Code Is    401

GET information about Logging Jobs without authorization token
    [Documentation]    Test ID: 8.3.4.1.14
    ...    Test title: GET information about Logging Jobs without authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Logging Jobs fails when omitting the authorization token.
    ...    Pre-conditions: none
    ...    Reference: clause 8.5.3.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 Logging Jobs without authorization token
    Check HTTP Response Status Code Is    401

GET information about Logging Jobs with expired or revoked authorization token
    [Documentation]    Test ID: 8.3.4.1.15
    ...    Test title: GET information about Logging Jobs with expired or revoked authorization token
    ...    Test objective: The objective is to test that the retrieval of information about Logging Jobs fails when using expired or revoked authorization token.
    ...    Pre-conditions: none
    ...    Reference: clause 8.5.3.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 Logging Jobs with expired or revoked authorization token
    Check HTTP Response Status Code Is    401

PUT Logging Jobs - Method not implemented
PUT Logging Jobs - Method not implemented
    [Documentation]    Test ID: 8.3.4.1.13
    [Documentation]    Test ID: 8.3.4.1.13
    ...    Test title: PUT Logging Jobs - Method not implemented
    ...    Test title: PUT Logging Jobs - Method not implemented
+29 −0
Original line number Original line Diff line number Diff line
@@ -52,6 +52,35 @@ GET Logging Jobs
    ${outputResponse}=    Output    response
    ${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse}
	Set Global Variable    @{response}    ${outputResponse}
	
	
GET Logging 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}/log_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

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

GET Logging 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}/log_jobs
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
GET Logging Job with invalid filter
GET Logging Job with invalid filter
    Set Headers  {"Accept":"${ACCEPT}"}  
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
+1 −0
Original line number Original line Diff line number Diff line
@@ -9,6 +9,7 @@ ${erroneousLogJobId} wrongID


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


${CONTENT_TYPE}    application/json
${CONTENT_TYPE}    application/json
${CONTENT_TYPE_JSON}    application/json
${CONTENT_TYPE_JSON}    application/json