diff options
author | shangxdy <shang.xiaodong@zte.com.cn> | 2016-07-08 15:15:00 +0800 |
---|---|---|
committer | shangxdy <shang.xiaodong@zte.com.cn> | 2016-07-10 00:38:59 +0800 |
commit | 0997552722dc4845a854e0e6f8d7f18058e26380 (patch) | |
tree | b90d1e808bb326612211ba56b3b941516493398d /tosca2heat/heat-translator/translator/tests/data | |
parent | 7fe3011a67a239f7dc04153c54eaff78ef967eaf (diff) |
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 <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/heat-translator/translator/tests/data')
10 files changed, 493 insertions, 0 deletions
diff --git a/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_generate_keys.sh b/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_generate_keys.sh new file mode 100644 index 0000000..9dc8e16 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_generate_keys.sh @@ -0,0 +1,4 @@ +#!/bin/bash +test -d /root/.ssh || mkdir /root/.ssh +test -f /root/.ssh/id_rsa.pub || ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa +cat /root/.ssh/id_rsa.pub > ${heat_outputs_path}.public_key diff --git a/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_import_public_key.sh b/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_import_public_key.sh new file mode 100644 index 0000000..1ef94e0 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/artifacts/ssh/ssh_import_public_key.sh @@ -0,0 +1,3 @@ +#!/bin/bash +test -d /root/.ssh || mkdir /root/.ssh +echo "$public_key" >> /root/.ssh/authorized_keys diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_exchange_public_ssh_key.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_exchange_public_ssh_key.yaml new file mode 100644 index 0000000..1dfa125 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_exchange_public_ssh_key.yaml @@ -0,0 +1,55 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test get_operation_output by exchanging ssh public key + +parameters: {} +resources: + generate_ssh_key_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: generate_ssh_key_create_config + server: + get_resource: server1 + import_public_key_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: import_public_key_create_config + input_values: + public_key: + get_attr: + - generate_ssh_key_create_deploy + - public_key + server: + get_resource: server2 + depends_on: + - generate_ssh_key_create_deploy + server1: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + server2: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + generate_ssh_key_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: artifacts/ssh/ssh_generate_keys.sh + group: script + outputs: + - name: public_key + import_public_key_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: artifacts/ssh/ssh_import_public_key.sh + group: script +outputs: {}
\ No newline at end of file diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_get_functions_semantic.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_get_functions_semantic.yaml new file mode 100644 index 0000000..318a739 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_get_functions_semantic.yaml @@ -0,0 +1,52 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test get_* functions semantic + +parameters: + map_val: + type: string +resources: + myapp_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + input_values: + list_val: list_val_0 + config: + get_resource: myapp_configure_config + server: + get_resource: server + depends_on: + - mysql_database + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + myapp_configure_config: + type: OS::Heat::SoftwareConfig + properties: + group: script + config: + get_file: myapp_configure.sh +outputs: + map_val: + description: map_val + value: + get_input: map_val + concat_map_val: + value: + str_replace: + params: + $s2: :8080 + $s0: http:// + $s1: + get_input: map_val + template: $s0$s1$s2 + static_map_val: + value: static_value + test_list_of_functions: + value: + - get_input: map_val + - static_value diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_interface_on_compute.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_interface_on_compute.yaml new file mode 100644 index 0000000..0399c06 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_interface_on_compute.yaml @@ -0,0 +1,44 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test Compute node with interface + +parameters: {} +resources: + softwarecomponent_depending_on_customcompute_install_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: softwarecomponent_depending_on_customcompute_install_create_config + server: + get_resource: server + depends_on: + - server_create_deploy + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + softwarecomponent_depending_on_customcompute_install_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: post_install.sh + group: script + server_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install.sh + group: script + server_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: server_create_config + input_values: + install_path: /opt + server: + get_resource: server +outputs: {}
\ No newline at end of file diff --git a/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_script_types.yaml b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_script_types.yaml new file mode 100644 index 0000000..5f0585d --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/hot_output/hot_script_types.yaml @@ -0,0 +1,101 @@ +heat_template_version: 2013-05-23 + +description: > + TOSCA template to test usage of different script types like Ansible and Puppet + one. + +parameters: {} +resources: + customwebserver2_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver2_create_config + server: + get_resource: server + customwebserver_create_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_create_config + server: + get_resource: server + server: + type: OS::Nova::Server + properties: + flavor: m1.small + image: ubuntu-12.04-software-config-os-init + user_data_format: SOFTWARE_CONFIG + customwebserver2_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: start.sh + group: script + customwebserver2_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver2_start_config + server: + get_resource: server + depends_on: + - customwebserver2_configure_deploy + customwebserver2_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install.sh + group: script + customwebserver2_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: configure.py + group: script + customwebserver2_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver2_configure_config + server: + get_resource: server + depends_on: + - customwebserver2_create_deploy + customwebserver_start_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: start.pp + group: puppet + customwebserver_start_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_start_config + server: + get_resource: server + depends_on: + - customwebserver_configure_deploy + customwebserver_create_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: install.yaml + group: ansible + customwebserver_configure_config: + type: OS::Heat::SoftwareConfig + properties: + config: + get_file: configure.yml + group: ansible + customwebserver_configure_deploy: + type: OS::Heat::SoftwareDeployment + properties: + config: + get_resource: customwebserver_configure_config + server: + get_resource: server + depends_on: + - customwebserver_create_deploy +outputs: {} diff --git a/tosca2heat/heat-translator/translator/tests/data/test_tosca_get_functions_semantic.yaml b/tosca2heat/heat-translator/translator/tests/data/test_tosca_get_functions_semantic.yaml new file mode 100644 index 0000000..2a76978 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/test_tosca_get_functions_semantic.yaml @@ -0,0 +1,84 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: TOSCA template to test get_* functions semantic + +node_types: + tosca.capabilities.MyFeature: + derived_from: tosca.capabilities.Root + properties: + my_list: + type: list + my_map: + type: map + + tosca.nodes.WebApplication.MyApp: + derived_from: tosca.nodes.WebApplication + requirements: + - myfeature: + capability: tosca.capabilities.MyFeature + node: tosca.nodes.MyDatabase + relationship: tosca.relationships.ConnectsTo + + tosca.nodes.MyDatabase: + derived_from: tosca.nodes.Database + capabilities: + myfeature: + type: tosca.capabilities.MyFeature + +topology_template: + inputs: + map_val: + type: string + + node_templates: + server: + type: tosca.nodes.Compute + capabilities: + host: + properties: + num_cpus: 1 + mem_size: 1 GB + os: + properties: + type: Linux + distribution: Ubuntu + version: 12.04 + architecture: x86_64 + + mysql_database: + type: tosca.nodes.MyDatabase + requirements: + - host: server + capabilities: + myfeature: + properties: + my_list: [list_val_0] + my_map: + test_key: { get_input: map_val } + test_key_static: static_value + + myapp: + type: tosca.nodes.WebApplication.MyApp + requirements: + - myfeature: mysql_database + - host: server + interfaces: + Standard: + configure: + implementation: myapp_configure.sh + inputs: + list_val: { get_property: [ SELF, myfeature, my_list, 0 ] } + + outputs: + map_val: + description: map_val + value: { get_property: [ myapp, myfeature, my_map, test_key ] } + + static_map_val: + value: { get_property: [ myapp, myfeature, my_map, test_key_static ] } + + concat_map_val: + value: { concat: [ 'http://', { get_property: [ myapp, myfeature, my_map, test_key ] }, ':8080' ] } + + test_list_of_functions: + value: [ { get_property: [ myapp, myfeature, my_map, test_key ] }, { get_property: [ myapp, myfeature, my_map, test_key_static ] } ] diff --git a/tosca2heat/heat-translator/translator/tests/data/test_tosca_interface_on_compute.yaml b/tosca2heat/heat-translator/translator/tests/data/test_tosca_interface_on_compute.yaml new file mode 100644 index 0000000..e033c3c --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/test_tosca_interface_on_compute.yaml @@ -0,0 +1,48 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: TOSCA template to test Compute node with interface + +node_types: + tosca.nodes.CustomCompute: + derived_from: tosca.nodes.Compute + properties: + install_path: + type: string + default: /opt + interfaces: + Standard: + create: + implementation: install.sh + inputs: + install_path: { get_property: [ SELF, install_path ] } + +topology_template: + node_templates: + + softwarecomponent_without_behavior: + type: tosca.nodes.SoftwareComponent + requirements: + - host: server + + softwarecomponent_depending_on_customcompute_install: + type: tosca.nodes.SoftwareComponent + interfaces: + Standard: + create: + implementation: post_install.sh + requirements: + - host: server + + server: + type: tosca.nodes.CustomCompute + capabilities: + host: + properties: + num_cpus: 1 + mem_size: 1 GB + os: + properties: + type: Linux + distribution: Ubuntu + version: 12.04 + architecture: x86_64 diff --git a/tosca2heat/heat-translator/translator/tests/data/test_tosca_script_types.yaml b/tosca2heat/heat-translator/translator/tests/data/test_tosca_script_types.yaml new file mode 100644 index 0000000..b54cbcb --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/test_tosca_script_types.yaml @@ -0,0 +1,48 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: > + TOSCA template to test usage of different script types like + Ansible and Puppet one. + +topology_template: + + node_templates: + customwebserver: + type: tosca.nodes.WebServer + requirements: + - host: server + interfaces: + Standard: + create: + implementation: install.yaml + configure: + implementation: configure.yml + start: + implementation: start.pp + + customwebserver2: + type: tosca.nodes.WebServer + requirements: + - host: server + interfaces: + Standard: + create: + implementation: install.sh + configure: + implementation: configure.py + start: + implementation: start.sh + + server: + type: tosca.nodes.Compute + capabilities: + host: + properties: + num_cpus: 1 + mem_size: 1 GB + os: + properties: + type: Linux + distribution: Ubuntu + version: 12.04 + architecture: x86_64 diff --git a/tosca2heat/heat-translator/translator/tests/data/tosca_exchange_public_ssh_key.yaml b/tosca2heat/heat-translator/translator/tests/data/tosca_exchange_public_ssh_key.yaml new file mode 100644 index 0000000..7decb33 --- /dev/null +++ b/tosca2heat/heat-translator/translator/tests/data/tosca_exchange_public_ssh_key.yaml @@ -0,0 +1,54 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 + +description: TOSCA template to test get_operation_output by exchanging ssh public key + +topology_template: + + node_templates: + server1: + type: tosca.nodes.Compute + capabilities: + host: + properties: + num_cpus: 1 + mem_size: 1 GB + os: + properties: + type: Linux + distribution: Ubuntu + version: 12.04 + architecture: x86_64 + + server2: + type: tosca.nodes.Compute + capabilities: + host: + properties: + num_cpus: 1 + mem_size: 1 GB + os: + properties: + type: Linux + distribution: Ubuntu + version: 12.04 + architecture: x86_64 + + generate_ssh_key: + type: tosca.nodes.SoftwareComponent + interfaces: + Standard: + create: artifacts/ssh/ssh_generate_keys.sh + requirements: + - host: server1 + + import_public_key: + type: tosca.nodes.SoftwareComponent + interfaces: + Standard: + create: + implementation: artifacts/ssh/ssh_import_public_key.sh + inputs: + public_key: { get_operation_output: [generate_ssh_key, Standard, create, public_key] } + requirements: + - host: server2 + - dependency: generate_ssh_key |