Commit 332e9c56 authored by piscione's avatar piscione
Browse files

MEC040 early implementation of TCs. Some refinements needed

parent 2dd0cf99
Loading
Loading
Loading
Loading
+226 −2
Original line number Diff line number Diff line
@@ -181,8 +181,173 @@ TP_MEC_MEC040_SRV_MEF_001_OK_11
    Should Be True    '${counterSystemName}'>'0'
    Should Be True    '${counterSystemId}'>'0'
                                    
TP_MEC_MEC040_SRV_MEF_001_NF_01
    [Documentation]
    ...  Check that the IUT responds with an error 
    ...  when selection is not applicable - SystemId
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.1, clause 5.2.2.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve all system info resources with query params   ${NOT_EXT_SYSTEM_ID_QUERY_PARAM}
    Check HTTP Response Status Code Is    404

TP_MEC_MEC040_SRV_MEF_001_NF_02
    [Documentation]
    ...  Check that the IUT responds with an error
    ...  when selection is not applicable - SystemName
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.1, clause 5.2.2.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve all system info resources with query params   ${NOT_EXT_SYSTEM_NAME_QUERY_PARAM}
    Check HTTP Response Status Code Is    404


TP_MEC_MEC040_SRV_MEF_001_NF_03
    [Documentation]
    ...  Check that the IUT responds with an error
    ...  when selection is not applicable - SystemProvider
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.1, clause 5.2.2.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve all system info resources with query params   ${NOT_EXT_SYS_PROVIDER_QUERY_PARAM}
    Check HTTP Response Status Code Is    404

##TODO double check
TP_MEC_MEC040_SRV_MEF_001_BR
    [Documentation]
    ...  Check that the IUT responds with an error when request is malformed
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.1, clause 5.2.2.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
   Retrieve all system info resources wrong URL
   #Check HTTP Response Status Code Is    400
    
TP_MEC_MEC040_SRV_MEF_002_OK
    [Documentation]
    ...  Check that the IUT creates a new systemInfo when requested by a MEC Orchestrator
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.4, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Register System Info    SystemInfo
    Check HTTP Response Status Code Is    201
    Check HTTP Response Body Json Schema Is  SystemInfo   
    

TP_MEC_MEC040_SRV_MEF_002_BR_01
    [Documentation]
    ...  Check that the IUT responds with an error on creating an existing systemInfo
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.4, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Register System Info    SystemInfoBR
    Check HTTP Response Status Code Is    400


##TODO double check
TP_MEC_MEC040_SRV_MEF_002_BR_02
    [Documentation]
    ...  Check that the IUT responds with an error on providing inconsistent data
    ...  ETSI GS MEC 040 V3.1.1, clause 7.3.3.4, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Register System Info    SystemInfoBR
    Check HTTP Response Status Code Is    400    
    
TP_MEC_MEC040_SRV_MEF_003_OK
    [Documentation]
    ...  Check that the IUT responds with a selection of all available systemInfo 
    ...  when requested by a MEC Orchestrator
    ...  ETSI GS MEC 040 V3.1.1, clause 7.4.3.1, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve specific system info resource   ${EXPECTED_SYSTEM_ID} 
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is  SystemInfo
    
TP_MEC_MEC040_SRV_MEF_003_NF
    [Documentation]
    ...  Check that the IUT responds with an error
    ...  when it receives a request for returning a systemInfo  referred with a wrong systemId
    ...  ETSI GS MEC 040 V3.1.1, clause 7.4.3.1, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve specific system info resource    ${NOT_EXISTING_SYSTEM_ID} 
    Check HTTP Response Status Code Is    404

##TODO double check    
TP_MEC_MEC040_SRV_MEF_003_BR
    [Documentation]
    ...  Check that the IUT responds with an error
    ...  when it receives a request for returning a systemInfo  referred with a wrong systemId
    ...  ETSI GS MEC 040 V3.1.1, clause 7.4.3.1, clause 5.2.2.1.1
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Retrieve specific system info resource    ${NOT_EXISTING_SYSTEM_ID} 
    #Check HTTP Response Status Code Is    400
    
