Commit 15e1d8b6 authored by piscione's avatar piscione
Browse files

Update Robot tests of MEC015.

parent 523d9d5f
Loading
Loading
Loading
Loading
Loading
+172 −41
Original line number Original line Diff line number Diff line
@@ -21,11 +21,10 @@ TP_MEC_MEC015_SRV_MTS_001_OK
    Check HTTP Response Body Json Schema Is   MtsCapabilityInfo
    Check HTTP Response Body Json Schema Is   MtsCapabilityInfo
    
    



##GET on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions
##GET on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions
TP_MEC_MEC015_SRV_MTS_002_OK
TP_MEC_MEC015_SRV_MTS_002_OK
    [Documentation]
    [Documentation]
    ...  Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve MTS session list information
    Retrieve MTS session list information
@@ -37,35 +36,17 @@ TP_MEC_MEC015_SRV_MTS_002_OK
    END
    END
    Should Be True    ${passed}
    Should Be True    ${passed}



TP_MEC_MEC015_SRV_MTS_002_BR
TP_MEC_MEC015_SRV_MTS_003_OK
    [Documentation]
    ...  Check that the IUT responds with a configured Multi-access Traffic Steering when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve MTS session list information using filter  ${CORRECT_FILTER}   ${APP_INSTANCE_ID}   
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    FOR    ${mstSessionInfo}    IN    @{response['body']}
        ${passed}    Run Keyword And Return Status    Should Be Equal As Strings  ${mstSessionInfo['appInsId']}    ${APP_INSTANCE_ID}    
        Exit For Loop If    ${passed}
    END
    Should Be True    ${passed}
    


TP_MEC_MEC015_SRV_MTS_003_BR
    [Documentation]
    [Documentation]
    ...  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 the list of configured Multi-access Traffic Steering when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve MTS session list information using filter  ${BAD_FILTER}   ${APP_INSTANCE_ID}   
    Retrieve MTS session list information using filter  ${BAD_FILTER}   ${APP_INSTANCE_ID}   
    Check HTTP Response Status Code Is    400
    Check HTTP Response Status Code Is    400



TP_MEC_MEC015_SRV_MTS_002_NF
TP_MEC_MEC015_SRV_MTS_003_NF
    [Documentation]
    [Documentation]
    ...  Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application
    ...  Check that the IUT responds with the list of configured Multi-access Traffic Steering when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve MTS session list information using filter  ${CORRECT_FILTER}   ${NOT_EXISTING_APP_INSTANCE_ID}   
    Retrieve MTS session list information using filter  ${CORRECT_FILTER}   ${NOT_EXISTING_APP_INSTANCE_ID}   
@@ -73,32 +54,150 @@ TP_MEC_MEC015_SRV_MTS_003_NF


    
    
##POST on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions
##POST on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions
TP_MEC_MEC015_SRV_MTS_004_OK_01
TP_MEC_MEC015_SRV_MTS_003_OK_01
    [Documentation]
    [Documentation]
    ...  Check that the IUT responds with a registration and initialisation approval for the requested MTS session requirements sent by a MEC Application
    ...  Check that the IUT creates a MTS session when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Register MTS session   MtsSessionInfoApplicationSpecific.json
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoApplicationSpecific.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Register MTS session    ${body}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${APP_INSTANCE_ID}
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${json_object['appInsId']}
    Should Be Equal As Strings  ${response['body']['requestType']}    ${json_object['requestType']}
    Should Be Equal As Strings  ${response['body']['qosD']}    ${json_object['qosD']}
    Should Be Equal As Strings  ${response['body']['mtsMode']}    ${json_object['mtsMode']}
    Should Be Equal As Strings  ${response['body']['trafficDirection']}    ${json_object['trafficDirection']}



TP_MEC_MEC015_SRV_MTS_004_OK_02
TP_MEC_MEC015_SRV_MTS_003_OK_02
    [Documentation]
    [Documentation]
    ...  Check that the IUT responds with a registration and initialisation approval for the requested MTS session requirements sent by a MEC Application
    ...  Check that the IUT creates a MTS session when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Register MTS session   MtsSessionInfoSessionSpecific.json
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoSessionSpecific.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Register MTS session   ${body}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${json_object['appInsId']}
    Should Be Equal As Strings  ${response['body']['requestType']}    ${json_object['requestType']}
    Should Be Equal As Strings  ${response['body']['flowFilter']}    ${json_object['flowFilter']}
    Should Be Equal As Strings  ${response['body']['qosD']}    ${json_object['qosD']}
    Should Be Equal As Strings  ${response['body']['mtsMode']}    ${json_object['mtsMode']}
    Should Be Equal As Strings  ${response['body']['trafficDirection']}    ${json_object['trafficDirection']}
    

