Commit 73ec70a5 authored by Yann Garcia's avatar Yann Garcia
Browse files

Enhance UETAG test cases

parent 3344c605
Loading
Loading
Loading
Loading
+19 −18
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@
*** Settings ***
Resource    ../../environment/variables.txt
Resource    ../../resources/GenericKeywords.robot
Resource    ../../resources/UEidentityAPI.robot
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false

Default Tags    TC_MEC_SRV_UETAG
@@ -14,9 +15,9 @@ Default Tags TC_MEC_SRV_UETAG
*** Test Cases ***
Get UE Identity Tag information
    [Documentation]   TC_MEC_SRV_UETAG_001_OK
    # Check that the IUT responds with the information on a UE Identity tag when queried by a MEC Application
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT responds with the information on a UE Identity tag when queried by a MEC Application
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_001_OK    TP_MEC_SRV_UETAG

@@ -35,9 +36,9 @@ Get UE Identity Tag information
Bad Request error on UE Identity Tag registration
# FIXME Which IE protocol should be invalid?
    [Documentation]   TC_MEC_SRV_UETAG_001_BR
    # Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_001_BR    TP_MEC_SRV_UETAG

@@ -52,9 +53,9 @@ Bad Request error on UE Identity Tag registration

Not Found error on UE Identity Tag registration
    [Documentation]   TC_MEC_SRV_UETAG_001_NF
    # Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT responds with an error when a request for an URI that cannot be mapped to a valid resource URI is sent by a MEC Application
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_001_NF    TP_MEC_SRV_UETAG

@@ -69,9 +70,9 @@ Not Found error on UE Identity Tag registration

Register a UE Identity Tag
    [Documentation]   TC_MEC_PLAT_UETAG_002_OK
    # Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT registers a tag (representing a UE) or a list of tags when commanded by a MEC Application
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_002_OK    TP_MEC_SRV_UETAG

@@ -89,9 +90,9 @@ Register a UE Identity Tag

Bad Request error on invalid state
    [Documentation]   TC_MEC_PLAT_UETAG_002_BR
    # Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_002_BR    TP_MEC_SRV_UETAG

@@ -107,9 +108,9 @@ Bad Request error on invalid state

Precondition Failed error on invalid state
    [Documentation]   TC_MEC_PLAT_UETAG_002_PF
    # Check that the IUT responds with ProblemDetails on information an invalid URI
    # Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    # Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Check that the IUT responds with ProblemDetails on information an invalid URI
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo

    [Tags]    TP_MEC_SRV_UETAG_002_PF    TP_MEC_SRV_UETAG

+2 −2
Original line number Diff line number Diff line
*** Variables ***
${MEC-APP_SCHEMA}                   http
${MEC-APP_HOST}                     172.28.4.87
#${MEC-APP_HOST}                     172.28.4.87
#${MEC-APP_HOST}                     127.0.0.1
#${MEC-APP_HOST}                     192.168.0.17
${MEC-APP_HOST}                     10.192.2.172
${MEC-APP_PORT}                     8081
${ZONE_ID}                          zone01
${APP_INSTANCE_ID}                  appInst01
+0 −25
Original line number Diff line number Diff line
@@ -25,13 +25,6 @@ Check HTTP Response Body Json Schema Is
    Validate Json    ${schema}    ${response['body']}
    Log    Json Schema Validation OK


Check Location
    [Arguments]    ${value}
    Log    Check Location for userInfo element
    Should be Equal    ${response['body']['userInfo']['zoneId']}    ${value}
    Log    Location OK

Should Be Present In Json List
    [Arguments]     ${expr}   ${json_field}   ${json_value}
    Log    Check if ${json_field} is present in ${expr} with the value ${jsonvalue}
@@ -39,21 +32,3 @@ Should Be Present In Json List
    \  Exit For Loop If    "${item['${json_field}']}" == "${json_value}"
    Log    Item found ${item}
    [return]    ${item}

Check User Identity Tag state
    [Arguments]    ${ue_identity_tag}    ${state}
    Log    Check ueIdentityTag state ${state}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"Basic YWxhZGRpbjpvcGVuc2VzYW1l"}
    Set Headers    {"Content-Length":"0"}
    Get    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${ue_identity_tag}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   ueIdentityTagInfo
    #Log    Check ueIdentityTagsList for ${UE_IDENTITY_TAG} element
    ${result}=    Should Be Present In Json List    ${response['body']['ueIdentityTagInfo']['ueIdentityTags']}    ueIdentityTag    ${UE_IDENTITY_TAG}
    #Log    ${UE_IDENTITY_TAG} found with state ${result}
    Should Be Equal    ${result}[state]    ${state}
    [return]    ${state}
+12 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    ../environment/variables.txt
Resource    LocationAPI.robot
#Library    REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library    JSONSchemaLibrary    schemas/

*** Keywords ***
Check Location
    [Arguments]    ${value}
    Log    Check Location for userInfo element
    Should be Equal    ${response['body']['userInfo']['zoneId']}    ${value}
    Log    Location OK
+24 −0
Original line number Diff line number Diff line
*** Settings ***
Resource    ../environment/variables.txt
Resource    UEidentityAPI.robot
Library    REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library    JSONSchemaLibrary    schemas/

*** Keywords ***
Check User Identity Tag state
    [Arguments]    ${ue_identity_tag}    ${state}
    Log    Check ueIdentityTag state ${state}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"Basic YWxhZGRpbjpvcGVuc2VzYW1l"}
    Set Headers    {"Content-Length":"0"}
    Get    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${ue_identity_tag}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   ueIdentityTagInfo
    #Log    Check ueIdentityTagsList for ${UE_IDENTITY_TAG} element
    ${result}=    Should Be Present In Json List    ${response['body']['ueIdentityTagInfo']['ueIdentityTags']}    ueIdentityTag    ${UE_IDENTITY_TAG}
    #Log    ${UE_IDENTITY_TAG} found with state ${result}
    Should Be Equal    ${result}[state]    ${state}
    [return]    ${state}