Commit e681c0a7 authored by Elian Kraja's avatar Elian Kraja
Browse files

Minor fixies on variables

parent ebc7ed76
Loading
Loading
Loading
Loading
Loading
+0 −110
Original line number Original line Diff line number Diff line
*** Settings ***
*** Settings ***
Library    JSONSchemaLibrary    schemas/
Library    JSONSchemaLibrary    schemas/
Library    BuiltIn
Library    BuiltIn
Library    REST    ${AMS_SCHEMA}://${AMS_HOST}:${AMS_PORT}    ssl_verify=false
Library    OperatingSystem
Library    OperatingSystem


*** Variables ***
*** Variables ***
@@ -54,113 +53,4 @@ Check HTTP Response Contain Header with value
    Check HTTP Response Header Contains    ${HEADER_TOCHECK}
    Check HTTP Response Header Contains    ${HEADER_TOCHECK}
    Should Be Equal As Strings    ${value}    ${response['headers']['Content-Type']}    
    Should Be Equal As Strings    ${value}    ${response['headers']['Content-Type']}    


vGET
    [Arguments]    ${uri}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    GET    ${uri}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vPOST
    [Arguments]    ${uri}    ${content}

    ${file}=    Catenate    SEPARATOR=    json/    ${content}    .json
    ${body}=    Get File    ${file}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    POST    ${uri}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vPUT
    [Arguments]    ${uri}    ${content}

    ${file}=    Catenate    SEPARATOR=    json/    ${content}    .json
    ${body}=    Get File    ${file}

    # Retrieve the e-tag value to ensure a proper update.
    vGET    ${uri}
    Set Headers    {"If-Match":"${response['headers']['If-Match']}"}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    PUT    ${uri}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vPUT without e-tag
    [Arguments]    ${uri}    ${content}

    ${file}=    Catenate    SEPARATOR=    json/    ${content}    .json
    ${body}=    Get File    ${file}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    PUT    ${uri}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vPUT invalid e-tag
    [Arguments]    ${uri}    ${content}

    ${file}=    Catenate    SEPARATOR=    json/    ${content}    .json
    ${body}=    Get File    ${file}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"If-Match":"__some_invalid_value__"}

    PUT    ${uri}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vDELETE
    [Arguments]    ${uri}

    # Retrieve the e-tag value to ensure a proper delete.
    vGET    ${uri}
    Set Headers    {"If-Match":"${response['headers']['If-Match']}"}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    DELETE    ${uri}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vDELETE without e-tag
    [Arguments]    ${uri}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}

    DELETE    ${uri}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

vDELETE invalid e-tag
    [Arguments]    ${uri}

    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"If-Match":"__some_invalid_value__"}

    DELETE    ${uri}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
+5 −4
Original line number Original line Diff line number Diff line
@@ -6,6 +6,7 @@ Resource environment/variables.txt
Resource    ../../pics.txt
Resource    ../../pics.txt
Resource    ../../GenericKeywords.robot
Resource    ../../GenericKeywords.robot
Resource    resources/UeAppsContextAPI.robot
Resource    resources/UeAppsContextAPI.robot
Library     String
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false
Library     REST    ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT}    ssl_verify=false




@@ -43,7 +44,7 @@ Update of the application context
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Create an application context
    Create an application context
    # Test Body
    # Test Body
    ${CREATE_APP_CTX['callbackReference']}=    ${CALLBACK_REFERENCE_1}
    ${CREATE_APP_CTX}=    Set Variable  ${CALLBACK_REFERENCE_1}
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
    Check HTTP Response Status Code Is    204
    Check HTTP Response Status Code Is    204
    Check HTTP Response Body Json Schema Is   AppContext
    Check HTTP Response Body Json Schema Is   AppContext
@@ -62,7 +63,7 @@ Update of the application context with wrong parameters
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Create an application context
    Create an application context
    # Test Body
    # Test Body
    ${CREATE_APP_CTX['callbackReference']}=    '' # Empty string
    ${CREATE_APP_CTX}=     Set Variable  '' # Empty string
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
    Update application context    ${APP_CTX_ID}    ${CREATE_APP_CTX}
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400
    Check ProblemDetails    400
    Check ProblemDetails    400
@@ -80,7 +81,7 @@ Update of the application context with unknown URI
    Should Be True    ${PIC_SERVICES} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Create an application context
    Create an application context
    # Test Body
    # Test Body
    ${CREATE_APP_CTX['callbackReference']}=    ${CALLBACK_REFERENCE_1}
    ${CREATE_APP_CTX}=    Set Variable    ${CALLBACK_REFERENCE_1}
    Update application context    ${NON_EXISTENT_APP_CTX_ID}    ${CREATE_APP_CTX}
    Update application context    ${NON_EXISTENT_APP_CTX_ID}    ${CREATE_APP_CTX}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
    Check ProblemDetails    404
    Check ProblemDetails    404