TP_MEC_MEC015_SRV_MTS_003_BR
    [Documentation]
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoApplicationSpecific_BR.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Register MTS session   ${body}
    Check HTTP Response Status Code Is    400
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${json_object['appInsId']}
    Should Be Equal As Strings  ${response['body']['requestType']}    ${json_object['requestType']}
    Should Be Equal As Strings  ${response['body']['qosD']}    ${json_object['qosD']}
    Should Be Equal As Strings  ${response['body']['mtsMode']}    ${json_object['mtsMode']}
    Should Be Equal As Strings  ${response['body']['trafficDirection']}    ${json_object['trafficDirection']}


##GET on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId}
TP_MEC_MEC015_SRV_MTS_004_OK
    [Documentation]
    ...  Check that the IUT responds with a configured Multi-access Traffic Steering session when queried by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve single MTS session   ${SESSION_ID}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Should Be Equal As Strings  ${response['body']['appInsId']}                   ${APP_INSTANCE_ID}
    Should Be Equal As Strings  ${response['body']['appInsId']}                   ${APP_INSTANCE_ID}
    Should Be Equal As Strings  ${response['body']['requestType']}             ${REQUEST_TYPE_SESSION}     
    Should Be Equal As Strings  ${response['body']['mtsMode']}                   ${MTS_LOW_MODE_COST} 
    Should Be Equal As Strings  ${response['body']['trafficDirection']}         ${TRAFFIC_DIRECTION_DL}   

TP_MEC_MEC015_SRV_MTS_004_BR
    [Documentation]
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Retrieve single MTS session   ${WRONG_SESSION_ID}	
    Check HTTP Response Status Code Is    400
    
    
TP_MEC_MEC015_SRV_MTS_004_NF
TP_MEC_MEC015_SRV_MTS_004_NF
    [Documentation]
    [Documentation]
    ...  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
    ...  ETSI GS MEC 015 V2.1.1, clause 9.5.3.2
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.1
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Register MTS session wrong URI   MtsSessionInfoSessionSpecific.json
    Retrieve single MTS session   ${NOT_EXISTING_SESSION_ID}
    Check HTTP Response Status Code Is    404


##PUT on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId}
TP_MEC_MEC015_SRV_MTS_005_OK
    [Documentation]
    ...  Check that the IUT updates the information about an individual MTS session when commanded by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoApplicationSpecificUpdate.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Update requested requirements on the MTS Service    ${SESSION_ID}     ${body}
    Check HTTP Response Status Code Is    200
    Check HTTP Response Body Json Schema Is   MtsSessionInfo
    Should Be Equal As Strings  ${response['body']['appInsId']}    ${json_object['appInsId']}
    Should Be Equal As Strings  ${response['body']['requestType']}    ${json_object['requestType']}
    Should Be Equal As Strings  ${response['body']['qosD']}    ${json_object['qosD']}
    Should Be Equal As Strings  ${response['body']['mtsMode']}    ${json_object['mtsMode']}
    Should Be Equal As Strings  ${response['body']['trafficDirection']}    ${json_object['trafficDirection']}    
    
TP_MEC_MEC015_SRV_MTS_005_BR
    [Documentation]
    ...  Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoApplicationSpecificUpdate_BR.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Update requested requirements on the MTS Service    ${SESSION_ID}     ${body}
    Check HTTP Response Status Code Is    400

TP_MEC_MEC015_SRV_MTS_005_NF
    [Documentation]
    ...  Check that the IUT responds with an error when a request with an unknown resource URI is sent by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.2
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    ${path}    Catenate    SEPARATOR=      jsons/     MtsSessionInfoApplicationSpecificUpdate.json
    ${body}    Get File    ${path}
    ${json_object}=	Evaluate  json.loads('''${body}''')  json
    Update requested requirements on the MTS Service    ${NOT_EXISTING_SESSION_ID}     ${body}
    Check HTTP Response Status Code Is    404
             
##DELETE on ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/{sessionId}
TP_MEC_MEC015_SRV_MTS_006_OK
    [Documentation]
    ...  Check that the IUT deregisters a MTS session when commanded by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.3
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Unregister from the MTS Service   ${SESSION_ID}
    Check HTTP Response Status Code Is    204

##TP_MEC_MEC015_SRV_MTS_006_BR missing. 
#See issues https://forge.etsi.org/rep/mec/gs032p2-test-purposes/issues/11 for further details.

TP_MEC_MEC015_SRV_MTS_006_NF
    [Documentation]
    ...  Check that the IUT deregisters a MTS session when commanded by a MEC Application
    ...  ETSI GS MEC 015 V2.1.1, clause 9.4.3.3
    ...  https://forge.etsi.org/rep/mec/gs015-bandwith-mgmt-api/blob/master/BwManagementApi.yaml
    Unregister from the MTS Service   ${NOT_EXISTING_SESSION_ID}
    Check HTTP Response Status Code Is    404
    Check HTTP Response Status Code Is    404
   
   
