summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/data/functions
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/data/functions')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml2
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml23
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token.yaml15
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token_invalid.yaml17
4 files changed, 56 insertions, 1 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml
index 88a2721..7511999 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml
@@ -1,7 +1,7 @@
tosca_definitions_version: tosca_simple_yaml_1_0
description: >
- TOSCA template for testing get_attribute with a list attribute and an index
+ TOSCA template for testing get_attribute with an incorrect index
imports:
- ../custom_types/compute_with_attribute_list.yaml
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml
new file mode 100644
index 0000000..79e632c
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml
@@ -0,0 +1,23 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: >
+ TOSCA template for testing get_attribute with nested attributes
+
+imports:
+ - ../custom_types/compute_with_nested_atributes.yaml
+
+topology_template:
+ node_templates:
+ server:
+ type: tosca.nodes.ComputeWithCapWithAttr
+ capabilities:
+ endpoint:
+ properties:
+ port: 80
+ interfaces:
+ Standard:
+ configure:
+ implementation: configure.sh
+ inputs:
+ ip_address: { get_attribute: [ SELF, endpoint, credential, 0, token ] }
+
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token.yaml
new file mode 100644
index 0000000..495a930
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token.yaml
@@ -0,0 +1,15 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Template for deploying a single server with token function.
+
+topology_template:
+ node_templates:
+ server:
+ type: tosca.nodes.Compute
+
+ outputs:
+ url:
+ description: Get the first part of the ip
+ value: { token: [ get_attribute: [ server, public_address ],
+ '.' ,
+ 0 ] }
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token_invalid.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token_invalid.yaml
new file mode 100644
index 0000000..35ae2ff
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token_invalid.yaml
@@ -0,0 +1,17 @@
+tosca_definitions_version: tosca_simple_yaml_1_0
+
+description: Template for deploying a single server with invalid token function.
+
+topology_template:
+ outputs:
+ invalid_token_syntax_1:
+ description: test token with only two paremeters.
+ value: { token: ["some_string", "_"]}
+
+ invalid_token_syntax_2:
+ description: test token with invalid string as third argument.
+ value: { token: ["some_string", "_", "1"]}
+
+ invalid_token_syntax_3:
+ description: test token with invalid string as second argument.
+ value: { token: ["some_string", "aa", "1"]}