Commit 5d7b0b75 authored by Michele Carignani's avatar Michele Carignani

Merge branch '2.1.1-fix-plu'

parents 31208d0c dd0169d7
Pipeline #4978 passed with stage
in 0 seconds
......@@ -23,12 +23,21 @@ Check HTTP Response Body Json Schema Is
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}
Log Check if ${json_field} is present in ${expr} with the value ${json_value}
:FOR ${item} IN @{expr}
\ Exit For Loop If "${item['${json_field}']}" == "${json_value}"
\ Exit For Loop If ${item[${json_field}]} == ${json_value}
Log Item found ${item}
[return] ${item}
Should Be Present In Json
[Arguments] ${expr} ${json_field} ${json_value}
Log Check if ${json_field} is present in ${expr} with the value ${json_value}
Should Be Equal As Strings ${expr}[${json_field}] ${json_value}
Check Response Contains
[Arguments] ${source} ${parameter} ${value}
Should Be Present In Json ${source} ${parameter} ${value}
Check Result Contains
[Arguments] ${source} ${parameter} ${value}
Should Be Present In Json List ${source} ${parameter} ${value}
......
# MEC Testing Framework in Robot Framework
# MEC Testing Framework in Robot Framework - GS 032-2
## Introduction
This repositories contains the test specifications and test adapter code for MEC Testing project in Robot Framework
This repositories contains the test specifications and test adapter code for MEC Testing project in Robot Framework.
Latest publicly available drafts are available at https://docbox.etsi.org/isg/mec/open.
For more information on ETSI ISG Multi-access Edge Computing (MEC), visit https://www.etsi.org/technologies/multi-access-edge-computing.
## Contact information
Email at cti_support at etsi dot org
Email at `cti_support` at `etsi` dot `org`.
## License
Unless specified otherwise, the content of this repository and the files contained are released under the BSD-3-Clause license.
......@@ -21,16 +27,78 @@ NOTE All draft can be found in the 'IETF XML Registry', accessible [here](https:
## Installation
TODO
The main precondition for running the tests is having [Robot Framework](http://robotframework.org/) installed.
The [Robot Framework Installation Instructions](https://github.com/robotframework/robotframework/blob/master/INSTALL.rst) provide full details of the installation procedure.
For those familiar with installing Python packages with [pip](http://pip-installer.org/) package manager, the following command can be run to install [Robot Framework](http://robotframework.org/):
[Robot Framework](http://robotframework.org/) >3.0 is recommended. It requires Python 3.
### Robot Framework Required Libraries
The [Robot Framework](http://robotframework.org/) Test Cases in this repository depend on the following libraries:
* [RESTInstance](https://github.com/asyrjasalo/RESTinstance)
* [DependencyLibrary](https://github.com/mentalisttraceur/robotframework-dependencylibrary)
* [JSONLibrary](https://github.com/nottyo/robotframework-jsonlibrary)
* [JSONSchemaLibrary](https://github.com/jstaffans/robotframework-jsonschemalibrary)
* [Requests](https://pypi.org/project/robotframework-requests/)
A [pip](http://pip-installer.org/) [requirements file](https://forge.etsi.org/rep/mec/gs032p3-robot-test-suite/blob/2.1.1-fix-plu/requirements.txt) is provided to ease the installation of the required python libraries, as follows:
```
$ pip install -r requirements.txt
```
## Usage
TODO
The usage of these Test Suites goes through different steps. First of all, you should be aware of the structure's folder. After that, some configuration steps are needed and at the end, you can run the test.
### Folder structure
The Test folder is structured as follow:
### Test Suite files
```
<group>/<feature>/<interface>
e.g.: SRV/APPSUB/PlatAppSubscriptions.robot
```
### Environmental files
In the same folder, you will find two subfolders
* environment
* jsons
The **environment** folder contain a file, called *variables.txt*, which contains all the information necessary to reach and interact with the SUT
```
*** Variables ***
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 192.168.56.1
${MEC-APP_PORT} 8081
...
```
This file should be updated before running the tests.
The **json** folder contains the json payloads necessary to perform the POST/PUT/PATCH requests.
These files should contain the exact content to be sent.
### Execution of the test cases
The [Robot Framework](http://robotframework.org/) Test Cases in this repository can be executed with the following command:
```
$ robot <name_of_the_robot_file>
```
To execute all test case files in a directory recursively, just give the directory as an argument. You can also give multiple files or directories in one go and use various command-line options supported by [Robot Framework](http://robotframework.org/).
For more information about the command-line usage, you can run:
```
$ robot --help
```
The [Robot Framework User Guide](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#executing-test-cases) provides full details on how to execute tests in general.
## How to Report a Bug
The ETSI MEC Testing Framework project is under constant development, so it is possible that you will
encounter a bug while using it. Please report bugs at cti_support at etsi dot org.
encounter a bug while using it. You may report in the [Issues section](https://forge.etsi.org/rep/mec/gs032p3-robot-test-suite/issues) of the project.
For any other inquiry, you may contact cti_support at etsi dot org.
This diff is collapsed.
......@@ -18,17 +18,8 @@ ${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
## this parameter should be the same as in jsons/ServiceInfo.json on param serName
${NEW_SERVICE_NAME} NEW_SERVICE_NAME
# # 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
## this parameter should be the same as in jsons/ServiceInfoUpdated.json on param sversion
${SVC_NEW_VERSION} v2.0
\ No newline at end of file
{
"serName": "NEW_SERVICE_NAME",
"version": "reprehenderit Ut non commodo",
"state": "INACTIVE",
"transportInfo": {
"id": "labore ut Excepteur sunt ipsum",
"name": "in minim enim",
"type": "MB_ROUTING",
"protocol": "veniam aliqua cillum in",
"version": "exercitation pariatur",
"endpoint": {
"addresses": [
{
"host": "sint culpa laboris",
"port": 10968
}
]
},
"security": {
"oAuth2Info": {
"grantTypes": [
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "https://RXjkuoqKaR.nskcJZJsyoIFJ0k86hJdxq.eTHEGqxAybM3DEZlUlYQpZ47s6RR+O9gyFrLbO92,9"
}
},
"description": "dolor occaecat pariatur ex do"
},
"serializer": "XML",
"serInstanceId": "cillum nostrud minim consectetur proident",
"serCategory": {
"href": "http://VWwswcAtAylGx.usasPjZ+bqQIHCMc7FfToVvk2M.SYAWYvSDKGSRL7Z.rxyfC0goFNZtoGJrlFc89,",
"id": "consectetur et eiusmod",
"name": "ea ipsum irure mollit et",
"version": "et"
},
"scopeOfLocality": "ZONE",
"consumedLocalOnly": true,
"isLocal": false
}
\ No newline at end of file
{
"Name": "WRONG_PARAMETER_NAME",
"version": "reprehenderit Ut non commodo",
"state": "INACTIVE",
"transportInfo": {
"id": "labore ut Excepteur sunt ipsum",
"name": "in minim enim",
"type": "MB_ROUTING",
"protocol": "veniam aliqua cillum in",
"version": "exercitation pariatur",
"endpoint": {
"addresses": [
{
"host": "sint culpa laboris",
"port": 10968
}
]
},
"security": {
"oAuth2Info": {
"grantTypes": [
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "https://RXjkuoqKaR.nskcJZJsyoIFJ0k86hJdxq.eTHEGqxAybM3DEZlUlYQpZ47s6RR+O9gyFrLbO92,9"
}
},
"description": "dolor occaecat pariatur ex do"
},
"serializer": "XML",
"serInstanceId": "cillum nostrud minim consectetur proident",
"serCategory": {
"href": "http://VWwswcAtAylGx.usasPjZ+bqQIHCMc7FfToVvk2M.SYAWYvSDKGSRL7Z.rxyfC0goFNZtoGJrlFc89,",
"id": "consectetur et eiusmod",
"name": "ea ipsum irure mollit et",
"version": "et"
},
"scopeOfLocality": "ZONE",
"consumedLocalOnly": true,
"isLocal": false
}
\ No newline at end of file
{
"serName": "NEW_SERVICE_NAME",
"version": "v2.0",
"state": "INACTIVE",
"transportInfo": {
"id": "labore ut Excepteur sunt ipsum",
"name": "in minim enim",
"type": "MB_ROUTING",
"protocol": "veniam aliqua cillum in",
"version": "exercitation pariatur",
"endpoint": {
"addresses": [
{
"host": "sint culpa laboris",
"port": 10968
}
]
},
"security": {
"oAuth2Info": {
"grantTypes": [
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "https://RXjkuoqKaR.nskcJZJsyoIFJ0k86hJdxq.eTHEGqxAybM3DEZlUlYQpZ47s6RR+O9gyFrLbO92,9"
}
},
"description": "dolor occaecat pariatur ex do"
},
"serializer": "XML",
"serInstanceId": "cillum nostrud minim consectetur proident",
"serCategory": {
"href": "http://VWwswcAtAylGx.usasPjZ+bqQIHCMc7FfToVvk2M.SYAWYvSDKGSRL7Z.rxyfC0goFNZtoGJrlFc89,",
"id": "consectetur et eiusmod",
"name": "ea ipsum irure mollit et",
"version": "et"
},
"scopeOfLocality": "ZONE",
"consumedLocalOnly": true,
"isLocal": false
}
\ No newline at end of file
{
"serName": "NEW_SERVICE_NAME",
"a_version": "v2.0",
"state": "INACTIVE",
"transportInfo": {
"id": "labore ut Excepteur sunt ipsum",
"name": "in minim enim",
"type": "MB_ROUTING",
"protocol": "veniam aliqua cillum in",
"version": "exercitation pariatur",
"endpoint": {
"addresses": [
{
"host": "sint culpa laboris",
"port": 10968
}
]
},
"security": {
"oAuth2Info": {
"grantTypes": [
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_CLIENT_CREDENTIALS"
],
"tokenEndpoint": "https://RXjkuoqKaR.nskcJZJsyoIFJ0k86hJdxq.eTHEGqxAybM3DEZlUlYQpZ47s6RR+O9gyFrLbO92,9"
}
},
"description": "dolor occaecat pariatur ex do"
},
"serializer": "XML",
"serInstanceId": "cillum nostrud minim consectetur proident",
"serCategory": {
"href": "http://VWwswcAtAylGx.usasPjZ+bqQIHCMc7FfToVvk2M.SYAWYvSDKGSRL7Z.rxyfC0goFNZtoGJrlFc89,",
"id": "consectetur et eiusmod",
"name": "ea ipsum irure mollit et",
"version": "et"
},
"scopeOfLocality": "ZONE",
"consumedLocalOnly": true,
"isLocal": false
}
\ No newline at end of file
{
"description": "This type represents the general information of a MEC service.",
"type": "object",
"required": [
"serName",
"version",
"state",
"transportInfo",
"serializer"
],
"properties": {
"serInstanceId": {
"description": "Identifier of the service instance assigned by the MEC platform.",
"type": "string",
"readOnly": true,
"example": "ServiceInstance123"
},
"serName": {
"description": "The name of the service. This is how the service producing MEC application identifies the service instance it produces.",
"type": "string",
"example": "ExampleService"
},
"serCategory": {
"description": "This type represents the category reference",
"type": "object",
"required": [
"href",
"id",
"name",
"version"
],
"properties": {
"href": {
"description": "Reference of the catalogue",
"type": "string",
"format": "uri",
"example": "/example/catalogue1"
},
"id": {
"description": "Unique identifier of the category",
"type": "string",
"example": "id12345"
},
"name": {
"description": "Name of the category, example values include RNI, Location & Bandwidth Management",
"type": "string",
"example": "RNI"
},
"version": {
"description": "Category version",
"type": "string",
"example": "version1"
}
}
},
"version": {
"description": "Service version",
"type": "string",
"example": "ServiceVersion1"
},
"state": {
"description": "This enumeration defines the possible states of a service.",
"type": "string",
"enum": [
"ACTIVE",
"INACTIVE"
],
"example": "ACTIVE"
},
"transportInfo": {
"description": "This type represents the general information of a MEC service.",
"type": "object",
"required": [
"id",
"name",
"type",
"protocol",
"version",
"endpoint",
"security"
],
"properties": {
"id": {
"description": "The identifier of this transport",
"type": "string",
"example": "TransId12345"
},
"name": {
"description": "The name of this transport",
"type": "string",
"example": "REST"
},
"description": {
"description": "Human-readable description of this transport",
"type": "string",
"example": "REST API"
},
"type": {
"description": "The enumeration TransportType represents types of transports",
"type": "string",
"enum": [
"REST_HTTP",
"MB_TOPIC_BASED",
"MB_ROUTING",
"MB_PUBSUB",
"RPC",
"RPC_STREAMING",
"WEBSOCKET"
],
"example": "REST_HTTP"
},
"protocol": {
"description": "The name of the protocol used. Shall be set to HTTP for a REST API.",
"type": "string",
"example": "HTTP"
},
"version": {
"description": "The version of the protocol used",
"type": "string",
"example": "2.0"
},
"endpoint": {
"description": "This type represents information about a transport endpoint",
"type": "object",
"oneOf": [{
"description": "Entry point information of the service as string, formatted according to URI syntax",
"type": "object",
"required": [
"uris"
],
"properties": {
"uris": {
"type": "array",
"minItems": 0,
"items": {
"description": "Entry point information of the service",
"type": "string",
"format": "uri",
"example": "/mecSerMgmtApi/service/EntryPoint"
}
}
}
},
{
"description": "Entry point information of the service as one or more pairs of IP address and port",
"type": "object",
"required": [
"addresses"
],
"properties": {
"addresses": {
"type": "array",
"minItems": 0,
"items": {
"description": "A IP address and port pair",
"type": "object",
"required": [
"host",
"port"
],
"properties": {
"host": {
"description": "Host portion of the address",
"type": "string",
"example": "192.0.2.0"
},
"port": {
"description": "Port portion of the address",
"type": "integer",
"format": "uint32",
"example": 8080
}
}
}
}
}
},
{
"description": "Entry point information of the service in a format defined by an implementation, or in an external specification.",
"type": "object",
"required": [
"alternative"
],
"properties": {
"alternative": {
"type": "object"
}
}
}
]
},
"security": {
"description": "This type represents security information related to a transport",
"type": "object",
"properties": {
"oAuth2Info": {
"description": "Parameters related to use of OAuth 2.0",
"required": [
"grantTypes",
"tokenEndpoint"
],
"properties": {
"grantTypes": {
"description": "List of supported OAuth 2.0 grant types.",
"type": "array",
"minItems": 1,
"maxItems": 4,
"items": {
"description": "OAuth 2.0 grant type",
"type": "string",
"enum": [
"OAUTH2_AUTHORIZATION_CODE",
"OAUTH2_IMPLICIT_GRANT",
"OAUTH2_RESOURCE_OWNER",
"OAUTH2_CLIENT_CREDENTIALS"
],
"example": "OAUTH2_CLIENT_CREDENTIALS"
}
},
"tokenEndpoint": {
"description": "The token endpoint",
"type": "string",
"format": "uri",
"example": "/mecSerMgmtApi/security/TokenEndPoint"
}
},
"type": "object"
}
}
},
"implSpecificInfo": {
"description": "Additional implementation specific details of the transport",
"type": "object"
}
}
},
"serializer": {
"description": "The enumeration represents types of serializers",
"type": "string",
"enum": [
"JSON",
"XML",
"PROTOBUF3"
],
"example": "JSON"
},
"scopeOfLocality": {
"description": "The scope of locality as expressed by \"consumedLocalOnly\" and \"isLocal\". If absent, defaults to MEC_HOST",
"type": "string",
"enum": [
"MEC_SYSTEM",
"MEC_HOST",
"NFVI_POP",
"ZONE",
"ZONE_GROUP",
"NFVI_NODE"
],
"example": "MEC_SYSTEM"
},
"consumedLocalOnly": {
"description": "Indicate whether the service can only be consumed by the MEC applications located in the same locality (as defined by scopeOfLocality) as this service instance.",
"type": "boolean",
"example": false
},
"isLocal": {
"description": "Indicate whether the service is located in the same locality (as defined by scopeOfLocality) as the consuming MEC application.",
"type": "boolean",
"example": true
}
}
}
\ No newline at end of file
{
"type": "array",
"items": {
"objects": {
"description": "This type represents the general information of a MEC service.",
"type": "object",
"required": [
"serInstanceId",
"serName",
"version",
"state",
"transportInfo",
......@@ -11,39 +12,264 @@
],
"properties": {
"serInstanceId": {
"type": "string"
"description": "Identifier of the service instance assigned by the MEC platform.",
"type": "string",
"readOnly": true,
"example": "ServiceInstance123"
},
"serName": {
"type": "string"
"description": "The name of the service. This is how the service producing MEC application identifies the service instance it produces.",
"type": "string",
"example": "ExampleService"
},
"serCategory": {
"type": "string"
"description": "This type represents the category reference",
"type": "object",
"required": [
"href",
"id",
"name",
"version"
],
"properties": {
"href": {
"description": "Reference of the catalogue",
"type": "string",
"format": "uri",
"example": "/example/catalogue1"
},
"id": {
"description": "Unique identifier of the category",
"type": "string",
"example": "id12345"
},
"name": {
"description": "Name of the category, example values include RNI, Location & Bandwidth Management",
"type": "string",
"example": "RNI"
},
"version": {
"description": "Category version",
"type": "string",
"example": "version1"
}
}
},
"version": {
"type": "string"
"description": "Service version",
"type": "string",
"example": "ServiceVersion1"
},
"state": {
"description": "This enumeration defines the possible states of a service.",
"type": "string",
"enum": [
"ACTIVE",
"INACTIVE"
]
],
"example": "ACTIVE"
},
"transportInfo": {
"type": "string"
"description": "This type represents the general information of a MEC service.",
"type": "object",
"required": [
"id",
"name",
"type",
"protocol",
"version",