TP_MEC_MEC040_SRV_MEF_004_OK_01
    [Documentation]
    ...  Check that the IUT updates the systemInfo when requested by a MEC Orchestrator
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Update specific system info resource  ${EXPECTED_SYSTEM_ID}    SystemInfoUpdate
    Check HTTP Response Status Code Is    200
    Should Be Equal As Strings    ${response['body']['systemProvider']}        ${EXPECTED_NEW_SYSTEM_PROVIDER}

TP_MEC_MEC040_SRV_MEF_004_OK_02
    [Documentation]
    ...  Check that the IUT updates the systemInfo when requested by a MEC Orchestrator
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Update specific system info resource  ${EXPECTED_SYSTEM_ID}    SystemInfoUpdate2
    Check HTTP Response Status Code Is    200
    Should Be Equal As Strings    ${response['body']['systemName']}        ${EXPECTED_NEW_SYSTEM_NAME}
  
TP_MEC_MEC040_SRV_MEF_004_OK_02
    [Documentation]
    ...  Check that the IUT updates the systemInfo when requested by a MEC Orchestrator
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Update specific system info resource  ${EXPECTED_SYSTEM_ID}    SystemInfoUpdate3
    Check HTTP Response Status Code Is    200
    Should Be Equal As Strings    ${response['body']['systemName']}        ${EXPECTED_NEW_SYSTEM_NAME}
    Should Be Equal As Strings    ${response['body']['systemProvider']}    ${EXPECTED_NEW_SYSTEM_PROVIDER}

TP_MEC_MEC040_SRV_MEF_004_NF
    [Documentation]
    ...  Check that the IUT responds with an error when requested to update an unknown systemInfo
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Update specific system info resource  ${NOT_EXISTING_SYSTEM_ID}    SystemInfoUpdate3
    Check HTTP Response Status Code Is    404

##TODO double check the corresponding TP
#TP_MEC_MEC040_SRV_MEF_004_BR_01
    #[Documentation]
    #...  Check that the IUT responds with an error when requested to update with an inconsistant URI
    #...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    #...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    #Update specific system info resource  ${NOT_EXISTING_SYSTEM_ID}    SystemInfoUpdate3
    #Check HTTP Response Status Code Is    400

TP_MEC_MEC040_SRV_MEF_004_BR_02
    [Documentation]
    ...  Check that the IUT responds with an error when requested to update with no data provided
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.3, clause 5.2.2.1.2
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Update specific system info resource  ${EXPECTED_SYSTEM_ID}    SystemInfoUpdateBR
    Check HTTP Response Status Code Is    400            
    
TP_MEC_MEC040_SRV_MEF_005_OK
    [Documentation]
    ...  Check that the IUT responds with an error when requested to delete an unknown systemInfo
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.5, clause 5.2.2.1.3
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Remove specific system info resource  ${EXPECTED_SYSTEM_ID}  
    Check HTTP Response Status Code Is    204  
    
TP_MEC_MEC040_SRV_MEF_005_NF
    [Documentation]
    ...  Check that the IUT responds with an error when requested to delete an unknown systemInfo
    ...  ETSI GS MEC 040 V3.1.1, clause clause 7.4.3.5, clause 5.2.2.1.3
    ...  https://www.etsi.org/deliver/etsi_gs/mec/001_099/040/03.01.01_60/gs_mec040v030101p.pdf
    Remove specific system info resource  ${NOT_EXISTING_SYSTEM_ID}  
    Check HTTP Response Status Code Is    404
############################################################################


   
      
*** Keywords ***
Retrieve all system info resources
    Should Be True    ${PIC_MEC_PLAT} == 1
@@ -194,7 +359,6 @@ Retrieve all system info resources
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    

Retrieve all system info resources with query params
    [Arguments]     ${query_params}
    Should Be True    ${PIC_MEC_PLAT} == 1
@@ -205,3 +369,63 @@ Retrieve all system info resources with query params
    GET   ${apiRoot}/${apiName}/${apiVersion}/fed_resources/system_info?${query_params}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}

 Retrieve specific system info resource
    [Arguments]     ${SYSTEM_INFO_ID}
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    GET   ${apiRoot}/${apiName}/${apiVersion}/fed_resources/system_info/${SYSTEM_INFO_ID}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
        
Register System Info
    [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}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    POST   ${apiRoot}/${apiName}/${apiVersion}/fed_resources/system_info   ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}  


