Commit d1c8bd65 authored by piscione's avatar piscione
Browse files

Draft version of MEC014 v3.1.1 TCs available

parent 4cc2bc35
Loading
Loading
Loading
Loading
+105 −68
Original line number Original line Diff line number Diff line
@@ -14,144 +14,181 @@ Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_v
TC_MEC_MEC014_SRV_UETAG_001_OK
TC_MEC_MEC014_SRV_UETAG_001_OK
    [Documentation]   Request UE Identity Tag information
    [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
    ...  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  ETSI GS MEC 014 3.1.1, clause 7.3.3.1,
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  		    ETSI GS MEC 014 3.1.1, clause 6.2.2
    Get UE Identity Tag information
    [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 Status Code Is    200
    Check HTTP Response Body Json Schema Is   ueIdentityTagInfo
    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
TC_MEC_MEC014_SRV_UETAG_001_BR
    [Documentation]   Request UE Identity Tag information using bad parameters
    [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
    ...  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 ETSI GS MEC 014 3.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    [Setup]  Create new App Instance  CreateAppInstanceRequest
    Get UE Identity Tag information using bad parameters
    Get UE Identity Tag information using bad parameters    ${APP_INSTANCE_ID}      ${UE_IDENTITY_TAG} 
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400
    Check ProblemDetails    400
    [TearDown]    Delete APP Instance  ${APP_INSTANCE_ID} 






TC_MEC_MEC014_SRV_UETAG_001_NF
TC_MEC_MEC014_SRV_UETAG_001_NF
    [Documentation]   Request UE Identity Tag information using non-existent application instance
    [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
    ...  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 ETSI GS MEC 014 V3.1.1, clause 7.3.3.1
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    [Setup]    Delete APP Instance  ${NON_EXISTENT_APP_INSTANCE_ID}
    Get UE Identity Tag information using non-existent application instance
    Get UE Identity Tag information    ${NON_EXISTENT_APP_INSTANCE_ID}      ${UE_IDENTITY_TAG}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
    Check ProblemDetails    404




TC_MEC_MEC014_SRV_UETAG_002_OK
TC_MEC_MEC014_SRV_UETAG_002_OK
    [Documentation]   Register an UE Identity Tag
    [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
    ...  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
    ...  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 Status Code Is    200
    Check HTTP Response Body Json Schema Is    UeIdentityTagInfo
    Check HTTP Response Body Json Schema Is    UeIdentityTagInfo
    Log    Checking Postcondition
    FOR    ${identityTag}    IN    @{response['body']['ueIdentityTags']}   
    Check User Identity Tag state    ${UE_IDENTITY_TAG}    REGISTERED
        ${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
TC_MEC_MEC014_SRV_UETAG_002_BR
    [Documentation]   Register an UE Identity Tag using invalid state
    [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
    ...  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 ETSI GS MEC 014 3.1.1, clause 7.3.3.2,
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...            ETSI GS MEC 014 3.1.1, clause 6.2.2
    Update an UE Identity Tag using invalid state    {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG}","state":"INVALID_STATE"}]}
    [Setup]  Create new App Instance  CreateAppInstanceRequest
    Update an UE Identity Tag     ${APP_INSTANCE_ID}   IdentityTagBR  
    Check HTTP Response Status Code Is    400
    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
TC_MEC_MEC014_SRV_UETAG_002_PF
    [Documentation]   Unregister an UE Identity Tag already in unregistered state
    [Documentation]   Unregister an UE Identity Tag already in unregistered state
    ...  Check that the IUT responds with ProblemDetails on information an invalid URI
    ...  Check that the IUT responds with an error when
    ...  Reference ETSI GS MEC 014 V1.1.1, clause 7.3.3.2
    ...  a request sent by a MEC Application doesn't comply with a required condition
    ...  Reference https://forge.etsi.org/gitlab/mec/gs014-ue-identity-api/blob/master/UEidentityAPI.yaml#/definitions/UeIdentityTagInfo
    ...  Reference ETSI GS MEC 014 V3.1.1, clause 7.3.3.2
    Update an UE Identity Tag using a not applicable valid state    {"ueIdentityTags":[{"ueIdentityTag":"${UE_IDENTITY_TAG_INVALID_STATE}","state":"UNREGISTERED"}]}
    [Setup]  Create new App Instance  CreateAppInstanceRequest
    Update an UE Identity Tag     ${APP_INSTANCE_ID}   IdentityTagPF  
    Check HTTP Response Status Code Is    412
    Check HTTP Response Status Code Is    412
    Check ProblemDetails    412
    [TearDown]    Delete APP Instance  ${APP_INSTANCE_ID} 





*** Keywords ***
*** Keywords ***
Get UE Identity Tag information
Create new App Instance
    Should Be True    ${PIC_MEC_PLAT} == 1
    [Arguments]    ${content}
    Should Be True    ${PIC_SERVICES} == 1
    Log    Creating a new app package
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    Get    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${UE_IDENTITY_TAG}
    ${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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}

    Set Suite Variable    ${APP_INSTANCE_ID}    ${response['body']['id']} 


Get UE Identity Tag information using bad parameters

# FIXME Which IE protocol should be invalid?
Create new App Instance and Check User Identity Tag unregistered state 
    Should Be True    ${PIC_MEC_PLAT} == 1
   [Arguments]    ${content}    ${app_instance_id}      ${ue_identity_tag}  
    Should Be True    ${PIC_SERVICES} == 1
    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    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    DELETE    http://${APP_INST_HOST}:${APP_INST_PORT}/${apiRoot_APP_INST}/${apiName_APP_INST}/${apiVersion_APP_INST}/app_instances${app_instance_id}
    Get    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTagERROR=${UE_IDENTITY_TAG}
    ${output}=    Output    response
    ${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_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    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
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}




Update an UE Identity Tag
Get UE Identity Tag information using bad parameters
    [Arguments]    ${content}
    [Arguments]    ${app_instance_id}    ${ue_identity_tag}
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ## As far as I understood, we are not checking preconditions.
    Set Headers    {"Content-Length":"0"}
    # Preamble: Check that the user tag is not registered
    Get    /${apiName}/${apiVersion}/${app_instance_id}/ue_identity_tag_info?ueIdentityTagERROR=${ue_identity_tag}
    ## Check User Identity Tag state    ${UE_IDENTITY_TAG}    UNREGISTERED
    log    ${content}
    Put    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info    ${content}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    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
Update an UE Identity Tag
    [Arguments]    ${content}
    [Arguments]    ${app_instance_id}     ${content}
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}    
    Set Headers    {"Authorization":"${TOKEN}"}    
    # Test Body: Register the tag user and check that the IUT has registered the tag user
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    Put    /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info    ${content}
    ${body}=    Get File    ${file}
    Put    /${apiName}/${apiVersion}/${app_instance_id}/ue_identity_tag_info    ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}


    # TODO Check ProblemDetails
+16 −5
Original line number Original line Diff line number Diff line
@@ -2,12 +2,23 @@
${MEC-APP_SCHEMA}                   http
${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}                     127.0.0.1
${MEC-APP_HOST}                     192.168.56.1
${MEC-APP_HOST}                     127.0.0.1
${MEC-APP_PORT}                     8081
${MEC-APP_PORT}                     8085
${apiRoot}
${apiName}                          ui
${apiVersion}                       v1

${ZONE_ID}                          zone01
${ZONE_ID}                          zone01
${APP_INSTANCE_ID}                  appInst01
${APP_INSTANCE_ID}
${NON_EXISTENT_APP_INSTANCE_ID}     appInst99
${NON_EXISTENT_APP_INSTANCE_ID}     NON_EXISTENT_APP_INSTANCE_ID
${UE_IDENTITY_TAG}                  UeTagA
${UE_IDENTITY_TAG}                  UeIdentityTag
${UE_IDENTITY_TAG_INVALID_STATE}    UeTagC
${UE_IDENTITY_TAG_INVALID_STATE}    UeTagC
${response}                         {}
${response}                         {}
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
${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
+5 −0
Original line number Original line Diff line number Diff line
{
  "appDId": "e0deee2b-6e50-4f33-ab09-8bf0585025d3",
  "appInstanceDescription": "description",
  "appInstanceName": "name"
}
 No newline at end of file
+8 −0
Original line number Original line Diff line number Diff line
{
    "ueIdentityTags": [
        {
            "ueIdentityTag": "UeIdentityTag",
            "state": "REGISTERED"
        }
    ]
}
 No newline at end of file
+8 −0
Original line number Original line Diff line number Diff line
{
    "ueIdentityTags": [
        {
            "ueIdentityTag": "UeIdentityTag",
            "state": "INVALID_STATE"
        }
    ]
}
 No newline at end of file
Loading