Commit c93fc816 authored by piscione's avatar piscione
Browse files

Added Test setups and test teardowns to the IoT Platform MEC033 TCs

parent 7a3014ef
Loading
Loading
Loading
Loading
+86 −10
Original line number Original line Diff line number Diff line
@@ -8,30 +8,50 @@ Resource ../../../../GenericKeywords.robot
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false
Library     OperatingSystem    
Library     OperatingSystem    


Test Setup       Test Setup   ${PLATFORM_ID_PLACEHOLDER}   IoTPlatformInfo      ${NO_ACTION}
Test Teardown    Test TearDown    ${PLATFORM_ID_PLACEHOLDER}   IoTPlatformInfo      ${NO_ACTION}


*** Test Cases ***
*** Test Cases ***
TP_MEC_MEC033_MEX_IOTS_IOTPLAT_001_OK
TC_MEC_MEC033_MEX_IOTS_IOTPLAT_001_OK
    [Documentation]
    [Documentation]
    ...  Check that the IUT responds with the list of registered IoT platforms
    ...  Check that the IUT responds with the list of registered IoT platforms
    ...  when queried by a Service Consumer
    ...  when queried by a Service Consumer
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    [Setup]      Test Setup   ${None}   IoTPlatformInfo      ${REGISTER_ACTION}
    ${IOT_PLATFORM_ID_VALUE}   Get value entry from JSON file    IoTPlatformInfo  iotPlatformId
    LOG    ${IOT_PLATFORM_ID_VALUE} 
    Retrieve all registered IOT Platform information
    Retrieve all registered IOT Platform information
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is  IotPlatformInfoList
    Check HTTP Response Body Json Schema Is  IotPlatformInfoList
    [Teardown]    Test TearDown    ${IOT_PLATFORM_ID_VALUE}   ${None}      ${REMOVE_ACTION}




TP_MEC_MEC033_MEX_IOTS_IOTPLAT_002_OK

TC_MEC_MEC033_MEX_IOTS_IOTPLAT_002_OK
    [Documentation]
    [Documentation]
    ...  Check that the IUT registers the information of a new IoT platform
    ...  Check that the IUT registers the information of a new IoT platform
	...  when requested by a Service Consumer
	...  when requested by a Service Consumer
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.4
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.4
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    
    [Setup]      Test Setup   ${IOT_PLATFORM_ID}   ${None}      ${REMOVE_ACTION}    
    ${IOT_PLATFORM_ID_VALUE}   Get value entry from JSON file    IoTPlatformInfo  iotPlatformId
    ${USER_TRANSPORT_INFO_VALUE}   Get value entry from JSON file    IoTPlatformInfo  userTransportInfo

    Register IOT Platform information     IotPlatformInfo
    Register IOT Platform information     IotPlatformInfo
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is   IotPlatformInfo
    Check HTTP Response Body Json Schema Is   IotPlatformInfo
    Check HTTP Response Header Contains    Location
    
    Should Be Equal As Strings    ${response['body']['iotPlatformId']}   ${IOT_PLATFORM_ID}
    Should Be Equal As Strings    ${response['body']['userTransportInfo']}       ${USER_TRANSPORT_INFO_VALUE}


    [Teardown]    Test TearDown    ${IOT_PLATFORM_ID_VALUE}   ${None}      ${REMOVE_ACTION}
    
    
TP_MEC_MEC033_MEX_IOTS_IOTPLAT_002_BR

TC_MEC_MEC033_MEX_IOTS_IOTPLAT_002_BR
    [Documentation]
    [Documentation]
    ...  Check that the IUT returns an error
    ...  Check that the IUT returns an error
	...  when Service Consumer request to register an IoT device with incorrect parameters
	...  when Service Consumer request to register an IoT device with incorrect parameters
@@ -41,43 +61,62 @@ TP_MEC_MEC033_MEX_IOTS_IOTPLAT_002_BR
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400




TP_MEC_MEC033_MEX_IOTS_IOTPLAT_003_OK
TC_MEC_MEC033_MEX_IOTS_IOTPLAT_003_OK
    [Documentation]
    [Documentation]
    ...  Check that the IUT returns the IoT platform information
    ...  Check that the IUT returns the IoT platform information
    ...  when requested by Service Consumer specifying the IoT platform identifier
    ...  when requested by Service Consumer specifying the IoT platform identifier
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    Retrieve specific registered IOT Platform information    ${IOT_PLATFORM_ID}
    [Setup]      Test Setup   ${None}   IoTPlatformInfo      ${REGISTER_ACTION}
    ${IOT_PLATFORM_ID_VALUE}   Get value entry from JSON file    IoTPlatformInfo  iotPlatformId
    ${USER_TRANSPORT_INFO_VALUE}   Get value entry from JSON file    IoTPlatformInfo  userTransportInfo
    
    Retrieve specific registered IOT Platform information    ${IOT_PLATFORM_ID_VALUE}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is  IotPlatformInfo
    Check HTTP Response Body Json Schema Is  IotPlatformInfo
    Should Be Equal As Strings    ${response['body']['iotPlatformId']}   ${IOT_PLATFORM_ID_VALUE}
    Should Be Equal As Strings    ${response['body']['userTransportInfo']}       ${USER_TRANSPORT_INFO_VALUE}


    [Teardown]    Test TearDown    ${IOT_PLATFORM_ID}   ${None}      ${REMOVE_ACTION}
    
    
