From 2cecd886d08bd2f97426746aa19b581568c38954 Mon Sep 17 00:00:00 2001 From: JvD_Ericsson Date: Tue, 13 Jun 2023 08:48:16 +0100 Subject: Create test model Issue-ID: SDC-4471 Signed-off-by: JvD_Ericsson Change-Id: I49d6721b9c60cf62ddcdc47beed70db08ba0a031 --- .../resources/import/tosca/models/init/README.md | 26 +++ .../models/init/testModel/imports/testModel.yaml | 222 +++++++++++++++++++++ .../tosca/models/init/testModel/payload.json | 4 + .../testModel/tosca/categories/categoryTypes.yml | 7 + .../init/testModel/tosca/data-types/dataTypes.yml | 135 +++++++++++++ .../init/testModel/tosca/node-types/metadata.json | 91 +++++++++ .../init/testModel/tosca/node-types/nodeTypes.yaml | 137 +++++++++++++ 7 files changed, 622 insertions(+) create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/README.md create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/imports/testModel.yaml create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/payload.json create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/categories/categoryTypes.yml create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/data-types/dataTypes.yml create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/metadata.json create mode 100644 integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/nodeTypes.yaml (limited to 'integration-tests/src/main/resources/import/tosca/models/init') diff --git a/integration-tests/src/main/resources/import/tosca/models/init/README.md b/integration-tests/src/main/resources/import/tosca/models/init/README.md new file mode 100644 index 0000000000..d4d1a368f9 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/README.md @@ -0,0 +1,26 @@ +This folder purpose is to contain any models that needs to be created during the first +initialization of the system (install). + +```bash +├── init +│ ├── +│ │ ├── payload.json +│ │ ├── imports +│ │ │ ├── **/*.yaml +[...] +│ ├── +│ │ ├── payload.json +│ │ ├── imports +│ │ │ ├── **/*.yaml +``` + +The model folder name is irrelevant to indicate which model should be created. This information must +be provided in the payload.json contained within the model folder. + +The content of the payload.json for the model with name "ETSI SOL001 v2.5.1" is expected to be: +```json +{ + "name": "ETSI SOL001 v2.5.1" +} +``` + diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/imports/testModel.yaml b/integration-tests/src/main/resources/import/tosca/models/init/testModel/imports/testModel.yaml new file mode 100644 index 0000000000..994823159b --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/imports/testModel.yaml @@ -0,0 +1,222 @@ +tosca_definitions_version: tosca_simple_yaml_1_3 +description: test model types definitions + +data_types: + tosca.datatypes.test.testDataTypeSimple: + derived_from: tosca.datatypes.Root + description: A simple data type used for testing + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + tosca.datatypes.test.testDataTypeComplex: + derived_from: tosca.datatypes.Root + description: A complex data type used for testing + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + complex_prop: + type: tosca.datatypes.test.testDataTypeSimple + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_complex_prop: + type: list + entry_schema: + type: tosca.datatypes.test.testDataTypeSimple + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + map_complex_prop: + type: map + required: true + entry_schema: + type: tosca.datatypes.test.testDataTypeSimple +node_types: + tosca.nodes.test.testWithConstraints: + derived_from: tosca.nodes.Root + properties: + string_prop_with_c: + type: string + constraints: + - valid_values: + - abc + - def + tosca.nodes.test.testNodeSimple: + derived_from: tosca.nodes.Root + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + tosca.nodes.test.testNodeComplex: + derived_from: tosca.nodes.Root + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + complex_prop: + type: tosca.datatypes.test.testDataTypeComplex + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_complex_prop: + type: list + entry_schema: + type: tosca.datatypes.test.testDataTypeComplex + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + map_complex_prop: + type: map + required: true + entry_schema: + type: tosca.datatypes.test.testDataTypeComplex diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/payload.json b/integration-tests/src/main/resources/import/tosca/models/init/testModel/payload.json new file mode 100644 index 0000000000..093326d9e8 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/payload.json @@ -0,0 +1,4 @@ +{ + "name": "TEST MODEL", + "modelType": "NORMATIVE" +} diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/categories/categoryTypes.yml b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/categories/categoryTypes.yml new file mode 100644 index 0000000000..18e3e544e5 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/categories/categoryTypes.yml @@ -0,0 +1,7 @@ +services: + Mobility: + name: "TEST service" + icons: ['network_l_1-3'] + models: [ + "TEST MODEL" + ] diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/data-types/dataTypes.yml b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/data-types/dataTypes.yml new file mode 100644 index 0000000000..8b55f563e5 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/data-types/dataTypes.yml @@ -0,0 +1,135 @@ +tosca.datatypes.Root: + description: The TOSCA root Data Type all other TOSCA base Data Types derive from +integer: + derived_from: tosca.datatypes.Root +string: + derived_from: tosca.datatypes.Root +timestamp: + derived_from: tosca.datatypes.Root +boolean: + derived_from: tosca.datatypes.Root +float: + derived_from: tosca.datatypes.Root +range: + derived_from: tosca.datatypes.Root +list: + derived_from: tosca.datatypes.Root +map: + derived_from: tosca.datatypes.Root +json: + derived_from: tosca.datatypes.Root +scalar-unit: + derived_from: tosca.datatypes.Root +scalar-unit.size: + derived_from: scalar-unit +scalar-unit.time: + derived_from: scalar-unit +scalar-unit.frequency: + derived_from: scalar-unit +scalar-unit.bitrate: + derived_from: scalar-unit +tosca.datatypes.test.testDataTypeSimple: + derived_from: tosca.datatypes.Root + description: A simple data type used for testing + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer +tosca.datatypes.test.testDataTypeComplex: + derived_from: tosca.datatypes.Root + description: A complex data type used for testing + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + complex_prop: + type: tosca.datatypes.test.testDataTypeSimple + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_complex_prop: + type: list + entry_schema: + type: tosca.datatypes.test.testDataTypeSimple + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + map_complex_prop: + type: map + required: true + entry_schema: + type: tosca.datatypes.test.testDataTypeSimple \ No newline at end of file diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/metadata.json b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/metadata.json new file mode 100644 index 0000000000..e38dd6cf82 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/metadata.json @@ -0,0 +1,91 @@ +{ + "nodeMetadataList": [ + { + "contactId": "jh0003", + "toscaName": "tosca.nodes.Root", + "name": "Root", + "model": "TEST MODEL", + "description": "The TOSCA Node Type all other TOSCA base Node Types derive from", + "resourceIconPath": "defaulticon", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Abstract" + } + ] + } + ], + "tags": [ + "Root", + "tosca.nodes.Root" + ] + }, + { + "contactId": "jh0003", + "toscaName": "tosca.nodes.test.testWithConstraints", + "name": "TestWithConstraints", + "model": "TEST MODEL", + "description": "A vfc used for testing constraints", + "resourceIconPath": "defaulticon", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Infrastructure" + } + ] + } + ], + "tags": [ + "TestWithConstraints" + ] + }, + { + "payloadName": "testNodeSimple.yml", + "contactId": "jh0003", + "toscaName": "tosca.nodes.test.testNodeSimple", + "name": "TestNodeSimple", + "model": "TEST MODEL", + "description": "A vfc used for testing simple data types", + "resourceIconPath": "defaulticon", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Infrastructure" + } + ] + } + ], + "tags": [ + "TestNodeSimple" + ] + }, + { + "payloadName": "testNodeComplex.yml", + "contactId": "jh0003", + "toscaName": "tosca.nodes.test.testNodeComplex", + "name": "TestNodeComplex", + "model": "TEST MODEL", + "description": "A vfc used for testing complex data types", + "resourceIconPath": "defaulticon", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Infrastructure" + } + ] + } + ], + "tags": [ + "TestNodeComplex" + ] + } + ] +} \ No newline at end of file diff --git a/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/nodeTypes.yaml b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/nodeTypes.yaml new file mode 100644 index 0000000000..928459d3b6 --- /dev/null +++ b/integration-tests/src/main/resources/import/tosca/models/init/testModel/tosca/node-types/nodeTypes.yaml @@ -0,0 +1,137 @@ +tosca_definitions_version: tosca_simple_yaml_1_2 +description: Node types used during integration testing + +node_types: + tosca.nodes.Root: + description: The TOSCA Node Type all other TOSCA base Node Types derive from + attributes: + tosca_id: + type: string + tosca_name: + type: string + state: + type: string + capabilities: + feature: + type: tosca.capabilities.Node + requirements: + - dependency: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: [ 0, UNBOUNDED ] + interfaces: + Standard: + type: tosca.interfaces.node.lifecycle.Standard + tosca.nodes.test.testWithConstraints: + derived_from: tosca.nodes.Root + properties: + string_prop_with_c: + type: string + constraints: + - valid_values: + - abc + - def + tosca.nodes.test.testNodeSimple: + derived_from: tosca.nodes.Root + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + tosca.nodes.test.testNodeComplex: + derived_from: tosca.nodes.Root + properties: + str_prop: + type: string + required: true + int_prop: + type: integer + required: true + timestamp_prop: + type: timestamp + required: true + boolean_prop: + type: boolean + required: true + float_prop: + type: float + required: true + json_prop: + type: json + required: true + complex_prop: + type: tosca.datatypes.test.testDataTypeComplex + list_str_prop: + type: list + required: true + entry_schema: + type: string + list_int_prop: + type: list + required: true + entry_schema: + type: integer + list_complex_prop: + type: list + entry_schema: + type: tosca.datatypes.test.testDataTypeComplex + list_map_prop: + type: list + required: true + entry_schema: + type: map + map_str_prop: + type: map + required: true + entry_schema: + type: string + map_int_prop: + type: map + required: true + entry_schema: + type: integer + map_complex_prop: + type: map + required: true + entry_schema: + type: tosca.datatypes.test.testDataTypeComplex -- cgit 1.2.3-korg