From ccedd079a040aa521618167155e7c6a13b4742c6 Mon Sep 17 00:00:00 2001 From: piscione Date: Mon, 31 Jan 2022 10:00:36 +0100 Subject: [PATCH] Implemented Grant TCs for MEC010p2. --- MEC010p2/MEO/GRANT/Grant.robot | 94 +++++++++++++------ MEC010p2/MEO/GRANT/environment/variables.txt | 4 +- ...ectedRequest.json => grantBadRequest.json} | 0 .../MEO/GRANT/jsons/grantBadRequest2.json | 6 ++ MEC010p2/MEO/GRANT/jsons/grantRequest2.json | 8 ++ .../GRANT/jsons/grantRequestAsynchronous.json | 22 +++++ .../jsons/grantRequestAsynchronous2.json | 22 +++++ 7 files changed, 126 insertions(+), 30 deletions(-) rename MEC010p2/MEO/GRANT/jsons/{grantRejectedRequest.json => grantBadRequest.json} (100%) create mode 100644 MEC010p2/MEO/GRANT/jsons/grantBadRequest2.json create mode 100644 MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous.json create mode 100644 MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous2.json diff --git a/MEC010p2/MEO/GRANT/Grant.robot b/MEC010p2/MEO/GRANT/Grant.robot index bb8075f..b83ccff 100644 --- a/MEC010p2/MEO/GRANT/Grant.robot +++ b/MEC010p2/MEO/GRANT/Grant.robot @@ -8,14 +8,13 @@ Library REST ${MEO_SCHEMA}://${MEO_HOST}:${MEO_PORT} ssl_verify=false Library OperatingSystem - - *** Test Cases *** TP_MEC_MEC010p2_MEO_GRANT_001_OK - [Documentation] + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_001_OK ... Check that MEO sends a synchronous grant response when a grant request is requested ... ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1 ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 (GrantRequest) + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 Note 2 (GrantRequest) ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS Create a GRANT request grantRequest @@ -23,43 +22,90 @@ TP_MEC_MEC010p2_MEO_GRANT_001_OK Check HTTP Response Header Contains Location Check HTTP Response Body Json Schema Is Grant - - - TP_MEC_MEC010p2_MEO_GRANT_001_BR - [Documentation] TP_MEC_MEO_GRANT_001_BR + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_001_BR ... Check that MEO responds with an error when it receives a malformed request when a new grant request is performed ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2 ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS - Create a GRANT request grantRejectedRequest + Create a GRANT request grantBadRequest Check HTTP Response Status Code Is 400 - - - TP_MEC_MEC010p2_MEO_GRANT_002_OK - [Documentation] TP_MEC_MEO_GRANT_002_OK - ... Check that MEO sends a asynchronous grant response when a grant request is requested - ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.1 - ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_002_OK + ... Check that MEO sends a synchronous grant response when a grant request is requested + ... ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1 + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 //GrantRequest + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS Create a GRANT request grantRequest2 Check HTTP Response Status Code Is 201 - Check HTTP Response Header Contains Location Check HTTP Response Body Json Schema Is Grant + +#TP_MEC_MEC010p2_MEO_GRANT_002_BR TODO clarify TPs before implementing this +# [Documentation] TP_MEC_MEC010p2_MEO_GRANT_002_BR +# ... Check that MEO responds with an error when it receives a malformed request when a new grant request is performed +# ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2 +# ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) +# [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS +# Create a GRANT request grantBadRequest2 +# Check HTTP Response Status Code Is 400 +TP_MEC_MEC010p2_MEO_GRANT_003_OK + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_003_OK + ... Check that MEO sends an asynchronous grant response when a grant request is requested + ... ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1 + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 (GrantRequest) + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 Note 2 (GrantRequest) + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Create a GRANT request grantRequestAsynchronous + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location +##TODO Fix numbering against success case +TP_MEC_MEC010p2_MEO_GRANT_003_NF + [Documentation] TP_MEC_MEO_GRANT_003_NF + ... Check that MEO responds with an error when it receives a request for returning a grant referred with a wrong ID + ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2 + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Get an individual grant ${NOT_EXISTING_GRANT_ID} + Check HTTP Response Status Code Is 404 + + +TP_MEC_MEC010p2_MEO_GRANT_004_OK + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_004_OK + ... Check that MEO sends an asynchronous grant response when a grant request is requested + ... ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1 + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 (GrantRequest) + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant) + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Create a GRANT request grantRequestAsynchronous2 + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + +TP_MEC_MEC010p2_MEO_GRANT_005_OK + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_005_OK + ... Check that MEO sends the status of a grant request when a query on a granting ID is performed. + ... The process of creating the grant is ongoing, no grant is available yet + ... ETSI GS MEC 010-2 2.2.1, clause 7.5.2.3.2 + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 + [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS + Get an individual grant ${GRANT_ID_ACCEPTED} + Check HTTP Response Status Code Is 202 + Check HTTP Response Header Contains Location + TP_MEC_MEC010p2_MEO_GRANT_006_OK - [Documentation] TP_MEC_MEO_GRANT_003_OK + [Documentation] TP_MEC_MEC010p2_MEO_GRANT_006_OK ... Check that MEO sends the status of a grant request when a query on a granting ID is performed. ... The process of creating the grant is ongoing, no grant is available yet - ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2 + ... ETSI GS MEC 010-2 2.2.1, clause 7.5.2.3.2 + ... ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS Get an individual grant ${GRANT_ID} Check HTTP Response Status Code Is 200 @@ -67,17 +113,7 @@ TP_MEC_MEC010p2_MEO_GRANT_006_OK Check HTTP Response Body Json Schema Is Grant - -TP_MEC_MEC010p2_MEO_GRANT_003_NF - [Documentation] TP_MEC_MEO_GRANT_003_NF - ... Check that MEO responds with an error when it receives a request for returning a grant referred with a wrong ID - ... ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2 - [Tags] PIC_GRANTS_MANAGEMENT INCLUDE_UNDEFINED_SCHEMAS - Get an individual grant ${NOT_EXISTING_GRANT_ID} - Check HTTP Response Status Code Is 404 - - - + *** Keywords *** Create a GRANT request diff --git a/MEC010p2/MEO/GRANT/environment/variables.txt b/MEC010p2/MEO/GRANT/environment/variables.txt index 750b765..603052e 100644 --- a/MEC010p2/MEO/GRANT/environment/variables.txt +++ b/MEC010p2/MEO/GRANT/environment/variables.txt @@ -12,7 +12,9 @@ ${apiVersion} v1 # Specific variables ${GRANT_ID} e0deee2b-6e50-4f33-ab09-8bf0585025d3 -${NOT_EXISTING_GRANT_ID} non_existant_grant_id +${GRANT_ID_ACCEPTED} abcdee2b-6e50-4f33-ab09-8bf05850abcd +${NOT_EXISTING_GRANT_ID} NOT_EXISTING_GRANT_ID +${APP_INSTANCE_ID} 456 # Notifications variables diff --git a/MEC010p2/MEO/GRANT/jsons/grantRejectedRequest.json b/MEC010p2/MEO/GRANT/jsons/grantBadRequest.json similarity index 100% rename from MEC010p2/MEO/GRANT/jsons/grantRejectedRequest.json rename to MEC010p2/MEO/GRANT/jsons/grantBadRequest.json diff --git a/MEC010p2/MEO/GRANT/jsons/grantBadRequest2.json b/MEC010p2/MEO/GRANT/jsons/grantBadRequest2.json new file mode 100644 index 0000000..36380ae --- /dev/null +++ b/MEC010p2/MEO/GRANT/jsons/grantBadRequest2.json @@ -0,0 +1,6 @@ +{ + "id": "123", + "appInstanceId": "456", + "appLcmOpOccId": "789", + "operationERROR":"INSTANTIATE" +} \ No newline at end of file diff --git a/MEC010p2/MEO/GRANT/jsons/grantRequest2.json b/MEC010p2/MEO/GRANT/jsons/grantRequest2.json index da29253..4a9a1d4 100644 --- a/MEC010p2/MEO/GRANT/jsons/grantRequest2.json +++ b/MEC010p2/MEO/GRANT/jsons/grantRequest2.json @@ -3,6 +3,14 @@ "appInstanceId": "456", "appLcmOpOccId": "789", "operation": "OPERATE", + "addResources": [ + { + "resourceDefinitionId": "resourceDefinitionId", + "vimConnectionId": "vimConnectionId", + "resourceGroupId": "resourceGroupId", + "zoneId": "zoneId" + } + ], "_links": { "appLcmOpOcc": { "href": "https://anexample.ex/" diff --git a/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous.json b/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous.json new file mode 100644 index 0000000..edc0c4c --- /dev/null +++ b/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous.json @@ -0,0 +1,22 @@ +{ + "id": "456", + "appInstanceId": "456", + "appLcmOpOccId": "789", + "operation": "INSTANTIATE", + "addResources": [ + { + "resourceDefinitionId": "resourceDefinitionId", + "vimConnectionId": "vimConnectionId", + "resourceGroupId": "resourceGroupId", + "zoneId": "zoneId" + } + ], + "_links": { + "appLcmOpOcc": { + "href": "https://anexample.ex/" + }, + "appInstance": { + "href": "https://anexample.ex/" + } + } +} \ No newline at end of file diff --git a/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous2.json b/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous2.json new file mode 100644 index 0000000..b72c923 --- /dev/null +++ b/MEC010p2/MEO/GRANT/jsons/grantRequestAsynchronous2.json @@ -0,0 +1,22 @@ +{ + "id": "456", + "appInstanceId": "456", + "appLcmOpOccId": "789", + "operation": "OPERATE", + "addResources": [ + { + "resourceDefinitionId": "resourceDefinitionId", + "vimConnectionId": "vimConnectionId", + "resourceGroupId": "resourceGroupId", + "zoneId": "zoneId" + } + ], + "_links": { + "appLcmOpOcc": { + "href": "https://anexample.ex/" + }, + "appInstance": { + "href": "https://anexample.ex/" + } + } +} \ No newline at end of file -- GitLab