Commit 420a7746 authored by Giacomo Bernini's avatar Giacomo Bernini Committed by Giacomo Bernini
Browse files

added authentication tests + fixed some keywords

parent d73c2ad9
Loading
Loading
Loading
Loading
+64 −28
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@ POST Alarms - Method not implemented
Get information about multiple alarms  
    [Documentation]    Test ID: 8.3.3.1.2
    ...    Test title: Get information about multiple alarms
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema and content validation of the returned alarms data structure
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema of the returned alarms data structure
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
@@ -36,7 +36,7 @@ Get information about multiple alarms
Get information about multiple alarms with filter 
    [Documentation]    Test ID: 8.3.3.1.3
    ...    Test title: Get information about multiple alarms with filter
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema and content validation of the returned alarms data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Test objective: The objective is to retrieve information about the alarm list and perform a JSON schema validation of the returned alarms data structure, and verify that the retrieved information matches the issued attribute-based filters 
    ...    Pre-conditions: none 
    ...    Reference: clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
@@ -46,10 +46,10 @@ Get information about multiple alarms with filter
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms

Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
Get information about multiple alarms with invalid attribute-based filtering parameters
    [Documentation]    Test ID: 8.3.3.1.4
    ...    Test title:  Get information about multiple alarms Bad Request Invalid attribute-based filtering parameters
    ...    Test objective: The objective is to try to retrieve information about the alarm list with invalid filters and perform a JSON schema and content validation of the returned problem details data structure
    ...    Test title:  Get information about multiple alarms with invalid attribute-based filtering parameters
    ...    Test objective: The objective is to try to retrieve information about the alarm list with invalid filters and perform a JSON schema validation of the returned problem details data structure
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] V3.3.1
    ...    Config ID: Config_prod_NFV-MANO
@@ -71,12 +71,12 @@ Get information about multiple alarms as a Paged Response
    ...    Post-Conditions: none
    GET Fault Management Alarms
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    Check HTTP Response Header Contains Link
    
Get information about multiple alarms - Bad Request Response too Big
    [Documentation]    Test ID: 8.3.3.1.6
    ...    Test title:  Get information about multiple alarms - Bad Request Response too Big
    ...    Test objective: The objective is to try to retrieve information about the alarm list because response is too big and perform a JSON schema and content validation of the returned problem details data structure
    ...    Test objective: The objective is to try to retrieve information about the alarm list because response is too big and perform a JSON schema validation of the returned problem details data structure
    ...    Pre-conditions: none
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
@@ -90,12 +90,12 @@ GET information about alarms with attribute-based filter "id"
    [Documentation]    Test ID: 8.3.3.1.7
    ...    Test title: GET information about alarms with attribute-based filter "id"
    ...    Test objective: The objective is to retrieve information about the alarm list with alarm filter "id"
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Alarms Task with filter "id"
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms with filter "id"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarm
    Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "id"
@@ -107,9 +107,9 @@ GET information about multiple alarms with attribute-based filter "managedObject
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Alarms Task with filter "managedObjectId"
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms with filter "managedObjectId"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms 
    Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "managedObjectId"
@@ -121,9 +121,9 @@ GET information about multiple alarms with attribute-based filter "eventType"
    ...    Pre-conditions: 
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Alarms Task with filter "eventType"
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms with filter "eventType"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms
    Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "eventType"
@@ -132,12 +132,12 @@ GET information about multiple alarms with attribute-based filter "perceivedSeve
    [Documentation]    Test ID: 8.3.3.1.10
    ...    Test title: GET information about multiple alarms with attribute-based filter "perceivedSeverity"
    ...    Test objective: The objective is to retrieve information about the alarm list with attribute filter "perceivedSeverity"
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Alarms Task with filter "perceivedSeverity"
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms with filter "perceivedSeverity"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms 
    Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "perceivedSeverity"
