From 73ec70a5db0b61d40cfeba054f141d9780d58535 Mon Sep 17 00:00:00 2001 From: garciay Date: Thu, 1 Aug 2019 12:47:23 +0200 Subject: [PATCH] Enhance UETAG test cases --- SRV/UETAG/PlatUeIdentity.robot | 37 +++++++++++++++++---------------- environment/variables.txt | 4 ++-- resources/GenericKeywords.robot | 25 ---------------------- resources/LocationAPI.robot | 12 +++++++++++ resources/UEidentityAPI.robot | 24 +++++++++++++++++++++ 5 files changed, 57 insertions(+), 45 deletions(-) create mode 100644 resources/LocationAPI.robot create mode 100644 resources/UEidentityAPI.robot diff --git a/SRV/UETAG/PlatUeIdentity.robot b/SRV/UETAG/PlatUeIdentity.robot index 17de4cd..404cffd 100644 --- a/SRV/UETAG/PlatUeIdentity.robot +++ b/SRV/UETAG/PlatUeIdentity.robot @@ -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 diff --git a/environment/variables.txt b/environment/variables.txt index 664bfc0..08921ed 100644 --- a/environment/variables.txt +++ b/environment/variables.txt @@ -1,8 +1,8 @@ *** 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 diff --git a/resources/GenericKeywords.robot b/resources/GenericKeywords.robot index b609f85..2cabd01 100644 --- a/resources/GenericKeywords.robot +++ b/resources/GenericKeywords.robot @@ -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} diff --git a/resources/LocationAPI.robot b/resources/LocationAPI.robot new file mode 100644 index 0000000..012566b --- /dev/null +++ b/resources/LocationAPI.robot @@ -0,0 +1,12 @@ +*** 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 diff --git a/resources/UEidentityAPI.robot b/resources/UEidentityAPI.robot new file mode 100644 index 0000000..5e9e248 --- /dev/null +++ b/resources/UEidentityAPI.robot @@ -0,0 +1,24 @@ +*** 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} -- GitLab