Update specific system info resource
    [Arguments]     ${systemId}     ${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}"}
    ${file}=    Catenate    SEPARATOR=    jsons/    ${content}    .json
    ${body}=    Get File    ${file}
    PATCH  ${apiRoot}/${apiName}/${apiVersion}/fed_resources/system_info/${systemId}   ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
Remove specific system info resource 
    [Arguments]     ${systemId} 
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"application/json"}
    DELETE  ${apiRoot}/${apiName}/${apiVersion}/fed_resources/system_info/${systemId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output} 
    
        
Retrieve all system info resources wrong URL
    Should Be True    ${PIC_MEC_PLAT} == 1
    Should Be True    ${PIC_SERVICES} == 1
    Set Headers    {"Accept":"application/json"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    GET   ${apiRoot}/${apiName}/v10/fed_resources/system_info
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
 No newline at end of file
+8 −2
Original line number Diff line number Diff line
@@ -10,24 +10,30 @@ ${apiName} fed-enablement
${apiVersion}                           v1

${EXPECTED_SYSTEM_ID}                   SYSTEM_ID
${NOT_EXISTING_SYSTEM_ID}               NOT_EXISTING_SYS_ID
${EXPECTED_SYSTEM_ID2}                  SYSTEM_ID2
${SYSTEM_ID_QUERY_PARAM}                systemId=${EXPECTED_SYSTEM_ID} 
${NOT_EXT_SYSTEM_ID_QUERY_PARAM}        systemId=${NOT_EXISTING_SYSTEM_ID} 
${MULTIPLE_SYSTEM_ID_QUERY_PARAM}       systemId=${EXPECTED_SYSTEM_ID},${EXPECTED_SYSTEM_ID2}
${EMPTY_SYSTEM_ID_QUERY_PARAM}          systemId=

${EXPECTED_SYSTEM_NAME}                 SYSTEM_NAME
${EXPECTED_SYSTEM_NAME2}                SYSTEM_NAME2
${NOT_EXISTING_SYS_NAME}                NOT_EXISTING_SYS_NAME
${SYSTEM_NAME_QUERY_PARAM}              systemName=${EXPECTED_SYSTEM_NAME}
${NOT_EXT_SYSTEM_NAME_QUERY_PARAM}      systemName=${NOT_EXISTING_SYS_NAME}
${MUTIPLE_SYSTEM_NAME_QUERY_PARAM}      systemName=${EXPECTED_SYSTEM_NAME},${EXPECTED_SYSTEM_NAME2}    
${EMPTY_SYSTEM_NAME_QUERY_PARAM}        systemName=

${EXPECTED_SYSTEM_PROVIDER}             SYSTEM_PROVIDER
${EXPECTED_SYSTEM_PROVIDER2}            SYSTEM_PROVIDER2
${NOT_EXT_SYS_PROVIDER}                 NOT_EXISTING_SYS_PROVIDER
${SYSTEM_PROVIDER_QUERY_PARAM}          systemProvider=${EXPECTED_SYSTEM_PROVIDER}
${NOT_EXT_SYS_PROVIDER_QUERY_PARAM}     systemProvider=${NOT_EXT_SYS_PROVIDER}
${MUTIPLE_SYS_PROVIDER_QUERY_PAR}       systemProvider=${EXPECTED_SYSTEM_PROVIDER},${EXPECTED_SYSTEM_PROVIDER2}    
${EMPTY_SYSTEM_PROVIDER_QUERY_PARAM}        systemProvider=


${FILTER_ON_SYSTEM_ID_AND_NAME}       systemId=${EXPECTED_SYSTEM_ID},systemName=${EXPECTED_SYSTEM_NAME}

${EXPECTED_NEW_SYSTEM_PROVIDER}       SYSTEM_NEW_ENDPOINT_1
${EXPECTED_NEW_SYSTEM_NAME}           SYSTEM_NEW_NAME_1
+0 −1
Original line number Diff line number Diff line
{
  "systemId": "systemId",
  "systemName": "systemNamea",
  "systemProvider": "systemProvider"
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
{
  "systemId":"SYSTEM_ID",
  "systemName": "systemNamea",
  "systemProvider": "systemProvider"
}
 No newline at end of file
+3 −0
Original line number Diff line number Diff line
{
  "endpoint": "SYSTEM_NEW_ENDPOINT_1"
}
 No newline at end of file
Loading