@@ -102,7 +103,7 @@ Delete of the application context
    Check HTTP Response Status Code Is    204
    Check HTTP Response Status Code Is    204




Delete of the application context
Delete of the application context with non esistent APP CTX ID
    [Documentation]   TC_MEC_MEO_UEAPPCTX_003_NF
    [Documentation]   TC_MEC_MEO_UEAPPCTX_003_NF
    ...  Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
    ...  Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.5.3.5
+1 −1
Original line number Original line Diff line number Diff line
@@ -46,7 +46,7 @@ Get the list of the application contexts with wrong parameter
    Delete an application context    ${APP_CTX_ID}
    Delete an application context    ${APP_CTX_ID}




Get the list of the application contexts with wrong parameter
Get the list of the application contexts with non esistent parameter
    [Documentation]   TC_MEC_MEO_UEAPPS_001_NF
    [Documentation]   TC_MEC_MEO_UEAPPS_001_NF
    ...  Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
    ...  Check that the IUT responds with an error when a request for an unknown URI is sent by a MEC Application
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.3.3.1
    ...  Reference ETSI GS MEC 016 V1.1.1, clause 7.3.3.1
+86 −41
Original line number Original line Diff line number Diff line
@@ -4,16 +4,16 @@ Documentation
...    A test suite for validating Application Service Availability Query (APPSAQ) operations.
...    A test suite for validating Application Service Availability Query (APPSAQ) operations.


Resource    ../../GenericKeywords.robot
Resource    ../../GenericKeywords.robot
Resource    environment/variables.txt
Library     REST    ${SCHEMA}://${HOST}:${PORT}    ssl_verify=false


Default Tags    TP_MEC_SRV_APPSAQ
Default Tags    TC_MEC_SRV_APPSAQ




*** Variables ***



*** Test Cases ***
*** Test Cases ***


TP_MEC_SRV_APPSAQ_001_OK
TC_MEC_SRV_APPSAQ_001_OK
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with a list of available MEC services
    ...    Check that the IUT responds with a list of available MEC services
    ...    for a given application instance when queried by a MEC Application
    ...    for a given application instance when queried by a MEC Application
@@ -23,12 +23,12 @@ TP_MEC_SRV_APPSAQ_001_OK


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES


    vGET    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services
    Get a list of mecService of an application instance    ${APP_INSTANCE_ID} 
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ServiceInfoList
    Check HTTP Response Body Json Schema Is    ServiceInfoList




TP_MEC_SRV_APPSAQ_001_BR
TC_MEC_SRV_APPSAQ_001_BR
    [Documentation]
    [Documentation]
    ...   Check that the IUT responds with an error when
    ...   Check that the IUT responds with an error when
    ...    a request with incorrect parameters is sent by a MEC Application
    ...    a request with incorrect parameters is sent by a MEC Application
@@ -38,11 +38,11 @@ TP_MEC_SRV_APPSAQ_001_BR
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES


    # Wrong query parameter name should trigger an error response.
    # Wrong query parameter name should trigger an error response.
    vGET    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services?id=some_instance_id
    Get a list of mecService of an application instance with parameters    ${APP_INSTANCE_ID}    ${INSTANCE_ID}    ${FAKE_INSTANCE_ID_VALUE}
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400




TP_MEC_SRV_APPSAQ_002_OK
TC_MEC_SRV_APPSAQ_002_OK
    [Documentation]
    [Documentation]
    ...    Check that the IUT notifies the authorised relevant (subscribed) application
    ...    Check that the IUT notifies the authorised relevant (subscribed) application
    ...    instances when a new service for a given application instance is registered
    ...    instances when a new service for a given application instance is registered
@@ -51,16 +51,14 @@ TP_MEC_SRV_APPSAQ_002_OK
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Create new service    ServiceInfo    ${APP_INSTANCE_ID}
    vPOST    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services    ${MEC_APP_NEW_SVC_DATA}
    Check HTTP Response Status Code Is    201
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check HTTP Response Header Contains    Location
    Check HTTP Response Header Contains    Location
    Check Result Contains    ${response['body']['ServiceInfo']}    serName    ${SERVICE_NAME}
#    Check Result Contains    ${response['body']['ServiceInfo']}    serName    ${SERVICE_NAME}
    Check Plaform IUT notifies the MEC Application instances    ServiceAvailabilityNotification




