From 0997552722dc4845a854e0e6f8d7f18058e26380 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Fri, 8 Jul 2016 15:15:00 +0800 Subject: Synchronise the openstack bugs When run unittests through tox, some test cases are always error, the errors are already done in openstack community, so it's necessary to synchronise the fixes. Change-Id: Ib29078e6cc138a474e89c6a2cc90ad7a1db1bb46 JIRA: PARSER-63 Signed-off-by: shangxdy --- .../test_get_attribute_with_index_error.yaml | 2 +- .../test_get_attribute_with_nested_params.yaml | 23 ++++++++++++++++++++++ .../tests/data/functions/test_token.yaml | 15 ++++++++++++++ .../tests/data/functions/test_token_invalid.yaml | 17 ++++++++++++++++ 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml create mode 100644 tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token.yaml create mode 100644 tosca2heat/tosca-parser/toscaparser/tests/data/functions/test_token_invalid.yaml (limited to 'tosca2heat/tosca-parser/toscaparser/tests/data/functions') 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"]} -- cgit 1.2.3-korg