TP_MEC_MEC033_MEX_IOTS_IOTPLAT_003_NF

TC_MEC_MEC033_MEX_IOTS_IOTPLAT_003_NF
    [Documentation]
    [Documentation]
    ...  Check that the IUT returns the IoT platform information
    ...  Check that the IUT returns the IoT platform information
    ...  when requested by Service Consumer specifying the IoT platform identifier
    ...  when requested by Service Consumer specifying the IoT platform identifier
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.1
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    [Setup]      Test Setup   ${NOT_EXISTING_IOT_PLATFORM_ID}   ${None}      ${NOT_EXISTING_IOT_PLATFORM_ID}
    Retrieve specific registered IOT Platform information    ${NOT_EXISTING_IOT_PLATFORM_ID}
    Retrieve specific registered IOT Platform information    ${NOT_EXISTING_IOT_PLATFORM_ID}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404




TP_MEC_MEC033_MEX_IOTS_IOTPLAT_004_OK
TC_MEC_MEC033_MEX_IOTS_IOTPLAT_004_OK
    [Documentation]
    [Documentation]
    ...  Check that the IUT updates the information about a registered IoT platform
    ...  Check that the IUT updates the information about a registered IoT platform
	...  when requested by a Service Consumer
	...  when requested by a Service Consumer
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.2
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.2
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    Update registered IOT Platform information   ${IOT_PLATFORM_ID}  IotPlatformInfoUpdate
    [Setup]      Test Setup   ${None}   IoTPlatformInfo      ${REGISTER_ACTION}
    ${IOT_PLATFORM_ID_VALUE}   Get value entry from JSON file    IotPlatformInfoUpdate  iotPlatformId
    ${USER_TRANSPORT_INFO_VALUE}   Get value entry from JSON file    IotPlatformInfoUpdate  userTransportInfo
    
    Update registered IOT Platform information   ${IOT_PLATFORM_ID_VALUE}  IotPlatformInfoUpdate
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   IotPlatformInfo
    Check HTTP Response Body Json Schema Is   IotPlatformInfo
    Should Be Equal As Strings    ${response['body']['iotPlatformId']}   ${IOT_PLATFORM_ID_VALUE}
    Should Be Equal As Strings    ${response['body']['userTransportInfo']}       ${USER_TRANSPORT_INFO_VALUE}
    
    [Teardown]    Test TearDown    ${IOT_PLATFORM_ID_VALUE}   ${None}      ${REMOVE_ACTION}



TP_MEC_MEC033_MEX_IOTS_IOTPLAT_004_NF
TC_MEC_MEC033_MEX_IOTS_IOTPLAT_004_NF
    [Documentation]
    [Documentation]
    ...  Check that the IUT returns an error
    ...  Check that the IUT returns an error
	...  when a Service Consumer requests to update a not registered IoT platform
	...  when a Service Consumer requests to update a not registered IoT platform
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.2
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.2
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    [Setup]      Test Setup   ${NOT_EXISTING_IOT_PLATFORM_ID}   ${None}      ${NOT_EXISTING_IOT_PLATFORM_ID}
    Update registered IOT Platform information   ${NOT_EXISTING_IOT_PLATFORM_ID}  IotPlatformInfoUpdate
    Update registered IOT Platform information   ${NOT_EXISTING_IOT_PLATFORM_ID}  IotPlatformInfoUpdate
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404


@@ -88,16 +127,20 @@ TP_MEC_MEC033_MEX_IOTS_IOTPLAT_005_OK
	...  when requested by a Service Consumer specifying the registered IoT platform identifier
	...  when requested by a Service Consumer specifying the registered IoT platform identifier
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.5
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.5
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    [Setup]      Test Setup   ${None}   IoTPlatformInfo      ${REGISTER_ACTION}
    ${IOT_PLATFORM_ID_VALUE}   Get value entry from JSON file    IoTPlatformInfo  iotPlatformId    
    Deregister IOT Platform information   ${IOT_PLATFORM_ID}
    Deregister IOT Platform information   ${IOT_PLATFORM_ID}
    Check HTTP Response Status Code Is    204
    Check HTTP Response Status Code Is    204
    [Teardown]    Test TearDown    ${IOT_PLATFORM_ID_VALUE}   ${None}      ${REMOVE_ACTION}