@@ -146,18 +146,54 @@ GET information about multiple alarms with attribute-based filter "probableCause
    [Documentation]    Test ID: 8.3.3.1.11
    ...    Test title: GET information about multiple alarms with attribute-based filter "probableCause"
    ...    Test objective: The objective is to retrieve information about the alarm list with attribute filter "probableCause"
    ...    Pre-conditions: 
    ...    Pre-conditions: none
    ...    Reference: Clause 7.5.3.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
    ...    Applicability: 
    ...    Post-Conditions: 
    GET Alarms Task with filter "probableCause"
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Fault Management Alarms with filter "probableCause"
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    Alarms
    Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "probableCause"

PUT Alarms - Method not implemented
Get information about multiple alarms with malformed authorization token
    [Documentation]    Test ID: 8.3.3.1.12
    ...    Test title: Get information about multiple alarms with malformed authorization token
    ...    Test objective: The objective is to test that the retrieval of information about the alarm list fails when using malformed authorization token
    ...    Pre-conditions: none
    ...    Reference: clause 7.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 Fault Management Alarms with malformed authorization token
    Check HTTP Response Status Code Is    400

Get information about multiple alarms without authorization token
    [Documentation]    Test ID: 8.3.3.1.13
    ...    Test title: Get information about multiple alarms without authorization token
    ...    Test objective: The objective is to test that the retrieval of information about the alarm list fails when omitting the authorization token
    ...    Pre-conditions: none
    ...    Reference: clause 7.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 Fault Management Alarms 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.3.1.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 about the alarm list fails when using expired or revoked authorization token
    ...    Pre-conditions: One or more Network Service Descriptors are onboarded in the NFVO
    ...    Reference: clause 7.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 Fault Management Alarms with expired or revoked authorization token
    Check HTTP Response Status Code Is    401

PUT Alarms - Method not implemented
    [Documentation]    Test ID: 8.3.3.1.15
    ...    Test title: PUT Alarms - Method not implemented 
    ...    Test objective: The objective is to test that PUT method is not allowed to modify fault management alarms on NFV-MANO.
    ...    Pre-conditions: none
@@ -169,7 +205,7 @@ PUT Alarms - Method not implemented
    Check HTTP Response Status Code Is    405

PATCH Alarms - Method not implemented
     [Documentation]    Test ID: 8.3.3.1.13
     [Documentation]    Test ID: 8.3.3.1.16
    ...    Test title: PATCH Alarms - Method not implemented 
    ...    Test objective: The objective is to test that PATCH method is not allowed to modify fault management alarms on NFV-MANO.
    ...    Pre-conditions: none
@@ -181,7 +217,7 @@ PATCH Alarms - Method not implemented
    Check HTTP Response Status Code Is    405

DELETE Alarms - Method not implemented
     [Documentation]    Test ID: 8.3.3.1.14
     [Documentation]    Test ID: 8.3.3.1.17
    ...    Test title: POST Alarms - Method not implemented 
    ...    Test objective: The objective is to test that DELETE method is not allowed for fault management alarms on NFV-MANO
    ...    Pre-conditions: none
+36 −7
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ GET Fault Management Alarms With Invalid Filters
	${outputResponse}=    Output    response
	Set Global Variable    @{response}    ${outputResponse} 
	
Check LINK in Header
Check HTTP Response Header Contains Link
    ${linkURL}=    Get Value From Json    ${response['headers']}    $..Link
    Should Not Be Empty    ${linkURL}

@@ -178,7 +178,7 @@ POST Subscription
    ${outputResponse}=    Output    response
    Set Global Variable    @{response}    ${outputResponse}
    
Check Operation Occurrence Id
Check HTTP Response Header Contains Location
    ${opOccId}=    Get Value From Json    ${response['headers']}    $..Location
    Should Not Be Empty    ${opOccId}
    
@@ -332,7 +332,7 @@ Check Individual Subscription deleted
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/subscriptions/${subscriptionId} 
    Integer    response status    404
    
