From 3dd07e0279093cfd5ec055d7d5f8df4971e735b0 Mon Sep 17 00:00:00 2001 From: Matthew D'Alonzo Date: Tue, 6 Aug 2024 12:06:31 -0400 Subject: [PATCH] Update all feature files to 1.5.8 (#99) * Update uri_serializer, uri_deserializer, uuid_serializer, uuid_deserializer, uattributes_validator, uri_validator to 1.5.8 spec (uuid_validator updated in previous PR) --- .../org/eclipse/uprotocol/ProtoConverter.java | 45 +- .../steps/tck_step_implementations.py | 34 +- .../serializers/long_uri_deserializer.feature | 74 -- .../serializers/long_uri_serializer.feature | 72 -- .../micro_uri_deserializer.feature | 54 -- .../serializers/micro_uri_serializer.feature | 56 -- .../serializers/uri_deserializer.feature | 60 ++ .../tests/serializers/uri_serializer.feature | 60 ++ ...izer.feature => uuid_deserializer.feature} | 7 +- ...alizer.feature => uuid_serializer.feature} | 0 .../validators/uattributes_validator.feature | 99 ++- .../tests/validators/uri_validator.feature | 652 ++++++------------ test_manager/testData/workflow_test_data.json | 37 + 13 files changed, 471 insertions(+), 779 deletions(-) delete mode 100644 test_manager/features/tests/serializers/long_uri_deserializer.feature delete mode 100644 test_manager/features/tests/serializers/long_uri_serializer.feature delete mode 100644 test_manager/features/tests/serializers/micro_uri_deserializer.feature delete mode 100644 test_manager/features/tests/serializers/micro_uri_serializer.feature create mode 100644 test_manager/features/tests/serializers/uri_deserializer.feature create mode 100644 test_manager/features/tests/serializers/uri_serializer.feature rename test_manager/features/tests/serializers/{long_uuid_deserializer.feature => uuid_deserializer.feature} (78%) rename test_manager/features/tests/serializers/{long_uuid_serializer.feature => uuid_serializer.feature} (100%) diff --git a/test_agent/java/src/main/java/org/eclipse/uprotocol/ProtoConverter.java b/test_agent/java/src/main/java/org/eclipse/uprotocol/ProtoConverter.java index a87c4e19..0034c3b9 100644 --- a/test_agent/java/src/main/java/org/eclipse/uprotocol/ProtoConverter.java +++ b/test_agent/java/src/main/java/org/eclipse/uprotocol/ProtoConverter.java @@ -21,16 +21,20 @@ package org.eclipse.uprotocol; +import com.google.gson.Gson; import com.google.protobuf.ByteString; import com.google.protobuf.Descriptors; import com.google.protobuf.Message; import com.google.protobuf.Descriptors.EnumValueDescriptor; import com.google.protobuf.Descriptors.FieldDescriptor; +import com.google.protobuf.InvalidProtocolBufferException; + import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.logging.Logger; +import com.google.protobuf.util.JsonFormat; import org.json.JSONArray; import org.json.JSONObject; @@ -152,40 +156,17 @@ public static JSONObject convertMessageToJSON(Message message) { } public static Map convertMessageToMap(Message message) { - Map result = new HashMap<>(); + Map map; + JsonFormat.Printer printer = JsonFormat.printer().includingDefaultValueFields().preservingProtoFieldNames(); + Gson gson = new Gson(); - List allFields = message.getDescriptorForType().getFields(); - for (FieldDescriptor field : allFields) { - String fieldName = field.getName(); - Object defaultOrSetValue = message.getField(field); - Object value = getattr(message, field, defaultOrSetValue); - if (value instanceof EnumValueDescriptor) { - value = ((EnumValueDescriptor) value).getNumber(); - } - - if (value instanceof ByteString) { - value = ((ByteString) value).toStringUtf8(); - } - - if (value instanceof Message) { - result.put(fieldName, convertMessageToMap((Message) value)); - } else if (field.isRepeated()) { - List repeated = new ArrayList<>(); - for (Object subMsg : (List) value) { - if (subMsg instanceof Message) { - repeated.add(convertMessageToMap((Message) subMsg)); - } else { - repeated.add(subMsg); - } - } - result.put(fieldName, repeated); - - } else if (field.isRequired() || field.isOptional()) { - result.put(fieldName, value); - } + try { + String jsonString = printer.print(message); + map = gson.fromJson(jsonString, Map.class); + } catch (InvalidProtocolBufferException ex) { + map = new HashMap<>(); } - - return result; + return map; } public static Object getattr(Message message, FieldDescriptor field, Object defaultValue) { diff --git a/test_manager/features/steps/tck_step_implementations.py b/test_manager/features/steps/tck_step_implementations.py index 5d7685cf..631d3823 100644 --- a/test_manager/features/steps/tck_step_implementations.py +++ b/test_manager/features/steps/tck_step_implementations.py @@ -16,6 +16,7 @@ """ import base64 +import binascii import codecs import json import os @@ -169,7 +170,11 @@ def create_sdk_data(context, sdk_name: str, command: str): sdk_name, "initialize_transport", context.ue_tracker[int(ue_number) - 1][2] ) context.logger.info(f"Response Json {command} -> {response_json}") - assert_that(int(response_json["data"]["code"]), equal_to(UCode.OK)) + + try: + assert_that(int(response_json["data"]["code"]), equal_to(UCode.OK)) + except ValueError: + assert_that(response_json["data"]["code"], equal_to("OK")) context.logger.info(f"{sdk_name} connected to Test Manager...") @@ -319,7 +324,7 @@ def verify_uuid_received_properties(context): if len(expected_value) > 0: if field in int_type_fields: expected_value: int = int(expected_value) - assert_that(deserialized_uuid[field], equal_to(expected_value)) + assert_that(int(deserialized_uuid[field]), equal_to(expected_value)) except AssertionError as ae: raise AssertionError(f"Assertion error. {ae}") @@ -358,8 +363,12 @@ def send_command_request(context, command: str): def receive_status(context, field_name: str, expected_value: str): try: actual_value: str = context.response_data[field_name] + expected_value_string = expected_value expected_value: int = getattr(UCode, expected_value) - assert_that(expected_value, equal_to(int(actual_value))) + try: + assert_that(expected_value, equal_to(int(actual_value))) + except ValueError: + assert_that(expected_value_string, equal_to(actual_value)) except AssertionError: raise AssertionError( f"Assertion error. Expected is {expected_value} but " f"received {context.response_data[field_name]}" @@ -402,11 +411,20 @@ def receive_value_as_bytes(context, sender_sdk_name: str, field_name: str, expec decoded_string = "type.googleapis.com/" + val.split(".com/")[1] rec_field_value = bytes(decoded_string, "utf-8") else: - rec_field_value: bytes = val.encode("utf-8") - - assert ( - rec_field_value.split(b"googleapis.com/")[1] == expected_value.encode("utf-8").split(b"googleapis.com/")[1] - ) + try: + rec_field_value: bytes = val.encode("utf-8") + except Exception as e: + context.logger.info(f"Exception: {e}") + try: + data_bytes = base64.b64decode(val) + assert ( + data_bytes.split(b"googleapis.com/")[1] == expected_value.encode("utf-8").split(b"googleapis.com/")[1] + ) + except binascii.Error: + assert ( + rec_field_value.split(b"googleapis.com/")[1] + == expected_value.encode("utf-8").split(b"googleapis.com/")[1] + ) except AssertionError: raise AssertionError( diff --git a/test_manager/features/tests/serializers/long_uri_deserializer.feature b/test_manager/features/tests/serializers/long_uri_deserializer.feature deleted file mode 100644 index bf720f90..00000000 --- a/test_manager/features/tests/serializers/long_uri_deserializer.feature +++ /dev/null @@ -1,74 +0,0 @@ -# ------------------------------------------------------------------------- -# -# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to -# the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http: *www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# SPDX-FileType: SOURCE -# SPDX-License-Identifier: Apache-2.0 -# -# ------------------------------------------------------------------------- - -Feature: Local and Remote URI de-serialization - - Scenario Outline: Testing the local uri deserializer - Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "" - - Then the deserialized uri received should have the following properties: - | Field | Value | - | entity.name | | - | entity.version_major | | - | resource.name | | - | resource.instance | | - | resource.message | | - - Examples: - | entity_name | resource_name | resource_instance | resource_message | entity_version_major | serialized_uri | - | neelam | rpc | test | | 0 | /neelam//rpc.test | - | neelam | | | | 0 | /neelam | - | neelam | | | | 1 | /neelam/1 | - | neelam | test | | | 0 | /neelam//test | - | neelam | test | | | 1 | /neelam/1/test | - | neelam | test | front | | 0 | /neelam//test.front | - | neelam | test | front | | 1 | /neelam/1/test.front | - | neelam | test | front | Test | 0 | /neelam//test.front#Test | - | neelam | test | front | Test | 1 | /neelam/1/test.front#Test | - - - Scenario Outline: Testing the remote uri deserializer - Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "" - Then the deserialized uri received should have the following properties: - | Field | Value | - | authority.name | | - | entity.name | | - | entity.version_major | | - | resource.name | | - | resource.instance | | - | resource.message | | - - Examples: - | authority_name | entity_name | resource_name | resource_instance | resource_message | entity_version_major | serialized_uri | - | vcu.my_car_vin | neelam | | | | 0 | //vcu.my_car_vin/neelam | - | vcu.my_car_vin | neelam | | | | 1 | //vcu.my_car_vin/neelam/1 | - | vcu.my_car_vin | neelam | test | | | 1 | //vcu.my_car_vin/neelam/1/test | - | vcu.my_car_vin | neelam | test | | | 0 | //vcu.my_car_vin/neelam//test | - | vcu.my_car_vin | neelam | test | front | | 1 | //vcu.my_car_vin/neelam/1/test.front | - | vcu.my_car_vin | neelam | test | front | | 0 | //vcu.my_car_vin/neelam//test.front | - | vcu.my_car_vin | neelam | test | front | Test | 1 | //vcu.my_car_vin/neelam/1/test.front#Test | - | vcu.my_car_vin | neelam | test | front | Test | 0 | //vcu.my_car_vin/neelam//test.front#Test | - | vcu.my_car_vin | petapp | rpc | response | | 0 | //vcu.my_car_vin/petapp//rpc.response | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/long_uri_serializer.feature b/test_manager/features/tests/serializers/long_uri_serializer.feature deleted file mode 100644 index e4018b0c..00000000 --- a/test_manager/features/tests/serializers/long_uri_serializer.feature +++ /dev/null @@ -1,72 +0,0 @@ -# ------------------------------------------------------------------------- -# -# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to -# the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http: *www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# SPDX-FileType: SOURCE -# SPDX-License-Identifier: Apache-2.0 -# -# ------------------------------------------------------------------------- - -Feature: Local and Remote URI serialization - - Scenario Outline: Testing the local uri serializer - Given "uE1" creates data for "uri_serialize" - And sets "entity.name" to "" - And sets "entity.version_major" to "" - And sets "resource.name" to "" - And sets "resource.instance" to "" - And sets "resource.message" to "" - - When sends "uri_serialize" request - Then the serialized uri received is "" - - Examples: - | entity_name | resource_name | resource_instance | resource_message | entity_version_major | expected_uri | - | neelam | rpc | test | | 0 | /neelam//rpc.test | - | neelam | | | | 0 | /neelam | - | neelam | | | | 1 | /neelam/1 | - | neelam | test | | | 0 | /neelam//test | - | neelam | test | | | 1 | /neelam/1/test | - | neelam | test | front | | 0 | /neelam//test.front | - | neelam | test | front | | 1 | /neelam/1/test.front | - | neelam | test | front | Test | 0 | /neelam//test.front#Test | - | neelam | test | front | Test | 1 | /neelam/1/test.front#Test | - - Scenario Outline: Testing the remote uri serializer - Given "uE1" creates data for "uri_serialize" - And sets "authority.name" to "" - And sets "entity.name" to "" - And sets "entity.version_major" to "" - And sets "resource.name" to "" - And sets "resource.instance" to "" - And sets "resource.message" to "" - - When sends "uri_serialize" request - Then the serialized uri received is "" - - Examples: - | authority_name | entity_name | resource_name | resource_instance | resource_message | entity_version_major | expected_uri | - | vcu.my_car_vin | neelam | | | | 0 | //vcu.my_car_vin/neelam | - | vcu.my_car_vin | neelam | | | | 1 | //vcu.my_car_vin/neelam/1 | - | vcu.my_car_vin | neelam | test | | | 1 | //vcu.my_car_vin/neelam/1/test | - | vcu.my_car_vin | neelam | test | | | 0 | //vcu.my_car_vin/neelam//test | - | vcu.my_car_vin | neelam | test | front | | 1 | //vcu.my_car_vin/neelam/1/test.front | - | vcu.my_car_vin | neelam | test | front | | 0 | //vcu.my_car_vin/neelam//test.front | - | vcu.my_car_vin | neelam | test | front | Test | 1 | //vcu.my_car_vin/neelam/1/test.front#Test | - | vcu.my_car_vin | neelam | test | front | Test | 0 | //vcu.my_car_vin/neelam//test.front#Test | - | vcu.my_car_vin | petapp | rpc | response | | 0 | //vcu.my_car_vin/petapp//rpc.response | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/micro_uri_deserializer.feature b/test_manager/features/tests/serializers/micro_uri_deserializer.feature deleted file mode 100644 index 596a23c3..00000000 --- a/test_manager/features/tests/serializers/micro_uri_deserializer.feature +++ /dev/null @@ -1,54 +0,0 @@ -# ------------------------------------------------------------------------- -# -# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to -# the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http: *www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# SPDX-FileType: SOURCE -# SPDX-License-Identifier: Apache-2.0 -# -# ------------------------------------------------------------------------- - -Feature: Local and Remote URI de-serialization - - Scenario Outline: Testing the local uri micro deserializer - Given "uE1" creates data for "micro_deserialize_uri" - When sends a "micro_deserialize_uri" request with micro serialized input "" - - Then the deserialized uri received should have the following properties: - | Field | Value | - | authority.id | | - | authority.name | | - | entity.id | | - | entity.name | | - | entity.version_major | | - | resource.id | | - | resource.name | | - | resource.instance | | - | resource.message | | - Examples: - | authority_id | authority_name | entity_id | entity_name | entity_version_major | resource_id | resource_name | resource_instance | resource_message | micro_serialized_uri_as_base64_str | - | | | 0 | | 0 | 0 | | | | | - | | | 1 | | 0 | 1 | rpc | | | AQAAAQABAAA= | - | | | 1 | | 0 | 1 | rpc | | | AQAAAQABAAA= | - | | | 1 | | 1 | 1 | rpc | | | AQAAAQABAQA= | - | | | 1 | | 0 | 1 | rpc | | | AQAAAQABAAA= | - | | | 2 | | 1 | 3 | rpc | | | AQAAAwACAQA= | - | | | 0 | | 0 | 0 | rpc | response | | AQAAAAAAAAA= | - | | | 100 | | 1 | 300 | rpc | | | AQABLABkAQA= | - | | | 255 | | 0 | 255 | rpc | | | AQAA/wD/AAA= | - | | | 256 | | 1 | 256 | rpc | | | AQABAAEAAQA= | - | unique id 1234 | | 29999 | | 254 | 99 | rpc | | | AQMAY3Uv/gAOdW5pcXVlIGlkIDEyMzQ= | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/micro_uri_serializer.feature b/test_manager/features/tests/serializers/micro_uri_serializer.feature deleted file mode 100644 index ed773332..00000000 --- a/test_manager/features/tests/serializers/micro_uri_serializer.feature +++ /dev/null @@ -1,56 +0,0 @@ -# ------------------------------------------------------------------------- -# -# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to -# the Eclipse Foundation -# -# See the NOTICE file(s) distributed with this work for additional -# information regarding copyright ownership. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http: *www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# SPDX-FileType: SOURCE -# SPDX-License-Identifier: Apache-2.0 -# -# ------------------------------------------------------------------------- - -Feature: UUri Micro Serialization - - Scenario Outline: Testing uuri micro serializer - Given "uE1" creates data for "micro_serialize_uri" - And sets "authority.id" to "" - And sets "authority.name" to "" - And sets "entity.id" to "" - And sets "entity.name" to "" - And sets "entity.version_major" to "" - And sets "resource.id" to "" - And sets "resource.name" to "" - And sets "resource.instance" to "" - And sets "resource.message" to "" - - When sends "micro_serialize_uri" request - Then receives micro serialized uri "" - - Examples: - | authority_id | authority_name | entity_id | entity_name | resource_id | resource_name | resource_instance | resource_message | entity_version_major | expected_bytes_as_base64_str | - | | | | neelam | | rpc | test | | 0 | | - | | | 1 | neelam | | | | | 0 | | - | | | | neelam | 1 | | | | 1 | | - | | | 1 | neelam | 1 | test | | | 0 | AQAAAQABAAA= | - | | | 1 | neelam | 1 | | | | 0 | AQAAAQABAAA= | - | | | 1 | neelam | 1 | | | | 1 | AQAAAQABAQA= | - | | | 1 | neelam | 1 | rpc | test | | 0 | AQAAAQABAAA= | - | | | 2 | neelam | 3 | test | | | 1 | AQAAAwACAQA= | - | | | 0 | neelam | 0 | test | front | | 0 | AQAAAAAAAAA= | - | | | 100 | neelam | 300 | test | front | | 1 | AQABLABkAQA= | - | | | 255 | neelam | 255 | test | front | Test | 0 | AQAA/wD/AAA= | - | | | 256 | neelam | 256 | test | front | Test | 1 | AQABAAEAAQA= | - |BYTES:unique id 1234| vcu.my_car_vin | 29999 | | 99 | | | | 254 | AQMAY3Uv/gAOdW5pcXVlIGlkIDEyMzQ= | diff --git a/test_manager/features/tests/serializers/uri_deserializer.feature b/test_manager/features/tests/serializers/uri_deserializer.feature new file mode 100644 index 00000000..10bc939a --- /dev/null +++ b/test_manager/features/tests/serializers/uri_deserializer.feature @@ -0,0 +1,60 @@ +# ------------------------------------------------------------------------- +# +# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to +# the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http: *www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# SPDX-FileType: SOURCE +# SPDX-License-Identifier: Apache-2.0 +# +# ------------------------------------------------------------------------- + +Feature: Local and Remote URI de-serialization + + Scenario Outline: Testing the local uri deserializer + Given "uE1" creates data for "uri_deserialize" + When sends a "uri_deserialize" request with serialized input "" + + Then the deserialized uri received should have the following properties: + | Field | Value | + | ue_id | | + | ue_version_major | | + | resource_id | | + + Examples: + | ue_id | resource_id | ue_version_major | serialized_uri | + | 9029 | 0 | 2 | /2345/2 | + | 9029 | 0 | 1 | /2345/1 | + | 9029 | 4660 | 2 | /2345/2/1234 | + | 9029 | 4660 | 1 | /2345/1/1234 | + + + Scenario Outline: Testing the remote uri deserializer + Given "uE1" creates data for "uri_deserialize" + When sends a "uri_deserialize" request with serialized input "" + Then the deserialized uri received should have the following properties: + | Field | Value | + | authority_name | | + | ue_id | | + | ue_version_major | | + | resource_id | | + + Examples: + | authority_name | ue_id | resource_id | ue_version_major | serialized_uri | + | vcu.my_car_vin | 1193046 | 0 | 2 | //vcu.my_car_vin/123456/2 | + | vcu.my_car_vin | 1193046 | 0 | 1 | //vcu.my_car_vin/123456/1 | + | vcu.my_car_vin | 1193046 | 9029 | 1 | //vcu.my_car_vin/123456/1/2345 | + | vcu.my_car_vin | 1193046 | 9029 | 2 | //vcu.my_car_vin/123456/2/2345 | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/uri_serializer.feature b/test_manager/features/tests/serializers/uri_serializer.feature new file mode 100644 index 00000000..d62162d1 --- /dev/null +++ b/test_manager/features/tests/serializers/uri_serializer.feature @@ -0,0 +1,60 @@ +# ------------------------------------------------------------------------- +# +# SPDX-FileCopyrightText: Copyright (c) 2024 Contributors to +# the Eclipse Foundation +# +# See the NOTICE file(s) distributed with this work for additional +# information regarding copyright ownership. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http: *www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# SPDX-FileType: SOURCE +# SPDX-License-Identifier: Apache-2.0 +# +# ------------------------------------------------------------------------- + +Feature: Local and Remote URI serialization + + Scenario Outline: Testing the local uri serializer + Given "uE1" creates data for "uri_serialize" + And sets "ue_id" to "" + And sets "ue_version_major" to "" + And sets "resource_id" to "" + + When sends "uri_serialize" request + Then the serialized uri received is "" + + Examples: + | ue_id | resource_id | version_major | expected_uri | + | 2345 | 1234 | 2 | /929/2/4d2 | + | 2345 | | | /929/0/0 | + | 2345 | | 2 | /929/2/0 | + | 2345 | | 1 | /929/1/0 | + | 2345 | 1234 | 1 | /929/1/4d2 | + + Scenario Outline: Testing the remote uri serializer + Given "uE1" creates data for "uri_serialize" + And sets "authority_name" to "" + And sets "ue_id" to "" + And sets "ue_version_major" to "" + And sets "resource_id" to "" + + When sends "uri_serialize" request + Then the serialized uri received is "" + + Examples: + | authority_name | ue_id | resource_id | version_major | expected_uri | + | vcu.my_car_vin | 1235 | | 2 | //vcu.my_car_vin/4d3/2/0 | + | vcu.my_car_vin | 2345 | | 1 | //vcu.my_car_vin/929/1/0 | + | vcu.my_car_vin | 2345 | | | //vcu.my_car_vin/929/0/0 | + | vcu.my_car_vin | 2345 | 1234 | 1 | //vcu.my_car_vin/929/1/4d2 | + | vcu.my_car_vin | 2345 | 1234 | 2 | //vcu.my_car_vin/929/2/4d2 | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/long_uuid_deserializer.feature b/test_manager/features/tests/serializers/uuid_deserializer.feature similarity index 78% rename from test_manager/features/tests/serializers/long_uuid_deserializer.feature rename to test_manager/features/tests/serializers/uuid_deserializer.feature index d78c2c81..7fe9cd55 100644 --- a/test_manager/features/tests/serializers/long_uuid_deserializer.feature +++ b/test_manager/features/tests/serializers/uuid_deserializer.feature @@ -25,7 +25,7 @@ Feature: UUID de-serialization Scenario Outline: Testing the long uuid deserializer - Given "" creates data for "uuid_deserialize" + Given "uE1" creates data for "uuid_deserialize" When sends a "uuid_deserialize" request with serialized input "" Then the deserialized uuid received should have the following properties: | Field | Value | @@ -33,6 +33,5 @@ Feature: UUID de-serialization | msb | | Examples: - | uE1 | lsb | msb | serialized_uuid | - | python | 11155833020022798372 | 112128268635242497 | 018e5c10-f548-8001-9ad1-7b068c083824 | - | java | -7290911053686753244 | 112128268635242497 | 018e5c10-f548-8001-9ad1-7b068c083824 | + | lsb | msb | serialized_uuid | + | 11155833020022798372 | 112128268635242497 | 018e5c10-f548-8001-9ad1-7b068c083824 | \ No newline at end of file diff --git a/test_manager/features/tests/serializers/long_uuid_serializer.feature b/test_manager/features/tests/serializers/uuid_serializer.feature similarity index 100% rename from test_manager/features/tests/serializers/long_uuid_serializer.feature rename to test_manager/features/tests/serializers/uuid_serializer.feature diff --git a/test_manager/features/tests/validators/uattributes_validator.feature b/test_manager/features/tests/validators/uattributes_validator.feature index 49633cd2..0ad46caf 100644 --- a/test_manager/features/tests/validators/uattributes_validator.feature +++ b/test_manager/features/tests/validators/uattributes_validator.feature @@ -28,16 +28,14 @@ Feature: UAttributes Validation Given "uE1" creates data for "uattributes_validate" And sets "validation_method" to "" And sets "validation_type" to "" - And sets "attributes.source.authority.name" to "" - And sets "attributes.source.entity.name" to "" - And sets "attributes.source.entity.version_major" to "" - And sets "attributes.source.resource.name" to "" - And sets "attributes.sink.authority.name" to "" - And sets "attributes.sink.entity.name" to "" - And sets "attributes.sink.entity.version_major" to "" - And sets "attributes.sink.resource.name" to "" - And sets "attributes.sink.resource.instance" to "" - And sets "attributes.sink.resource.id" to "" + And sets "attributes.source.authority_name" to "" + And sets "attributes.source.ue_id" to "" + And sets "attributes.source.ue_version_major" to "" + And sets "attributes.source.resource_id" to "" + And sets "attributes.sink.authority_name" to "" + And sets "attributes.sink.ue_id" to "" + And sets "attributes.sink.ue_version_major" to "" + And sets "attributes.sink.resource_id" to "" And sets "attributes.priority" to "" And sets "attributes.type" to "" And sets "id" to "" @@ -48,46 +46,45 @@ Feature: UAttributes Validation When sends "uattributes_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | val_type | val_method | source_authority_name | source_entity_name| source_version_major | source_resource_name | sink_authority_name | sink_entity_name | sink_version_major | sink_resource_name | sink_resource_instance | sink_resource_id | priority | message_type | id_type | token | ttl | permission_level | comm_status | reqid_type | expected_status | expected_message | - | get_validator | | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | | | | | | | | UAttributesValidator.Publish | - | get_validator | | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | | | 1000 | | | | | UAttributesValidator.Request | - | get_validator | | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | | | | | | | | UAttributesValidator.Response | - | get_validator | | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_NOTIFICATION | | | | | | | | UAttributesValidator.Notification | - | get_validator | | | | | | | | | | | | | | | | | | | | | UAttributesValidator.Publish | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | True | | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1000 | 2 | 3 | | True | | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | uprotocol | False | Wrong Attribute Type [UMESSAGE_TYPE_RESPONSE] | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | Uri is empty. | - | | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | | | | True | | - | | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | 2 | 3 | uprotocol | True | | - | | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | 1000 | | | uprotocol | False | Wrong Attribute Type [UMESSAGE_TYPE_RESPONSE] | - | | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | | | | False | Uri is empty. | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | uprotocol | True | | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | 2 | 3 | uprotocol | True | | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | | False | Wrong Attribute Type [UMESSAGE_TYPE_NOTIFICATION],Missing correlationId | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | | False | Missing Sink,Missing correlationId | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | | False | Missing correlationId | - | is_expired | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | | - | is_expired | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 0 | | | | False | | - | is_expired | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 10000| | | | False | | - | is_expired | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1 | | | | True | | - | validate_ttl | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 100 | | | | True | | - | validate_sink | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | Uri is empty. | - | validate_sink | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | True | | - | validate_req_id | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | uprotocol | True | | - | validate_type | notification_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | True | | - | validate_sink | notification_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | True | | - | validate_sink | notification_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | False | Missing Sink | - | validate_permission_level | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | 3 | | uprotocol | True | | - | validate_permission_level | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | default | | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | 0 | | uprotocol | False | Invalid Permission Level | - | | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | Wrong Attribute Type [UMESSAGE_TYPE_PUBLISH],Missing TTL,Missing Sink | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | 2 | 3 | uprotocol | False | Wrong Attribute Type [UMESSAGE_TYPE_REQUEST] | - | | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1000 | 2 | 3 | | False | Wrong Attribute Type [UMESSAGE_TYPE_PUBLISH],Missing Sink,Missing correlationId | - | | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | uprotocol | null | | | | | True | | - | validate_id | publish_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | | | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | | | | | | | False | Missing id | - | validate_id | notification_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_NOTIFICATION | | | | | | | False | Missing id | - | validate_id | request_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_REQUEST | | | 1000 | | | | False | Missing id | - | validate_id | response_validator | vcu.someVin.veh.com | petapp.com | 1 | rpc | vcu.someVin.veh.com | petapp.com | 1 | rpc | response | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_RESPONSE | | | | | | uprotocol | False | Missing id | \ No newline at end of file + | val_type | val_method | source_authority_name | source_ue_id | source_version_major | source_resource_id | sink_authority_name | sink_ue_id | sink_version_major | sink_resource_id | priority | message_type | id_type | token | ttl | permission_level | comm_status | reqid_type | expected_status | + | get_validator | | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | | | | | | | | + | get_validator | | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | | | 1000 | | | | | + | get_validator | | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | | | | | | | | + | get_validator | | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_NOTIFICATION | | | | | | | | + | get_validator | | | | | | | | | | | | | | | | | | | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS1 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | True | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS1 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1000 | 2 | 3 | | True | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS1 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | uprotocol | False | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS1 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | + | | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 1234 | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | | | | True | + | | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 1234 | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | 2 | 3 | | True | + | | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | 1000 | | | uprotocol | False | + | | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | | | | False | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | uprotocol | True | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | 2 | 3 | uprotocol | True | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | | False | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | | False | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS4 | UMESSAGE_TYPE_RESPONSE | uprotocol | | | | | | False | + | is_expired | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | + | is_expired | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 0 | | | | False | + | is_expired | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 10000| | | | False | + | is_expired | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1 | | | | True | + | validate_ttl | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 100 | | | | True | + | validate_sink | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | + | validate_sink | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | True | + | validate_req_id | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | True | + | validate_type | notification_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | True | + | validate_sink | notification_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | True | + | validate_sink | notification_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_NOTIFICATION | uprotocol | | | | | uprotocol | False | + | validate_permission_level | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | 3 | | uprotocol | True | + | validate_permission_level | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | default | | | | UPRIORITY_CS0 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | 0 | | uprotocol | False | + | | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS4 | UMESSAGE_TYPE_PUBLISH | uprotocol | | | | | | False | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_REQUEST | uprotocol | | 1000 | 2 | 3 | uprotocol | False | + | | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | uprotocol | | 1000 | 2 | 3 | | False | + | | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | uprotocol | null | | | | | True | + | validate_id | publish_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | | | | | UPRIORITY_CS6 | UMESSAGE_TYPE_PUBLISH | | | | | | | False | + | validate_id | notification_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_NOTIFICATION | | | | | | | False | + | validate_id | request_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_REQUEST | | | 1000 | | | | False | + | validate_id | response_validator | vcu.someVin.veh.com | 42000 | 1 | 1 | vcu.someVin.veh.com | 1234 | 1 | 0 | UPRIORITY_CS6 | UMESSAGE_TYPE_RESPONSE | | | | | | uprotocol | False | \ No newline at end of file diff --git a/test_manager/features/tests/validators/uri_validator.feature b/test_manager/features/tests/validators/uri_validator.feature index 8606ebde..286b3af0 100644 --- a/test_manager/features/tests/validators/uri_validator.feature +++ b/test_manager/features/tests/validators/uri_validator.feature @@ -23,24 +23,72 @@ # ------------------------------------------------------------------------- Feature: URI Validation - Scenario Outline: UUri validate completely filled UUri + Scenario Outline: UUri Validation for an empty UUri + Given "uE1" creates data for "uri_deserialize" + + When sends a "uri_deserialize" request with serialized input "" + + Then receives json with following set fields: + | protobuf_field_names | protobuf_field_values | protobuf_field_type | + | authority_name | | str | + | ue_id | 0 | int | + | ue_version_major | 0 | int | + | resource_id | 0 | int | + + When "uE2" creates data for "uri_validate" + And sets "validation_type" to "" + And sets "uuri" to previous response data + And sends "uri_validate" request + + Then receives validation result as "" + + Examples: + | validation_type | bool_result | + | is_empty | True | + | is_rpc_method | False | + | is_rpc_response | False | + | is_default_resource_id | False | + | is_topic | False | + + + Scenario Outline: UUri validation for a UUri with only authority_name + Given "uE1" creates data for "uri_deserialize" + + When sends a "uri_deserialize" request with serialized input "//hi" + + Then receives json with following set fields: + | protobuf_field_names | protobuf_field_values | protobuf_field_type | + | authority_name | hi | str | + | ue_id | 0 | int | + | ue_version_major | 0 | int | + | resource_id | 0 | int | + + When "uE2" creates data for "uri_validate" + And sets "validation_type" to "" + And sets "uuri" to previous response data + And sends "uri_validate" request + + Then receives validation result as "" + + Examples: + | validation_type | bool_result | + | is_empty | False | + | is_rpc_method | False | + | is_rpc_response | True | + | is_default_resource_id | True | + | is_topic | False | + + Scenario Outline: UUri validation for a UUri with resource_id less than min_topic_id Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//authority_name_nameName/name of entity/64/resource name.resource instance#message of resource" + When sends a "uri_deserialize" request with serialized input "//hi/1/1/7FFF" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.id | | bytes | - | authority.name | authority_name_nameName | str | - | entity.id | 0 | int | - | entity.name | name of entity | str | - | entity.version_major | 64 | int | - | entity.version_minor | 0 | int | - | resource.name | resource name | str | - | resource.instance | resource instance | str | - | resource.message | message of resource | str | - | resource.id | 0 | int | + | authority_name | hi | str | + | ue_id | 1 | int | + | ue_version_major | 1 | int | + | resource_id | 32767 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" @@ -48,39 +96,22 @@ Feature: URI Validation And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | True | | - | is_micro_form | True | | - | is_long_form | True | | - - Scenario Outline: UUri validate completely filled UUri 2 + | validation_type | bool_result | + | is_rpc_method | True | + + Scenario Outline: UUri validation for a UUri with resource_id greater than min_topic_id Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//uAuthName/entityName/1/resrcName.instance#Message" + When sends a "uri_deserialize" request with serialized input "//hi/1/1/8000" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.id | | bytes | - | authority.name | uAuthName | str | - | entity.id | 0 | int | - | entity.name | entityName | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | resrcName | str | - | resource.instance | instance | str | - | resource.message | Message | str | - | resource.id | 0 | int | + | authority_name | hi | str | + | ue_id | 1 | int | + | ue_version_major | 1 | int | + | resource_id | 32768 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" @@ -88,40 +119,22 @@ Feature: URI Validation And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | True | | - | is_micro_form | True | | - | is_long_form | True | | - - Scenario Outline: UUri validate completely filled UUri, but no uAuthority + | validation_type | bool_result | + | is_rpc_method | False | + + Scenario Outline: UUri validation for a UUri with resource_id equal to rpc_response_id Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/entityName/1/resrcName.instance#Message" + When sends a "uri_deserialize" request with serialized input "//hi/1/1/8000" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.id | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | entityName | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | resrcName | str | - | resource.instance | instance | str | - | resource.message | Message | str | - | resource.id | 0 | int | + | authority_name | hi | str | + | ue_id | 1 | int | + | ue_version_major | 1 | int | + | resource_id | 32768 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" @@ -129,560 +142,343 @@ Feature: URI Validation And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate completely filled UUri, but no UEntity + | validation_type | bool_result | + | is_rpc_method | False | + + Scenario Outline: UUri matches when equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//uAuthName///resrcName.instance#Message" + When sends a "uri_deserialize" request with serialized input "//authority/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.id | | bytes | - | authority.name | uAuthName | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | resrcName | str | - | resource.instance | instance | str | - | resource.message | Message | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - - Scenario Outline: UUri validate completely filled UUri, but no uResource + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri matches when wildcard authority equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//uAuthName/entityName/1" + When sends a "uri_deserialize" request with serialized input "//*/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.id | | bytes | - | authority.name | uAuthName | str | - | entity.id | 0 | int | - | entity.name | entityName | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | * | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - + | validation_type | bool_result | + | matches | True | - Scenario Outline: UUri validate purely remote UUri + Scenario Outline: UUri matches when wildcard authority equal to /A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "" + When sends a "uri_deserialize" request with serialized input "//*/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | * | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate with random string + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri matches when wildcard entity_id equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "random string" + When sends a "uri_deserialize" request with serialized input "//authority/FFFF/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 65535 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate just entity name to validate correctly + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri matches when matching entity instance equal to //authority/2A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/neelam" + When sends a "uri_deserialize" request with serialized input "//authority/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | neelam | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/2A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate filled UAuthority and partially filled UEntity, but no UEntity name + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri matches when wildcard entity version equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//VCU.myvin//1" + When sends a "uri_deserialize" request with serialized input "//authority/A410/FF/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | VCU.myvin | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 255 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate just UEntity name and version major + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri matches when wildcard resource id equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/hartley/1000" + When sends a "uri_deserialize" request with serialized input "//authority/A410/3/FFFF" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | hartley | str | - | entity.version_major | 1000 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 65535 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Invalid RPC method uri. Uri should be the method to be called, or method from response. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate random string 2 + | validation_type | bool_result | + | matches | True | + + Scenario Outline: UUri doesn't match when uppercase authorty not equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input ":" + When sends a "uri_deserialize" request with serialized input "//Authority/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | Authority | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario Outline: UUri validate random string 3 + | validation_type | bool_result | + | matches | False | + + Scenario Outline: UUri doesn't match when local pattern match isn't equal to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "///" + When sends a "uri_deserialize" request with serialized input "/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | False | Uri is missing uSoftware Entity name. | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Uri is missing uSoftware Entity name. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | False | Uri is missing uSoftware Entity name. | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - # Tests UriValidator.validate_rpc_method() - Scenario Outline: UUri validate rpc_method filled entity name, resource name and instance + | validation_type | bool_result | + | matches | False | + + Scenario Outline: UUri doesn't match when different authority to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/neelam//rpc.echo" + When sends a "uri_deserialize" request with serialized input "//other/A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | neelam | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | rpc | str | - | resource.instance | echo | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | other | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | True | | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - - Scenario Outline: UUri validate rpc_method as rpc methods 2 + | validation_type | bool_result | + | matches | False | + + Scenario Outline: UUri doesn't match when different entity id to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "//bo.cloud/petapp/1/rpc.response" + When sends a "uri_deserialize" request with serialized input "//authority/45/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | bo.cloud | str | - | entity.id | 0 | int | - | entity.name | petapp | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | rpc | str | - | resource.instance | response | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 69 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | True | | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | True | | - | is_micro_form | True | | - | is_long_form | True | | + | validation_type | bool_result | + | matches | False | - - Scenario Outline: UUri validate rpc_method as rpc methods 3 + Scenario Outline: UUri doesn't match when different entity instance to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/petapp//rpc.response" + When sends a "uri_deserialize" request with serialized input "//authority/30A410/3/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | petapp | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | rpc | str | - | resource.instance | response | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 3187728 | int | + | ue_version_major | 3 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request Then receives validation result as "" - And receives validation message as "" Examples: - | validation_type | bool_result | message_result | - | uri | True | | - # False for now bc default message="" is set, but should be True - | rpc_response | False | Invalid RPC response type. | - # rpc_method: resource.name == "rpc", resource.instance != "" or id < 32768 - | rpc_method | True | | - | is_empty | False | | - - # is_resolved == is long formed (filled names in uauth, enti, & resrc) and micro formed (existing ids in uauth, enti, & resrc ) - | is_resolved | False | | - | is_micro_form | True | | - | is_long_form | False | | - - Scenario: UUri validate rpc_method, even tho resource.instance == "", resource id < 32768 so still rpc_method + | validation_type | bool_result | + | matches | False | + + Scenario Outline: UUri doesn't match when different entity version to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "/petapp/1/rpc" + When sends a "uri_deserialize" request with serialized input "//authority/A410/1/1003" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | petapp | str | - | entity.version_major | 1 | int | - | entity.version_minor | 0 | int | - | resource.name | rpc | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 1 | int | + | resource_id | 4099 | int | When "uE2" creates data for "uri_validate" - And sets "validation_type" to "rpc_method" + And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request - Then receives validation result as "True" - And receives validation message as "" + Then receives validation result as "" + Examples: + | validation_type | bool_result | + | matches | False | - # Below is False, BUT should be TRUE! fix until new UUri signature is implemented by June 10ish, 2024 - Scenario: UUri validate is_rpc_response given inputs + Scenario Outline: UUri doesn't match when different resource id to //authority/A410/3/1003 Given "uE1" creates data for "uri_deserialize" - When sends a "uri_deserialize" request with serialized input "" + When sends a "uri_deserialize" request with serialized input "//authority/A410/3/ABCD" Then receives json with following set fields: | protobuf_field_names | protobuf_field_values | protobuf_field_type | - | authority.ip | | bytes | - | authority.name | | str | - | entity.id | 0 | int | - | entity.name | | str | - | entity.version_major | 0 | int | - | entity.version_minor | 0 | int | - | resource.name | | str | - | resource.instance | | str | - | resource.message | | str | - | resource.id | 0 | int | + | authority_name | authority | str | + | ue_id | 42000 | int | + | ue_version_major | 3 | int | + | resource_id | 43981 | int | When "uE2" creates data for "uri_validate" - And sets "validation_type" to "is_empty" + And sets "validation_type" to "" And sets "uuri" to previous response data + And sets "uuri_2" to "//authority/A410/3/1003" And sends "uri_validate" request - Then receives validation result as "False" - And receives validation message as "" + Then receives validation result as "" + Examples: + | validation_type | bool_result | + | matches | False | \ No newline at end of file diff --git a/test_manager/testData/workflow_test_data.json b/test_manager/testData/workflow_test_data.json index 508abfe4..6c815f5e 100644 --- a/test_manager/testData/workflow_test_data.json +++ b/test_manager/testData/workflow_test_data.json @@ -1,4 +1,41 @@ [ + { + "feature_name" : "uri_serializer", + "path": "serializers", + "ue1": ["python", "java"], + "transports": ["socket"] + }, + { + "feature_name" : "uri_deserializer", + "path": "serializers", + "ue1": ["python", "java"], + "transports": ["socket"] + }, + { + "feature_name" : "uuid_serializer", + "path": "serializers", + "ue1": ["python", "java"], + "transports": ["socket"] + }, + { + "feature_name" : "uuid_deserializer", + "path": "serializers", + "ue1": ["python", "java"], + "transports": ["socket"] + }, + { + "feature_name" : "uattributes_validator", + "path": "validators", + "ue1": ["python", "java"], + "transports": ["socket"] + }, + { + "feature_name" : "uri_validator", + "path": "validators", + "ue1": ["python", "java"], + "ue2": ["python", "java"], + "transports": ["socket"] + }, { "feature_name" : "uuid_validator", "path": "validators",