Commit f70f9377 authored by piscione's avatar piscione
Browse files

Added robot tests for MEC028.

parent 433eae94
Pipeline #6901 passed with stage
in 0 seconds
''[Documentation] robot --outputdir ../../outputs ./WaiApInfo.robot
... Test Suite to validate WLAN Information API (AP_INFO) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_001_OK
[Documentation]
... Check that the IUT responds with the list of WLAN Access Point
... Reference "ETSI GS MEC 028 2.1.1, clause 7.3.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the access point information
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ApInfo
## Post condition
FOR ${apInfo} IN @{response['body']}
${passed} Run Keyword And Return Status Should Be Equal As Strings ${apInfo['apId']['macId']} ${MAC_ID}
Exit For Loop If ${passed}
END
Should Be True ${passed}
TP_MEC_MEC028_SRV_WAI_002_OK
[Documentation]
... Check that the IUT responds with the list of WLAN Access Point filtered by the macId provided as query parameter
... Reference "ETSI GS MEC 028 2.1.1, clause 7.3.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the access point information using filters ${filter}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is ApInfo
## Post condition
FOR ${apInfo} IN @{response['body']}
${passed} Run Keyword And Return Status Should Be Equal As Strings ${apInfo['apId']['macId']} ${MAC_ID}
Exit For Loop If ${passed}
END
Should Be True ${passed}
TP_MEC_MEC028_SRV_WAI_002_BR
[Documentation]
... Check that the IUT responds with an error when a request with incorrect parameters is sent by a MEC Application
... Reference "ETSI GS MEC 028 2.1.1, clause 7.3.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/ApInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the access point information using filters ${bad_filter}
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Retrieve the access point information
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/queries/ap/ap_information
${output}= Output response
Set Suite Variable ${response} ${output}
Retrieve the access point information using filters
[Arguments] ${filter}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/queries/ap/ap_information?filter=${filter}
${output}= Output response
Set Suite Variable ${response} ${output}
\ No newline at end of file
*** Variables ***
${apiRoot}
${apiName} wai
${apiVersion} v1
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 127.0.0.1
${MEC-APP_PORT} 8082
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${MAC_ID} macId01
${filter} (eq,apId/macId,macId01)
${bad_filter} (eq,apId/mac,macId01)
\ No newline at end of file
This diff is collapsed.
{
"ProblemDetails": {
"properties": {
"detail": {
"description": "A human-readable explanation specific to this occurrence of the problem",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"instance": {
"description": "A URI reference that identifies the specific occurrence of the problem",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
},
"status": {
"description": "The HTTP status code for this occurrence of the problem",
"format": "uint32",
"type": "integer",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "Uint32"
},
"title": {
"description": "A short, human-readable summary of the problem type",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"type": {
"description": "A URI reference according to IETF RFC 3986 that identifies the problem type",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
}
},
"type": "object"
}
}
\ No newline at end of file
''[Documentation] robot --outputdir ../../outputs ./ExistingSubscription.robot
... Test Suite to validate WLAN Information API (EXT_SUB) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
#GET
*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_008_OK
[Documentation]
... Check that the IUT responds with the list of Subscription"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve existing subscription information ${SUB_ID}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is AssocStaSubscription
Should Be Equal As Strings ${response['body']['subscriptionType']} ${SUB_TYPE}
Should Be Equal As Strings ${response['body']['callbackReference']} ${CALLBACK_URI}
Should Be Equal As Strings ${response['body']['apId']['macId']} ${MAC_ID}
TP_MEC_MEC028_SRV_WAI_008_NF
[Documentation]
... Check that the IUT responds with an error when a request for existing subscription with incorrect parameters is sent"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve existing subscription information ${NOT_EXISTING_SUB_ID}
Check HTTP Response Status Code Is 404
#PUT
*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_009_OK
[Documentation]
... Check that the IUT responds with a Notification Subscription when it is modified"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.2
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Modify existing subscription information ${SUB_ID} UpdateAssocStaSubscription.json
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is AssocStaSubscription
Should Be Equal As Strings ${response['body']['subscriptionType']} ${SUB_TYPE}
Should Be Equal As Strings ${response['body']['callbackReference']} ${NEW_CALLBACK_URI}
Should Be Equal As Strings ${response['body']['apId']['macId']} ${MAC_ID}
TP_MEC_MEC028_SRV_WAI_009_BR
[Documentation]
... Check that the IUT responds with an error when an invalid field is set in the subscription modification request"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.2
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Modify existing subscription information ${SUB_ID} UpdateAssocStaSubscription_BR.json
Check HTTP Response Status Code Is 400
#DELETE
TP_MEC_MEC028_SRV_WAI_010_OK
[Documentation]
... Check that the IUT responds with 204 when an existing subscription is correctly deleted"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.5
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Remove existing subscription information ${SUB_ID}
Check HTTP Response Status Code Is 204
TP_MEC_MEC028_SRV_WAI_010_NF
[Documentation]
... Check that the IUT responds with an error when an not existing subscription cannot be deleted"
... Reference "ETSI GS MEC 028 2.1.1, clause 7.6.3.5
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Remove existing subscription information ${NOT_EXISTING_SUB_ID}
Check HTTP Response Status Code Is 404
*** Keywords ***
Retrieve existing subscription information
[Arguments] ${SUB_ID}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID}
${output}= Output response
Set Suite Variable ${response} ${output}
Modify existing subscription information
[Arguments] ${SUB_ID} ${content}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
${path} Catenate SEPARATOR= jsons/ ${content}
${body} Get File ${path}
PUT ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID} ${body}
${output}= Output response
Set Suite Variable ${response} ${output}
Remove existing subscription information
[Arguments] ${SUB_ID}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
DELETE ${apiRoot}/${apiName}/${apiVersion}/subscriptions/${SUB_ID}
${output}= Output response
Set Suite Variable ${response} ${output}
\ No newline at end of file
*** Variables ***
${apiRoot}
${apiName} wai
${apiVersion} v1
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 127.0.0.1
${MEC-APP_PORT} 8082
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${SUB_TYPE} AssocStaSubscription
${SUB_ID} 1
${NOT_EXISTING_SUB_ID} 99
${CALLBACK_URI} http://callback.uri/1
${NEW_CALLBACK_URI} http://new.callback.uri/1
${MAC_ID} macId01
\ No newline at end of file
{
"_links":{
"href":""
},
"apId": {
"macId": "macId01"
},
"callbackReference": "http://new.callback.uri/1",
"subscriptionType": "AssocStaSubscription"
}
\ No newline at end of file
{
"_links":{
"href":""
},
"apId": {
"macId": "macId01"
},
"callbackReference": "http://callback.uri/1",
"subscriptionType": "INVALID_VALUE"
}
\ No newline at end of file
{
"properties": {
"_links": {
"description": "Hyperlink related to the resource. This shall be only included in the HTTP responses and in HTTP PUT requests.",
"properties": {
"self": {
"properties": {
"href": {
"description": "URI referring to a resource",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
}
},
"required": [
"href"
],
"type": "object",
"x-etsi-ref": "6.5.23"
}
},
"required": [
"self"
],
"type": "object",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "Structure (inlined)"
},
"apId": {
"properties": {
"ipAddress": {
"description": "IPv4 or IPv6 address allocated for the Access Point.",
"items": {
"type": "string"
},
"minItems": 0,
"type": "array",
"x-etsi-mec-cardinality": "0..N",
"x-etsi-mec-origin-type": "String"
},
"macId": {
"description": "Unique Identifier assigned to an Access Point (as network interface controller) for communications at the data link layer of a network segment.",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
},
"ssid": {
"description": "Service Set Identifier to identify logical networks including Basic Service Set and Extended Service Set.",
"items": {
"type": "string"
},
"minItems": 0,
"type": "array",
"x-etsi-mec-cardinality": "0..N",
"x-etsi-mec-origin-type": "String"
}
},
"required": [
"macId"
],
"type": "object",
"x-etsi-ref": "6.5.3"
},
"callbackReference": {
"description": "URI selected by the service consumer to receive notifications on the subscribed WLAN information. This shall be included both in the request and in response.",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "URI"
},
"expiryDeadline": {
"properties": {
"nanoSeconds": {
"description": "The nanoseconds part of the time. Time is defined as Unix-time since January 1, 1970, 00:00:00 UTC.",
"format": "uint32",
"type": "integer",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "Uint32"
},
"seconds": {
"description": "The seconds part of the time. Time is defined as Unixtime since January 1, 1970, 00:00:00 UTC.",
"format": "uint32",
"type": "integer",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "Uint32"
}
},
"required": [
"seconds",
"nanoSeconds"
],
"type": "object",
"x-etsi-ref": "6.5.2"
},
"subscriptionType": {
"description": "Shall be set to \"AssocStaSubscription\".",
"type": "string",
"x-etsi-mec-cardinality": "1",
"x-etsi-mec-origin-type": "String"
}
},
"required": [
"subscriptionType",
"callbackReference",
"apId"
],
"type": "object",
"x-etsi-ref": "6.3.2"
}
\ No newline at end of file
''[Documentation] robot --outputdir ../../outputs ./WaiSTAInfo.robot
... Test Suite to validate WLAN Information API (STA_INFO) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_003_OK
[Documentation]
... Check that the IUT responds with the list of Station Point
... Reference "ETSI GS MEC 028 2.1.1, clause 7.4.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schema/StaInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the station information
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is StaInfo
## Post condition
FOR ${staInfo} IN @{response['body']}
${passed} Run Keyword And Return Status Should Be Equal As Strings ${staInfo['staId']['macId']} ${MAC_ID}
Exit For Loop If ${passed}
END
Should Be True ${passed}
TP_MEC_MEC028_SRV_WAI_004_OK
[Documentation]
... Check that the IUT responds with the list of Station Point filtered by the macId provided as query parameter
... Reference "ETSI GS MEC 028 2.1.1, clause 7.4.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schema/StaInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the station information using filters ${filter}
Check HTTP Response Status Code Is 200
Check HTTP Response Body Json Schema Is StaInfo
## Post condition
FOR ${staInfo} IN @{response['body']}
${passed} Run Keyword And Return Status Should Be Equal As Strings ${staInfo['staId']['macId']} ${MAC_ID}
Exit For Loop If ${passed}
END
Should Be True ${passed}
TP_MEC_MEC028_SRV_WAI_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 028 2.1.1, clause 7.4.3.1
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schema/StaInfo
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Retrieve the station information using filters ${bad_filter}
Check HTTP Response Status Code Is 400
Check HTTP Response Body Json Schema Is ProblemDetails
*** Keywords ***
Retrieve the station information
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/queries/sta/sta_information
${output}= Output response
Set Suite Variable ${response} ${output}
Retrieve the station information using filters
[Arguments] ${filter}
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Set Headers {"Accept":"application/json"}
Set Headers {"Content-Type":"application/json"}
Set Headers {"Authorization":"${TOKEN}"}
GET ${apiRoot}/${apiName}/${apiVersion}/queries/sta/sta_information?filter=${filter}
${output}= Output response
Set Suite Variable ${response} ${output}
\ No newline at end of file
*** Variables ***
${apiRoot}
${apiName} wai
${apiVersion} v1
${MEC-APP_SCHEMA} http
${MEC-APP_HOST} 127.0.0.1
${MEC-APP_PORT} 8082
${TOKEN} Basic YWxhZGRpbjpvcGVuc2VzYW1l
${MAC_ID} macId01
${filter} (eq,staId/macId,macId01)
${bad_filter} (eq,staId/mac,macId01)
\ No newline at end of file
{
"properties": {
"detail": {
"description": "A human-readable explanation specific to this occurrence of the problem",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"instance": {
"description": "A URI reference that identifies the specific occurrence of the problem",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
},
"status": {
"description": "The HTTP status code for this occurrence of the problem",
"format": "uint32",
"type": "integer",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "Uint32"
},
"title": {
"description": "A short, human-readable summary of the problem type",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "String"
},
"type": {
"description": "A URI reference according to IETF RFC 3986 that identifies the problem type",
"format": "uri",
"type": "string",
"x-etsi-mec-cardinality": "0..1",
"x-etsi-mec-origin-type": "URI"
}
},
"type": "object"
}
\ No newline at end of file
This diff is collapsed.
''[Documentation] robot --outputdir ../../outputs ./WaiSubscription.robot
... Test Suite to validate WLAN Information API (SUB) operations.
*** Settings ***
Resource environment/variables.txt
Resource ../../../pics.txt
Resource ../../../GenericKeywords.robot
Library String
Library OperatingSystem
Library REST ${MEC-APP_SCHEMA}://${MEC-APP_HOST}:${MEC-APP_PORT} ssl_verify=false
#POST
*** Test Cases ***
TP_MEC_MEC028_SRV_WAI_007_OK
[Documentation]
... Check that the IUT responds with a Notification Subscription
... Reference "ETSI GS MEC 028 2.1.1, clause 7.5.3.4
... https://forge.etsi.org/rep/mec/gs028-wai-api/blob/v2.1.1/WlanInformationApi.yaml#/schemas/AssocStaSubscription
Should Be True ${PIC_MEC_SYSTEM} == 1
Should Be True ${PIC_SERVICES} == 1
Send a request for creating a subscription AssocStaSubscription.json
Check HTTP Response Status Code Is 201
Check HTTP Response Body Json Schema Is AssocStaSubscription
Should Be Equal As Strings ${response['body']['subscriptionType']} ${SUB_TYPE}
Should Be Equal As Strings ${response['body']['_links']['self']['href']} ${HREF}
Should Be Equal As Strings ${response['headers']['Location']} ${HREF}
TP_MEC_MEC028_SRV_WAI_007_BR
[Documentation]
<