Commit 710a4b2a authored by Miguel Angel Reina Ortega's avatar Miguel Angel Reina Ortega
Browse files

Merge branch 'v2.2.1-dev' into 'master'

V2.2.1 dev

Closes #35, #37, #34, #36, #33, #39, #30, #32, and #28

See merge request !2
parents 5d7b0b75 980cf761
Loading
Loading
Loading
Loading
Loading
+18 −1
Original line number Original line Diff line number Diff line
@@ -9,7 +9,24 @@ cd "$(dirname "$0")"


run_dir="$(pwd)"
run_dir="$(pwd)"


echo "Using git branch $GIT_BRANCH"

./scripts/build-container.sh
./scripts/build-container.sh
./scripts/run-container.sh "${run_dir}"
./scripts/run-container.sh "${run_dir}"


exit $?
if [[ "$GIT_BRANCH" =~ .*fix-plu$ ]]; then

	apiTestsVersion=$(echo $GIT_BRANCH | cut -d'/' -f 2)
	apiTestsVersion=$(echo $apiTestsVersion | cut -d'-' -f 1)
	echo apiTestsVersion
	
	curl -X POST \
     -F token=${ROBOT_HIVE_TAP_TT_TOKEN} \
     -F ref=master \
     -F "variables[API_TESTS_VERSION]=$apiTestsVersion" \
     -F "variables[TEST_SUITE]=MEC" \
     https://forge.etsi.org/rep/api/v4/projects/484/trigger/pipeline
fi
ret=$?
echo "Final validation result: $ret"
exit $ret
+2 −1
Original line number Original line Diff line number Diff line
@@ -25,7 +25,8 @@ Should Be Present In Json List
    [Arguments]     ${expr}   ${json_field}   ${json_value}
    [Arguments]     ${expr}   ${json_field}   ${json_value}
    Log    Check if ${json_field} is present in ${expr} with the value ${json_value}
    Log    Check if ${json_field} is present in ${expr} with the value ${json_value}
    :FOR  ${item}  IN  @{expr}
    :FOR  ${item}  IN  @{expr}
    \  Exit For Loop If    ${item[${json_field}]} == ${json_value}
    \  ${are_equal}=    Should Be Equal As Strings    ${item["${json_field}"]}    ${json_value}
    \  Exit For Loop If    ${are_equal}
    Log    Item found ${item}
    Log    Item found ${item}
    [return]    ${item}
    [return]    ${item}
    
    
+131 −0
Original line number Original line Diff line number Diff line
''[Documentation]   robot --outputdir ./outputs ./SRV/UETAG/PlatUeIdentity.robot
''[Documentation]   robot --outputdir ./outputs ./Grant.robot
...    Test Suite to validate UE Identity Tag (UETAG) operations.
...    Test Suite to validate Grant operations.


*** Settings ***
*** Settings ***
Resource    environment/variables.txt
Resource    environment/variables.txt
Resource    ../../GenericKeywords.robot
Resource    ../../../GenericKeywords.robot
Library     REST    ${MEO_SCHEMA}://${MEO_HOST}:${MEO_PORT}    ssl_verify=false
Library     REST    ${MEO_SCHEMA}://${MEO_HOST}:${MEO_PORT}    ssl_verify=false
Library     OperatingSystem
Library     OperatingSystem






*** Test Cases ***
*** Test Cases ***
Request a new Grant - Synchronous mode
TC_MEC_MEC010p2_MEO_GRANT_001_OK
    [Documentation]   TP_MEC_MEO_GRANT_001_OK
    [Documentation]   TP_MEC_MEC010p2_MEO_GRANT_001_OK
    ...  Check that MEO sends a synchronous grant response when a grant request is requested
    ...  Check that MEO sends a synchronous grant response when a grant request is requested
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1
    ...  ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.2.2-1 (GrantRequest)
    ...  ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1 (GrantRequest)
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    ...  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
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRequest
    Create a GRANT request    grantRequest
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is   Grant
    Check HTTP Response Body Json Schema Is   Grant



TC_MEC_MEC010p2_MEO_GRANT_001_BR

    [Documentation]   TP_MEC_MEC010p2_MEO_GRANT_001_BR
Request a new Grant - Malformed request
    [Documentation]   TP_MEC_MEO_GRANT_001_BR
    ...  Check that MEO responds with an error when it receives a malformed request when a new grant request is performed
    ...  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.0.10, clause 7.6.1.3.2
    ...  ETSI GS MEC 010-2 2.2.1, clause 7.6.1.3.2
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    ...  ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1 (Grant)
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRejectedRequest
    Create a GRANT request    grantBadRequest
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400