GET Alarms Task with filter "id"
GET Fault Management Alarms with filter "id"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "id".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -344,7 +344,7 @@ GET Alarms Task with filter "id"
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "id"
    Should Be Equal As Strings    ${response['body']['id']}    ${alarmId}

GET Alarms Task with filter "managedObjectId"
GET Fault Management Alarms with filter "managedObjectId"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "NFV-MANOcInstanceIds".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -356,7 +356,7 @@ GET Alarms Task with filter "managedObjectId"
Check PostCondition HTTP Response Body alarms Matches the requested attribute-based filter "managedObjectId"
    Should Be Equal As Strings    ${response['body']['managedObjectId']}    ${managedObjectId}

GET Alarms Task with filter "eventType"
GET Fault Management Alarms with filter "eventType"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "eventType".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -370,7 +370,7 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba
    Should Be Equal As Strings    ${item['eventType']}   ${eventType}
    END
	
GET Alarms Task with filter "perceivedSeverity"
GET Fault Management Alarms with filter "perceivedSeverity"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "perceivedSeverity".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -384,7 +384,7 @@ Check PostCondition HTTP Response Body alarms Matches the requested attribute-ba
    Should Be Equal As Strings    ${item['perceivedSeverity']}   ${perceivedSeverity}
    END
	
GET Alarms Task with filter "probableCause"
GET Fault Management Alarms with filter "probableCause"
	Log    Query NFV-MANO The GET method queries information about multiple alarms with filters "probableCause".
    Set Headers  {"Accept":"${ACCEPT}"}  
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"Authorization":"${AUTHORIZATION}"}
@@ -460,3 +460,32 @@ Check PostCondition HTTP Response Body Subscriptions Matches the requested attri
    :FOR   ${item}   IN  @{response['body']}
    Should Be Equal As Strings    ${item['filter']['probableCauses']}   ${probableCause}
    END

GET Fault Management Alarms 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}/alarms
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Fault Management Alarms 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}/alarms
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

GET Fault Management Alarms 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}/alarms
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
 No newline at end of file
+11 −11
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@ Library JSONSchemaLibrary schemas/
Create a new Fault Management alarm subscription
    [Documentation]    Test ID:8.3.3.3.1
    ...    Test title: Create a new fault management alarm subscription
    ...    Test objective: The objective is to create a new fault management alarm subscription and perform a JSON schema and content validation of the returned fault management alarms subscription data structure
    ...    Test objective: The objective is to create a new fault management alarm subscription and perform a JSON schema validation of the returned fault management alarms subscription data structure
    ...    Pre-conditions: No subscription with the same filter and callbackUri exists
    ...    Reference: clause 7.5.5.3.1 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -19,14 +19,14 @@ Create a new Fault Management alarm subscription
    ...    Post-Conditions: subscription is created
    POST Subscription
    Check HTTP Response Status Code Is    201
    Check Operation Occurrence Id
    Check HTTP Response Body Json Schema Is  FmSubscription
    Check HTTP Response Header Contains Location
    Check PostCondition Subscription is created

Create a new alarm subscription - DUPLICATION
     [Documentation]    Test ID: 8.3.3.3.2
    ...    Test title: Create a new alarm subscription - DUPLICATION
    ...    Test objective: The objective is to create a new subscription with the NFV-MANO allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    ...    Test objective: The objective is to create a new subscription with the NFV-MANO allowing duplication and perform a JSON schema validation of the returned fault management alarms subscription data structure.
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: clause 7.5.5.3.1 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -34,14 +34,14 @@ Create a new alarm subscription - DUPLICATION
    ...    Post-Conditions: duplicated subscription is created
    POST Subscription Duplication permitted
    Check HTTP Response Status Code Is    201
    Check Operation Occurrence Id
    Check HTTP Response Body Json Schema Is  FmSubscription
    Check HTTP Response Header Contains Location
    Check Postcondition FaultManagement Subscription Is Set

