From 6606104725aec959b0a472f30243cd8848c8131f Mon Sep 17 00:00:00 2001 From: piscione Date: Thu, 18 May 2023 11:14:22 +0200 Subject: [PATCH] First implementation of MEC011 v3.1.1 TCs based on the corresponding TPs --- MEC011/SRV/REGAPPS/README.md | 0 MEC011/SRV/REGAPPS/RegApps.robot | 269 ++++++++++++++++++ MEC011/SRV/REGAPPS/environment/variables.txt | 16 ++ MEC011/SRV/REGAPPS/jsons/AppInfo.json | 3 + MEC011/SRV/REGAPPS/jsons/AppInfo2.json | 4 + MEC011/SRV/REGAPPS/jsons/AppInfo3.json | 5 + MEC011/SRV/REGAPPS/jsons/AppInfoBR1.json | 4 + MEC011/SRV/REGAPPS/jsons/AppInfoBR2.json | 5 + MEC011/SRV/REGAPPS/jsons/AppInfoBR3.json | 9 + MEC011/SRV/REGAPPS/jsons/AppInfoBR4.json | 9 + MEC011/SRV/REGAPPS/jsons/AppInfoBR5.json | 8 + MEC011/SRV/REGAPPS/jsons/AppInfoBR6.json | 8 + MEC011/SRV/REGAPPS/jsons/AppInfoUpdate.json | 3 + .../SRV/REGAPPS/schemas/AppInfo.schema.json | 18 ++ 14 files changed, 361 insertions(+) create mode 100644 MEC011/SRV/REGAPPS/README.md create mode 100644 MEC011/SRV/REGAPPS/RegApps.robot create mode 100644 MEC011/SRV/REGAPPS/environment/variables.txt create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfo.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfo2.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfo3.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR1.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR2.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR3.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR4.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR5.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoBR6.json create mode 100644 MEC011/SRV/REGAPPS/jsons/AppInfoUpdate.json create mode 100644 MEC011/SRV/REGAPPS/schemas/AppInfo.schema.json diff --git a/MEC011/SRV/REGAPPS/README.md b/MEC011/SRV/REGAPPS/README.md new file mode 100644 index 0000000..e69de29 diff --git a/MEC011/SRV/REGAPPS/RegApps.robot b/MEC011/SRV/REGAPPS/RegApps.robot new file mode 100644 index 0000000..6efdd88 --- /dev/null +++ b/MEC011/SRV/REGAPPS/RegApps.robot @@ -0,0 +1,269 @@ +*** Settings *** + +Documentation +... A test suite for validating Registration applications (REGAPPS) operations. + +Resource ../../../GenericKeywords.robot +Resource environment/variables.txt +Library REST ${SCHEMA}://${HOST}:${PORT} ssl_verify=false + +Default Tags TC_MEC_SRV_REGAPPS + + + +*** Test Cases *** + +TP_MEC_MEC011_SRV_REGAPPS_001_OK_01 + [Documentation] + ... Check that the IUT acknowledges the registration + ... by a MEC Application to the MEC platform + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfo + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is AppInfo + Check Response Contains ${response['body']} appName ${APP_NAME} + + + +TP_MEC_MEC011_SRV_REGAPPS_001_OK_02 + [Documentation] + ... Check that the IUT acknowledges the registration + ... by a MEC Application to the MEC platform + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfo2 + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is AppInfo + Check Response Contains ${response['body']} appName ${APP_NAME} + Check Response Contains ${response['body']} appInstanceId ${APP_INSTANCE_ID} + + +TP_MEC_MEC011_SRV_REGAPPS_001_OK_03 + [Documentation] + ... Check that the IUT acknowledges the registration + ... by a MEC Application to the MEC platform + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfo3 + Check HTTP Response Status Code Is 201 + Check HTTP Response Header Contains Location + Check HTTP Response Body Json Schema Is AppInfo + Check Response Contains ${response['body']} appName ${APP_NAME} + Check Response Contains ${response['body']} appInstanceId ${APP_INSTANCE_ID} + Check Response Contains ${response['body']} appDId ${APPD_ID} + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_01 + [Documentation] + ... Check that the IUT responds with an error message when the IUT received a registration with + ... missing fields from a MEC Application instantiated by the MEC platform + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR1 + Check HTTP Response Status Code Is 400 + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_02 + [Documentation] + ... Check that the IUT responds with an error message + ... when the IUT received by a MEC Application registration with missing endpoint + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR2 + Check HTTP Response Status Code Is 400 + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_03 + [Documentation] + ... Check that the IUT responds with an error message when the IUT received by a + ... MEC Application registration with unexpected appServiceRequired + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR3 + Check HTTP Response Status Code Is 400 + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_04 + [Documentation] + ... Check that the IUT responds with an error message when the IUT received by a + ... MEC Application registration with unexpected appServiceRequired + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR4 + Check HTTP Response Status Code Is 400 + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_05 + [Documentation] + ... Check that the IUT responds with an error message when the IUT received by a + ... MEC Application registration with unexpected appFeatureRequired + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR5 + Check HTTP Response Status Code Is 400 + + +TP_MEC_MEC011_SRV_REGAPPS_001_BR_06 + [Documentation] + ... Check that the IUT responds with an error message when the IUT received by a + ... MEC Application registration with unexpected appFeatureOptional + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.13.3.4 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Create a new MEC application instance profile AppInfoBR6 + Check HTTP Response Status Code Is 400 + + + +TP_MEC_MEC011_SRV_REGAPPS_002_OK + [Documentation] + ... Check that the IUT responds with the AppInfo description + ... when queried by a MEC Application + ... + ... ETSI GS MEC 011 3.1.1, clause 7.2.14.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Get MEC application instance profile ${APP_INSTANCE_ID} + Check HTTP Response Status Code Is 200 + Check HTTP Response Body Json Schema Is AppInfo + Check Response Contains ${response['body']} appInstanceId ${APP_INSTANCE_ID} + + +TP_MEC_MEC011_SRV_REGAPPS_002_NF + [Documentation] + ... Check that the IUT responds with an error + ... when it receives a request for returning an AppInfo with a wrong ID + ... + ... ETSI GS MEC 011 3.1.1, clause 7.2.14.3.1 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Get MEC application instance profile ${NOT_EXISTING_APP_INSTANCE_ID} + Check HTTP Response Status Code Is 404 + + + +TP_MEC_MEC011_SRV_REGAPPS_003_OK + [Documentation] + ... Check that the IUT responds with 204 No Content + ... when queried to update MEC Application registration + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.14.3.2 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Update MEC application registration ${APP_INSTANCE_ID} AppInfoUpdate + Check HTTP Response Status Code Is 204 + + + +TP_MEC_MEC011_SRV_REGAPPS_003_NF + [Documentation] + ... Check that the IUT responds with 204 No Content + ... when queried to update MEC Application registration + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.14.3.2 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Update MEC application registration ${NOT_EXISTING_APP_INSTANCE_ID} AppInfoUpdate + Check HTTP Response Status Code Is 404 + + + +TP_MEC_MEC011_SRV_REGAPPS_004_OK + [Documentation] + ... Check that the IUT responds with 204 No Content + ... when queried to delete an existing MEC Application registration + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.14.3.5 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Delete MEC application instance profile ${APP_INSTANCE_ID} + Check HTTP Response Status Code Is 204 + + + +TP_MEC_MEC011_SRV_REGAPPS_004_NF + [Documentation] + ... Check that the IUT responds with an error when queried to + ... delete an unknown MEC Application registration + ... + ... Reference ETSI GS MEC 011 3.1.1, clause 7.2.14.3.5 + + [Tags] PIC_MEC_PLAT PIC_SERVICES + Delete MEC application instance profile ${NOT_EXISTING_APP_INSTANCE_ID} + Check HTTP Response Status Code Is 404 + + + + +*** Keywords *** +Create a new MEC application instance profile + [Arguments] ${content} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + #Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + Post ${apiRoot}/${apiName}/${apiVersion}/registrations ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + + +Get MEC application instance profile + [Arguments] ${app_instance_id} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + #Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + Get ${apiRoot}/${apiName}/${apiVersion}/registrations/${app_instance_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + + + + +Update MEC application registration + [Arguments] ${app_instance_id} ${content} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + #Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + ${file}= Catenate SEPARATOR= jsons/ ${content} .json + ${body}= Get File ${file} + Put ${apiRoot}/${apiName}/${apiVersion}/registrations/${app_instance_id} ${body} + ${output}= Output response + Set Suite Variable ${response} ${output} + + + + +Delete MEC application instance profile + [Arguments] ${app_instance_id} + Set Headers {"Accept":"application/json"} + Set Headers {"Content-Type":"application/json"} + #Set Headers {"Content-Type":"*/*"} + Set Headers {"Authorization":"${TOKEN}"} + Delete ${apiRoot}/${apiName}/${apiVersion}/registrations/${app_instance_id} + ${output}= Output response + Set Suite Variable ${response} ${output} + \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/environment/variables.txt b/MEC011/SRV/REGAPPS/environment/variables.txt new file mode 100644 index 0000000..27fe68f --- /dev/null +++ b/MEC011/SRV/REGAPPS/environment/variables.txt @@ -0,0 +1,16 @@ +*** Variables *** +# Generic variables +${SCHEMA} http +${HOST} 127.0.0.1 +${PORT} 8081 +${response} {} +${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l +${apiRoot} +${apiName} mec_app_support +${apiVersion} v2 + +# Specific variables +${APP_NAME} appName +${APP_INSTANCE_ID} appInstanceId +${NOT_EXISTING_APP_INSTANCE_ID} notExistingAppInstanceId +${APPD_ID} appDId \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfo.json b/MEC011/SRV/REGAPPS/jsons/AppInfo.json new file mode 100644 index 0000000..31c9053 --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfo.json @@ -0,0 +1,3 @@ +{ + "appName": "sampleAppName" +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfo2.json b/MEC011/SRV/REGAPPS/jsons/AppInfo2.json new file mode 100644 index 0000000..88f988d --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfo2.json @@ -0,0 +1,4 @@ +{ + "appName": "sampleAppName", + "appInstanceId": "appInstanceId" +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfo3.json b/MEC011/SRV/REGAPPS/jsons/AppInfo3.json new file mode 100644 index 0000000..c6c461a --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfo3.json @@ -0,0 +1,5 @@ +{ + "appName": "sampleAppName", + "appInstanceId": "appInstanceId", + "appDId": "appDId" +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR1.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR1.json new file mode 100644 index 0000000..6e6098c --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR1.json @@ -0,0 +1,4 @@ +{ + "appName": "appNameWithoutAppDId", + "appInstanceId": "appInstanceIdWithoutAppDId" +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR2.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR2.json new file mode 100644 index 0000000..ab43a52 --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR2.json @@ -0,0 +1,5 @@ +{ + "appName": "appNameWithoutAppDId", + "appInstanceId": "appInstanceIdWithoutAppDId", + "isInsByMec": false +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR3.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR3.json new file mode 100644 index 0000000..a0b0820 --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR3.json @@ -0,0 +1,9 @@ +{ + "appName": "appNameWithoutAppDId", + "appIappServiceRequirednstanceID": "appInstanceIdWithoutAppDId", + "appServiceRequired": [{ + "serName": "serviceName", + "version": "0.1" + }] + +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR4.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR4.json new file mode 100644 index 0000000..acefd4e --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR4.json @@ -0,0 +1,9 @@ +{ + "appName": "appNameWithoutAppDId", + "appIappServiceRequirednstanceID": "appInstanceIdWithoutAppDId", + "appServiceOptional": [{ + "serName": "notExpectedAppServiceOptional", + "version": "0.1" + }] + +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR5.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR5.json new file mode 100644 index 0000000..c93aa5d --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR5.json @@ -0,0 +1,8 @@ +{ + "appName": "appNameWithoutAppDId", + "appIappServiceRequirednstanceID": "appInstanceIdWithoutAppDId", + "appFeatureRequired": [{ + "featureName": "featureName", + "version": "0.1" + }] +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoBR6.json b/MEC011/SRV/REGAPPS/jsons/AppInfoBR6.json new file mode 100644 index 0000000..1213d05 --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoBR6.json @@ -0,0 +1,8 @@ +{ + "appName": "appNameWithoutAppDId", + "appIappServiceRequirednstanceID": "appInstanceIdWithoutAppDId", + "appFeatureOptional": [{ + "featureName": "appFeatureOptinalName", + "version": "0.1" + }] +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/jsons/AppInfoUpdate.json b/MEC011/SRV/REGAPPS/jsons/AppInfoUpdate.json new file mode 100644 index 0000000..31c9053 --- /dev/null +++ b/MEC011/SRV/REGAPPS/jsons/AppInfoUpdate.json @@ -0,0 +1,3 @@ +{ + "appName": "sampleAppName" +} \ No newline at end of file diff --git a/MEC011/SRV/REGAPPS/schemas/AppInfo.schema.json b/MEC011/SRV/REGAPPS/schemas/AppInfo.schema.json new file mode 100644 index 0000000..8dd41cb --- /dev/null +++ b/MEC011/SRV/REGAPPS/schemas/AppInfo.schema.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "appName": { + "type": "string" + }, + "appInstanceId": { + "type": "string" + }, + "appDId": { + "type": "string" + } + }, + "required": [ + "appName" + ] + } \ No newline at end of file -- GitLab