TC_MEC_MEC010p2_MEO_GRANT_002_OK

    [Documentation]  TP_MEC_MEC010p2_MEO_GRANT_002_OK  
Request a new Grant - Asynchronous mode
    ...  Check that MEO sends a synchronous grant response when a grant request is requested
    [Documentation]   TP_MEC_MEO_GRANT_002_OK
    ...  ETSI GS MEC 010-2 2.2.1, clause 7.5.1.3.1
    ...  Check that MEO sends a asynchronous grant response when a grant request is requested
    ...  ETSI GS MEC 010-2 2.2.1, Table 6.2.4.2.2-1        //GrantRequest
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.1
    ...  ETSI GS MEC 010-2 2.2.1, Table 6.2.4.4.2-1
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1 (Grant)
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Create a GRANT request    grantRequest
    Create a GRANT request    grantRequest2
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    201
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body is Empty
    Check HTTP Response Body Json Schema Is   Grant
    
    


Request an individual grant - Ongoing process

    [Documentation]    TP_MEC_MEO_GRANT_003_OK
TC_MEC_MEC010p2_MEO_GRANT_003_OK
    ...  Check that MEO sends the status of a grant request when a query on a granting ID is performed.
    [Documentation]   TP_MEC_MEC010p2_MEO_GRANT_003_OK
    ...  The process of creating the grant is ongoing, no grant is available yet 
    ...  Check that MEO sends an asynchronous grant response when a grant request is requested
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    ...  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
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Get an individual grant    ${grantId}
    Create a GRANT request    grantRequestAsynchronous
    Check HTTP Response Status Code Is    202
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body is Empty






Request an individual grant using non existant grant identifier
TC_MEC_MEC010p2_MEO_GRANT_004_OK
    [Documentation]    TP_MEC_MEO_GRANT_003_NF
    [Documentation]  TP_MEC_MEC010p2_MEO_GRANT_004_OK 
    ...    Check that MEO responds with an error when it receives a request for returning a grant referred with a wrong ID
    ...  Check that MEO sends an asynchronous grant response when a grant request is requested
    ...    ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    ...  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
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Get an individual grant    ${non_existant_grant_id}
    Create a GRANT request    grantRequestAsynchronous2
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    202
    Check HTTP Response Header Contains    Location
    
    


TC_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
    
    
Request an individual grant - Successful 
TC_MEC_MEC010p2_MEO_GRANT_006_OK
    [Documentation]    TP_MEC_MEO_GRANT_004_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 
    ...  Check that MEO sends the status of a grant request when a query on a granting ID is performed.
    ...  ETSI GS MEC 010-2 2.0.10, clause 7.6.1.3.2
    ...  The process of creating the grant is ongoing, no grant is available yet 
    ...  ETSI GS MEC 010-2 2.0.10, Table 6.2.4.4.2-1
    ...  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
    [Tags]    PIC_GRANTS_MANAGEMENT    INCLUDE_UNDEFINED_SCHEMAS
    Get an individual grant    ${grantId}
    Get an individual grant    ${GRANT_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Header Contains    Location
    Check HTTP Response Body Json Schema Is   Grant
    Check HTTP Response Body Json Schema Is   Grant
    
    
TC_MEC_MEC010p2_MEO_GRANT_006_NF
    [Documentation]    TP_MEC_MEC010p2_MEO_GRANT_006_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.1.1, clause 7.5.2.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 ***
*** Keywords ***
@@ -99,7 +121,7 @@ Create a GRANT request
Get an individual grant
Get an individual grant
    [Arguments]    ${grantId}
    [Arguments]    ${grantId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}    allow_redirects=false
    Get    ${apiRoot}/${apiName}/${apiVersion}/grants/${grantId}    allow_redirects=false
    ${output}=    Output    response
    ${output}=    Output    response
+0 −0

File moved.

+6 −3
Original line number Original line Diff line number Diff line
*** Variables ***
*** Variables ***
# Generic variables
# Generic variables
${MEO_SCHEMA}                   http
${MEO_SCHEMA}                   http
${MEO_HOST}                     10.192.2.172
#${MEO_HOST}                     10.192.2.172
${MEO_HOST}                     127.0.0.1
${MEO_PORT}                     8081
${MEO_PORT}                     8081
${response}                         {}
${response}                         {}
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
@@ -10,8 +11,10 @@ ${apiName} granting
${apiVersion}     v1
${apiVersion}     v1


# Specific variables
# Specific variables
${grantId}                        e0deee2b-6e50-4f33-ab09-8bf0585025d3
${GRANT_ID}                        e0deee2b-6e50-4f33-ab09-8bf0585025d3
${non_existant_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
# Notifications variables
Loading