TP_MEC_SRV_APPSAQ_002_BR
TC_MEC_SRV_APPSAQ_002_BR
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request with incorrect parameters is sent by a MEC Application
    ...    a request with incorrect parameters is sent by a MEC Application
@@ -69,12 +67,11 @@ TP_MEC_SRV_APPSAQ_002_BR
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Create new service    ServiceInfoError    ${APP_INSTANCE_ID}
    vPOST    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services    ${MEC_APP_NEW_SVC_DATA_BR}
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400




TP_MEC_SRV_APPSAQ_002_NF
TC_MEC_SRV_APPSAQ_002_NF
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...    a request for an unknown URI is sent by a MEC Application
@@ -83,12 +80,11 @@ TP_MEC_SRV_APPSAQ_002_NF
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Create new service    ServiceInfo    ${NON_EXISTENT_APP_INSTANCE_ID}
    vPOST    /${PX_MEC_SVC_MGMT_APPS_URI}/${NON_EXISTENT_APP_INSTANCE_ID}/services    ${MEC_APP_NEW_SVC_DATA}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404




TP_MEC_SRV_APPSAQ_003_OK
TC_MEC_SRV_APPSAQ_003_OK
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with the information on a specific service
    ...    Check that the IUT responds with the information on a specific service
    ...    for a given application instance when queried by a MEC Application
    ...    for a given application instance when queried by a MEC Application
@@ -97,14 +93,13 @@ TP_MEC_SRV_APPSAQ_003_OK
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Get individual service    ${APP_INSTANCE_ID}    ${SERVICE_ID}
    vGET    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${SERVICE_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check Result Contains    ${response['body']['ServiceInfo']}    serInstanceId    ${SERVICE_ID}
    Check Result Contains    ${response['body']['ServiceInfo']}    serInstanceId    ${SERVICE_ID}




TP_MEC_SRV_APPSAQ_003_NF
TC_MEC_SRV_APPSAQ_003_NF
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...    a request for an unknown URI is sent by a MEC Application
@@ -112,12 +107,11 @@ TP_MEC_SRV_APPSAQ_003_NF
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 8.2.7.3.1
    ...    Reference    ETSI GS MEC 011 V2.0.9, clause 8.2.7.3.1


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Get individual service    ${APP_INSTANCE_ID}    ${NON_EXISTENT_SERVICE_ID}
    vGET    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${NON_EXISTENT_SERVICE_ID}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404




TP_MEC_SRV_APPSAQ_004_OK
TC_MEC_SRV_APPSAQ_004_OK
    [Documentation]
    [Documentation]
    ...    Check that the IUT updates a service information for a given
    ...    Check that the IUT updates a service information for a given
    ...    application instance when commanded by a MEC Application
    ...    application instance when commanded by a MEC Application
@@ -126,14 +120,13 @@ TP_MEC_SRV_APPSAQ_004_OK
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Update service    ${APP_INSTANCE_ID}    ${SERVICE_ID}    ServiceInfoUpdated
    vPUT    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${SERVICE_ID}    ${MEC_APP_SVC_UPDT_DATA}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check HTTP Response Body Json Schema Is    ServiceInfo
    Check Result Contains    ${response['body']['ServiceInfo']}    version    ${SVC_NEW_VERSION}
    #Check Result Contains    ${response['body']['ServiceInfo']}    version    ${SVC_NEW_VERSION}




TP_MEC_SRV_APPSAQ_004_BR
TC_MEC_SRV_APPSAQ_004_BR
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request with incorrect parameters is sent by a MEC Application
    ...    a request with incorrect parameters is sent by a MEC Application
@@ -142,12 +135,11 @@ TP_MEC_SRV_APPSAQ_004_BR
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Update service    ${APP_INSTANCE_ID}    ${SERVICE_ID}    ServiceInfoUpdatedError
    vPUT    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${SERVICE_ID}    ${MEC_APP_SVC_UPDT_DATA_BR}
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400




TP_MEC_SRV_APPSAQ_004_NF
TC_MEC_SRV_APPSAQ_004_NF
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request for an unknown URI is sent by a MEC Application
    ...    a request for an unknown URI is sent by a MEC Application
@@ -156,12 +148,11 @@ TP_MEC_SRV_APPSAQ_004_NF
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Update service    ${APP_INSTANCE_ID}    ${NON_EXISTENT_SERVICE_ID}    ServiceInfoUpdated
    vPUT    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${NON_EXISTENT_SERVICE_ID}    ${MEC_APP_SVC_UPDT_DATA}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404




TP_MEC_SRV_APPSAQ_004_PF
TC_MEC_SRV_APPSAQ_004_PF
    [Documentation]
    [Documentation]
    ...    Check that the IUT responds with an error when
    ...    Check that the IUT responds with an error when
    ...    a request sent by a MEC Application doesn't comply with a required condition
    ...    a request sent by a MEC Application doesn't comply with a required condition
@@ -170,19 +161,73 @@ TP_MEC_SRV_APPSAQ_004_PF
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo
    ...    OpenAPI    https://forge.etsi.org/rep/mec/gs011-app-enablement-api/blob/v2.0.9/MecServiceMgmtApi.yaml#/definitions/ServiceInfo


    [Tags]    PIC_MEC_PLAT    PIC_SERVICES
    [Tags]    PIC_MEC_PLAT    PIC_SERVICES

    Update service with invalid etag     ${APP_INSTANCE_ID}    ${SERVICE_ID}    ServiceInfoUpdated
    vPUT invalid e-tag    /${PX_MEC_SVC_MGMT_APPS_URI}/${APP_INSTANCE_ID}/services/${SERVICE_ID}    ${MEC_APP_SVC_UPDT_DATA}
    Check HTTP Response Status Code Is    412
    Check HTTP Response Status Code Is    412






*** Keywords ***
*** Keywords ***

Get a list of mecService of an application instance with parameters
Check Plaform IUT notifies the MEC Application instances
    [Arguments]    ${appInstanceId}    ${key}=None    ${value}=None
    [Documentation]
    Set Headers    {"Accept":"application/json"}
    ...    
    Set Headers    {"Authorization":"${TOKEN}"}

    Get    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/services?${key}=${value}
    [Arguments]    ${instance_id}    ${content}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

Get a list of mecService of an application instance
    [Arguments]    ${appInstanceId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/services
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    

Create new service
    [Arguments]    ${content}    ${appInstanceId}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    Post    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/services    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}


Get individual service
    [Arguments]    ${appInstanceId}    ${serviceName} 
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/services/${serviceName}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}  
    