Create a new alarm subscription - NO DUPLICATION
    [Documentation]    Test ID: 8.3.3.3.3
    ...    Test title: Create a new alarm subscription - NO DUPLICATION
    ...    Test objective: The objective is to create a new subscription with the NFV-MANO not allowing duplication and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    ...    Test objective: The objective is to create a new subscription with the NFV-MANO not allowing duplication and perform a JSON schema validation of the returned fault management alarms subscription data structure.
    ...    Pre-conditions: subscription with the same filter and callbackUri exists
    ...    Reference: clause 7.5.5.3.1 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -49,14 +49,14 @@ Create a new alarm subscription - NO DUPLICATION
    ...    Post-Conditions: duplicated subscription is not created
    POST Subscription Duplication not permitted
    Check HTTP Response Status Code Is    303
    Check Operation Occurrence Id
    Check HTTP Response Body Json Schema Is  FmSubscription
    Check HTTP Response Header Contains Location
    Check Postcondition Subscription Resource Returned in Location Header Is Available

Retrieve a list of alarm subscriptions
    [Documentation]    Test ID: 8.3.3.3.4
    ...    Test title: Retrieve a list of alarm subscriptions
    ...    Test objective: The objective is to retrieve the list of active subscriptions and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    ...    Test objective: The objective is to retrieve the list of active subscriptions and perform a JSON schema validation of the returned fault management alarms subscription data structure.
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -69,7 +69,7 @@ Retrieve a list of alarm subscriptions
Retrieve a list of alarm subscriptions with filter
    [Documentation]    Test ID: 8.3.3.3.5
    ...    Test title: Retrieve a list of alarm subscriptions with filter
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter and perform a JSON schema and content validation of the returned fault management alarms subscription data structure.
    ...    Test objective: The objective is to retrieve the list of active subscriptions with filter and perform a JSON schema validation of the returned fault management alarms subscription data structure.
    ...    Pre-conditions: none 
    ...    Reference: clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -90,12 +90,12 @@ Get information about multiple alarms as a Paged Response
    ...    Post-Conditions: none
    GET Subscriptions
    Check HTTP Response Status Code Is    200
    Check LINK in Header
    Check HTTP Response Header Contains Link
    
GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    [Documentation]    Test ID: 8.3.3.3.7
    ...    Test title: GET subscriptions - Bad Request Invalid attribute-based filtering parameters
    ...    Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters and perform a JSON schema and content validation of the returned problem details data structure.
    ...    Test objective: The objective is to retrieve the list of active subscriptions with Invalid attribute-based filtering parameters and perform a JSON schema validation of the returned problem details data structure.
    ...    Pre-conditions: none
    ...    Reference: clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID:   Config_prod_NFV-MANO
@@ -109,7 +109,7 @@ GET subscriptions - Bad Request Invalid attribute-based filtering parameters
Get information about multiple alarms - Bad Request Response too Big
    [Documentation]    Test ID: 8.3.3.3.8
    ...    Test title:  Get information about multiple alarms - Bad Request Response too Big
    ...    Test objective: The objective is to try to retrieve information about active list subscription to check that response is too big and perform a JSON schema and content validation of the returned problem details data structure
    ...    Test objective: The objective is to try to retrieve information about active list subscription to check that response is too big and perform a JSON schema validation of the returned problem details data structure
    ...    Pre-conditions: none
    ...    Reference: Clause clause 7.5.5.3.2 - ETSI GS NFV-SOL 009 [5] v3.3.1
    ...    Config ID: Config_prod_NFV-MANO
+2 −2
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@ ${CONTENT_TYPE} application/json
${ACCEPT}         application/json
${ACCEPT_JSON}         application/json
${AUTH_USAGE}     1

${WRONG_AUTHORIZATION}    Bearer    XXXXXWRONGXXXXX
${NEG_AUTHORIZATION}    Bearer negativetoken
${BAD_AUTHORIZATION}    Bear sometoken
${apiRoot}        /
${apiName}        nfvmanofm
${apiMajorVersion}     v1