diff options
author | Eliezio Oliveira <eliezio.oliveira@est.tech> | 2019-07-31 11:50:26 +0100 |
---|---|---|
committer | Dan Timoney <dtimoney@att.com> | 2019-08-09 19:46:17 +0000 |
commit | 1e7e4a53684df04ba248c20d884ba907ca7c2870 (patch) | |
tree | d75f0c3b55ada932c42cff18ba120e3c337c37f4 /components/model-catalog/blueprint-model/uat-blueprints/echo | |
parent | 1596f69d2e59a158ae509e798448a398b2c9559f (diff) |
Add declarative acceptance tests
First two UATs are for blueprints Echo and "PNF Configuration".
The body of the ODL mount request was changed from XML to JSON,
so it can be represented in a YAML file.
Initial documentation about the UATs can be found at
components/model-catalog/blueprint-model/uat-blueprints/README.md
BluePrintArchiveUtils.recurseFiles() replaced by compressFolder() that
uses native Java 7. Removed commons-compress as dependency since is no
longer used.
Change-Id: I96a584ae12ca009f90fe8fe9485eb57ce05e8add
Issue-ID: CCSDK-1569
Signed-off-by: Eliezio Oliveira <eliezio.oliveira@est.tech>
Diffstat (limited to 'components/model-catalog/blueprint-model/uat-blueprints/echo')
12 files changed, 347 insertions, 0 deletions
diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/artifact_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/artifact_types.json new file mode 100644 index 000000000..6ec3b4105 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/artifact_types.json @@ -0,0 +1,22 @@ +{ + "artifact_types" : { + "artifact-directed-graph" : { + "description" : "Directed Graph File", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json", "xml" ] + }, + "artifact-mapping-resource" : { + "description" : "Resource Mapping File used along with Configuration template", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "json" ] + }, + "artifact-template-velocity" : { + "description" : " Velocity Template used for Configuration", + "version" : "1.0.0", + "derived_from" : "tosca.artifacts.Implementation", + "file_ext" : [ "vtl" ] + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/data_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/data_types.json new file mode 100644 index 000000000..24f501953 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/data_types.json @@ -0,0 +1,14 @@ +{ + "data_types" : { + "dt-echo-properties" : { + "description" : "Dynamic DataType definition for workflow(echo).", + "version" : "1.0.0", + "properties" : { + "echoed-message" : { + "type" : "string" + } + }, + "derived_from" : "tosca.datatypes.Dynamic" + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-mapping.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-mapping.json new file mode 100644 index 000000000..02f2b496f --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-mapping.json @@ -0,0 +1,13 @@ +[ + { + "name": "echoed-message", + "input-param": true, + "property": { + "type": "string" + }, + "dictionary-name": "echoed-message", + "dictionary-source": "input", + "dependencies": [ + ] + } +] diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-test.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-test.json new file mode 100644 index 000000000..3105484ce --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/echo-test.json @@ -0,0 +1,91 @@ +{ + "tosca_definitions_version" : "controller_blueprint_1_0_0", + "metadata" : { + "template_author" : "Rodrigo Ottero", + "author-email" : "rodrigo.ottero@est.tech", + "user-groups" : "ADMIN, OPERATION", + "template_name" : "echo_test", + "template_version" : "1.0.0", + "template_tags" : "echo_test, echo, test, testing" + }, + "imports" : [ { + "file" : "Definitions/data_types.json" + }, { + "file" : "Definitions/relationship_types.json" + }, { + "file" : "Definitions/artifact_types.json" + }, { + "file" : "Definitions/node_types.json" + }, { + "file" : "Definitions/policy_types.json" + } ], + "topology_template" : { + "workflows" : { + "echo" : { + "steps" : { + "activate-process" : { + "description" : "Echo a message", + "target" : "echo-process", + "activities" : [ { + "call_operation" : "" + } ] + } + }, + "inputs" : { + "echo-properties" : { + "description" : "Dynamic PropertyDefinition for workflow(echo).", + "required" : true, + "type" : "dt-echo-properties" + } + } + } + }, + "node_templates" : { + "echo-process" : { + "type" : "dg-generic", + "properties" : { + "content" : { + "get_artifact" : [ "SELF", "dg-echo-process" ] + }, + "dependency-node-templates" : [ "echo" ] + }, + "artifacts" : { + "dg-config-assign-process" : { + "type" : "artifact-directed-graph", + "file" : "Plans/TEST_echo.xml" + } + } + }, + "echo" : { + "type" : "component-resource-resolution", + "interfaces" : { + "ResourceResolutionComponent" : { + "operations" : { + "process" : { + "inputs" : { + "artifact-prefix-names" : [ "echo" ] + }, + "outputs" : { + "resource-assignment-params" : { + "get_attribute" : [ "SELF", "assignment-params" ] + }, + "status" : "success" + } + } + } + } + }, + "artifacts" : { + "echo-template" : { + "type" : "artifact-template-velocity", + "file" : "Templates/echo-template.vtl" + }, + "echo-mapping" : { + "type" : "artifact-mapping-resource", + "file" : "Definitions/echo-mapping.json" + } + } + } + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/node_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/node_types.json new file mode 100644 index 000000000..a3fc254b2 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/node_types.json @@ -0,0 +1,129 @@ +{ + "node_types" : { + "component-resource-resolution" : { + "description" : "This is Resource Assignment Component API", + "version" : "1.0.0", + "attributes" : { + "assignment-params" : { + "required" : true, + "type" : "string" + } + }, + "capabilities" : { + "component-node" : { + "type" : "tosca.capabilities.Node" + } + }, + "interfaces" : { + "ResourceResolutionComponent" : { + "operations" : { + "process" : { + "inputs" : { + "resolution-key" : { + "description" : "Key for service instance related correlation.", + "required" : false, + "type" : "string" + }, + "occurrence": { + "description": "Number of time to perform the resolution.", + "required": false, + "default": 1, + "type": "integer" + }, + "store-result" : { + "description" : "Whether or not to store the output.", + "required" : false, + "type" : "boolean" + }, + "resource-type" : { + "description" : "Request type.", + "required" : false, + "type" : "string" + }, + "artifact-prefix-names" : { + "description" : "Template , Resource Assignment Artifact Prefix names", + "required" : true, + "type" : "list", + "entry_schema" : { + "type" : "string" + } + }, + "request-id" : { + "description" : "Request Id, Unique Id for the request.", + "required" : true, + "type" : "string" + }, + "resource-id" : { + "description" : "Resource Id.", + "required" : false, + "type" : "string" + }, + "action-name" : { + "description" : "Action Name of the process", + "required" : false, + "type" : "string" + }, + "dynamic-properties" : { + "description" : "Dynamic Json Content or DSL Json reference.", + "required" : false, + "type" : "json" + } + }, + "outputs" : { + "resource-assignment-params" : { + "required" : true, + "type" : "string" + }, + "status" : { + "required" : true, + "type" : "string" + } + } + } + } + } + }, + "derived_from" : "tosca.nodes.Component" + }, + "dg-generic" : { + "description" : "This is Generic Directed Graph Type", + "version" : "1.0.0", + "properties" : { + "content" : { + "required" : true, + "type" : "string" + }, + "dependency-node-templates" : { + "description" : "Dependent Step Components NodeTemplate name.", + "required" : true, + "type" : "list", + "entry_schema" : { + "type" : "string" + } + } + }, + "derived_from" : "tosca.nodes.Workflow" + }, + "source-input" : { + "description" : "This is Input Resource Source Node Type", + "version" : "1.0.0", + "properties" : { }, + "derived_from" : "tosca.nodes.ResourceSource" + }, + "tosca.nodes.Component" : { + "description" : "This is default Component Node", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.ResourceSource" : { + "description" : "TOSCA base type for Resource Sources", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + }, + "tosca.nodes.Workflow" : { + "description" : "This is Directed Graph Node Type", + "version" : "1.0.0", + "derived_from" : "tosca.nodes.Root" + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/policy_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/policy_types.json new file mode 100644 index 000000000..1e44cc70a --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/policy_types.json @@ -0,0 +1,3 @@ +{ + "policy_types" : { } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/relationship_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/relationship_types.json new file mode 100644 index 000000000..4ddd7a57c --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/relationship_types.json @@ -0,0 +1,3 @@ +{ + "relationship_types" : { } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/resources_definition_types.json b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/resources_definition_types.json new file mode 100644 index 000000000..4b0cf47e7 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Definitions/resources_definition_types.json @@ -0,0 +1,17 @@ +{ + "echoed-message" : { + "tags" : "echoed-message", + "name" : "echoed-message", + "property" : { + "description" : "echoed-message", + "type" : "string" + }, + "updated-by" : "Rodrigo Ottero <rodrigo.ottero@est.tech>", + "sources" : { + "input" : { + "type" : "source-input", + "properties" : { } + } + } + } +}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Plans/TEST_echo.xml b/components/model-catalog/blueprint-model/uat-blueprints/echo/Plans/TEST_echo.xml new file mode 100644 index 000000000..4305c7dd8 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Plans/TEST_echo.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<service-logic xmlns="http://www.onap.org/sdnc/svclogic" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.onap.org/sdnc/svclogic ./svclogic.xsd" module="CONFIG" version="1.0.0"> + <method rpc="ResourceAssignAndActivate" mode="sync"> + <block atomic="true"> + <execute plugin="echo" method="process"> + <outcome value="failure"> + <return status="failure" /> + </outcome> + <outcome value="success"> + <return status="success" /> + </outcome> + </execute> + </block> + </method> +</service-logic> diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta b/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta new file mode 100644 index 000000000..769d46474 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/TOSCA-Metadata/TOSCA.meta @@ -0,0 +1,5 @@ +TOSCA-Meta-File-Version: 1.0.0 +CSAR-Version: 1.0 +Created-By: Rodrigo Ottero +Entry-Definitions: Definitions/echo-test.json +Template-Tags: activation-blueprint diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Templates/echo-template.vtl b/components/model-catalog/blueprint-model/uat-blueprints/echo/Templates/echo-template.vtl new file mode 100644 index 000000000..9e2dcc1e5 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Templates/echo-template.vtl @@ -0,0 +1 @@ +${echoed-message}
\ No newline at end of file diff --git a/components/model-catalog/blueprint-model/uat-blueprints/echo/Tests/uat.yaml b/components/model-catalog/blueprint-model/uat-blueprints/echo/Tests/uat.yaml new file mode 100644 index 000000000..116230929 --- /dev/null +++ b/components/model-catalog/blueprint-model/uat-blueprints/echo/Tests/uat.yaml @@ -0,0 +1,34 @@ +%YAML 1.1 +--- +processes: + - name: echo-it + request: + commonHeader: &ch + originatorId: sdnc + requestId: "1234" + subRequestId: "1234-12234" + actionIdentifiers: &ai + blueprintName: echo_test + blueprintVersion: "1.0.0" + actionName: echo + mode: sync + payload: + echo-request: + echo-properties: + echoed-message: &message "Hello World!" + expectedResponse: + commonHeader: *ch + actionIdentifiers: *ai + status: + code: 200 + eventType: EVENT_COMPONENT_EXECUTED + errorMessage: null + message: success + payload: + echo-response: {} + stepData: + name: echo + properties: + resource-assignment-params: + echo: *message + status: success |