Commit b884815a authored by Giacomo Bernini's avatar Giacomo Bernini
Browse files

Merge branch '5.3.1-dev-SOL023-CERT-MGMT' into '5.3.1-dev-SOL023'

import cert-mgmt additions in sol023 main dev branch

See merge request !439
parents f05699eb c8f72eb2
Loading
Loading
Loading
Loading
+214 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt
Resource    CertificateManagementKeywords.robot
Library     REST
...         ${CM_SCHEMA}://${CM_HOST}:${CM_PORT}
...         ssl_verify=false
Library     OperatingSystem
Library     JSONLibrary
Library     JSONSchemaLibrary    schemas/

*** Test Cases ***
POST API Version - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.1
    ...    Test title: POST API version - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none    
    POST API Version
	Check HTTP Response Status Code Is    405
    
GET API Version
    [Documentation]    Test ID: 13.3.1.1.2
    ...    Test title: GET API Version
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET API Version
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    ApiVersionInformation

PUT API Version - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.3
    ...    Test title: PUT API Version - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT API Version
	Check HTTP Response Status Code Is    405

PATCH API Version - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.4
    ...    Test title: PATCH API Version - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH API Version
	Check HTTP Response Status Code Is    405
    
DELETE API Version - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.5
    ...    Test title: DELETE API Version - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE API Version
	Check HTTP Response Status Code Is    405
	
POST API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.6
    ...    Test title: POST API version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.1 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none    
    POST API Version
	Check HTTP Response Status Code Is    405
    
GET API Version with apiMajorVerion
    [Documentation]    Test ID: 13.3.1.1.7
    ...    Test title: GET API Version with apiMajorVerion
    ...    Test objective: The objective is to test that GET method successfully return ApiVersionInformation
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.2 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    GET API Version
	Check HTTP Response Status Code Is    200
	Check HTTP Response Body Json Schema Is    ApiVersionInformation

PUT API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.8
    ...    Test title: PUT API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.3 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PUT API Version
	Check HTTP Response Status Code Is    405

PATCH API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.9
    ...    Test title: PATCH API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.4 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    PATCH API Version
	Check HTTP Response Status Code Is    405
    
DELETE API Version with apiMajorVerion - Method not implemented
    [Documentation]    Test ID: 13.3.1.1.10
    ...    Test title: DELETE API Version with apiMajorVerion - Method not implemented
    ...    Test objective: The objective is to test that DELETE method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 9.3.3.3.5 - ETSI GS NFV-SOL 013 [5] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none 
    DELETE API Version
	Check HTTP Response Status Code Is    405

*** Keywords ***
POST API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Post    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
GET API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PUT API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PATCH API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
DELETE API Version
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/${apiName}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
POST API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Post    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
GET API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PUT API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Put    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
PATCH API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Patch    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
DELETE API Version with apiMajorVersion
    Set Headers    {"Accept":"${ACCEPT}"} 
    Run Keyword If    ${AUTH_USAGE} == 1    Set Headers    {"${AUTHORIZATION_HEADER}":"${AUTHORIZATION_TOKEN}"}
    Delete    ${apiRoot}/${apiName}/${apiMajorVersion}/api_versions
    ${outputResponse}=    Output    response
	Set Global Variable    ${response}    ${outputResponse} 
	
Check HTTP Response Status Code Is
    [Arguments]    ${expected_status}    
    Should Be Equal As Strings    ${response['status']}    ${expected_status}
    Log    Status code validated 

Check HTTP Response Body Json Schema Is
    [Arguments]    ${input}
    ${schema} =    Catenate    SEPARATOR=    ${input}    .schema.json
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK
 No newline at end of file
+316 −0

File added.

Preview size limit exceeded, changes collapsed.

+140 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    environment/variables.txt
Resource    CertificateManagementKeywords.robot
Library     REST
...         ${CM_SCHEMA}://${CM_HOST}:${CM_PORT}
...         ssl_verify=false
Library     OperatingSystem
Library     JSONLibrary
Library     JSONSchemaLibrary    schemas/

*** Test Cases ***
POST Individual Subject - Method not implemented
    [Documentation]    Test ID: 13.3.1.3.1
    ...    Test title: POST Individual Subject - Method not implemented
    ...    Test objective: The objective is to test that POST method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.1  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    POST Individual Subject
    Check HTTP Response Status Code Is    405
GET Information about an Individual Subject
    [Documentation]    Test ID: 13.3.1.3.2
    ...    Test title: GET Information about an Individual Subject
    ...    Test objective: The objective is to retrieve Information about Individual Subject with permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.2  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Subject with permitted authorization scope
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    SubjectInstance
GET Information about an Individual Subject with not permitted authorization scope
    [Documentation]    Test ID: 13.3.1.3.3
    ...    Test title: GET Information about an Individual Subject with not permitted authorization scope
    ...    Test objective: The objective is to retrieve Information about Individual Subject with not permitted authorization scope
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.2  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Subject with not permitted authorization scope
    Check HTTP Response Status Code Is    403
    Check HTTP Response Body Json Schema Is    ProblemDetails
