aboutsummaryrefslogtreecommitdiffstats
path: root/ms/controllerblueprints/modules/blueprint-core/src/test/resources
diff options
context:
space:
mode:
Diffstat (limited to 'ms/controllerblueprints/modules/blueprint-core/src/test/resources')
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/componentnode/default.json100
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/alltype-data.json10
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/default-context.json7
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json261
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/convert.json36
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/default.json16
-rw-r--r--ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts44
-rwxr-xr-xms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json36
-rwxr-xr-xms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl61
9 files changed, 571 insertions, 0 deletions
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/componentnode/default.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/componentnode/default.json
new file mode 100644
index 00000000..a1982631
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/componentnode/default.json
@@ -0,0 +1,100 @@
+{
+ "metadata": {
+ "template_author": "bs2796",
+ "vendor": "Juniper",
+ "os": "XXX",
+ "service-type": "AVPN",
+ "vnf-type": "VRR",
+ "action": "Base Configuration",
+ "sub-action": "Generate Configuration",
+ "template_name": "VRR-baseconfiguration",
+ "template_version": "1.0.0"
+ },
+ "topology_template": {
+ "inputs": {
+ "service-instance-id": {
+ "required": true,
+ "type": "string"
+ },
+ "vnf-id": {
+ "required": true,
+ "type": "string"
+ },
+ "service": {
+ "required": true,
+ "type": "string"
+ },
+ "region": {
+ "required": true,
+ "type": "string"
+ },
+ "bundle-id": {
+ "required": true,
+ "type": "string"
+ },
+ "bundle-mac": {
+ "required": true,
+ "type": "string"
+ }
+ },
+ "node_templates": {
+ "generate-configuration": {
+ "type": "mock-component-generateConfig",
+ "interfaces": {
+ "org-onap-ccsdk-config-params-service-MockComponentNode": {
+ "operations": {
+ "process": {
+ "inputs": {
+ "entity-type": "vnf-type",
+ "template-content": "sample-template",
+ "entity-id": { "get_input" : "vnf-id" }
+ },
+ "outputs": {
+ "mergedData": "merged Data",
+ "status": "status"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ },
+ "node_types": {
+ "mock-component-generateConfig": {
+ "interfaces": {
+ "org-onap-ccsdk-config-params-service-MockComponentNode": {
+ "operations": {
+ "process": {
+ "inputs": {
+ "entity-type": {
+ "required": false,
+ "type": "string"
+ },
+ "template-content": {
+ "required": false,
+ "type": "string"
+ },
+ "entity-id": {
+ "required": true,
+ "type": "string"
+ }
+ },
+ "outputs": {
+ "generated-config": {
+ "required": true,
+ "type": "string"
+ },
+ "status": {
+ "required": true,
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "derived_from": "tosca.nodes.Component"
+ }
+ }
+}
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/alltype-data.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/alltype-data.json
new file mode 100644
index 00000000..055b0965
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/alltype-data.json
@@ -0,0 +1,10 @@
+{
+ "intValue" : 1,
+ "floatValue" : 1.34,
+ "booleanValue" : true,
+ "stringValue" : "sample-String",
+ "timeValue" : "2018-09-29",
+ "arrayStringValue" : ["one", "two"],
+ "mapValue" : {"profile_name1":"profile_name1",
+ "profile_name2":"profile_name2"}
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/default-context.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/default-context.json
new file mode 100644
index 00000000..3968626b
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/data/default-context.json
@@ -0,0 +1,7 @@
+{
+ "request-id" : "12345",
+ "hostname" : "localhost",
+ "template_name": "baseconfiguration",
+ "template_version": "1.0.0",
+ "action-name" : "sample-action"
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json
new file mode 100644
index 00000000..cac8770a
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/dictionary/dictionary_schema.json
@@ -0,0 +1,261 @@
+{
+ "type": "object",
+ "properties": {
+ "resource-path": {
+ "type": "string",
+ "required": true
+ },
+ "description": {
+ "type": "string"
+ },
+ "updated-by": {
+ "type": "string"
+ },
+ "data-type": {
+ "type": "string",
+ "required": true
+ },
+ "source": {
+ "type": "object",
+ "required": true,
+ "properties": {
+ "input": {
+ "type": "object",
+ "properties": {
+ "key": {
+ "type": "string"
+ }
+ }
+ },
+ "component": {
+ "type": "object",
+ "properties": {
+ "name": {
+ "type": "string",
+ "required": true
+ },
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "default": {
+ "type": "any"
+ },
+ "aai": {
+ "type": "any"
+ },
+ "primary-config-data": {
+ "type": "object",
+ "properties": {
+ "path": {
+ "type": "string",
+ "required": true
+ },
+ "url-path": {
+ "type": "string",
+ "required": true
+ },
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "type": {
+ "type": "string",
+ "required": true
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "base": {
+ "type": "string",
+ "required": true
+ }
+ }
+ },
+ "network-resource-discovery": {
+ "type": "object",
+ "properties": {
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "primary-db": {
+ "type": "object",
+ "properties": {
+ "query": {
+ "type": "string",
+ "required": true
+ },
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "type": {
+ "type": "string",
+ "required": true
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "base": {
+ "type": "string",
+ "required": true
+ }
+ }
+ },
+ "policy": {
+ "type": "object",
+ "properties": {
+ "input-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ },
+ "output-key-mapping": {
+ "type": "object",
+ "additionalProperties": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "candidate-dependency": {
+ "type": "object",
+ "properties": {
+ "input": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "component": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "aai": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "primary-config-data": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "network-resource-discovery": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "primary-db": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ },
+ "policy": {
+ "type": "object",
+ "properties": {
+ "names": {
+ "type": "array",
+ "items": {
+ "type": "string"
+ }
+ }
+ }
+ }
+ }
+ },
+ "tags": {
+ "type": "string"
+ },
+ "default": {
+ "type": "any"
+ },
+ "name": {
+ "type": "string",
+ "required": true
+ },
+ "valid-values": {
+ "type": "string"
+ },
+ "resource-type": {
+ "type": "string",
+ "required": true
+ },
+ "sample-value": {
+ "type": "string"
+ },
+ "entry-schema": {
+ "type": "string"
+ }
+ }
+}
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/convert.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/convert.json
new file mode 100644
index 00000000..f7893ce5
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/convert.json
@@ -0,0 +1,36 @@
+{
+ "type": "sdnc-component-getResourceAssignment",
+ "interfaces": {
+ "ResourceAssignmentService": {
+ "operations": {
+ "getResourceAssignment": {
+ "inputs": {
+ "assignment-mappings": [
+ {
+ "name": "service-name",
+ "mapping-field": "service",
+ "mapping-category": "SDN",
+ "required": true
+ },
+ {
+ "name": "region-name",
+ "mapping-field": "region",
+ "mapping-category": "SDN",
+ "required": true
+ }
+ ],
+ "pre-data": {
+ "get_input": "get-resource-assignment.config-params"
+ },
+ "prifix": "get-resource-assignment"
+ },
+ "outputs": {
+ "resource-assignment-status": "success",
+ "resource-assignment-params": "{ \"set_value\" : \"get-resource-assignment.config-params"
+ }
+ }
+ }
+ }
+ }
+}
+
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/default.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/default.json
new file mode 100644
index 00000000..9f17574e
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/properties/default.json
@@ -0,0 +1,16 @@
+{
+ "default": { "get_input" : "loopback-default" },
+ "domain": "ethernet",
+ "criteria": [
+ {
+ "value": "attga301me1",
+ "type": "complex",
+ "nodeString": "layer3-service-list[].service-data.l3sdn-vnf-fields.vnf-name"
+ },
+ {
+ "value": { "get_input" : "host-ip-address" },
+ "type": "simple",
+ "nodeString": "layer3-service-list[].service-data.l3sdn-vnf-fields.vnf-name"
+ }
+ ]
+}
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts
new file mode 100644
index 00000000..44cc957d
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * 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.
+ */
+
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
+
+open class SampleBlueprintFunctionNode : BlueprintFunctionNode<String, String>{
+
+ override fun getName(): String {
+ return "Kotlin-Script-Function-Node"
+ }
+
+ override fun prepareRequest(executionRequest: String): String {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun process(executionRequest: String) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun recover(runtimeException: RuntimeException, executionRequest: String) {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun prepareResponse(): String {
+ TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+ }
+
+ override fun apply(t: String): String {
+ return "$t-status"
+ }
+} \ No newline at end of file
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json
new file mode 100755
index 00000000..2acc6fcd
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-data.json
@@ -0,0 +1,36 @@
+{
+ "node0_hostname": "sdnc-host",
+ "node0_backup_router_address": "2001:1890:1253::192:168:100:1",
+ "servers": [
+ "Server1",
+ "Server2",
+ "Server3"
+ ],
+ "tacplus-servers": [
+ {
+ "tacplus-server-name": "tacplus-server-name1",
+ "tacplus-server-source-address": "enc-dsdsasa1"
+ },
+ {
+ "tacplus-server-name": "tacplus-server-name2",
+ "tacplus-server-source-address": "enc-dsdsasa2"
+ }
+ ],
+ "classes": [
+ {
+ "name": "superuser-class",
+ "idle-timeout": 5,
+ "permissions": "all"
+ },
+ {
+ "name": "tacacs-adv-class",
+ "idle-timeout": 5
+ },
+ {
+ "name": "tacacs-base-class",
+ "idle-timeout": 5
+ }
+ ],
+ "system-password": "teamops-system-password",
+ "root-password": "teamops-root-password"
+}
diff --git a/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl
new file mode 100755
index 00000000..f7b1269b
--- /dev/null
+++ b/ms/controllerblueprints/modules/blueprint-core/src/test/resources/templates/base-config-template.vtl
@@ -0,0 +1,61 @@
+<configuration xmlns="http://xml.juniper.net/xnm/1.1/xnm"
+xmlns:a="http://xml.juniper.net/junos/15.1X49/junos">
+ <version>15.1X49-D50.3</version>
+ <groups>
+ <name>node0</name>
+ <system>
+ #foreach($server in ${servers})
+ <server-host-name>$StringUtils.upperCase("$server")</server-host-name>
+ #end
+ </system>
+ <system>
+ <host-name>${node0_hostname}</host-name>
+ <backup-router>
+ <address>${node0_backup_router_address}</address>
+ <destination>$node0_backup_router_address</destination>
+ </backup-router>
+ #foreach($tacplus-server in ${tacplus-servers})
+ <tacplus-server>
+ <name>$tacplus-server.tacplus-server-name</name>
+ <source-address>$tacplus-server.tacplus-server-source-address</source-address>
+ </tacplus-server>
+ #end
+ <login>
+ <message>ONAP information assets</message>
+ #foreach($class in ${classes})
+ <class>
+ <name>$class.name</name>
+ <idle-timeout>$class.idle-timeout</idle-timeout>
+ #if ($class.permissions)
+ <permissions>$class.permissions</permissions>
+ #end
+ </class>
+ #end
+ <user>
+ <name>readonly</name>
+ <full-name>Read Only Account Access</full-name>
+ <uid>1001</uid>
+ <class>tacacs-base-class</class>
+ </user>
+ <user>
+ <name>readwrite</name>
+ <full-name>Read - Write Account Access</full-name>
+ <uid>1002</uid>
+ <class>tacacs-adv-class</class>
+ <authentication>
+ <encrypted-password>${system-password}</encrypted-password>
+ </authentication>
+ </user>
+ <user>
+ <name>readwrite</name>
+ <full-name>Emergency Access Only</full-name>
+ <uid>1000</uid>
+ <class>superuser-class</class>
+ <authentication>
+ <encrypted-password>${root-password}</encrypted-password>
+ </authentication>
+ </user>
+ </login>
+ </system>
+ </groups>
+</configuration> \ No newline at end of file