From 138f73c0a97d6ccdf3638cd6af5f6c95fa91ee33 Mon Sep 17 00:00:00 2001 From: uihassan <najam.hassan@xflowresearch.com> Date: Mon, 14 Sep 2020 15:02:20 +0500 Subject: [PATCH] authorization testcases added --- .../LoggingJobs.robot | 37 ++++++++++++++++++- .../NFVMANOLogManagementKeywords.robot | 29 +++++++++++++++ .../environment/variables.txt | 1 + 3 files changed, 66 insertions(+), 1 deletion(-) diff --git a/SOL009/NFVMANOLogManagement-API/LoggingJobs.robot b/SOL009/NFVMANOLogManagement-API/LoggingJobs.robot index c72f4b10..329a1c5f 100644 --- a/SOL009/NFVMANOLogManagement-API/LoggingJobs.robot +++ b/SOL009/NFVMANOLogManagement-API/LoggingJobs.robot @@ -113,7 +113,6 @@ GET information about Logging Jobs with "exclude_default" attribute selector Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is LoggingJobs - GET information about Logging Jobs with "fields" attribute selector [Documentation] Test ID: 8.3.4.1.9 ... 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 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 [Documentation] Test ID: 8.3.4.1.13 ... Test title: PUT Logging Jobs - Method not implemented diff --git a/SOL009/NFVMANOLogManagement-API/NFVMANOLogManagementKeywords.robot b/SOL009/NFVMANOLogManagement-API/NFVMANOLogManagementKeywords.robot index d2cc5cae..dfaf7ab2 100644 --- a/SOL009/NFVMANOLogManagement-API/NFVMANOLogManagementKeywords.robot +++ b/SOL009/NFVMANOLogManagement-API/NFVMANOLogManagementKeywords.robot @@ -52,6 +52,35 @@ GET Logging Jobs ${outputResponse}= Output response 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 Set Headers {"Accept":"${ACCEPT}"} Run Keyword If ${AUTH_USAGE} == 1 Set Headers {"Authorization":"${AUTHORIZATION}"} diff --git a/SOL009/NFVMANOLogManagement-API/environment/variables.txt b/SOL009/NFVMANOLogManagement-API/environment/variables.txt index aff90b47..4a30d550 100644 --- a/SOL009/NFVMANOLogManagement-API/environment/variables.txt +++ b/SOL009/NFVMANOLogManagement-API/environment/variables.txt @@ -9,6 +9,7 @@ ${erroneousLogJobId} wrongID ${AUTHORIZATION} Bearer 0b79bab50daca910b000d4f1a2b675d604257e42 ${NEG_AUTHORIZATION} Bearer negativetoken +${BAD_AUTHORIZATION} Bear sometoken ${CONTENT_TYPE} application/json ${CONTENT_TYPE_JSON} application/json -- GitLab