GET Information about an Individual Subject - Unauthorized
    [Documentation]    Test ID: 13.3.1.3.4
    ...    Test title: GET Information about an Individual Subject - Unauthorized
    ...    Test objective: The objective is to retrieve Information about Individual Subject without authorization
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.2  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Subject - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
GET Information about an Individual Subject - Not Found
    [Documentation]    Test ID: 13.3.1.3.5
    ...    Test title: GET Information about an Individual Subject - Not Found
    ...    Test objective: The objective is to test the retrieval of information about an "Individual Subject" resource fails when the resource is not present.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.2  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    GET Individual Subject - Not Found
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails
PUT Individual Subject - Method not implemented
    [Documentation]    Test ID: 13.3.1.3.6
    ...    Test title: PUT Individual Subject - Method not implemented
    ...    Test objective: The objective is to test that PUT method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.3  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    PUT Individual Subject
    Check HTTP Response Status Code Is    405
PATCH Individual Subject - Method not implemented
    [Documentation]    Test ID: 13.3.1.3.7
    ...    Test title: PATCH Individual Subject - Method not implemented
    ...    Test objective: The objective is to test that PATCH method is not implemented
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.4  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: none
    PATCH Individual Subject
    Check HTTP Response Status Code Is    405
DELETE Individual Subject
    [Documentation]    Test ID: 13.3.1.3.8
    ...    Test title: DELETE Individual Subject
    ...    Test objective: The objective is to delete an individual Subject
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.5  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: Subject deleted
    DELETE Individual Subject
    Check HTTP Response Status Code Is    204
DELETE Individual Subject - Conflict
    [Documentation]    Test ID: 13.3.1.3.9
    ...    Test title: DELETE Individual Subject - Conflict
    ...    Test objective: The objective is to delete an individual Subject resource that is currently in use by another resource, and to verify that the appropriate error response is returned.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.5  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: Subject deleted
    DELETE Individual Subject - Conflict
    Check HTTP Response Status Code Is    409
    Check HTTP Response Body Json Schema Is    ProblemDetails
DELETE Individual Subject - Unauthorized
    [Documentation]    Test ID: 13.3.1.3.10
    ...    Test title: DELETE Individual Subject - Unauthorized
    ...    Test objective: The objective is to delete an individual Subject resource without authorization, and to verify that the appropriate error response is returned.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.5  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: Subject deleted
    DELETE Individual Subject - Unauthorized
    Check HTTP Response Status Code Is    401
    Check HTTP Response Body Json Schema Is    ProblemDetails
DELETE Individual Subject - Not Found
    [Documentation]    Test ID: 13.3.1.3.11
    ...    Test title: DELETE Individual Subject - Not Found
    ...    Test objective: The objective is to delete an individual Subject resource that does not exist, and to verify that the appropriate error response is returned.
    ...    Pre-conditions: none
    ...    Reference: Clause 5.6.3.4.3.5  - ETSI GS NFV-SOL 023 [13] v5.3.1
    ...    Config ID: config_prod_CMF
    ...    Applicability: none
    ...    Post-Conditions: Subject deleted
    DELETE Individual Subject - Not Found
    Check HTTP Response Status Code Is    404
    Check HTTP Response Body Json Schema Is    ProblemDetails
+215 −0

File added.

Preview size limit exceeded, changes collapsed.

+24 −0
Original line number Diff line number Diff line
*** Variables ***
${CM_SCHEMA}    https
${CM_HOST}      localhost   
${CM_PORT}      8080    
${apiRoot}        /
${apiName}        nfv-cert
${apiMajorVersion}    v1

${ACCEPT}         application/json
${ACCEPT_JSON}     application/json
${CONTENT_TYPE}    application/json
${CONTENT_TYPE_PATCH}    application/merge-patch+json
${AUTHORIZATION_HEADER}    Authorization
${AUTHORIZATION_TOKEN}    Bearer 0b79bab50daca910b000d4f1a2b675d604257e42
${AUTH_USAGE}     1
${OAUTH_Encryption_ALGORITHM}   HS256
${API_VERSION}         1.0.0
${response}=    httpresponse
${SUBJECTS_SCOPE}   cert:v1:subject
${NEG_SCOPE}    cert:v1:invalid
${requested_fields}    subjectId
${subjectId}        SubjectId
${subject_Id_In_Use}         subject_Id_In_Use
${notExistantsubjectId}        notExistantsubjectId
 No newline at end of file
Loading