TP_MEC_MEC033_MEX_IOTS_IOTPLAT_005_NF
TC_MEC_MEC033_MEX_IOTS_IOTPLAT_005_NF
    [Documentation]
    [Documentation]
    ...  Check that the IUT returns an error
    ...  Check that the IUT returns an error
	...  when a Service Consumer request to deregister an IoT platform using incorrect parameters
	...  when a Service Consumer request to deregister an IoT platform using incorrect parameters
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.5
    ...  ETSI GS MEC 033 V3.1.1, clause 7.5.3.5
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    ...  https://www.etsi.org/deliver/etsi_gs/MEC/001_099/033/03.01.01_60/gs_MEC033v030101p.pdf
    [Setup]      Test Setup   ${NOT_EXISTING_IOT_PLATFORM_ID}   ${None}      ${NOT_EXISTING_IOT_PLATFORM_ID}
    Deregister IOT Platform information   ${NOT_EXISTING_IOT_PLATFORM_ID}
    Deregister IOT Platform information   ${NOT_EXISTING_IOT_PLATFORM_ID}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
    
    
@@ -105,6 +148,39 @@ TP_MEC_MEC033_MEX_IOTS_IOTPLAT_005_NF
############################################################################
############################################################################
      
      
*** Keywords ***
*** Keywords ***
Test Setup 
    [Arguments]     ${iotPlatformId}    ${content}   ${action}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
     
    IF    '''${action}''' == '''${REGISTER_ACTION}'''
       ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
       ${body}=    Get File    ${file}
       POST   ${apiRoot}/${apiName}/${apiVersion}/registered_iot_platforms   ${body}
    END
    
    IF    '''${action}''' == '''${REMOVE_ACTION}'''
        DELETE   ${apiRoot}/${apiName}/${apiVersion}/registered_iot_platforms/${iotPlatformId}
   END
    
Test Teardown  
    [Arguments]     ${iotPlatformId}    ${content}   ${action}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
     
    IF    '''${action}''' == '''${REGISTER_ACTION}'''
       ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
       ${body}=    Get File    ${file}
       POST   ${apiRoot}/${apiName}/${apiVersion}/registered_iot_platforms   ${body}
    END
    
    IF    '''${action}''' == '''${REMOVE_ACTION}'''
        DELETE   ${apiRoot}/${apiName}/${apiVersion}/registered_iot_platforms/${iotPlatformId}
   END
      

Retrieve all registered IOT Platform information
Retrieve all registered IOT Platform information
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
+6 −0
Original line number Original line Diff line number Diff line
@@ -9,5 +9,11 @@ ${apiRoot}
${apiName}                amsi
${apiName}                amsi
${apiVersion}             v1
${apiVersion}             v1


${REGISTER_ACTION}        REGISTER
${REMOVE_ACTION}          REMOVE 
${NO_ACTION}              NO_ACTION


${PLATFORM_ID_PLACEHOLDER}        PLATFORM_ID_PLACEHOLDER
${IOT_PLATFORM_ID}                iotPlatformId
${IOT_PLATFORM_ID}                iotPlatformId
${NOT_EXISTING_IOT_PLATFORM_ID}   notExistingIotPlatformId
${NOT_EXISTING_IOT_PLATFORM_ID}   notExistingIotPlatformId
 No newline at end of file
+3 −4
Original line number Original line Diff line number Diff line
[{
{
    "iotPlatformId": "cupidatat",
    "iotPlatformId": "iotPlatformId",
    "userTransportInfo": [
    "userTransportInfo": [
        {
        {
            "id": "IoTPlatformId",
            "id": "IoTPlatformId",
@@ -44,4 +44,3 @@
        }
        }
    ]
    ]
}
}
 No newline at end of file
]
 No newline at end of file
+1 −44
Original line number Original line Diff line number Diff line
{
{
    "iotPlatformId": "IoTPlatformId",
    "iotPlatformId": "IoTPlatformId",
    "enable":true,
    "enabled":true
    "userTransportInfo": [
        {
            "id": "IoTPlatformId",
            "name": "nameUserTransportInfo",
            "type": "REST_HTTP",
            "protocol": "HTTP",
            "version": "1.00",
            "endpoint": {
                "alternative": "amet commodo ad qui cupidatat",
                "fqdn": [
                    "fqdn"
                ],
                "addresses": [
                    {
                        "host": "somehost.com",
                        "port": 1234
                    }
                ]
            },
            "security": {
                "oAuth2Info": {
                    "grantTypes": [
                        "OAUTH2_AUTHORIZATION_CODE",
                        "OAUTH2_RESOURCE_OWNER",
                        "OAUTH2_RESOURCE_OWNER"
                    ],
                    "tokenEndpoint": "https://IqNooo.tosnwuA0fdU9jlKNmu3uyYD"
                }
            },
            "implSpecificInfo": {
                "downlinkTopics": [
                    "downlinkTopic01"
                ],
                "uplinkTopics": [
                    "uplinkTopic01"
                ],
                "eventTopics": [
                    "eventTopics"
                ]
            },
            "description": "desc"
        }
    ]
}
}
 No newline at end of file