*** Keywords ***
*** Keywords ***
@@ -120,7 +219,7 @@ Retrieve MTS session list information
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/mts_session
    Get    ${apiRoot}/${apiName}/${apiVersion}/mts_sessions
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
@@ -133,21 +232,19 @@ Retrieve MTS session list information using filter
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Content-Type":"*/*"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Authorization":"${TOKEN}"}
    Set Headers    {"Content-Length":"0"}
    Set Headers    {"Content-Length":"0"}
    Get    ${apiRoot}/${apiName}/${apiVersion}/mts_session?${filter}=${value}
    Get    ${apiRoot}/${apiName}/${apiVersion}/mts_sessions?${filter}=${value}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
Register MTS session
Register MTS session
    [Arguments]    ${content}
    [Arguments]    ${body}
    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"}
    ${path}    Catenate    SEPARATOR=      jsons/     ${content}
    POST    ${apiRoot}/${apiName}/${apiVersion}/mts_sessions   ${body}
    ${body}    Get File    ${path}
    POST    ${apiRoot}/${apiName}/${apiVersion}/mts_session   ${body}
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
    
    
@@ -162,6 +259,40 @@ Register MTS session wrong URI
    Set Headers    {"Content-Length":"0"}
    Set Headers    {"Content-Length":"0"}
    ${path}    Catenate    SEPARATOR=      jsons/     ${content}
    ${path}    Catenate    SEPARATOR=      jsons/     ${content}
    ${body}    Get File    ${path}
    ${body}    Get File    ${path}
    POST    ${apiRoot}/${apiName}/v0/mts_session   ${body}
    POST    ${apiRoot}/${apiName}/v0/mts_sessions   ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Retrieve single MTS session
    [Arguments]    ${sessionId}
    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}/mts_sessions/${sessionId}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Update requested requirements on the MTS Service
    [Arguments]    ${sessionId}   ${body}
    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}"}
    PUT    ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/${sessionId}   ${body}
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    
Unregister from the MTS Service
    [Arguments]    ${sessionId} 
    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}"}
    LOG   ${sessionId} 
    DELETE    ${apiRoot}/${apiName}/${apiVersion}/mts_sessions/${sessionId} 
    ${output}=    Output    response
    ${output}=    Output    response
    Set Suite Variable    ${response}    ${output}
    Set Suite Variable    ${response}    ${output}
 No newline at end of file
+9 −1
Original line number Original line Diff line number Diff line
@@ -13,4 +13,12 @@ ${apiVersion} v1
${APP_INSTANCE_ID}					appInstId01
${APP_INSTANCE_ID}					appInstId01
${NOT_EXISTING_APP_INSTANCE_ID}		NOT_EXISTING_APP_INS_ID
${NOT_EXISTING_APP_INSTANCE_ID}		NOT_EXISTING_APP_INS_ID
${CORRECT_FILTER}					app_instance_id
${CORRECT_FILTER}					app_instance_id
${BAD_FILTER}						app_id
${BAD_FILTER}						appInsId
 No newline at end of file

${SESSION_ID}						1
${WRONG_SESSION_ID}					WRONG_SESSION_ID
${NOT_EXISTING_SESSION_ID}			NOT_EXISTING_SESSION_ID

${REQUEST_TYPE_SESSION}				0
${MTS_LOW_MODE_COST}				0
${TRAFFIC_DIRECTION_DL}				00
+0 −9
Original line number Original line Diff line number Diff line
@@ -6,15 +6,6 @@
		},
		},
		"mtsMode": 0,
		"mtsMode": 0,
		"trafficDirection": "00",
		"trafficDirection": "00",
  		"flowFilter": [{
			"dstPort": [8081],
			"protocol": 41,
			"sourcePort": [8081],
			"dstIp": "10.10.0.10",
			"dscp": 40,
			"sourceIp": "10.10.0.30"
		}   
          ],
        "qosD":{
        "qosD":{
             "minTpt":10
             "minTpt":10
        }
        }
+12 −0
Original line number Original line Diff line number Diff line
{
		"appInsId": "myAppInstId",
		"requestType": 0,
		"qosD": {
			"minTpt": 30
		},
		"mtsMode": 0,
		"trafficDirection": "00",
        "qosD":{
             "minTpt":10
        }
}
 No newline at end of file
+21 −0
Original line number Original line Diff line number Diff line
{
		"appInsId": "myAppInstId",
		"requestType": 0,
		"qosD": {
			"minTpt": 30
		},
		"mtsMode": 0,
		"trafficDirection": "00",
		"flowFilter": [{
			"dstPort": [8081],
			"protocol": 41,
			"sourcePort": [8081],
			"dstIp": "10.10.0.10",
			"dscp": 40,
			"sourceIp": "10.10.0.30"
		}   
          ],
        "qosD":{
             "minTpt":10
        }
}
 No newline at end of file
Loading