diff options
author | JvD_Ericsson <jeff.van.dam@est.tech> | 2023-06-13 08:48:16 +0100 |
---|---|---|
committer | Vasyl Razinkov <vasyl.razinkov@est.tech> | 2023-06-29 19:59:09 +0000 |
commit | 2cecd886d08bd2f97426746aa19b581568c38954 (patch) | |
tree | ed46432cde31c929393bf62dc09c54bbd8fcd110 /integration-tests/src | |
parent | cf0a8b21e85ec41260da802a2b923fabe89c9aaa (diff) |
Create test model
Issue-ID: SDC-4471
Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Change-Id: I49d6721b9c60cf62ddcdc47beed70db08ba0a031
Diffstat (limited to 'integration-tests/src')
9 files changed, 645 insertions, 0 deletions
diff --git a/integration-tests/src/main/assembly/normatives.xml b/integration-tests/src/main/assembly/normatives.xml new file mode 100644 index 0000000000..6f78bba84b --- /dev/null +++ b/integration-tests/src/main/assembly/normatives.xml @@ -0,0 +1,14 @@ +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" +xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + <id>bin</id> + <formats> + <format>tar.gz</format> + </formats> + <fileSets> + <fileSet> + <directory>src/main/resources/import</directory> + <outputDirectory>import</outputDirectory> + </fileSet> + </fileSets> +</assembly> diff --git a/integration-tests/src/main/assembly/replace.xml b/integration-tests/src/main/assembly/replace.xml new file mode 100644 index 0000000000..77e9c4110a --- /dev/null +++ b/integration-tests/src/main/assembly/replace.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<project name="stack_overflow"> + <target name ="BE-configuration"> + <echo>********** Replacing BE-configuration to add TEST service config *************</echo> + <replaceregexp file="integration-tests-init/BE-configuration.yaml.erb" match="serviceBaseNodeTypes:"> + <substitution expression="serviceBaseNodeTypes:${line.separator} TEST service:${line.separator} required: true${line.separator} baseTypes:${line.separator} - tosca.nodes.nfv.testNodeComplex${line.separator} doNotExtendBaseType: true"/> + </replaceregexp> + </target> +</project>
\ No newline at end of file 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 +│ ├── <model_1_to_create> +│ │ ├── payload.json +│ │ ├── imports +│ │ │ ├── **/*.yaml +[...] +│ ├── <model_n_to_create> +│ │ ├── 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 |