Update service    
    [Arguments]    ${appInstanceId}    ${serviceId}    ${content}
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    Set Headers    {"Authorization":"${TOKEN}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    Post    ${apiRoot}/${apiName}/${apiVersion}/applications/${appInstanceId}/services/${serviceId}    ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    


Update service with invalid etag
    [Arguments]    ${appInstanceId}    ${serviceId}    ${content}
    Set Headers    {"If-Match": ${INVALID_ETAG}}
    Update service    ${appInstanceId}    ${serviceId}    ${content}
    

# Check Plaform IUT notifies the MEC Application instances
    # [Documentation]
    # ...    

    # [Arguments]    ${instance_id}    ${content}


    # TODO check how to send the message (isn't defined). Does it need to be tested as it's not defined?
    # TODO check how to send the message (isn't defined). Does it need to be tested as it's not defined?
    
    
+34 −0
Original line number Original line Diff line number Diff line
*** Variables ***
# Generic variables
${SCHEMA}                   http
${HOST}                     10.192.2.172
${PORT}                     8081
${response}                         {}
${TOKEN}                            Basic YWxhZGRpbjpvcGVuc2VzYW1l
${apiRoot}        
${apiName}        mec_service_mgmt
${apiVersion}     v1

# Specific variables
${APP_INSTANCE_ID}                       5abe4782-2c70-4e47-9a4e-0ee3a1a0fd1f
${INSTANCE_ID}                      instance_id
${FAKE_INSTANCE_ID_VALUE}           5
${NON_EXISTENT_APP_INSTANCE_ID}     NON_ESISTENT_APP_INSTANCE_ID
${SERVICE_ID}                       e0deee2b-6e50-4f33-ab09-8bf0585025d3
${NON_EXISTENT_SERVICE_ID}          NON_EXISTENT_SERVICE_ID
${INVALID_ETAG}                     INVALID_ETAG

# ${SUBSCRIPTION_TYPE}                MobilityProcedureSubscription
# ${SUBSCRIPTION_ID}                  e0deee2b-6e50-4f33-ab09-8bf0585025d3
# ${NON_EXISTENT_SUBSCRIPTION_ID}     NON_EXISTENT_SUBSCRIPTION_ID
# ${NON_EXISTENT_APP_MOBILITY_SERVICE_ID}     NON_EXISTENT_APP_MOBILITY_SERVICE_ID

# # Notifications variables
# ${MOCK_SERVER_JAR}    ../../../bin/mockserver-netty-5.5.0-jar-with-dependencies.jar

# ${callback_port}    9091
# ${callback_uri}    http://172.22.1.7:${callback_port}
# ${callback_endpoint}    /amsi/subscriptions
# ${callback_endpoint_error}    /subs_404
# ${total_polling_time}   2 min
# ${polling_interval}     10 sec
 No newline at end of file
Loading