From 45ca65949829816371950a5c5e7259580c4d1db7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Pe=C3=B1a=20Garc=C3=ADa-Oliva?= Date: Wed, 24 Jul 2024 09:00:41 +0200 Subject: [PATCH] Update testing definitions in .feature file for Fall24 meta-release (#65) --- .../Test_definitions/home-devices-qod.feature | 263 ++++++++++++ .../home_devices_qod_setQos.feature | 394 ------------------ 2 files changed, 263 insertions(+), 394 deletions(-) create mode 100755 code/Test_definitions/home-devices-qod.feature delete mode 100755 code/Test_definitions/home_devices_qod_setQos.feature diff --git a/code/Test_definitions/home-devices-qod.feature b/code/Test_definitions/home-devices-qod.feature new file mode 100755 index 0000000..85d60dc --- /dev/null +++ b/code/Test_definitions/home-devices-qod.feature @@ -0,0 +1,263 @@ +Feature: CAMARA Home Devices QoD API, v0.4.0 + # Input to be provided by the implementation to the tester + # + # Implementation indications: + # * the maximum quantity of devices with non-default QoS behaviour + # * RSSI allowed threshold + # * maximum QoS (service class value) allowed + # * home network occupancy threshold + # * supported router interfaces and frequency bands in WiFi interface + # + # Testing assets: + # * A home device connected to the user home network identified by its IPv4 address + # * A home device connected to a specific frequency band that does not match to the required interface + # * A home device that does not support the required interface + # * A home device with RSSI is below allowed threshold + # * A user home network with the maximum quantity of devices with non-default QoS behaviour + # * A user home network with the occupancy above the allowed threshold + # * A user home network with the router offline + # + # References to OAS spec schemas refer to schemas specifies in home_devices_qod.yaml, version 0.4.0 + + Background: Common setQos setup + Given an environment at "apiRoot" + And the resource "home-devices-qod/v0.4/qos" + And the header "Content-Type" is set to "application/json" + And the header "Authorization" is set to a valid access token + And the header "x-correlator" is set to a UUID value + And the request body is set by default to a request body compliant with the schema + + # Happy path scenarios + + @setQos_01_set_service_class_success + Scenario Outline: Validate success response updating service class to "" + Given the access token identifies the user and the user home network + And the request body property "$.serviceClass" is set to "" + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + When the request "setQos" is sent + Then the response status code is 204 + And the response header "x-correlator" has same value as the request header "x-correlator" + + Examples: + | serviceClass | + | real_time_interactive | + | multimedia_streaming | + | broadcast_video | + | low_latency_data | + | high_throughput_data | + | low_priority_data | + + @setQos_02_restore_default_service_class_success + Scenario Outline: Validate success response restoring service class to default value + Given the access token identifies the user and the user home network + And the request body property "$.serviceClass" is set to "standard" + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + And the device service class was previously set to "" + When the request "setQos" is sent + Then the response status code is 204 + And the response header "x-correlator" has same value as the request header "x-correlator" + + Examples: + | serviceClass | + | real_time_interactive | + | multimedia_streaming | + | broadcast_video | + | low_latency_data | + | high_throughput_data | + | low_priority_data | + + # Generic errors + + @setQos_03_missing_required_property + Scenario Outline: Error response for missing required property in request body + Given the access token identifies the user and the user home network + And the request body property "" is not included + When the request "setQos" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + Examples: + | required_property | + | $.serviceClass | + | $.ipAddress | + + @setQos_04_invalid_ip_address_format + Scenario: Error 400 when the IP address format is not IPv4 + Given the access token identifies the user and the user home network + And the request body property "$.ipAddress" is not set to a valid IPv4 address + When the request "setQos" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @setQos_05_invalid_service_class + Scenario: Error 400 when service class is none of the allowed values + Given the access token identifies the user and the user home network + And the request body property "$.serviceClass" is not set to any of the allowed values + When the request "setQos" is sent + Then the response status code is 400 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 400 + And the response property "$.code" is "INVALID_ARGUMENT" + And the response property "$.message" contains a user friendly text + + @setQos_06_expired_access_token + Scenario: Error response for expired access token + Given an expired access token + And the request body is set to a valid request body + When the request "setQos" is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + + @setQos_07_invalid_access_token + Scenario: Error response for invalid access token + Given an invalid access token + And the request body is set to a valid request body + When the request "setQos" is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + + @setQos_08_missing_authorization_header + Scenario: Error response for no header "Authorization" + Given the header "Authorization" is not sent + And the request body is set to a valid request body + When the request "setQos" is sent + Then the response status code is 401 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 401 + And the response property "$.code" is "UNAUTHENTICATED" + And the response property "$.message" contains a user friendly text + + # API Specific Errors + + @setQos_09_user_home_network_not_deducted_from_access_token + Scenario: Error 403 when user home network cannot be deducted from access token + Given the access token does not contain user home network identifier + And the request body is set to a valid request body + When the request "setQos" is sent + Then the response status code is 403 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 403 + And the response property "$.code" is "HOME_DEVICES_QOD.INVALID_TOKEN_CONTEXT" + And the response property "$.message" contains a user friendly text + + @setQos_10_no_device_found + Scenario: Error 404 when there is no connected device matching with input criteria + Given the access token identifies the user and the user home network + And the request body property "$.ipAddress" is set to a non-existent IP address for any device connected to the user home network + When the request "setQos" is sent + Then the response status code is 404 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 404 + And the response property "$.code" is "HOME_DEVICES_QOD.NO_DEVICE_MATCH" + And the response property "$.message" contains a user friendly text + + @setQos_11_devices_quantity_exceeded + Scenario: Error 409 when the request exceeds the maximum quantity of devices with non-default QoS behaviour + Given a user with the maximum quantity of devices with non-default QoS behaviour + And the access token identifies the user and the user home network + And the request body property "$.serviceClass" is set to a value different from "standard" + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.TOO_MANY_DEVICES" + And the response property "$.message" contains a user friendly text + + @setQos_12_rssi_below_threshold + Scenario: Error 409 when RSSI from device is below allowed threshold + Given the access token identifies the user and the user home network + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + And the RSSI value from device is less than threshold + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.RSSI_BELOW_THRESHOLD" + And the response property "$.message" contains a user friendly text + + @setQos_13_qos_higher_than_allowed + Scenario: Error 409 when requested QoS is higher than the maximum QoS allowed + Given the access token identifies the user and the user home network + And the request body property "$.serviceClass" is set to a value higher than the maximum QoS allowed for the user home network + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + And the home user network has a QoS limit allowed + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.QOS_TOO_HIGH" + And the response property "$.message" contains a user friendly text + + @setQos_14_occupancy_higher_than_allowed + Scenario: Error 409 when the occupancy is above the allowed threshold + Given the access token identifies the user and the user home network + And the request body is set to a valid request body + And the user home network occupancy is above the threshold + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.OCCUPANCY_ABOVE_THRESHOLD" + And the response property "$.message" contains a user friendly text + + @setQos_15_InterfaceNotConnected + Scenario: Error 409 when the device is not connected to the required interface + Given a user with a device connected to a specific frequency band that does not match to the required interface + And the access token identifies the user and the user home network + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.NOT_CONNECTED_TO_REQUIRED_INTERFACE" + And the response property "$.message" contains a user friendly text + + @setQos_16_interface_not_supported + Scenario: Error 409 when the device does not support required interface + Given a user with a device that does not support the required interface + And the access token identifies the user and the user home network + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.NOT_SUPPORTED_REQUIRED_INTERFACE" + And the response property "$.message" contains a user friendly text + + @setQos_17_default_value_in_device + Scenario: Error 409 when the device QoS is already set to default value + Given the access token identifies the user and the user home network + And the device service class is set to "standard" + And the request body property "$.serviceClass" is set to "standard" + And the request body property "$.ipAddress" is set to the IP address of the device connected to the user home network + When the request "setQos" is sent + Then the response status code is 409 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 409 + And the response property "$.code" is "HOME_DEVICES_QOD.QOS_ALREADY_SET_TO_DEFAULT" + And the response property "$.message" contains a user friendly text + + @setQos_18_service_unavailable + Scenario: Error 503 when the router is offline + Given the access token identifies the user and the user home network + And the request body is set to a valid request body + And the router is offline + When the request "setQos" is sent + Then the response status code is 503 + And the response header "Content-Type" is "application/json" + And the response property "$.status" is 503 + And the response property "$.code" is "HOME_DEVICES_QOD.ROUTER_OFFLINE" + And the response property "$.message" contains a user friendly text diff --git a/code/Test_definitions/home_devices_qod_setQos.feature b/code/Test_definitions/home_devices_qod_setQos.feature deleted file mode 100755 index 7b6f354..0000000 --- a/code/Test_definitions/home_devices_qod_setQos.feature +++ /dev/null @@ -1,394 +0,0 @@ -# -# Revision: 0 - -Feature: Home Devices QoD 0.2.0 - setQos - - Set the desired QoS behaviour for the traffic corresponding to the user home device matching the input criteria. **QoS behaviour is determined by the service class provided by the API Client. Setting `standard` service class restores default traffic treatment for the target home device.** - -- The operation is executed for the user whose `sub` is in the access token used to call this endpoint, and for the home network also deducted from the information included in the access token. -- The target user device is identified by the internal IP address of that device in the home network. -- In case there is no device matching the input criteria, the operation returns a 404 error. - - Background: An environment where Operator's API GW exposes setQos - Given an environment with Operator's API GW - And the endpoint "home-devices-qod/v0/qos" - And the method "put" - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "192.168.1.27" - } - """ - And the header "x-correlator" is set to "[UUIDv4]" - - - # Common errors - - - @setQos_E10.01 - Scenario: Error response for expired access token - Given I want to test "setQos" - And an expired access_token - When I request "setQos" - Then the response status code is "401" - And the API returns the error code "UNAUTHENTICATED" - And the API returns a human readable error message - - - @setQos_E10.02 - Scenario: Error response for invalid access token - Given I want to test "setQos" - And an invalid access_token - When I request "setQos" - Then the response status code is "401" - And the API returns the error code "UNAUTHENTICATED" - And the API returns a human readable error message - - - @setQos_E10.03 - Scenario: Error response for no header "Authorization" - Given I want to test "setQos" - And the header "Authorization" is not sent - When I request "setQos" - Then the response status code is "401" - And the API returns the error code "UNAUTHENTICATED" - And the API returns a human readable error message - - - @setQos_E13.03 - Scenario Outline: Error response for missing required property in request body - Given I want to test "setQos" - And a valid access_token - And the request body at "" - When I request "setQos" - Then the response status code is "400" - And the API returns the error code "INVALID_ARGUMENT" - And the API returns a human readable error message - - Examples: - | request_body | - | ./data/setQos_request_data_missing_serviceClass.json | - | ./data/setQos_request_data_missing_ipAddress.json | - - - # API Specific Errors - - - @setQos_E19.01_InvalidIPAddressFormat - Scenario: Error 400 when the IP address format is not IPv4 - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "invalid_ipAddress" - } - """ - When I request "setQos" - Then the response status code is "400" - And the API returns the error code "INVALID_ARGUMENT" - And the API returns a human readable error message - - - @setQos_E19.02_InvalidServiceClass - Scenario: Error 400 when service class is none of the allowed values - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the request body is set to: - """ - { - "serviceClass": "invalid_service_class", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "400" - And the API returns the error code "INVALID_ARGUMENT" - And the API returns a human readable error message - - - @setQos_E19.03_UserHomeNetworkNotDeductedFromAccessToken - Scenario: Error 403 when user home network cannot be deducted from access token - Given I want to test "setQos" - And a valid access_token - And the access token does not contain user home network identifier - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "192.168.1.27" - } - """ - When I request "setQos" - Then the response status code is "403" - And the API returns the error code "HOME_DEVICES_QOD.INVALID_TOKEN_CONTEXT" - And the API returns a human readable error message - - - @setQos_E19.04_NoDeviceFound - Scenario: Error 404 when there is no connected device matching with input criteria - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to a non-existent IP address for any device connected to the user home network - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "404" - And the API returns the error code "HOME_DEVICES_QOD.NO_DEVICE_MATCH" - And the API returns a human readable error message - - - @setQos_E19.05_DevicesQuantityExceeded - Scenario: Error 409 when the request exceeds the maximum quantity of devices with non-default QoS behaviour - Given I want to test "setQos" for a user with the maximum quantity of devices with non-default QoS behaviour - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the variable "[CONTEXT: serviceClass]" is set to a value different from "standard" - And the request body is set to: - """ - { - "serviceClass": "[CONTEXT: serviceClass]", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.TOO_MANY_DEVICES" - And the API returns a human readable error message - - - @setQos_E19.06_RSSIBelowThreshold - Scenario: Error 409 when RSSI from device is below allowed threshold - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the RSSI value from device is less than threshold - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.RSSI_BELOW_THRESHOLD" - And the API returns a human readable error message - - - @setQos_E19.07_QoSHigherThanAllowed - Scenario: Error 409 when requested QoS is higher than the maximum QoS allowed - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the home user network has a QoS limit allowed - And the variable "[CONTEXT: serviceClass]" is set to a value higher than the maximum QoS allowed for the user home network - And the request body is set to: - """ - { - "serviceClass": "[CONTEXT: serviceClass]", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.QOS_TOO_HIGH" - And the API returns a human readable error message - - - @setQos_E19.08_OccupancyHigherThanAllowed - Scenario: Error 409 when the occupancy is above the allowed threshold - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the user home network occupancy is above the threshold - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.OCCUPANCY_ABOVE_THRESHOLD" - And the API returns a human readable error message - - - @setQos_E19.09_InterfaceNotConnected - Scenario: Error 409 when the device is not connected to the required interface - Given I want to test "setQos" for a user with a device connected to a specific frequency band - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the device is not connected to the required interface - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.NOT_CONNECTED_TO_REQUIRED_INTERFACE" - And the API returns a human readable error message - - - @setQos_E19.10_InterfaceNotSupported - Scenario: Error 409 when the device does not support required interface - Given I want to test "setQos" for a user with a device connected to a specific frequency band - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the device does not support the required interface - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.NOT_SUPPORTED_REQUIRED_INTERFACE" - And the API returns a human readable error message - - - @setQos_E19.11_DefaultValueInDevice - Scenario: Error 409 when the device QoS is already set to default value - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the device service class is set to "standard" - And the request body is set to: - """ - { - "serviceClass": "standard", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "409" - And the API returns the error code "HOME_DEVICES_QOD.QOS_ALREADY_SET_TO_DEFAULT" - And the API returns a human readable error message - - - @setQos_E19.12_ServiceUnavailable - Scenario: Error 503 when the router is offline - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the router is offline - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "503" - And the API returns the error code "HOME_DEVICES_QOD.ROUTER_OFFLINE" - And the API returns a human readable error message - - - # API Specific validations - - - @setQos_30.01_ValidateSuccessResponse - Scenario Outline: Validate success response updating service class to "" - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the variable "[CONTEXT: serviceClass]" is set to "" - And the request body is set to: - """ - { - "serviceClass": "[CONTEXT: serviceClass]", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "204" - - Examples: - | serviceClass | - | real_time_interactive | - | multimedia_streaming | - | broadcast_video | - | low_latency_data | - | high_throughput_data | - | low_priority_data | - - - @setQos_30.02_ValidateCorrelatorHeader - Scenario Outline: Validate having same x-correlator header value in response - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the header "x-correlator" is set to "" - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the request body is set to: - """ - { - "serviceClass": "real_time_interactive", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "204" - And the value of header "x-correlator" in response is the one set in request - - Examples: - | value | - | [UUIDv4] | - | [RANDOM: STR(64)] | - | string with spaces | - | "quoted string" | - - - @setQos_30.03_ValidateRestoreDevice - Scenario Outline: Validate success response updating service class to default value - Given I want to test "setQos" - And a valid access_token - And the access token identifies the user and the user home network - And the variable "[CONTEXT: ipAddress]" is set to the device IP address connected in the user home network - And the device service class was previously set to "" - And the request body is set to: - """ - { - "serviceClass": "standard", - "ipAddress": "[CONTEXT: ipAddress]" - } - """ - When I request "setQos" - Then the response status code is "204" - - Examples: - | serviceClass | - | real_time_interactive | - | multimedia_streaming | - | broadcast_video | - | low_latency_data | - | high_throughput_data | - | low_priority_data | -