diff --git a/MEC014/SRV/UETAG/PlatUeIdentity.robot b/MEC014/SRV/UETAG/PlatUeIdentity.robot index c9cdc4c4592559be667d13df886b51745a972d25..17c6d1fafb872668135cf4d5be50ecd9bdaba42a 100644 --- a/MEC014/SRV/UETAG/PlatUeIdentity.robot +++ b/MEC014/SRV/UETAG/PlatUeIdentity.robot @@ -14,144 +14,181 @@ Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_v TC_MEC_MEC014_SRV_UETAG_001_OK [Documentation] Request UE Identity Tag information ... 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 - Get UE Identity Tag information + ... Reference ETSI GS MEC 014 3.1.1, clause 7.3.3.1, + ... ETSI GS MEC 014 3.1.1, clause 6.2.2 + [Setup] Create new App Instance CreateAppInstanceRequest + Get UE Identity Tag information ${APP_INSTANCE_ID} ${UE_IDENTITY_TAG} Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is ueIdentityTagInfo - Check Result Contains ${response['body']['ueIdentityTagInfo']['ueIdentityTags']} ueIdentityTag ${UE_IDENTITY_TAG} + FOR ${identityTag} IN @{response['body']['ueIdentityTags']} + ${ueidentity_tag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[ueIdentityTag] ${UE_IDENTITY_TAG} + ${registered_flag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[state] REGISTERED + Exit For Loop If ${ueidentity_tag} and ${registered_flag} + END + Should Be True ${ueidentity_tag} + Should Be True ${registered_flag} + [TearDown] Delete APP Instance ${APP_INSTANCE_ID} + TC_MEC_MEC014_SRV_UETAG_001_BR [Documentation] Request UE Identity Tag information using bad parameters ... 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 - Get UE Identity Tag information using bad parameters + ... Reference ETSI GS MEC 014 3.1.1, clause 7.3.3.1 + [Setup] Create new App Instance CreateAppInstanceRequest + Get UE Identity Tag information using bad parameters ${APP_INSTANCE_ID} ${UE_IDENTITY_TAG} Check HTTP Response Status Code Is 400 - Check ProblemDetails 400 + [TearDown] Delete APP Instance ${APP_INSTANCE_ID} TC_MEC_MEC014_SRV_UETAG_001_NF [Documentation] Request UE Identity Tag information using non-existent application instance ... 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 - Get UE Identity Tag information using non-existent application instance + ... Reference ETSI GS MEC 014 V3.1.1, clause 7.3.3.1 + [Setup] Delete APP Instance ${NON_EXISTENT_APP_INSTANCE_ID} + Get UE Identity Tag information ${NON_EXISTENT_APP_INSTANCE_ID} ${UE_IDENTITY_TAG} Check HTTP Response Status Code Is 404 - Check ProblemDetails 404 TC_MEC_MEC014_SRV_UETAG_002_OK [Documentation] Register an UE Identity Tag ... 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 ETSI GS MEC 014 V3.1.1, clause 7.3.3.2 ... Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo - Update an UE Identity Tag {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG}","state":"REGISTERED"}]} + [Setup] Create new App Instance and Check User Identity Tag unregistered state CreateAppInstanceRequest ${APP_INSTANCE_ID} UeIdentityTag + Update an UE Identity Tag ${APP_INSTANCE_ID} IdentityTag Check HTTP Response Status Code Is 200 Check HTTP Response Body Json Schema Is UeIdentityTagInfo - Log Checking Postcondition - Check User Identity Tag state ${UE_IDENTITY_TAG} REGISTERED + FOR ${identityTag} IN @{response['body']['ueIdentityTags']} + ${ueidentity_tag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[ueIdentityTag] ${UE_IDENTITY_TAG} + ${registered_flag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[state] REGISTERED + + Exit For Loop If ${ueidentity_tag} and ${registered_flag} + END + Should Be True ${ueidentity_tag} + Should Be True ${registered_flag} + [TearDown] Delete APP Instance ${APP_INSTANCE_ID} TC_MEC_MEC014_SRV_UETAG_002_BR [Documentation] Register an UE Identity Tag using invalid state ... 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 - Update an UE Identity Tag using invalid state {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG}","state":"INVALID_STATE"}]} + ... Reference ETSI GS MEC 014 3.1.1, clause 7.3.3.2, + ... ETSI GS MEC 014 3.1.1, clause 6.2.2 + [Setup] Create new App Instance CreateAppInstanceRequest + Update an UE Identity Tag ${APP_INSTANCE_ID} IdentityTagBR Check HTTP Response Status Code Is 400 - Check ProblemDetails 400 + [TearDown] Delete APP Instance ${APP_INSTANCE_ID} +TC_MEC_MEC014_SRV_UETAG_002_NF + [Documentation] Register an UE Identity Tag using invalid state + ... Check that the IUT responds with an error when an unauthorised request is sent by a MEC Application + ... Reference ETSI GS MEC 014 3.1.1, clause 7.3.3.2 + [Setup] Delete APP Instance ${NON_EXISTENT_APP_INSTANCE_ID} + Update an UE Identity Tag ${NON_EXISTENT_APP_INSTANCE_ID} IdentityTag + Check HTTP Response Status Code Is 404 + TC_MEC_MEC014_SRV_UETAG_002_PF [Documentation] Unregister an UE Identity Tag already in unregistered state - ... 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 - Update an UE Identity Tag using a not applicable valid state {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG_INVALID_STATE}","state":"UNREGISTERED"}]} + ... Check that the IUT responds with an error when + ... a request sent by a MEC Application doesn't comply with a required condition + ... Reference ETSI GS MEC 014 V3.1.1, clause 7.3.3.2 + [Setup] Create new App Instance CreateAppInstanceRequest + Update an UE Identity Tag ${APP_INSTANCE_ID} IdentityTagPF Check HTTP Response Status Code Is 412 - Check ProblemDetails 412 + [TearDown] Delete APP Instance ${APP_INSTANCE_ID} + *** Keywords *** -Get UE Identity Tag information - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 +Create new App Instance + [Arguments] ${content} + Log Creating a new app package Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} - Set Headers {"Content-Length":"0"} - Get /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${UE_IDENTITY_TAG} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + POST http://${APP_INST_HOST}:${APP_INST_PORT}/${apiRoot_APP_INST}/${apiName_APP_INST}/${apiVersion_APP_INST}/app_instances ${body} ${output}= Output response Set Suite Variable ${response} ${output} - - -Get UE Identity Tag information using bad parameters -# FIXME Which IE protocol should be invalid? - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 + Set Suite Variable ${APP_INSTANCE_ID} ${response['body']['id']} + + +Create new App Instance and Check User Identity Tag unregistered state + [Arguments] ${content} ${app_instance_id} ${ue_identity_tag} + Get UE Identity Tag information ${app_instance_id} ${ue_identity_tag} + FOR ${identityTag} IN @{response['body']['ueIdentityTags']} + ${ueidentity_tag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[ueIdentityTag] ${ue_identity_tag} + ${registered_flag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[state] UNREGISTERED + Exit For Loop If ${ueidentity_tag} and ${registered_flag} + END + Should Be True ${ueidentity_tag} + Should Be True ${registered_flag} + +Delete APP Instance + [Arguments] ${app_instance_id} + Log Get single App Instance Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} + Set Headers {"Content-Type":"*/*"} Set Headers {"Authorization":"${TOKEN}"} - Set Headers {"Content-Length":"0"} - Get /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTagERROR=${UE_IDENTITY_TAG} + DELETE http://${APP_INST_HOST}:${APP_INST_PORT}/${apiRoot_APP_INST}/${apiName_APP_INST}/${apiVersion_APP_INST}/app_instances${app_instance_id} ${output}= Output response - Set Suite Variable ${response} ${output} - + Set Suite Variable ${response} ${output} + -Get UE Identity Tag information using non-existent application instance + +Get UE Identity Tag information + [Arguments] ${app_instance_id} ${ue_identity_tag} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} Set Headers {"Content-Length":"0"} - Get /exampleAPI/ui/v1/${NON_EXISTENT_APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${UE_IDENTITY_TAG} + Get /${apiName}/${apiVersion}/${app_instance_id}/ue_identity_tag_info?ueIdentityTag=${ue_identity_tag} ${output}= Output response Set Suite Variable ${response} ${output} -Update an UE Identity Tag - [Arguments] ${content} +Get UE Identity Tag information using bad parameters + [Arguments] ${app_instance_id} ${ue_identity_tag} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} Set Headers {"Authorization":"${TOKEN}"} - ## As far as I understood, we are not checking preconditions. - # Preamble: Check that the user tag is not registered - ## Check User Identity Tag state ${UE_IDENTITY_TAG} UNREGISTERED - log ${content} - Put /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info ${content} + Set Headers {"Content-Length":"0"} + Get /${apiName}/${apiVersion}/${app_instance_id}/ue_identity_tag_info?ueIdentityTagERROR=${ue_identity_tag} ${output}= Output response Set Suite Variable ${response} ${output} +Check User Identity Tag unregistered state + [Arguments] ${app_instance_id} ${ue_identity_tag} + Get UE Identity Tag information ${app_instance_id} ${ue_identity_tag} + FOR ${identityTag} IN @{response['body']['ueIdentityTags']} + ${ueidentity_tag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[ueIdentityTag] ${ue_identity_tag} + ${registered_flag} Run Keyword And Return Status Should Be Equal As Strings ${identityTag}[state] UNREGISTERED + Exit For Loop If ${ueidentity_tag} and ${registered_flag} + END + Should Be True ${ueidentity_tag} + Should Be True ${registered_flag} + -Update an UE Identity Tag using invalid state - [Arguments] ${content} - Should Be True ${PIC_MEC_PLAT} == 1 - Should Be True ${PIC_SERVICES} == 1 - Set Headers {"Accept":"application/json"} - Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - # Test Body: Register the tag user and check that the IUT has registered the tag user - Put /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info ${content} - ${output}= Output response - Set Suite Variable ${response} ${output} - -Update an UE Identity Tag using a not applicable valid state - [Arguments] ${content} +Update an UE Identity Tag + [Arguments] ${app_instance_id} ${content} Should Be True ${PIC_MEC_PLAT} == 1 Should Be True ${PIC_SERVICES} == 1 Set Headers {"Accept":"application/json"} Set Headers {"Content-Type":"application/json"} - Set Headers {"Authorization":"${TOKEN}"} - # Test Body: Register the tag user and check that the IUT has registered the tag user - Put /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info ${content} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + Put /${apiName}/${apiVersion}/${app_instance_id}/ue_identity_tag_info ${body} ${output}= Output response Set Suite Variable ${response} ${output} - # TODO Check ProblemDetails + diff --git a/MEC014/SRV/UETAG/environment/variables.txt b/MEC014/SRV/UETAG/environment/variables.txt index 492b598d03722a2c7d227c8d077d66ffb40a1ee9..82306889ed4a9dd9bf40371eaec1d1f4285028ca 100644 --- a/MEC014/SRV/UETAG/environment/variables.txt +++ b/MEC014/SRV/UETAG/environment/variables.txt @@ -2,12 +2,23 @@ ${MEC-APP_SCHEMA} http #${MEC-APP_HOST} 172.28.4.87 #${MEC-APP_HOST} 127.0.0.1 -${MEC-APP_HOST} 192.168.56.1 -${MEC-APP_PORT} 8081 +${MEC-APP_HOST} 127.0.0.1 +${MEC-APP_PORT} 8085 +${apiRoot} +${apiName} ui +${apiVersion} v1 + ${ZONE_ID} zone01 -${APP_INSTANCE_ID} appInst01 -${NON_EXISTENT_APP_INSTANCE_ID} appInst99 -${UE_IDENTITY_TAG} UeTagA +${APP_INSTANCE_ID} +${NON_EXISTENT_APP_INSTANCE_ID} NON_EXISTENT_APP_INSTANCE_ID +${UE_IDENTITY_TAG} UeIdentityTag ${UE_IDENTITY_TAG_INVALID_STATE} UeTagC ${response} {} ${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l + +##Variables for App Instances management +${APP_INST_HOST} 127.0.0.1 +${APP_INST_PORT} 8081 +${apiRoot_APP_INST} +${apiName_APP_INST} app_lcm +${apiVersion_APP_INST} v1 diff --git a/MEC014/SRV/UETAG/jsons/CreateAppInstanceRequest.json b/MEC014/SRV/UETAG/jsons/CreateAppInstanceRequest.json new file mode 100644 index 0000000000000000000000000000000000000000..3691ba6ce55af3f45f518ea1313f56a99e904b5a --- /dev/null +++ b/MEC014/SRV/UETAG/jsons/CreateAppInstanceRequest.json @@ -0,0 +1,5 @@ +{ + "appDId": "e0deee2b-6e50-4f33-ab09-8bf0585025d3", + "appInstanceDescription": "description", + "appInstanceName": "name" +} \ No newline at end of file diff --git a/MEC014/SRV/UETAG/jsons/IdentityTag.json b/MEC014/SRV/UETAG/jsons/IdentityTag.json new file mode 100644 index 0000000000000000000000000000000000000000..10f4601b32b839462c4002bd187856b00fb15ce7 --- /dev/null +++ b/MEC014/SRV/UETAG/jsons/IdentityTag.json @@ -0,0 +1,8 @@ +{ + "ueIdentityTags": [ + { + "ueIdentityTag": "UeIdentityTag", + "state": "REGISTERED" + } + ] +} \ No newline at end of file diff --git a/MEC014/SRV/UETAG/jsons/IdentityTagBR.json b/MEC014/SRV/UETAG/jsons/IdentityTagBR.json new file mode 100644 index 0000000000000000000000000000000000000000..f63d0984c29d3fe47953e01e1037c4891de3ba33 --- /dev/null +++ b/MEC014/SRV/UETAG/jsons/IdentityTagBR.json @@ -0,0 +1,8 @@ +{ + "ueIdentityTags": [ + { + "ueIdentityTag": "UeIdentityTag", + "state": "INVALID_STATE" + } + ] +} \ No newline at end of file diff --git a/MEC014/SRV/UETAG/jsons/IdentityTagPF.json b/MEC014/SRV/UETAG/jsons/IdentityTagPF.json new file mode 100644 index 0000000000000000000000000000000000000000..f4f5644e8cc268a8a6661cd40d7f02608f6fbaa4 --- /dev/null +++ b/MEC014/SRV/UETAG/jsons/IdentityTagPF.json @@ -0,0 +1,8 @@ +{ + "ueIdentityTags": [ + { + "ueIdentityTag": "UeIdentityTag", + "state": "UNREGISTER" + } + ] +} \ No newline at end of file