Commit 719d4daf authored by Elian Kraja's avatar Elian Kraja
Browse files

Refactoring generic elements. Added MEC-021 Robotframework code

parents c38aaf8c 049d3a21
......@@ -28,7 +28,6 @@ Should Be Present In Json List
Log Item found ${item}
[return] ${item}
Check Result Contains
[Arguments] ${source} ${parameter} ${value}
Should Be Present In Json List ${source} ${parameter} ${value}
''[Documentation] robot --outputdir ../../outputs ./RnisSpecificSubscription_BV.robot
... Test Suite to validate RNIS/Subscription (RNIS) operations.
*** Settings ***
Resource environment/variables.txt
Resource environment/pics.txt
Resource resources/GenericKeywords.robot
Resource resources/RadioNetworkInformationAPI.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
Request RNIS subscription list
[Documentation] TC_MEC_SRV_RNIS_011_OK
... Check that the RNIS service sends the list of links to the relevant RNIS subscriptions when requested
... ETSI GS MEC 012 2.0.4, clause 7.6.3.1
... Reference https://forge.etsi.org/gitlab/mec/gs012-rnis-api/blob/master/RniAPI.yaml#/definitions/SubscriptionLinkList
Get RNIS subscription list
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is RadioNetworkInformationAPI
log ${response['body']['SubscriptionLinkList']['_links']}
Should Be Equal ${response['body']['SubscriptionLinkList']['_links']['self']} ${LINKS_SELF}
*** Keywords ***
Get RNIS subscription list
Should Be True ${PIC_RNIS_SPECIFIC_SUBSCRIPTION} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
Set Headers {"Content-Length":"0"}
Get /exampleAPI/rni/v2/subscriptions
${output}= Output response
Set Suite Variable ${response} ${output}
*** Variables ***
${PIC_RNIS_SPECIFIC_SUBSCRIPTION} 1
*** Variables ***
${MEC-APP_SCHEMA} http
#${MEC-APP_HOST} 172.28.4.87
#${MEC-APP_HOST} 127.0.0.1
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${SUBSCRIPTION_ID} 7777
${NON_EXISTENT_SUBSCRIPTION_ID} 6666
${LINKS_SELF} http://example.com/exampleAPI/rni/v2/subscriptions
${response} {}
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
*** Settings ***
Resource ../environment/variables.txt
Resource GenericKeywords.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
Library JSONSchemaLibrary schemas/
*** Keywords ***
Get User Equipment for location with filters
[Arguments] ${value}
Set Headers {"Accept":"application/json"}
Get /location/v2/users/${value}
${output}= Output response
Set Suite Variable ${response} ${output}
Check HTTP Response Status Code Is
[Arguments] ${expected_status}
${status}= Convert To Integer ${expected_status}
Should Be Equal ${response['status']} ${status}
Log Status code validated
Check HTTP Response Body Json Schema Is
[Arguments] ${input}
Should Contain ${response['headers']['Content-Type']} application/json
${schema} = Catenate SEPARATOR= ${input} .schema.json
Validate Json ${schema} ${response['body']}
Log Json Schema Validation OK
Should Be Present In Json List
[Arguments] ${expr} ${json_field} ${json_value}
Log Check if ${json_field} is present in ${expr} with the value ${jsonvalue}
:FOR ${item} IN @{expr}
\ Exit For Loop If "${item['${json_field}']}" == "${json_value}"
Log Item found ${item}
[return] ${item}
Check Result Contains
[Arguments] ${source} ${parameter} ${value}
Should Be Present In Json List ${source} ${parameter} ${value}
*** Settings ***
Resource ../environment/variables.txt
Resource LocationAPI.robot
#Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
Library JSONSchemaLibrary schemas/
*** Keywords ***
Check Location
[Arguments] ${value}
Log Check Location for userInfo element
Should be Equal ${response['body']['userInfo']['zoneId']} ${value}
Log Location OK
*** Settings ***
Resource ../environment/variables.txt
Resource ../environment/pics.txt
Resource GenericKeywords.robot
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
Library JSONSchemaLibrary schemas/
*** Keywords ***
This diff is collapsed.
''[Documentation] robot --outputdir ./outputs ./SRV/UETAG/PlatUeIdentity.robot
''[Documentation] robot --outputdir ../../outputs ./PlatUeIdentity.robot
... Test Suite to validate UE Identity Tag (UETAG) operations.
*** Settings ***
......@@ -72,20 +72,21 @@ Unregister an UE Identity Tag already in unregistered state
*** Keywords ***
Get UE Identity Tag information
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
Set Headers {"Content-Length":"0"}
Get /exampleAPI/ui/v1/${APP_INSTANCE_ID}/ue_identity_tag_info?ueIdentityTag=${UE_IDENTITY_TAG}
${output}= Output response
Set Suite Variable ${response} ${output}
Get UE Identity Tag information using bad parameters
# FIXME Which IE protocol should be invalid?
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
......@@ -96,8 +97,8 @@ Get UE Identity Tag information using bad parameters
Get UE Identity Tag information using non-existent application instance
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
......@@ -109,14 +110,15 @@ Get UE Identity Tag information using non-existent application instance
Update an UE Identity Tag
[Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
## As far as I understood, we are not checking preconditions.
# Preamble: Check that the user tag is not registered
## 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
Set Suite Variable ${response} ${output}
......@@ -124,8 +126,8 @@ Update an UE Identity Tag
Update an UE Identity Tag using invalid state
[Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
......@@ -137,8 +139,8 @@ Update an UE Identity Tag using invalid state
Update an UE Identity Tag using a not applicable valid state
[Arguments] ${content}
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
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}"}
......@@ -148,4 +150,3 @@ Update an UE Identity Tag using a not applicable valid state
Set Suite Variable ${response} ${output}
# TODO Check ProblemDetails
\ No newline at end of file
......@@ -2,7 +2,7 @@
${MEC-APP_SCHEMA} http
#${MEC-APP_HOST} 172.28.4.87
#${MEC-APP_HOST} 127.0.0.1
${MEC-APP_HOST} 10.192.2.172
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
${ZONE_ID} zone01
${APP_INSTANCE_ID} appInst01
......
......@@ -9,8 +9,8 @@ Library JSONSchemaLibrary schemas/
*** Keywords ***
Check User Identity Tag state
[Arguments] ${ue_identity_tag} ${state}
Should Be True ${PIC_MEC_PLAT} == '1'
Should Be True ${PIC_SERVICES} == '1'
Should Be True ${PIC_MEC_PLAT} 1
Should Be True ${PIC_SERVICES} 1
Log Check ueIdentityTag state ${state}
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
......
......@@ -21,6 +21,13 @@ This file provides the list of the TODOs related to the STF 569.
### RNIS
Draft ETSI GS MEC 012 2.0.4
https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2
https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purposes/SRV/RNIS/RnisSpecificSubscription_BV.tplan2
- TC_MEC_SRV_RNIS_011_OK <font color="color:green">To be tested</font>
### SAQ
### SRVSUB
......@@ -99,4 +106,3 @@ https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/master/Test%20Purpo
Draft ETSI GS MEC 013 V2.0.3 (2018-10)
https://forge.etsi.org/gitlab/mec/gs032p2-test-purposes/blob/remove-401s/Test%20Purposes/SRV/UETRACKSUB/PlatUeTrackingSubscription.tplan2
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment