summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser-0.3.0/toscaparser/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tosca2heat/tosca-parser-0.3.0/toscaparser/tests')
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/__init__.py0
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/config.py25
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/create.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/create.sh14
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/config.sh7
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/create.sh12
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_collectd.py28
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_elasticsearch.py26
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_rsyslog.py25
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/create.sh20
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/start.sh4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/config.sh7
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create.sh14
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create_database.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/start.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh8
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh9
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh2
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/config.sh28
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/create.sh7
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/start.sh3
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/config.sh30
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/create.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_install.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_start.sh2
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_configure.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_install.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/base.py67
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.csarbin17488 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.zipbin17488 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_hello_world.zipbin936 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_invalid_entry_def.zipbin940 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zipbin936 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_missing_metadata.zipbin933 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_no_metadata_file.zipbin496 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_not_zip.zip1
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress.zipbin5967 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zipbin5971 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zipbin6043 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zipbin5969 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zipbin6043 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zipbin6046 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zipbin873 -> 0 bytes
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml13
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml11
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml16
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml25
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml29
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml13
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml217
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py25
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py28
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py26
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py25
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/README.txt5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh14
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh7
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh12
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh4
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh20
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh7
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh14
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh28
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh7
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh3
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh30
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh5
-rwxr-xr-xtosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml109
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml19
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt22
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh9
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh2
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh8
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh2
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh4
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta5
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/collectd.yaml13
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/elasticsearch.yaml12
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/kibana.yaml14
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/logstash.yaml25
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_rsyslog.yaml17
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_test_wordpress.yaml23
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml29
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/rsyslog.yaml13
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/wordpress.yaml19
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/custom_datatype_def.yaml48
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml65
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml25
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml24
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml18
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml33
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml20
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml17
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml28
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml28
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_invalid_function_signature.yaml34
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_capability_property.yaml36
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml20
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_property.yaml13
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_instance_nested_imports.yaml22
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_section_names.yaml25
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_template_version.yaml14
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_multiple_validation_errors.yaml125
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_inputs_in_template.yaml17
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_outputs_in_template.yaml15
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_requirements.yaml67
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml33
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error1.yaml31
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error2.yaml33
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/definitions.yaml54
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/subsystem.yaml85
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/system.yaml51
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_elk.yaml217
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_helloworld.yaml23
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress.yaml121
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml122
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml120
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml43
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml64
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml39
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml79
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml61
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml87
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml99
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml64
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml59
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml93
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml17
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml96
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml32
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_constraints.py357
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_datatypes.py327
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_exception.py42
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_functions.py204
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_prereq.py230
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_properties.py236
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_scalarunit.py355
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_shell.py57
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_topology_template.py160
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscadef.py335
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatpl.py544
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatplvalidation.py1109
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_utils.py60
-rw-r--r--tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_validate_tosca_version.py132
160 files changed, 0 insertions, 7938 deletions
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/__init__.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/__init__.py
deleted file mode 100644
index e69de29..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/__init__.py
+++ /dev/null
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/config.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/config.py
deleted file mode 100755
index 686bbd1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/config.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures collectd to send metric data to the
-# logstash server port 25826
-# The environment variable logstash_ip is expected to be set up
-import os
-with open("/etc/collectd/collectd.conf.d/tosca_elk.conf", "w") as fh:
- fh.write("""
- LoadPlugin network
- <Plugin network>
- Server "%s" "25826"
- </Plugin>
- """ % (os.environ['logstash_ip']))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/create.sh
deleted file mode 100755
index a483b88..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script install collectd for monitoring data
-
-apt-get update
-apt-get install -y collectd
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/start.sh
deleted file mode 100755
index 7e8e033..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/collectd/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts collectd as a service in init.d
-service collectd stop
-service collectd start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/create.sh
deleted file mode 100755
index c34126c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/create.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# This script installs java and elasticsearch
-
-apt-get update
-apt-get install -y openjdk-7-jre-headless
-
-wget -qO - https://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
-echo "deb http://packages.elasticsearch.org/elasticsearch/1.5/debian stable main" | tee -a /etc/apt/sources.list
-
-apt-get update
-apt-get install -y elasticsearch
-
-# set up to run as service
-update-rc.d elasticsearch defaults 95 10
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/start.sh
deleted file mode 100755
index bbc0347..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/elasticsearch/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts elasticsearch as a service in init.d
-service elasticsearch stop
-service elasticsearch start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/config.sh
deleted file mode 100755
index f28215a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/config.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# This script configures kibana to connect to the elasticsearch server
-# to access data and to export the app url on port 5601:
-# The environment variable elasticsearch_ip and kibana_ip are expected
-# to be set up.
-sed -i 's/localhost/'$elasticsearch_ip'/' /opt/kibana/config/kibana.yml
-sed -i 's/0.0.0.0/'$kibana_ip'/' /opt/kibana/config/kibana.yml
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/create.sh
deleted file mode 100755
index 41914b1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/create.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-# This script installs kibana and sets it up to run as a service in init.d
-cd /opt
-wget https://download.elastic.co/kibana/kibana/kibana-4.1.0-linux-x64.tar.gz
-tar xzvf kibana-4.1.0-linux-x64.tar.gz
-mv kibana-4.1.0-linux-x64 kibana
-
-# set up to run as service
-cd /etc/init.d
-wget https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/bce61d85643c2dcdfbc2728c55a41dab444dca20/kibana4
-chmod +x kibana4
-update-rc.d kibana4 defaults 96 9
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/start.sh
deleted file mode 100755
index 5149bb3..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/kibana/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts kibana as a service in init.d
-service kibana4 stop
-service kibana4 start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_collectd.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_collectd.py
deleted file mode 100755
index 18fdacf..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_collectd.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash input using the udp protocol on
-# port 25826. This is intended to receive data from collectd from
-# any source
-with open("/etc/logstash/conf.d/collectd.conf", "w") as fh:
- fh.write("""
- input {
- udp {
- port => 25826 # 25826 is the default for collectd
- buffer_size => 1452 # 1452 is the default for collectd
- codec => collectd { }
- tags => ["metrics"]
- type => "collectd"
- }
- }""")
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_elasticsearch.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_elasticsearch.py
deleted file mode 100755
index 2e5389c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_elasticsearch.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash output to forward to elasticsearch
-# The environment variable elasticsearch_ip is expected to be set up
-import os
-with open("/etc/logstash/conf.d/elasticsearch.conf", 'w') as fh:
- fh.write("""
- output {
- elasticsearch {
- action => index
- host => "%s"
- protocol => "http"
- }
- }""" % (os.environ['elasticsearch_ip']))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_rsyslog.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_rsyslog.py
deleted file mode 100755
index fc610c2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/configure_rsyslog.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash input using the RELP protocol on
-# port 2514 This is intended to receive logs from rsyslog from
-# any source
-with open("/etc/logstash/conf.d/rsyslog.conf", "w") as fh:
- fh.write("""
- input {
- relp {
- port => 2514
- tags => ["logs"]
- }
- }""")
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/create.sh
deleted file mode 100755
index 77cc8fd..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/create.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# This script installs java, logstash and the contrib package for logstash
-# install java as prereq
-
-apt-get update
-apt-get install -y openjdk-7-jre-headless
-mkdir /etc/logstash
-
-# install by apt-get from repo
-wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
-echo "deb http://packages.elasticsearch.org/logstash/1.4/debian stable main" | tee -a /etc/apt/sources.list
-
-apt-get update
-apt-get install -y logstash
-
-# install contrib to get the relp plugin
-/opt/logstash/bin/plugin install contrib
-
-# set up to run as service
-update-rc.d logstash defaults 95 10
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/start.sh
deleted file mode 100755
index a73cf61..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/logstash/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Run logstash as service in init.d
-service logstash stop
-service logstash start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/config.sh
deleted file mode 100644
index 78f484e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/config.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Edit the file /etc/mongod.conf, update with real IP of Mongo server
-# This script configures the mongodb server to export its service on
-# the server IP
-# bind_ip = 127.0.0.1 -> bind_ip = <IP for Mongo server>
-# The environment variable mongodb_ip is expected to be set up
-sed -i "s/= 127.0.0.1/= $mongodb_ip,127.0.0.1/" /etc/mongod.conf
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create.sh
deleted file mode 100644
index d84c275..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# This script installs mongodb
-
-apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
-echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
-
-apt-get update
-apt-get install -y mongodb-org
-
-#Wait for mongodb initialization
-while [[ ! -d "/var/lib/mongodb/_tmp" ]]; do
- echo "Waiting for mongodb initialization ..."
- sleep 5
-done
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create_database.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create_database.sh
deleted file mode 100644
index 16f1358..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/create_database.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-echo "conn = new Mongo();" > setup.js
-echo "db = conn.getDB('paypal_pizza');" >> setup.js
-echo "db.about.insert({'name': 'PayPal Pizza Store'});" >> setup.js
-mongo setup.js
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/start.sh
deleted file mode 100644
index ac200a5..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mongodb/start.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script starts mongodb
-service mongod stop
-rm /var/lib/mongodb/mongod.lock
-service mongod start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh
deleted file mode 100755
index 092136a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-cat << EOF | mysql -u root --password=$db_root_password
-CREATE DATABASE $db_name;
-GRANT ALL PRIVILEGES ON $db_name.* TO "$db_user"@"localhost"
-IDENTIFIED BY "$db_password";
-FLUSH PRIVILEGES;
-EXIT
-EOF \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh
deleted file mode 100755
index d4ef6b4..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-sed --regexp-extended "s/(port\s*=\s*)[0-9]*/\1$db_port/g" </etc/mysql/my.cnf >/tmp/my.cnf
-mv -f /tmp/my.cnf /etc/mysql/my.cnf
-/etc/init.d/mysql stop
-/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh
deleted file mode 100755
index 38628b9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-#This script installs mysql server
-
-apt-get update
-
-debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"
-debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"
-
-apt-get -y install --fix-missing mysql-server \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh
deleted file mode 100755
index 3378670..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/config.sh
deleted file mode 100644
index 1e149a2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/config.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# This script installs an app for nodejs: the app intended is the paypal app
-# and it is configured to connect to the mongodb server
-# The environment variables github_url and mongodb_ip are expected to be set up
-export app_dir=/opt/app
-git clone $github_url /opt/app
-if [ -f /opt/app/package.json ]; then
- cd /opt/app/ && npm install
- sed -i "s/localhost/$mongodb_ip/" config.json
-fi
-
-cat > /etc/init/nodeapp.conf <<EOS
-description "node.js app"
-
-start on (net-device-up
- and local-filesystems
- and runlevel [2345])
-stop on runlevel [!2345]
-
-expect fork
-respawn
-
-script
- export HOME=/
- export NODE_PATH=/usr/lib/node
- exec /usr/bin/node ${app_dir}/app.js >> /var/log/nodeapp.log 2>&1 &
-end script
-EOS
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/create.sh
deleted file mode 100644
index 04fd6c6..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/create.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# This script installs nodejs and the prereq
-
-add-apt-repository ppa:chris-lea/node.js
-
-apt-get update
-apt-get install -y nodejs build-essential
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/start.sh
deleted file mode 100644
index 6939cb7..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/nodejs/start.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-# This script starts the nodejs application
-start nodeapp
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/config.sh
deleted file mode 100644
index 630767d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/config.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# This script configures the output for rsyslogd to send logs to the
-# logstash server port 2514 using the RELP protocol
-# The environment variable logstash_ip is expected to be set up
-echo "module(load=\"omrelp\")
-action(type=\"omrelp\" target=\"$logstash_ip\" port=\"2514\")" > /etc/rsyslog.d/tosca_elk.conf
-
-# Remove the /dev/xconsole configuration as xconsole
-# is not available by default
-l=`awk '/=warn.*\|.*\/dev\/xconsole/{print NR - 1}' /etc/rsyslog.d/50-default.conf`
-if [ ! -z $l ]; then
- l=`expr $l + 1`
- line=`cat /etc/rsyslog.d/50-default.conf | head -n $l | tail -1`
- if [[ ! $line == \#* ]]; then
- l0=`expr $l - 3`
- sed -i -r -e "${l0},${l}s/^.{0}/&#/" /etc/rsyslog.d/50-default.conf
- fi
-fi
-
-# Enable nodejs logs for rsyslog
-if ! grep -q nodeapp "/etc/rsyslog.conf"; then
- sed -i 's/\$PrivDropToGroup\ syslog/\$PrivDropToGroup adm/' /etc/rsyslog.conf
- echo "\$ModLoad imfile.so
-\$InputFileName /var/log/nodeapp.log
-\$InputFileTag paypal_pizza:
-\$InputFileStateFile stat-nodeapp
-\$InputRunFileMonitor
-\$InputFilePollInterval 1" >> /etc/rsyslog.conf
-fi
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/create.sh
deleted file mode 100755
index affdd6e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script installs rsyslog and the library for RELP
-
-apt-get update
-apt-get install -y rsyslog rsyslog-relp
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/start.sh
deleted file mode 100755
index 3de82d1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/rsyslog/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts rsyslogd as a service in init.d
-service rsyslog stop
-service rsyslog start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_install.sh
deleted file mode 100755
index 4ca9b4e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-#This script installs apache web server
-
-apt-get update
-apt-get install -y apache2 \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_start.sh
deleted file mode 100755
index e962ca5..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/webserver/webserver_start.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-service apache2 start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_configure.sh
deleted file mode 100755
index 5598b4f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_configure.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-ln -s /usr/share/wordpress /var/www/html/wordpress
-gzip -d /usr/share/doc/wordpress/examples/setup-mysql.gz
-echo $wp_db_password | bash /usr/share/doc/wordpress/examples/setup-mysql -e $wp_db_name -u $wp_db_user localhost \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_install.sh
deleted file mode 100755
index 1320443..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/artifacts/wordpress/wordpress_install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-#This script installs wordpress
-
-apt-get update
-apt-get install -y wordpress \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/base.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/base.py
deleted file mode 100644
index f6ff8d1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/base.py
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright 2010-2011 OpenStack Foundation
-# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
-#
-# 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 os
-
-import fixtures
-import testscenarios
-import testtools
-
-from toscaparser.tosca_template import ToscaTemplate
-
-_TRUE_VALUES = ('True', 'true', '1', 'yes')
-
-
-class TestCase(testscenarios.TestWithScenarios, testtools.TestCase):
-
- """Test case base class for all unit tests."""
-
- def setUp(self):
- """Run before each test method to initialize test environment."""
-
- super(TestCase, self).setUp()
- test_timeout = os.environ.get('OS_TEST_TIMEOUT', 0)
- try:
- test_timeout = int(test_timeout)
- except ValueError:
- # If timeout value is invalid do not set a timeout.
- test_timeout = 0
- if test_timeout > 0:
- self.useFixture(fixtures.Timeout(test_timeout, gentle=True))
-
- self.useFixture(fixtures.NestedTempfile())
- self.useFixture(fixtures.TempHomeDir())
-
- if os.environ.get('OS_STDOUT_CAPTURE') in _TRUE_VALUES:
- stdout = self.useFixture(fixtures.StringStream('stdout')).stream
- self.useFixture(fixtures.MonkeyPatch('sys.stdout', stdout))
- if os.environ.get('OS_STDERR_CAPTURE') in _TRUE_VALUES:
- stderr = self.useFixture(fixtures.StringStream('stderr')).stream
- self.useFixture(fixtures.MonkeyPatch('sys.stderr', stderr))
-
- self.log_fixture = self.useFixture(fixtures.FakeLogger())
-
- def _load_template(self, filename):
- """Load a Tosca template from tests data folder.
-
- :param filename: Tosca template file name to load.
- :return: ToscaTemplate
- """
- return ToscaTemplate(os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- 'data',
- filename))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.csar b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.csar
deleted file mode 100644
index 5fae801..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.csar
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.zip
deleted file mode 100644
index 5fae801..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_elk.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_hello_world.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_hello_world.zip
deleted file mode 100644
index 43ffbbc..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_hello_world.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_invalid_entry_def.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_invalid_entry_def.zip
deleted file mode 100644
index 382f790..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_invalid_entry_def.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zip
deleted file mode 100644
index 3e6120b..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_missing_metadata.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_missing_metadata.zip
deleted file mode 100644
index 5ec7a99..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_missing_metadata.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_no_metadata_file.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_no_metadata_file.zip
deleted file mode 100644
index b0df9b9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_no_metadata_file.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_not_zip.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_not_zip.zip
deleted file mode 100644
index 43b7f5f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_not_zip.zip
+++ /dev/null
@@ -1 +0,0 @@
-This is an invalid CSAR file. \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress.zip
deleted file mode 100644
index 5df7b48..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zip
deleted file mode 100644
index d644259..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zip
deleted file mode 100644
index c7a260f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zip
deleted file mode 100644
index 5e4f9e0..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zip
deleted file mode 100644
index b4133b6..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip
deleted file mode 100644
index 5dedfcd..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zip b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zip
deleted file mode 100644
index 85d660a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zip
+++ /dev/null
Binary files differ
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml
deleted file mode 100644
index 1ac0935..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- collectd is a daemon which gathers statistics about the system it is running on.
-
-node_types:
- tosca.nodes.SoftwareComponent.Collectd:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - log_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Logstash
- relationship: tosca.relationships.ConnectsTo \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml
deleted file mode 100644
index 4a1770f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml
+++ /dev/null
@@ -1,11 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Elasticsearch is an open-source search engine built on top of Apache Lucene, a full-text search-engine library.
-
-node_types:
- tosca.nodes.SoftwareComponent.Elasticsearch:
- derived_from: tosca.nodes.SoftwareComponent
- capabilities:
- search_endpoint:
- type: tosca.capabilities.Endpoint
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml
deleted file mode 100644
index 3a4351c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml
+++ /dev/null
@@ -1,16 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Kibana is an open source analytics and visualization platform designed to work with Elasticsearch.
- You use Kibana to search, view, and interact with data stored in Elasticsearch.
-
-node_types:
- tosca.nodes.SoftwareComponent.Kibana:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - search_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Elasticsearch
- relationship: tosca.relationships.ConnectsTo
-
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml
deleted file mode 100644
index 8495954..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Logstash is a tool for receiving, processing and outputting logs. All kinds of logs. System logs, webserver logs,
- error logs, application logs, and just about anything you can throw at it.
-
-node_types:
- tosca.nodes.SoftwareComponent.Logstash:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - search_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Elasticsearch
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_source:
- inputs:
- elasticsearch_ip:
- type: string
- capabilities:
- log_endpoint:
- type: tosca.capabilities.Endpoint
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml
deleted file mode 100644
index d62c4c1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Pizza store app that allows you to explore the features provided by PayPal's REST APIs.
- More detail can be found at https://github.com/paypal/rest-api-sample-app-nodejs/
-
-node_types:
- tosca.nodes.WebApplication.PayPalPizzaStore:
- derived_from: tosca.nodes.WebApplication
- properties:
- github_url:
- required: no
- type: string
- description: location of the application on the github.
- default: https://github.com/sample.git
- requirements:
- #WebApplication inherits Computer, so host implied.
- - database_connection:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- configure:
- inputs:
- github_url:
- type: string
- mongodb_ip:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml
deleted file mode 100644
index 4614ee7..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- RSYSLOG is the Rocket-fast SYStem for LOG processing.
-
-node_types:
- tosca.nodes.SoftwareComponent.Rsyslog:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - log_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Logstash
- relationship: tosca.relationships.ConnectsTo
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml
deleted file mode 100644
index 932f131..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml
+++ /dev/null
@@ -1,217 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash and kibana each on a separate server
- with monitoring enabled for nodejs server where a sample nodejs application is running. The rsyslog and collectd are
- installed on a nodejs server.
-
-imports:
- - paypalpizzastore_nodejs_app.yaml
- - elasticsearch.yaml
- - logstash.yaml
- - kibana.yaml
- - collectd.yaml
- - rsyslog.yaml
-
-dsl_definitions:
- host_capabilities: &host_capabilities
- # container properties (flavor)
- disk_size: 10 GB
- num_cpus: { get_input: my_cpus }
- mem_size: 4096 MB
- os_capabilities: &os_capabilities
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
-topology_template:
- inputs:
- my_cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- github_url:
- type: string
- description: The URL to download nodejs.
- default: http://github.com/paypal/rest-api-sample-app-nodejs.git
-
- node_templates:
- paypal_pizzastore:
- type: tosca.nodes.WebApplication.PayPalPizzaStore
- properties:
- github_url: { get_input: github_url }
- requirements:
- - host: nodejs
- - database_connection: mongo_db
- interfaces:
- Standard:
- configure:
- implementation: ../Scripts/nodejs/config.sh
- inputs:
- github_url: { get_property: [ SELF, github_url ] }
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: ../Scripts/nodejs/start.sh
- nodejs:
- type: tosca.nodes.WebServer
- requirements:
- - host:
- node: app_server
- interfaces:
- Standard:
- create: ../Scripts/nodejs/create.sh
- mongo_db:
- type: tosca.nodes.Database
- requirements:
- - host: mongo_dbms
- interfaces:
- Standard:
- create: ../Scripts/mongodb/create_database.sh
- mongo_dbms:
- type: tosca.nodes.DBMS
- requirements:
- - host: mongo_server
- interfaces:
- Standard:
- create: ../Scripts/mongodb/create.sh
- configure:
- implementation: ../Scripts/mongodb/config.sh
- inputs:
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: ../Scripts/mongodb/start.sh
- elasticsearch:
- type: tosca.nodes.SoftwareComponent.Elasticsearch
- requirements:
- - host: elasticsearch_server
- interfaces:
- Standard:
- create: ../Scripts/elasticsearch/create.sh
- start: ../Scripts/elasticsearch/start.sh
- logstash:
- type: tosca.nodes.SoftwareComponent.Logstash
- requirements:
- - host: logstash_server
- - search_endpoint:
- node: elasticsearch
- capability: search_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_source:
- implementation: ../Python/logstash/configure_elasticsearch.py
- inputs:
- elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
- interfaces:
- Standard:
- create: ../Scripts/logstash/create.sh
- start: ../Scripts/logstash/start.sh
- kibana:
- type: tosca.nodes.SoftwareComponent.Kibana
- requirements:
- - host: kibana_server
- - search_endpoint: elasticsearch
- interfaces:
- Standard:
- create: ../Scripts/kibana/create.sh
- configure:
- implementation: ../Scripts/kibana/config.sh
- inputs:
- elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
- kibana_ip: { get_attribute: [kibana_server, private_address] }
- start: ../Scripts/kibana/start.sh
- app_collectd:
- type: tosca.nodes.SoftwareComponent.Collectd
- requirements:
- - host: app_server
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_target:
- implementation: ../Python/logstash/configure_collectd.py
- interfaces:
- Standard:
- create: ../Scripts/collectd/create.sh
- configure:
- implementation: ../Python/collectd/config.py
- inputs:
- logstash_ip: { get_attribute: [logstash_server, private_address] }
- start: ../Scripts/collectd/start.sh
- app_rsyslog:
- type: tosca.nodes.SoftwareComponent.Rsyslog
- requirements:
- - host: app_server
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_target:
- implementation: ../Python/logstash/configure_rsyslog.py
- interfaces:
- Standard:
- create: ../Scripts/rsyslog/create.sh
- configure:
- implementation: ../Scripts/rsyslog/config.sh
- inputs:
- logstash_ip: { get_attribute: [logstash_server, private_address] }
- start: ../Scripts/rsyslog/start.sh
- app_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- mongo_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- elasticsearch_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- logstash_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- kibana_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
-
- outputs:
- nodejs_url:
- description: URL for the nodejs server, http://<IP>:3000
- value: { get_attribute: [ app_server, private_address ] }
- mongodb_url:
- description: URL for the mongodb server.
- value: { get_attribute: [ mongo_server, private_address ] }
- elasticsearch_url:
- description: URL for the elasticsearch server.
- value: { get_attribute: [ elasticsearch_server, private_address ] }
- logstash_url:
- description: URL for the logstash server.
- value: { get_attribute: [ logstash_server, private_address ] }
- kibana_url:
- description: URL for the kibana server.
- value: { get_attribute: [ kibana_server, private_address ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py
deleted file mode 100755
index 686bbd1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures collectd to send metric data to the
-# logstash server port 25826
-# The environment variable logstash_ip is expected to be set up
-import os
-with open("/etc/collectd/collectd.conf.d/tosca_elk.conf", "w") as fh:
- fh.write("""
- LoadPlugin network
- <Plugin network>
- Server "%s" "25826"
- </Plugin>
- """ % (os.environ['logstash_ip']))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py
deleted file mode 100755
index 18fdacf..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash input using the udp protocol on
-# port 25826. This is intended to receive data from collectd from
-# any source
-with open("/etc/logstash/conf.d/collectd.conf", "w") as fh:
- fh.write("""
- input {
- udp {
- port => 25826 # 25826 is the default for collectd
- buffer_size => 1452 # 1452 is the default for collectd
- codec => collectd { }
- tags => ["metrics"]
- type => "collectd"
- }
- }""")
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py
deleted file mode 100755
index 2e5389c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash output to forward to elasticsearch
-# The environment variable elasticsearch_ip is expected to be set up
-import os
-with open("/etc/logstash/conf.d/elasticsearch.conf", 'w') as fh:
- fh.write("""
- output {
- elasticsearch {
- action => index
- host => "%s"
- protocol => "http"
- }
- }""" % (os.environ['elasticsearch_ip']))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py
deleted file mode 100755
index fc610c2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/usr/bin/python
-
-# 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.
-
-# This script configures the logstash input using the RELP protocol on
-# port 2514 This is intended to receive logs from rsyslog from
-# any source
-with open("/etc/logstash/conf.d/rsyslog.conf", "w") as fh:
- fh.write("""
- input {
- relp {
- port => 2514
- tags => ["logs"]
- }
- }""")
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/README.txt b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/README.txt
deleted file mode 100644
index 382c9b0..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/README.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-README:
-
-This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash and kibana each on a separate server with monitoring enabled for nodejs server where a sample nodejs application is running. The syslog and collectd are installed on a nodejs server.
-
-Entry information for processing through an orchestrator is contained in file TOSCA-Metadata/TOSCA.meta. This file provides high-level information such as CSAR version or creator of the CSAR. Furthermore, it provides pointers to the entry template under 'Entry-Definitions' key. The entry template itself may contain pointers to one or more files that are used to define TOSCA base type, unless provided by orchestrator as built-in TOSCA basetypes, and other non-normative types. These are typically provided under 'imports' section in the entry template file. Those type definitions will be read and processed by orchestrator or TOSCA parser to create an internal graph showing dependencies and relationships between various TOSCA types. The entry template may have references to various artifacts required for deployment and will be processed accordingly.
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh
deleted file mode 100755
index a483b88..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script install collectd for monitoring data
-
-apt-get update
-apt-get install -y collectd
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh
deleted file mode 100755
index 7e8e033..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts collectd as a service in init.d
-service collectd stop
-service collectd start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh
deleted file mode 100755
index c34126c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# This script installs java and elasticsearch
-
-apt-get update
-apt-get install -y openjdk-7-jre-headless
-
-wget -qO - https://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
-echo "deb http://packages.elasticsearch.org/elasticsearch/1.5/debian stable main" | tee -a /etc/apt/sources.list
-
-apt-get update
-apt-get install -y elasticsearch
-
-# set up to run as service
-update-rc.d elasticsearch defaults 95 10
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh
deleted file mode 100755
index bbc0347..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts elasticsearch as a service in init.d
-service elasticsearch stop
-service elasticsearch start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh
deleted file mode 100755
index f28215a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# This script configures kibana to connect to the elasticsearch server
-# to access data and to export the app url on port 5601:
-# The environment variable elasticsearch_ip and kibana_ip are expected
-# to be set up.
-sed -i 's/localhost/'$elasticsearch_ip'/' /opt/kibana/config/kibana.yml
-sed -i 's/0.0.0.0/'$kibana_ip'/' /opt/kibana/config/kibana.yml
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh
deleted file mode 100755
index 41914b1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/bin/bash
-# This script installs kibana and sets it up to run as a service in init.d
-cd /opt
-wget https://download.elastic.co/kibana/kibana/kibana-4.1.0-linux-x64.tar.gz
-tar xzvf kibana-4.1.0-linux-x64.tar.gz
-mv kibana-4.1.0-linux-x64 kibana
-
-# set up to run as service
-cd /etc/init.d
-wget https://gist.githubusercontent.com/thisismitch/8b15ac909aed214ad04a/raw/bce61d85643c2dcdfbc2728c55a41dab444dca20/kibana4
-chmod +x kibana4
-update-rc.d kibana4 defaults 96 9
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh
deleted file mode 100755
index 5149bb3..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts kibana as a service in init.d
-service kibana4 stop
-service kibana4 start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh
deleted file mode 100755
index 77cc8fd..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/bin/bash
-# This script installs java, logstash and the contrib package for logstash
-# install java as prereq
-
-apt-get update
-apt-get install -y openjdk-7-jre-headless
-mkdir /etc/logstash
-
-# install by apt-get from repo
-wget -O - http://packages.elasticsearch.org/GPG-KEY-elasticsearch | apt-key add -
-echo "deb http://packages.elasticsearch.org/logstash/1.4/debian stable main" | tee -a /etc/apt/sources.list
-
-apt-get update
-apt-get install -y logstash
-
-# install contrib to get the relp plugin
-/opt/logstash/bin/plugin install contrib
-
-# set up to run as service
-update-rc.d logstash defaults 95 10
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh
deleted file mode 100755
index a73cf61..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# Run logstash as service in init.d
-service logstash stop
-service logstash start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh
deleted file mode 100644
index 78f484e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Edit the file /etc/mongod.conf, update with real IP of Mongo server
-# This script configures the mongodb server to export its service on
-# the server IP
-# bind_ip = 127.0.0.1 -> bind_ip = <IP for Mongo server>
-# The environment variable mongodb_ip is expected to be set up
-sed -i "s/= 127.0.0.1/= $mongodb_ip,127.0.0.1/" /etc/mongod.conf
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh
deleted file mode 100644
index d84c275..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# This script installs mongodb
-
-apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
-echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.0.list
-
-apt-get update
-apt-get install -y mongodb-org
-
-#Wait for mongodb initialization
-while [[ ! -d "/var/lib/mongodb/_tmp" ]]; do
- echo "Waiting for mongodb initialization ..."
- sleep 5
-done
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh
deleted file mode 100644
index 16f1358..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-echo "conn = new Mongo();" > setup.js
-echo "db = conn.getDB('paypal_pizza');" >> setup.js
-echo "db.about.insert({'name': 'PayPal Pizza Store'});" >> setup.js
-mongo setup.js
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh
deleted file mode 100644
index ac200a5..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script starts mongodb
-service mongod stop
-rm /var/lib/mongodb/mongod.lock
-service mongod start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh
deleted file mode 100644
index 1e149a2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# This script installs an app for nodejs: the app intended is the paypal app
-# and it is configured to connect to the mongodb server
-# The environment variables github_url and mongodb_ip are expected to be set up
-export app_dir=/opt/app
-git clone $github_url /opt/app
-if [ -f /opt/app/package.json ]; then
- cd /opt/app/ && npm install
- sed -i "s/localhost/$mongodb_ip/" config.json
-fi
-
-cat > /etc/init/nodeapp.conf <<EOS
-description "node.js app"
-
-start on (net-device-up
- and local-filesystems
- and runlevel [2345])
-stop on runlevel [!2345]
-
-expect fork
-respawn
-
-script
- export HOME=/
- export NODE_PATH=/usr/lib/node
- exec /usr/bin/node ${app_dir}/app.js >> /var/log/nodeapp.log 2>&1 &
-end script
-EOS
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh
deleted file mode 100644
index 04fd6c6..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# This script installs nodejs and the prereq
-
-add-apt-repository ppa:chris-lea/node.js
-
-apt-get update
-apt-get install -y nodejs build-essential
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh
deleted file mode 100644
index 6939cb7..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-# This script starts the nodejs application
-start nodeapp
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh
deleted file mode 100644
index 630767d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-
-# This script configures the output for rsyslogd to send logs to the
-# logstash server port 2514 using the RELP protocol
-# The environment variable logstash_ip is expected to be set up
-echo "module(load=\"omrelp\")
-action(type=\"omrelp\" target=\"$logstash_ip\" port=\"2514\")" > /etc/rsyslog.d/tosca_elk.conf
-
-# Remove the /dev/xconsole configuration as xconsole
-# is not available by default
-l=`awk '/=warn.*\|.*\/dev\/xconsole/{print NR - 1}' /etc/rsyslog.d/50-default.conf`
-if [ ! -z $l ]; then
- l=`expr $l + 1`
- line=`cat /etc/rsyslog.d/50-default.conf | head -n $l | tail -1`
- if [[ ! $line == \#* ]]; then
- l0=`expr $l - 3`
- sed -i -r -e "${l0},${l}s/^.{0}/&#/" /etc/rsyslog.d/50-default.conf
- fi
-fi
-
-# Enable nodejs logs for rsyslog
-if ! grep -q nodeapp "/etc/rsyslog.conf"; then
- sed -i 's/\$PrivDropToGroup\ syslog/\$PrivDropToGroup adm/' /etc/rsyslog.conf
- echo "\$ModLoad imfile.so
-\$InputFileName /var/log/nodeapp.log
-\$InputFileTag paypal_pizza:
-\$InputFileStateFile stat-nodeapp
-\$InputRunFileMonitor
-\$InputFilePollInterval 1" >> /etc/rsyslog.conf
-fi
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh
deleted file mode 100755
index affdd6e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-# This script installs rsyslog and the library for RELP
-
-apt-get update
-apt-get install -y rsyslog rsyslog-relp
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh
deleted file mode 100755
index 3de82d1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-# This script starts rsyslogd as a service in init.d
-service rsyslog stop
-service rsyslog start
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta
deleted file mode 100644
index feb3d4f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta
+++ /dev/null
@@ -1,4 +0,0 @@
-TOSCA-Meta-File-Version: 1.0
-CSAR-Version: 1.1
-Created-By: OASIS TOSCA TC
-Entry-Definitions: Definitions/tosca_elk.yaml \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml
deleted file mode 100644
index 1dd195a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml
+++ /dev/null
@@ -1,109 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
-
-imports:
- - wordpress.yaml
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- db_name:
- type: string
- description: The name of the database.
- db_user:
- type: string
- description: The user name of the DB user.
- db_pwd:
- type: string
- description: The WordPress database admin account password.
- db_root_pwd:
- type: string
- description: Root password for MySQL.
- db_port:
- type: PortDef
- description: Port for the MySQL database.
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: ../Scripts/WordPress/install.sh
- configure:
- implementation: ../Scripts/WordPress/configure.sh
- inputs:
- wp_db_name: { get_property: [ mysql_database, name ] }
- wp_db_user: { get_property: [ mysql_database, user ] }
- wp_db_password: { get_property: [ mysql_database, password ] }
-
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- requirements:
- - host: mysql_dbms
- interfaces:
- Standard:
- configure:
- implementation: ../Scripts/MYSQLDatabase/configure.sh
- inputs:
- db_name: { get_property: [ SELF, name ] }
- db_user: { get_property: [ SELF, user ] }
- db_password: { get_property: [ SELF, password ] }
- db_root_password: { get_property: [ mysql_dbms, root_password ] }
-
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: { get_input: db_root_pwd }
- port: { get_input: db_port }
- requirements:
- - host: server
- interfaces:
- Standard:
- create: ../Scripts/MYSQLDBMS/install.sh
- start: ../Scripts/MYSQLDBMS/start.sh
- configure:
- implementation: ../Scripts/MYSQLDBMS/configure.sh
- inputs:
- root_password: { get_property: [ mysql_dbms, root_password ] }
-
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- - host: server
- interfaces:
- Standard:
- create: ../Scripts/WebServer/install.sh
- start: ../Scripts/WebServer/start.sh
-
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
-
- outputs:
- website_url:
- description: IP address for Wordpress wiki.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml
deleted file mode 100644
index 5899ed9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-node_types:
- tosca.nodes.WebApplication.WordPress:
- derived_from: tosca.nodes.WebApplication
- requirements:
- - database_endpoint:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- inputs:
- wp_db_name:
- type: string
- wp_db_user:
- type: string
- wp_db_password:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt
deleted file mode 100644
index e882ff6..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-README:
-
-This CSAR contains all definitions that are required for deploying WordPress
-and MySQL on a single compute instance.
-
-Entry information for processing through an orchestrator is contained in file
-TOSCA-Metadata/TOSCA.meta. This file provides high-level information such as
-CSAR version or creator of the CSAR. Furthermore, it provides pointers to the
-various TOSCA definitions files that contain the real details.
-The entry 'Entry-Definitions' points to the definitions file which holds the
-service template for the workload.
-'Entry-Definitions' is optional. An orchestrator can also process the contents
-like this:
-1) Read in and process each definitions file.
-2) For each definitions file:
- 2.1) Read in all * type definitions (node types, capability types, etc.) and
- store them in an internal map
-3) Verify and build dependencies (e.g. inheritance) between all type definitions
- previously read in. Orchestrator built-in types (e.g. TOSCA base types) are
- also considered in this step.
-4) Process the actual service template (the file with a node_templates section).
- Validate using previously obtained type information.
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh
deleted file mode 100644
index d4ef6b4..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-sed --regexp-extended "s/(port\s*=\s*)[0-9]*/\1$db_port/g" </etc/mysql/my.cnf >/tmp/my.cnf
-mv -f /tmp/my.cnf /etc/mysql/my.cnf
-/etc/init.d/mysql stop
-/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh
deleted file mode 100644
index 38628b9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-#This script installs mysql server
-
-apt-get update
-
-debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"
-debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"
-
-apt-get -y install --fix-missing mysql-server \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh
deleted file mode 100644
index 3378670..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh
deleted file mode 100644
index 092136a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/sh
-cat << EOF | mysql -u root --password=$db_root_password
-CREATE DATABASE $db_name;
-GRANT ALL PRIVILEGES ON $db_name.* TO "$db_user"@"localhost"
-IDENTIFIED BY "$db_password";
-FLUSH PRIVILEGES;
-EXIT
-EOF \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh
deleted file mode 100644
index 4ca9b4e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-#This script installs apache web server
-
-apt-get update
-apt-get install -y apache2 \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh
deleted file mode 100644
index e962ca5..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh
+++ /dev/null
@@ -1,2 +0,0 @@
-#!/bin/sh
-service apache2 start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh
deleted file mode 100644
index 5598b4f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-ln -s /usr/share/wordpress /var/www/html/wordpress
-gzip -d /usr/share/doc/wordpress/examples/setup-mysql.gz
-echo $wp_db_password | bash /usr/share/doc/wordpress/examples/setup-mysql -e $wp_db_name -u $wp_db_user localhost \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh
deleted file mode 100644
index 1320443..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/sh
-#This script installs wordpress
-
-apt-get update
-apt-get install -y wordpress \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta
deleted file mode 100644
index 5208113..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta
+++ /dev/null
@@ -1,5 +0,0 @@
-TOSCA-Meta-File-Version: 1.0
-CSAR-Version: 1.1
-Created-By: OASIS TOSCA TC
-Entry-Definitions: Definitions/tosca_single_instance_wordpress.yaml
-Content-Type: application/vnd.oasis.tosca.definitions.yaml
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/collectd.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/collectd.yaml
deleted file mode 100644
index 1ac0935..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/collectd.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- collectd is a daemon which gathers statistics about the system it is running on.
-
-node_types:
- tosca.nodes.SoftwareComponent.Collectd:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - log_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Logstash
- relationship: tosca.relationships.ConnectsTo \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/elasticsearch.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/elasticsearch.yaml
deleted file mode 100644
index b140a32..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/elasticsearch.yaml
+++ /dev/null
@@ -1,12 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Elasticsearch is an open-source search engine built on top of Apache Lucene,
- a full-text search-engine library.
-
-node_types:
- tosca.nodes.SoftwareComponent.Elasticsearch:
- derived_from: tosca.nodes.SoftwareComponent
- capabilities:
- search_endpoint:
- type: tosca.capabilities.Endpoint
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/kibana.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/kibana.yaml
deleted file mode 100644
index 5701e69..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/kibana.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Kibana is an open source analytics and visualization platform designed to work with Elasticsearch.
- You use Kibana to search, view, and interact with data stored in Elasticsearch.
-
-node_types:
- tosca.nodes.SoftwareComponent.Kibana:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - search_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Elasticsearch
- relationship: tosca.relationships.ConnectsTo
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/logstash.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/logstash.yaml
deleted file mode 100644
index cf60521..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/logstash.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Logstash is a tool for receiving, processing and outputting logs. All kinds
- of logs. System logs, webserver logs, error logs, application logs, and just
- about anything you can throw at it.
-
-node_types:
- tosca.nodes.SoftwareComponent.Logstash:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - search_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Elasticsearch
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_source:
- inputs:
- elasticsearch_ip:
- type: string
- capabilities:
- log_endpoint:
- type: tosca.capabilities.Endpoint
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_rsyslog.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_rsyslog.yaml
deleted file mode 100644
index 622acab..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_rsyslog.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- RSYSLOG is the Rocket-fast SYStem for LOG processing.
-
-imports:
- - test_import:
- file: custom_types/logstash.yaml
-
-node_types:
- tosca.nodes.SoftwareComponent.Rsyslog:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - log_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Logstash
- relationship: tosca.relationships.ConnectsTo
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_test_wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_test_wordpress.yaml
deleted file mode 100644
index 294bcc9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/nested_test_wordpress.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-imports:
- - rsyslog: custom_types/nested_rsyslog.yaml
-node_types:
- tosca.nodes.SoftwareComponent.Rsyslog.TestRsyslogType:
- derived_from: tosca.nodes.SoftwareComponent.Rsyslog
-
- tosca.nodes.WebApplication.WordPress:
- derived_from: tosca.nodes.WebApplication
- requirements:
- - database_endpoint:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- inputs:
- wp_db_name:
- type: string
- wp_db_user:
- type: string
- wp_db_password:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml
deleted file mode 100644
index d62c4c1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml
+++ /dev/null
@@ -1,29 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Pizza store app that allows you to explore the features provided by PayPal's REST APIs.
- More detail can be found at https://github.com/paypal/rest-api-sample-app-nodejs/
-
-node_types:
- tosca.nodes.WebApplication.PayPalPizzaStore:
- derived_from: tosca.nodes.WebApplication
- properties:
- github_url:
- required: no
- type: string
- description: location of the application on the github.
- default: https://github.com/sample.git
- requirements:
- #WebApplication inherits Computer, so host implied.
- - database_connection:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- configure:
- inputs:
- github_url:
- type: string
- mongodb_ip:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/rsyslog.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/rsyslog.yaml
deleted file mode 100644
index 4614ee7..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/rsyslog.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- RSYSLOG is the Rocket-fast SYStem for LOG processing.
-
-node_types:
- tosca.nodes.SoftwareComponent.Rsyslog:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - log_endpoint:
- capability: tosca.capabilities.Endpoint
- node: tosca.nodes.SoftwareComponent.Logstash
- relationship: tosca.relationships.ConnectsTo
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/wordpress.yaml
deleted file mode 100644
index 5899ed9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/custom_types/wordpress.yaml
+++ /dev/null
@@ -1,19 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-node_types:
- tosca.nodes.WebApplication.WordPress:
- derived_from: tosca.nodes.WebApplication
- requirements:
- - database_endpoint:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- inputs:
- wp_db_name:
- type: string
- wp_db_user:
- type: string
- wp_db_password:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/custom_datatype_def.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/custom_datatype_def.yaml
deleted file mode 100644
index 4b7da71..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/custom_datatype_def.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Custom type and node definition used to test custom datatypes.
-
-node_types:
- tosca.nodes.my.SomeNode:
- derived_from: tosca.nodes.Root
- properties:
- people:
- type: tosca.my.datatypes.People
-
-datatype_definitions:
- tosca.my.datatypes.PeopleBase:
- properties:
- name:
- type: string
- required: true
- constraints:
- - min_length: 2
- gender:
- type: string
- default: unknown
-
- tosca.my.datatypes.People:
- derived_from: tosca.my.datatypes.PeopleBase
- properties:
- addresses:
- type: map
- entry_schema:
- type: string
- contacts:
- type: list
- entry_schema:
- type: tosca.my.datatypes.ContactInfo
-
- tosca.my.datatypes.ContactInfo:
- description: simple contact information
- properties:
- contact_name:
- type: string
- required: true
- constraints:
- - min_length: 2
- contact_email:
- type: string
- contact_phone:
- type: string
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml
deleted file mode 100644
index aefe862..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA templates used to test custom datatypes.
-
-node_types:
- tosca.nodes.my.SomeNode:
- derived_from: tosca.nodes.Root
- properties:
- people:
- type: tosca.my.datatypes.People
-
-datatype_definitions:
- tosca.my.datatypes.PeopleBase:
- properties:
- name:
- type: string
- required: true
- constraints:
- - min_length: 2
- gender:
- type: string
- default: unknown
-
- tosca.my.datatypes.People:
- derived_from: tosca.my.datatypes.PeopleBase
- properties:
- addresses:
- type: map
- entry_schema:
- type: string
- contacts:
- type: list
- entry_schema:
- type: tosca.my.datatypes.ContactInfo
-
- tosca.my.datatypes.ContactInfo:
- description: simple contact information
- properties:
- contact_name:
- type: string
- required: true
- constraints:
- - min_length: 2
- contact_email:
- type: string
- contact_phone:
- type: string
-
-topology_template:
- node_templates:
- positive:
- type: tosca.nodes.my.SomeNode
- properties:
- people:
- name: Mike
- gender: male
- addresses: {Home: 1 foo street, Office: 9 bar avenue}
- contacts:
- - {contact_name: Tom,
- contact_email: tom@email.com,
- contact_phone: '123456789'}
- - {contact_name: Jerry,
- contact_email: jerry@email.com,
- contact_phone: '321654987'} \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml
deleted file mode 100644
index b28f499..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA templates used to test custom datatypes.
-
-imports:
- - custom_datatype_def.yaml
-
-topology_template:
- node_templates:
- # 123456789 is not a string
- error in nested datatype:
- type: tosca.nodes.my.SomeNode
- properties:
- people:
- name: Mike
- gender: male
- addresses: {Home: 1 foo street, Office: 9 bar avenue}
- contacts:
- - {contact_name: Tom,
- contact_email: tom@email.com,
- contact_phone: 123456789}
- - {contact_name: Jerry,
- contact_email: jerry@email.com,
- contact_phone: '321654987'}
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml
deleted file mode 100644
index f1762f4..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml
+++ /dev/null
@@ -1,24 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA templates used to test custom datatypes.
-
-imports:
- - custom_datatype_def.yaml
-
-topology_template:
- node_templates:
- positive:
- type: tosca.nodes.my.SomeNode
- properties:
- people:
- name: Mike
- gender: male
- addresses: {Home: 1 foo street, Office: 9 bar avenue}
- contacts:
- - {contact_name: Tom,
- contact_email: tom@email.com,
- contact_phone: '123456789'}
- - {contact_name: Jerry,
- contact_email: jerry@email.com,
- contact_phone: '321654987'}
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml
deleted file mode 100644
index 31cf681..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml
+++ /dev/null
@@ -1,18 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA templates used to test custom datatypes.
-
-imports:
- - custom_datatype_def.yaml
-
-topology_template:
- node_templates:
- # addresses is not a map
- error in field value:
- type: tosca.nodes.my.SomeNode
- properties:
- people:
- name: Mike
- gender: male
- addresses: [1 foo street, 9 bar avenue]
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml
deleted file mode 100644
index 90ffbe2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA template for testing get_attribute with HOST keyword.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- dbms:
- type: tosca.nodes.DBMS
- requirements:
- - host: server
- interfaces:
- Standard:
- configure:
- implementation: configure.sh
- inputs:
- ip_address: { get_attribute: [ HOST, private_address ] }
- database:
- type: tosca.nodes.Database
- requirements:
- - host: dbms
- interfaces:
- Standard:
- configure:
- implementation: configure.sh
- inputs:
- ip_address: { get_attribute: [ HOST, private_address ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml
deleted file mode 100644
index 69679ff..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA template for testing get_attribute with HOST keyword.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- interfaces:
- Standard:
- configure:
- implementation: configure.sh
- inputs:
- ip_address: { get_attribute: [ HOST, private_address ] }
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml
deleted file mode 100644
index 6c7d9bb..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA template for testing get_attribute with HOST keyword.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
-
- outputs:
- ip_address:
- value: { get_attribute: [ HOST, private_address ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml
deleted file mode 100644
index 0570c7c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing unknown attribute name in get_attribute
- function.
-
-topology_template:
- inputs:
- image_id:
- type: string
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- interfaces:
- Standard:
- configure:
- implementation: start_server.sh
- inputs:
- image_id: { get_input: image_id }
-
- outputs:
- ip_address:
- value: { get_attribute: [ server, unknown_attribute ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml
deleted file mode 100644
index 923305c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml
+++ /dev/null
@@ -1,28 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing unknown node template name in get_attribute
- function.
-
-topology_template:
- inputs:
- image_id:
- type: string
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- interfaces:
- Standard:
- configure:
- implementation: start_server.sh
- inputs:
- image_id: { get_input: image_id }
-
- outputs:
- ip_address:
- value: { get_attribute: [ unknown_node_template, private_address ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_invalid_function_signature.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_invalid_function_signature.yaml
deleted file mode 100644
index dde8427..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_invalid_function_signature.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile template to test invalid get_input function.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- # compute properties (flavor)
- disk_size: 10 GB
- num_cpus: { get_input: [cpus, cpus] }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
-
- outputs:
- server_address:
- description: IP address of server instance.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_capability_property.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_capability_property.yaml
deleted file mode 100644
index 4a92530..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_capability_property.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing an unknown capability property.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: 1234
- port: 3672
- database:
- type: tosca.nodes.Database
- properties:
- name: my_db
- user: abcd
- password: 1234
- capabilities:
- database_endpoint:
- properties:
- port: { get_property: [ dbms, port ] }
- requirements:
- - host: dbms
- interfaces:
- Standard:
- configure:
- implementation: database_configure.sh
- inputs:
- db_port: { get_property: [ SELF, database_endpoint, unknown ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml
deleted file mode 100644
index cbfb391..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing an unknown input.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- interfaces:
- Standard:
- configure:
- implementation: start_server.sh
- inputs:
- image_id: { get_input: image_id }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_property.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_property.yaml
deleted file mode 100644
index 9ba7ee5..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/functions/test_unknown_input_in_property.yaml
+++ /dev/null
@@ -1,13 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing an unknown input.
-
-topology_template:
- node_templates:
- obj_store_server:
- type: tosca.nodes.ObjectStorage
- properties:
- name: { get_input: objectstore_name }
- size: 1024 MB
- maxsize: 1 GB
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_instance_nested_imports.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_instance_nested_imports.yaml
deleted file mode 100644
index 6b6542c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_instance_nested_imports.yaml
+++ /dev/null
@@ -1,22 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
-
-imports:
- - wordpress: custom_types/nested_test_wordpress.yaml
-
-topology_template:
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
-
- testrsyslogtype:
- type: tosca.nodes.SoftwareComponent.Rsyslog.TestRsyslogType
-
- rsyslog:
- type: tosca.nodes.SoftwareComponent.Rsyslog
-
- logstash:
- type: tosca.nodes.SoftwareComponent.Logstash
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_section_names.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_section_names.yaml
deleted file mode 100644
index 6241585..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_section_names.yaml
+++ /dev/null
@@ -1,25 +0,0 @@
-tosca_definitions_versions: tosca_simple_yaml_1_0
-
-descriptions: >
- TOSCA profile with invalid top-level section names.
-
-import:
- - imported.yaml
-
-topology_templates:
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_template_version.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_template_version.yaml
deleted file mode 100644
index 86dce79..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_invalid_template_version.yaml
+++ /dev/null
@@ -1,14 +0,0 @@
-tosca_definitions_version: tosca_xyz
-
-description: >
- Test template with an invalid template version.
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_multiple_validation_errors.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_multiple_validation_errors.yaml
deleted file mode 100644
index ccae4eb..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_multiple_validation_errors.yaml
+++ /dev/null
@@ -1,125 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
-
-imports:
- - custom_types/not_there.yaml
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- db_name:
- type: string
- description: The name of the database.
- default: wordpress
- db_user:
- type: string
- description: The user name of the DB user.
- default: wp_user
- db_pwd:
- type: string
- description: The WordPress database admin account password.
- default: wp_pass
- db_root_pwd:
- type: string
- description: Root password for MySQL.
- db_port:
- type: PortDef
- description: Port for the MySQL database.
- default: 3306
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirement:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress/wordpress_install.sh
- configure:
- implementation: wordpress/wordpress_configure.sh
- inputs:
- wp_db_name: { get_property: [ mysql_database, name ] }
- wp_db_user: { get_property: [ mysql_database, user ] }
- wp_db_password: { get_property: [ mysql_database, password ] }
-
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host: mysql_dbms
- interfaces:
- Standard:
- configure:
- implementation: mysql/mysql_database_configure.sh
- inputs:
- db_name: { get_property: [ SELF, name ] }
- db_user: { get_property: [ SELF, user ] }
- db_password: { get_property: [ SELF, passwords ] }
- db_root_password: { get_property: [ mysql_dbms, root_password ] }
-
- mysql_dbms:
- type1: tosca.nodes.DBMS
- properties:
- root_password: { get_input: db_root_pwd }
- port: { get_input: db_port }
- requirements:
- - host: server
- interfaces:
- Standard:
- create:
- implementation: mysql/mysql_dbms_install.sh
- inputs:
- db_root_password: { get_property: [ mysql_dbms, root_password ] }
- start: mysql/mysql_dbms_start.sh
- configure:
- implementation: mysql/mysql_dbms_configure.sh
- inputs:
- db_port: { get_property: [ mysql_dbms, port ] }
-
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- - host: server1
- - database_endpoint:
- node: webserver
- relationship:
- type1: tosca.relationships.ConnectsTo
- interfaces:
- Standard:
- create: webserver/webserver_install.sh
- start: webserver/webserver_start.sh
-
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
- outputs:
- website_url:
- description: URL for Wordpress wiki.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_inputs_in_template.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_inputs_in_template.yaml
deleted file mode 100644
index 0b9da4c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_inputs_in_template.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing a template with no inputs.
-
-metadata: test
-
-topology_template:
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
-
- outputs:
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_outputs_in_template.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_outputs_in_template.yaml
deleted file mode 100644
index 51d42ff..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_no_outputs_in_template.yaml
+++ /dev/null
@@ -1,15 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for testing a template with no outputs.
-
-topology_template:
- inputs:
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_requirements.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_requirements.yaml
deleted file mode 100644
index 269c46d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_requirements.yaml
+++ /dev/null
@@ -1,67 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Test Requirements.
-
-imports:
- - custom_types/wordpress.yaml
-
-topology_template:
- node_templates:
- my_app:
- description: >
- Specify multiple requirement via node and relationship keyword,
- as an explicit relationship. Also demonstrates relationship with
- type keyword and without it as an in-line reference.
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - req1:
- node: my_webserver
- relationship: tosca.relationships.HostedOn
- - req2:
- node: mysql_database
- relationship:
- type: tosca.relationships.ConnectsTo
- mysql_database:
- description: Specify requirement via a capability as an implicit relationship.
- type: tosca.nodes.Database
- requirements:
- - host:
- node: my_dbms
- relationship: tosca.relationships.HostedOn
- my_dbms:
- type: tosca.nodes.DBMS
- my_webserver:
- type: tosca.nodes.WebServer
- my_server:
- description: >
- Specify requirement via a relationship template, as an explicit relationship.
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- num_cpus: 2
- disk_size: 10 GB
- mem_size: 4 MB
- os:
- properties:
- # host Operating System image properties
- architecture: x86_64
- type: linux
- distribution: rhel
- version: 6.5
- requirements:
- - req1:
- node: my_storage
- relationship: storage_attachment
- my_storage:
- type: tosca.nodes.BlockStorage
- properties:
- size: 1 GiB
- snapshot_id: id
-
- relationship_templates:
- storage_attachment:
- type: tosca.relationships.AttachesTo
- properties:
- location: /temp
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml
deleted file mode 100644
index 8a702fb..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with short type name for Compute.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- node_templates:
- server:
- type: Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
-
- outputs:
- server_address:
- description: IP address of server instance.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error1.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error1.yaml
deleted file mode 100644
index 591ee97..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error1.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-description: >
- TOSCA simple profile missing version section.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
-
- outputs:
- server_address:
- description: IP address of server instance.
- value: { get_property: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error2.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error2.yaml
deleted file mode 100644
index 683e623..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/test_tosca_top_level_error2.yaml
+++ /dev/null
@@ -1,33 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with invalid top-level key: 'node_template'.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- node_template:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
-
- outputs:
- server_address:
- description: IP address of server instance.
- value: { get_property: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/definitions.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/definitions.yaml
deleted file mode 100644
index 083ee75..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/definitions.yaml
+++ /dev/null
@@ -1,54 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-node_types:
- example.TransactionSubsystem:
- properties:
- mq_server_ip:
- type: string
- receiver_port:
- type: integer
- attributes:
- receiver_ip:
- type: string
- receiver_port:
- type: integer
- capabilities:
- message_receiver:
- type: example.capabilities.Receiver
- requirements:
- - database_endpoint:
- capability: tosca.capabilities.Endpoint.Database
- node: tosca.nodes.Database
- relationship: tosca.relationships.ConnectsTo
-
- example.QueuingSubsystem:
- derived_from: tosca.nodes.SoftwareComponent
- requirements:
- - receiver1:
- node: example.TransactionSubsystem
- relationship: tosca.relationships.ConnectsTo
- - receiver2:
- node: example.TransactionSubsystem
- relationship: tosca.relationships.ConnectsTo
-
- example.DatabaseSubsystem:
- derived_from: tosca.nodes.Database
-
- example.SomeApp:
- derived_from: tosca.nodes.SoftwareComponent
- properties:
- admin_user:
- type: string
- pool_size:
- type: integer
- capabilities:
- message_receiver:
- type: example.capabilities.Receiver
-
-capability_types:
- example.capabilities.Receiver:
- derived_from: tosca.capabilities.Endpoint
- properties:
- server_ip:
- type: string
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/subsystem.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/subsystem.yaml
deleted file mode 100644
index ddbc94e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/subsystem.yaml
+++ /dev/null
@@ -1,85 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Service template with topology_template, act as a nested system inside another system.
-
-imports:
- - definitions.yaml
-
-topology_template:
- description: Template of a database including its hosting stack.
-
- inputs:
- mq_server_ip:
- type: string
- description: IP address of the message queuing server to receive messages from.
- receiver_port:
- type: string
- description: Port to be used for receiving messages.
- my_cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- substitution_mappings:
- node_type: example.TransactionSubsystem
- capabilities:
- message_receiver: [ app, message_receiver ]
- requirements:
- database_endpoint: [ app, database ]
-
- node_templates:
- app:
- type: example.SomeApp
- properties:
- admin_user: foo
- pool_size: 10
- capabilities:
- message_receiver:
- properties:
- server_ip: { get_input: mq_server_ip }
- requirements:
- - host:
- node: websrv
-
- websrv:
- type: tosca.nodes.WebServer
- capabilities:
- data_endpoint:
- properties:
- port_name: { get_input: receiver_port }
- requirements:
- - host:
- node: server
-
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: my_cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
- outputs:
- receiver_ip:
- description: private IP address of the message receiver application
- value: { get_attribute: [ server, private_address ] }
-# It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
-# receiver_port:
-# description: Port of the message receiver endpoint
-# value: { get_attribute: [ app, data_endpoint, port_name ] }
-
- groups:
- webserver_group:
- members: [ websrv, server ]
- policies:
- - policy_name: none
-
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/system.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/system.yaml
deleted file mode 100644
index 99aee0d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/topology_template/system.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-imports:
- - definitions.yaml
-
-topology_template:
- description: Template of online transaction processing service.
-
- node_templates:
- mq:
- type: example.QueuingSubsystem
- # properties:
- # to be updated when substitution_mapping is implemented
- # capabilities:
- # message_queue_endpoint:
- # to be updated when substitution_mapping is implemented
- requirements:
- - receiver1: trans1
- - receiver2: trans2
-
- trans1:
- type: example.TransactionSubsystem
- properties:
- # to be updated when substitution_mapping is implemented
- # mq_server_ip: { get_attribute: [ mq, server_ip ] }
- receiver_port: 8080
- # capabilities:
- # message_receiver:
- # to be updated when substitution_mapping is implemented
- requirements:
- - database_endpoint: dbsys
-
- trans2:
- type: example.TransactionSubsystem
- properties:
- # to be updated when substitution_mapping is implemented
- # mq_server_ip: { get_attribute: [ mq, server_ip ] }
- receiver_port: 8080
- # capabilities:
- # message_receiver:
- # to be updated when substitution_mapping is implemented
- requirements:
- - database_endpoint: dbsys
-
- dbsys:
- type: example.DatabaseSubsystem
- # properties:
- # to be updated when substitution_mapping is implemented
- # capabilities:
- # database_endpoint:
- # to be updated when substitution_mapping is implemented \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_elk.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_elk.yaml
deleted file mode 100644
index 6fc1756..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_elk.yaml
+++ /dev/null
@@ -1,217 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- This TOSCA simple profile deploys nodejs, mongodb, elasticsearch, logstash
- and kibana each on a separate server with monitoring enabled for nodejs
- server where a sample nodejs application is running. The rsyslog and collectd
- are installed on a nodejs server.
-
-imports:
- - custom_types/paypalpizzastore_nodejs_app.yaml
- - custom_types/elasticsearch.yaml
- - custom_types/logstash.yaml
- - custom_types/kibana.yaml
- - custom_types/collectd.yaml
- - custom_types/rsyslog.yaml
-
-dsl_definitions:
- host_capabilities: &host_capabilities
- disk_size: 10 GB
- num_cpus: { get_input: my_cpus }
- mem_size: 4096 MB
- os_capabilities: &os_capabilities
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
-topology_template:
- inputs:
- my_cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- github_url:
- type: string
- description: The URL to download nodejs.
- default: http://github.com/paypal/rest-api-sample-app-nodejs.git
-
- node_templates:
- paypal_pizzastore:
- type: tosca.nodes.WebApplication.PayPalPizzaStore
- properties:
- github_url: { get_input: github_url }
- requirements:
- - host: nodejs
- - database_connection: mongo_db
- interfaces:
- Standard:
- configure:
- implementation: nodejs/config.sh
- inputs:
- github_url: { get_property: [ SELF, github_url ] }
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: nodejs/start.sh
- nodejs:
- type: tosca.nodes.WebServer
- requirements:
- - host: app_server
- interfaces:
- Standard:
- create: nodejs/create.sh
- mongo_db:
- type: tosca.nodes.Database
- requirements:
- - host: mongo_dbms
- interfaces:
- Standard:
- create: mongodb/create_database.sh
- mongo_dbms:
- type: tosca.nodes.DBMS
- requirements:
- - host: mongo_server
- interfaces:
- Standard:
- create: mongodb/create.sh
- configure:
- implementation: mongodb/config.sh
- inputs:
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: mongodb/start.sh
- elasticsearch:
- type: tosca.nodes.SoftwareComponent.Elasticsearch
- requirements:
- - host: elasticsearch_server
- interfaces:
- Standard:
- create: elasticsearch/create.sh
- start: elasticsearch/start.sh
- logstash:
- type: tosca.nodes.SoftwareComponent.Logstash
- requirements:
- - host: logstash_server
- - search_endpoint:
- node: elasticsearch
- capability: search_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_source:
- implementation: logstash/configure_elasticsearch.py
- inputs:
- elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
- interfaces:
- Standard:
- create: logstash/create.sh
- start: logstash/start.sh
- kibana:
- type: tosca.nodes.SoftwareComponent.Kibana
- requirements:
- - host: kibana_server
- - search_endpoint: elasticsearch
- interfaces:
- Standard:
- create: kibana/create.sh
- configure:
- implementation: kibana/config.sh
- inputs:
- elasticsearch_ip: { get_attribute: [elasticsearch_server, private_address] }
- kibana_ip: { get_attribute: [kibana_server, private_address] }
- start: kibana/start.sh
- app_collectd:
- type: tosca.nodes.SoftwareComponent.Collectd
- requirements:
- - host: app_server
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_target:
- implementation: logstash/configure_collectd.py
- interfaces:
- Standard:
- create: collectd/create.sh
- configure:
- implementation: collectd/config.py
- inputs:
- logstash_ip: { get_attribute: [logstash_server, private_address] }
- start: collectd/start.sh
- app_rsyslog:
- type: tosca.nodes.SoftwareComponent.Rsyslog
- requirements:
- - host: app_server
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- interfaces:
- Configure:
- pre_configure_target:
- implementation: logstash/configure_rsyslog.py
- interfaces:
- Standard:
- create: rsyslog/create.sh
- configure:
- implementation: rsyslog/config.sh
- inputs:
- logstash_ip: { get_attribute: [logstash_server, private_address] }
- start: rsyslog/start.sh
- app_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- mongo_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- elasticsearch_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- logstash_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- kibana_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
-
- outputs:
- nodejs_url:
- description: URL for the nodejs server, http://<IP>:3000
- value: { get_attribute: [ app_server, private_address ] }
- mongodb_url:
- description: URL for the mongodb server.
- value: { get_attribute: [ mongo_server, private_address ] }
- elasticsearch_url:
- description: URL for the elasticsearch server.
- value: { get_attribute: [ elasticsearch_server, private_address ] }
- logstash_url:
- description: URL for the logstash server.
- value: { get_attribute: [ logstash_server, private_address ] }
- kibana_url:
- description: URL for the kibana server.
- value: { get_attribute: [ kibana_server, private_address ] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_helloworld.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_helloworld.yaml
deleted file mode 100644
index 5b913ff..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_helloworld.yaml
+++ /dev/null
@@ -1,23 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: Template for deploying a single server with predefined properties.
-
-topology_template:
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- # Host container properties
- host:
- properties:
- num_cpus: 2
- disk_size: 10 GB
- mem_size: 512 MB
- # Guest Operating System properties
- os:
- properties:
- # host Operating System image properties
- architecture: x86_64
- type: Linux
- distribution: RHEL
- version: 6.5
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress.yaml
deleted file mode 100644
index 9e686ab..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress.yaml
+++ /dev/null
@@ -1,121 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
-
-imports:
- - custom_types/wordpress.yaml
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- db_name:
- type: string
- description: The name of the database.
- default: wordpress
- db_user:
- type: string
- description: The user name of the DB user.
- default: wp_user
- db_pwd:
- type: string
- description: The WordPress database admin account password.
- default: wp_pass
- db_root_pwd:
- type: string
- description: Root password for MySQL.
- db_port:
- type: PortDef
- description: Port for the MySQL database.
- default: 3306
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress/wordpress_install.sh
- configure:
- implementation: wordpress/wordpress_configure.sh
- inputs:
- wp_db_name: { get_property: [ mysql_database, name ] }
- wp_db_user: { get_property: [ mysql_database, user ] }
- wp_db_password: { get_property: [ mysql_database, password ] }
-
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host: mysql_dbms
- interfaces:
- Standard:
- configure:
- implementation: mysql/mysql_database_configure.sh
- inputs:
- db_name: { get_property: [ SELF, name ] }
- db_user: { get_property: [ SELF, user ] }
- db_password: { get_property: [ SELF, password ] }
- db_root_password: { get_property: [ mysql_dbms, root_password ] }
-
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: { get_input: db_root_pwd }
- port: { get_input: db_port }
- requirements:
- - host: server
- interfaces:
- Standard:
- create:
- implementation: mysql/mysql_dbms_install.sh
- inputs:
- db_root_password: { get_property: [ mysql_dbms, root_password ] }
- start: mysql/mysql_dbms_start.sh
- configure:
- implementation: mysql/mysql_dbms_configure.sh
- inputs:
- db_port: { get_property: [ mysql_dbms, port ] }
-
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- - host: server
- interfaces:
- Standard:
- create: webserver/webserver_install.sh
- start: webserver/webserver_start.sh
-
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
- outputs:
- website_url:
- description: URL for Wordpress wiki.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml
deleted file mode 100644
index 6caac11..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml
+++ /dev/null
@@ -1,122 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
- Parsing of this test template will fail with errors if provided imports does
- not refer to a valid absolute path.
-
-imports:
- - /tmp/tosca-parser/toscaparser/tests/data/custom_types/wordpress.yaml
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- db_name:
- type: string
- description: The name of the database.
- default: wordpress
- db_user:
- type: string
- description: The user name of the DB user.
- default: wp_user
- db_pwd:
- type: string
- description: The WordPress database admin account password.
- default: wp_pass
- db_root_pwd:
- type: string
- description: Root password for MySQL.
- db_port:
- type: PortDef
- description: Port for the MySQL database.
- default: 3306
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress/wordpress_install.sh
- configure:
- implementation: wordpress/wordpress_configure.sh
- inputs:
- wp_db_name: wordpress
- wp_db_user: wp_user
- wp_db_password: wp_pass
-
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host:
- node: mysql_dbms
- interfaces:
- Standard:
- configure:
- implementation: mysql/mysql_database_configure.sh
- inputs:
- db_name: wordpress
- db_user: wp_user
- db_password: wp_pass
- db_root_password: passw0rd
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: { get_input: db_root_pwd }
- port: { get_input: db_port }
- requirements:
- - host: server
- interfaces:
- Standard:
- create:
- implementation: mysql/mysql_dbms_install.sh
- inputs:
- db_root_password: passw0rd
- start: mysql/mysql_dbms_start.sh
- configure:
- implementation: mysql/mysql_dbms_configure.sh
- inputs:
- db_port: 3366
-
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- - host: server
- interfaces:
- Standard:
- create: webserver/webserver_install.sh
- start: webserver/webserver_start.sh
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
- outputs:
- website_url:
- description: URL for Wordpress wiki.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml
deleted file mode 100644
index e5f1580..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml
+++ /dev/null
@@ -1,120 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with wordpress, web server and mysql on the same server.
-
-imports:
- - https://raw.githubusercontent.com/openstack/heat-translator/master/translator/tests/data/custom_types/wordpress.yaml
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- db_name:
- type: string
- description: The name of the database.
- default: wordpress
- db_user:
- type: string
- description: The user name of the DB user.
- default: wp_user
- db_pwd:
- type: string
- description: The WordPress database admin account password.
- default: wp_pass
- db_root_pwd:
- type: string
- description: Root password for MySQL.
- db_port:
- type: PortDef
- description: Port for the MySQL database.
- default: 3306
-
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress/wordpress_install.sh
- configure:
- implementation: wordpress/wordpress_configure.sh
- inputs:
- wp_db_name: wordpress
- wp_db_user: wp_user
- wp_db_password: wp_pass
-
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host:
- node: mysql_dbms
- interfaces:
- Standard:
- configure:
- implementation: mysql/mysql_database_configure.sh
- inputs:
- db_name: wordpress
- db_user: wp_user
- db_password: wp_pass
- db_root_password: passw0rd
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: { get_input: db_root_pwd }
- port: { get_input: db_port }
- requirements:
- - host: server
- interfaces:
- Standard:
- create:
- implementation: mysql/mysql_dbms_install.sh
- inputs:
- db_root_password: passw0rd
- start: mysql/mysql_dbms_start.sh
- configure:
- implementation: mysql/mysql_dbms_configure.sh
- inputs:
- db_port: 3366
-
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- - host: server
- interfaces:
- Standard:
- create: webserver/webserver_install.sh
- start: webserver/webserver_start.sh
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
- outputs:
- website_url:
- description: URL for Wordpress wiki.
- value: { get_attribute: [server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml
deleted file mode 100644
index 8e58fa9..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml
+++ /dev/null
@@ -1,43 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with 1 server bound to a new network
-
-topology_template:
-
- inputs:
- network_name:
- type: string
- description: Network name
-
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 512 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: CirrOS
- version: 0.3.2
-
- my_network:
- type: tosca.nodes.network.Network
- properties:
- network_name: { get_input: network_name }
- ip_version: 4
- cidr: '192.168.0.0/24'
- start_ip: '192.168.0.50'
- end_ip: '192.168.0.200'
- gateway_ip: '192.168.0.1'
-
- my_port:
- type: tosca.nodes.network.Port
- requirements:
- - binding: my_server
- - link: my_network
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml
deleted file mode 100644
index d791b17..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with 1 server bound to 3 networks
-
-topology_template:
-
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 512 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: CirrOS
- version: 0.3.2
-
- my_network1:
- type: tosca.nodes.network.Network
- properties:
- cidr: '192.168.1.0/24'
- network_name: net1
-
- my_network2:
- type: tosca.nodes.network.Network
- properties:
- cidr: '192.168.2.0/24'
- network_name: net2
-
- my_network3:
- type: tosca.nodes.network.Network
- properties:
- cidr: '192.168.3.0/24'
- network_name: net3
-
- my_port1:
- type: tosca.nodes.network.Port
- properties:
- order: 0
- requirements:
- - binding: my_server
- - link: my_network1
-
- my_port2:
- type: tosca.nodes.network.Port
- properties:
- order: 1
- requirements:
- - binding: my_server
- - link: my_network2
-
- my_port3:
- type: tosca.nodes.network.Port
- properties:
- order: 2
- requirements:
- - binding: my_server
- - link: my_network3
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml
deleted file mode 100644
index 7fedc13..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with 1 server bound to an existing network
-
-topology_template:
- inputs:
- network_name:
- type: string
- description: Network name
-
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 512 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: CirrOS
- version: 0.3.2
-
- my_network:
- type: tosca.nodes.network.Network
- properties:
- network_name: { get_input: network_name }
-
- my_port:
- type: tosca.nodes.network.Port
- requirements:
- - binding:
- node: my_server
- - link:
- node: my_network
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml
deleted file mode 100644
index 1473a8d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml
+++ /dev/null
@@ -1,79 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with 2 servers bound to the 1 network
-
-topology_template:
-
- inputs:
- network_name:
- type: string
- description: Network name
- network_cidr:
- type: string
- default: 10.0.0.0/24
- description: CIDR for the network
- network_start_ip:
- type: string
- default: 10.0.0.100
- description: Start IP for the allocation pool
- network_end_ip:
- type: string
- default: 10.0.0.150
- description: End IP for the allocation pool
-
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 512 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: CirrOS
- version: 0.3.2
-
- my_server2:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 512 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: CirrOS
- version: 0.3.2
-
- my_network:
- type: tosca.nodes.network.Network
- properties:
- ip_version: 4
- cidr: { get_input: network_cidr }
- network_name: { get_input: network_name }
- start_ip: { get_input: network_start_ip }
- end_ip: { get_input: network_end_ip }
-
- my_port:
- type: tosca.nodes.network.Port
- requirements:
- - binding:
- node: my_server
- - link:
- node: my_network
-
- my_port2:
- type: tosca.nodes.network.Port
- requirements:
- - binding:
- node: my_server2
- - link:
- node: my_network
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml
deleted file mode 100644
index 460fa4c..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml
+++ /dev/null
@@ -1,61 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with server and attached block storage using the normative AttachesTo Relationship Type.
-
-topology_template:
-
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- description: Size of the storage to be created.
- default: 1 GB
- storage_snapshot_id:
- type: string
- description: >
- Optional identifier for an existing snapshot to use when creating storage.
- storage_location:
- type: string
- description: Block storage mount point (filesystem path).
-
- node_templates:
- my_server:
- type: Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 kB
- os:
- properties:
- architecture: x86_64
- type: linux
- distribution: fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship:
- type: AttachesTo
- properties:
- location: { get_input: storage_location }
-
- my_storage:
- type: BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- outputs:
- private_ip:
- description: The private IP address of the newly created compute instance.
- value: { get_attribute: [my_server, private_address] }
- volume_id:
- description: The volume id of the block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml
deleted file mode 100644
index df22d72..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml
+++ /dev/null
@@ -1,87 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with a Single Block Storage node shared by 2-Tier Application with custom AttachesTo Type and implied relationships.
-
-relationship_types:
- MyAttachesTo:
- derived_from: tosca.relationships.AttachesTo
- properties:
- location:
- type: string
- default: /default_location
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- default: 1 GB
- description: Size of the storage to be created.
- storage_snapshot_id:
- type: string
- description: >
- Optional identifier for an existing snapshot to use when creating storage.
-
- node_templates:
- my_web_app_tier_1:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship: MyAttachesTo
-
- my_web_app_tier_2:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship:
- type: MyAttachesTo
- properties:
- location: /some_other_data_location
-
- my_storage:
- type: tosca.nodes.BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- outputs:
- private_ip_1:
- description: The private IP address of the application's first tier.
- value: { get_attribute: [my_web_app_tier_1, private_address] }
- private_ip_2:
- description: The private IP address of the application's second tier.
- value: { get_attribute: [my_web_app_tier_2, private_address] }
- volume_id:
- description: The volume id of the block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml
deleted file mode 100644
index cb1c17a..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml
+++ /dev/null
@@ -1,99 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with a single Block Storage node shared by 2-Tier Application with custom AttachesTo Type and explicit Relationship Templates.
-
-relationship_types:
- MyAttachesTo:
- derived_from: tosca.relationships.AttachesTo
- properties:
- location:
- type: string
- default: /default_location
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- default: 1 GB
- description: Size of the storage to be created.
- storage_snapshot_id:
- type: string
- description: >
- Optional identifier for an existing snapshot to use when creating storage.
- storage_location:
- type: string
- description: >
- Block storage mount point (filesystem path).
-
- node_templates:
-
- my_web_app_tier_1:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 kB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship: storage_attachesto_1
-
- my_web_app_tier_2:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 kB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship: storage_attachesto_2
-
- my_storage:
- type: tosca.nodes.BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- relationship_templates:
- storage_attachesto_1:
- type: MyAttachesTo
- properties:
- location: /my_data_location
-
- storage_attachesto_2:
- type: MyAttachesTo
- properties:
- location: /some_other_data_location
- outputs:
- private_ip_1:
- description: The private IP address of the application's first tier.
- value: { get_attribute: [my_web_app_tier_1, private_address] }
- private_ip_2:
- description: The private IP address of the application's second tier.
- value: { get_attribute: [my_web_app_tier_2, private_address] }
- volume_id:
- description: The volume id of the block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml
deleted file mode 100644
index 932f89e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml
+++ /dev/null
@@ -1,64 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with server and attached block storage using a custom AttachesTo Relationship Type.
-
-relationship_types:
- MyCustomAttachesTo:
- derived_from: AttachesTo
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- description: Size of the storage to be created.
- default: 1 GB
- storage_snapshot_id:
- type: string
- description: >
- Optional identifier for an existing snapshot to use when creating storage.
- storage_location:
- type: string
- description: Block storage mount point (filesystem path).
-
- node_templates:
- my_server:
- type: Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- # Declare custom AttachesTo type using the 'relationship' keyword
- relationship:
- type: MyCustomAttachesTo
- properties:
- location: { get_input: storage_location }
- my_storage:
- type: BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- outputs:
- private_ip:
- description: The private IP address of the newly created compute instance.
- value: { get_attribute: [my_server, private_address] }
- volume_id:
- description: The volume id of the block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml
deleted file mode 100644
index c31a4da..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml
+++ /dev/null
@@ -1,59 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with server and attached block storage using a named Relationship Template for the storage attachment.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- description: Size of the storage to be created.
- default: 1 GB
- storage_location:
- type: string
- description: Block storage mount point (filesystem path).
-
- node_templates:
- my_server:
- type: Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- # Declare template to use with 'relationship' keyword
- relationship: storage_attachment
-
- my_storage:
- type: BlockStorage
- properties:
- size: { get_input: storage_size }
-
- relationship_templates:
- storage_attachment:
- type: AttachesTo
- properties:
- location: { get_input: storage_location }
-
- outputs:
- private_ip:
- description: The private IP address of the newly created compute instance.
- value: { get_attribute: [my_server, private_address] }
- volume_id:
- description: The volume id of the block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml
deleted file mode 100644
index aa4647e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml
+++ /dev/null
@@ -1,93 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with 2 servers each with different attached block storage.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- storage_size:
- type: scalar-unit.size
- default: 1 GB
- description: Size of the storage to be created.
- storage_snapshot_id:
- type: string
- description: >
- Optional identifier for an existing snapshot to use when creating storage.
- storage_location:
- type: string
- description: >
- Block storage mount point (filesystem path).
-
- node_templates:
- my_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage
- relationship:
- type: AttachesTo
- properties:
- location: { get_input: storage_location }
- my_storage:
- type: tosca.nodes.BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- my_server2:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- requirements:
- - local_storage:
- node: my_storage2
- relationship:
- type: AttachesTo
- properties:
- location: { get_input: storage_location }
- my_storage2:
- type: tosca.nodes.BlockStorage
- properties:
- size: { get_input: storage_size }
- snapshot_id: { get_input: storage_snapshot_id }
-
- outputs:
- server_ip_1:
- description: The private IP address of the application's first server.
- value: { get_attribute: [my_server, private_address] }
- server_ip_2:
- description: The private IP address of the application's second server.
- value: { get_attribute: [my_server2, private_address] }
- volume_id_1:
- description: The volume id of the first block storage instance.
- value: { get_attribute: [my_storage, volume_id] }
- volume_id_2:
- description: The volume id of the second block storage instance.
- value: { get_attribute: [my_storage2, volume_id] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml
deleted file mode 100644
index 869af48..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml
+++ /dev/null
@@ -1,17 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- Tosca template for creating an object storage service.
-
-topology_template:
- inputs:
- objectstore_name:
- type: string
-
- node_templates:
- obj_store_server:
- type: tosca.nodes.ObjectStorage
- properties:
- name: { get_input: objectstore_name }
- size: 1024 kB
- maxsize: 1 GB
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml
deleted file mode 100644
index f611071..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml
+++ /dev/null
@@ -1,96 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile with nodejs and mongodb.
-
-imports:
- - custom_types/paypalpizzastore_nodejs_app.yaml
-
-dsl_definitions:
- host_capabilities: &host_capabilities
- disk_size: 10 GB
- num_cpus: 1
- mem_size: 4096 MB
- os_capabilities: &os_capabilities
- architecture: x86_64
- type: Linux
- distribution: Ubuntu
- version: 14.04
-
-topology_template:
- inputs:
- my_cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
- default: 1
- github_url:
- type: string
- description: The URL to download nodejs.
- default: http://github.com/paypal/rest-api-sample-app-nodejs.git
-
- node_templates:
- paypal_pizzastore:
- type: tosca.nodes.WebApplication.PayPalPizzaStore
- properties:
- github_url: { get_input: github_url }
- requirements:
- - host: nodejs
- - database_connection: mongo_db
- interfaces:
- Standard:
- configure:
- implementation: nodejs/config.sh
- inputs:
- github_url: http://github.com/paypal/rest-api-sample-app-nodejs.git
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: nodejs/start.sh
- nodejs:
- type: tosca.nodes.WebServer
- requirements:
- - host: app_server
- interfaces:
- Standard:
- create: nodejs/create.sh
- mongo_db:
- type: tosca.nodes.Database
- requirements:
- - host: mongo_dbms
- interfaces:
- Standard:
- create: mongodb/create_database.sh
- mongo_dbms:
- type: tosca.nodes.DBMS
- requirements:
- - host: mongo_server
- interfaces:
- Standard:
- create: mongodb/create.sh
- configure:
- implementation: mongodb/config.sh
- inputs:
- mongodb_ip: { get_attribute: [mongo_server, private_address] }
- start: mongodb/start.sh
- mongo_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
- app_server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties: *host_capabilities
- os:
- properties: *os_capabilities
-
- outputs:
- nodejs_url:
- description: URL for the nodejs server, http://<IP>:3000
- value: { get_attribute: [app_server, private_address] }
- mongodb_url:
- description: URL for the mongodb server.
- value: { get_attribute: [mongo_server, private_address] }
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml
deleted file mode 100644
index c4cce9d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml
+++ /dev/null
@@ -1,32 +0,0 @@
-tosca_definitions_version: tosca_simple_yaml_1_0
-
-description: >
- TOSCA simple profile that just defines a single compute instance and selects a (guest) host Operating System from the Compute node's properties. Note, this example does not include default values on inputs properties.
-
-topology_template:
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraints:
- - valid_values: [ 1, 2, 4, 8 ]
-
- node_templates:
- my_server:
- type: Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: ubuntu
- version: 12.04
- outputs:
- private_ip:
- description: The private IP address of the deployed server instance.
- value: { get_attribute: [my_server, private_address] } \ No newline at end of file
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_constraints.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_constraints.py
deleted file mode 100644
index 78f4c71..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_constraints.py
+++ /dev/null
@@ -1,357 +0,0 @@
-# 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 datetime
-import yaml
-
-from toscaparser.common import exception
-from toscaparser.elements.constraints import Constraint
-from toscaparser.elements.constraints import Schema
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-from toscaparser.utils import yamlparser
-
-
-class ConstraintTest(TestCase):
-
- def test_schema_dict(self):
- tpl_snippet = '''
- cpus:
- type: integer
- description: Number of CPUs for the server.
- '''
- schema = yamlparser.simple_parse(tpl_snippet)
- cpus_schema = Schema('cpus', schema['cpus'])
- self.assertEqual(len(cpus_schema), 2)
- self.assertEqual('integer', cpus_schema.type)
- self.assertEqual('Number of CPUs for the server.',
- cpus_schema.description)
- self.assertEqual(True, cpus_schema.required)
- self.assertIsNone(cpus_schema.default)
-
- def test_schema_not_dict(self):
- tpl_snippet = '''
- cpus:
- - type: integer
- - description: Number of CPUs for the server.
- '''
- schema = yamlparser.simple_parse(tpl_snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Schema,
- 'cpus', schema['cpus'])
- self.assertEqual(_('Schema definition of "cpus" must be a dict.'),
- str(error))
-
- def test_schema_miss_type(self):
- tpl_snippet = '''
- cpus:
- description: Number of CPUs for the server.
- '''
- schema = yamlparser.simple_parse(tpl_snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Schema,
- 'cpus', schema['cpus'])
- self.assertEqual(_('Schema definition of "cpus" must have a "type" '
- 'attribute.'), str(error))
-
- def test_schema_none_description(self):
- tpl_snippet = '''
- cpus:
- type: integer
- '''
- schema = yamlparser.simple_parse(tpl_snippet)
- cpus_schema = Schema('cpus', schema['cpus'])
- self.assertEqual('', cpus_schema.description)
-
- def test_invalid_constraint_type(self):
- schema = {'invalid_type': 2}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('Invalid property "invalid_type".'),
- str(error))
-
- def test_invalid_prop_type(self):
- schema = {'length': 5}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('Property "length" is not valid for data type '
- '"integer".'), str(error))
-
- def test_invalid_validvalues(self):
- schema = {'valid_values': 2}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "valid_values" expects a list.'),
- str(error))
-
- def test_validvalues_validate(self):
- schema = {'valid_values': [2, 4, 6, 8]}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertIsNone(constraint.validate(4))
-
- def test_validvalues_validate_fail(self):
- schema = {'valid_values': [2, 4, 6, 8]}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 5)
- self.assertEqual(_('The value "5" of property "prop" is not valid. '
- 'Expected a value from "[2, 4, 6, 8]".'),
- str(error))
-
- def test_invalid_in_range(self):
- snippet = 'in_range: {2, 6}'
- schema = yaml.load(snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "in_range" expects a list.'),
- str(error))
-
- def test_in_range_min_max(self):
- schema = {'in_range': [2, 6]}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertEqual(2, constraint.min)
- self.assertEqual(6, constraint.max)
-
- def test_in_range_validate(self):
- schema = {'in_range': [2, 6]}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertIsNone(constraint.validate(2))
- self.assertIsNone(constraint.validate(4))
- self.assertIsNone(constraint.validate(6))
-
- def test_in_range_validate_fail(self):
- schema = {'in_range': [2, 6]}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 8)
- self.assertEqual(_('The value "8" of property "prop" is out of range '
- '"(min:2, max:6)".'), str(error))
-
- def test_equal_validate(self):
- schema = {'equal': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertIsNone(constraint.validate(4))
-
- def test_equal_validate_fail(self):
- schema = {'equal': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 8)
- self.assertEqual('The value "8" of property "prop" is not equal to '
- '"4".', str(error))
-
- def test_greater_than_validate(self):
- schema = {'greater_than': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertIsNone(constraint.validate(6))
-
- def test_greater_than_validate_fail(self):
- schema = {'greater_than': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 3)
- self.assertEqual(_('The value "3" of property "prop" must be greater '
- 'than "4".'), str(error))
-
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 4)
- self.assertEqual(_('The value "4" of property "prop" must be greater '
- 'than "4".'), str(error))
-
- def test_greater_than_invalid(self):
- snippet = 'greater_than: {4}'
- schema = yaml.load(snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "greater_than" expects comparable '
- 'values.'), str(error))
-
- def test_greater_or_equal_validate(self):
- schema = {'greater_or_equal': 3.9}
- constraint = Constraint('prop', Schema.FLOAT, schema)
- self.assertIsNone(constraint.validate(3.9))
- self.assertIsNone(constraint.validate(4.0))
-
- def test_greater_or_equal_validate_fail(self):
- schema = {'greater_or_equal': 3.9}
- constraint = Constraint('prop', Schema.FLOAT, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 3.0)
- self.assertEqual(_('The value "3.0" of property "prop" must be '
- 'greater than or equal to "3.9".'),
- str(error))
-
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 3.8)
- self.assertEqual(_('The value "3.8" of property "prop" must be '
- 'greater than or equal to "3.9".'),
- str(error))
-
- def test_greater_or_equal_invalid(self):
- snippet = 'greater_or_equal: {3.9}'
- schema = yaml.load(snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "greater_or_equal" expects '
- 'comparable values.'), str(error))
-
- def test_less_than_validate(self):
- schema = {'less_than': datetime.date(2014, 0o7, 25)}
- constraint = Constraint('prop', Schema.TIMESTAMP, schema)
- self.assertIsNone(constraint.validate(datetime.date(2014, 0o7, 20)))
- self.assertIsNone(constraint.validate(datetime.date(2014, 0o7, 24)))
-
- def test_less_than_validate_fail(self):
- schema = {'less_than': datetime.date(2014, 0o7, 25)}
- constraint = Constraint('prop', Schema.TIMESTAMP, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate,
- datetime.date(2014, 0o7, 25))
- self.assertEqual(_('The value "2014-07-25" of property "prop" must be '
- 'less than "2014-07-25".'),
- str(error))
-
- error = self.assertRaises(exception.ValidationError,
- constraint.validate,
- datetime.date(2014, 0o7, 27))
- self.assertEqual(_('The value "2014-07-27" of property "prop" must be '
- 'less than "2014-07-25".'),
- str(error))
-
- def test_less_than_invalid(self):
- snippet = 'less_than: {3.9}'
- schema = yaml.load(snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "less_than" expects comparable '
- 'values.'), str(error))
-
- def test_less_or_equal_validate(self):
- schema = {'less_or_equal': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- self.assertIsNone(constraint.validate(4))
- self.assertIsNone(constraint.validate(3))
-
- def test_less_or_equal_validate_fail(self):
- schema = {'less_or_equal': 4}
- constraint = Constraint('prop', Schema.INTEGER, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 5)
- self.assertEqual(_('The value "5" of property "prop" must be less '
- 'than or equal to "4".'), str(error))
-
- def test_less_or_equal_invalid(self):
- snippet = 'less_or_equal: {3.9}'
- schema = yaml.load(snippet)
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.INTEGER,
- schema)
- self.assertEqual(_('The property "less_or_equal" expects comparable '
- 'values.'), str(error))
-
- def test_invalid_length(self):
- schema = {'length': 'four'}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.STRING,
- schema)
- self.assertEqual(_('The property "length" expects an integer.'),
- str(error))
-
- schema = {'length': 4.5}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.STRING,
- schema)
- self.assertEqual(_('The property "length" expects an integer.'),
- str(error))
-
- def test_length_validate(self):
- schema = {'length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- self.assertIsNone(constraint.validate('abcd'))
-
- def test_length_validate_fail(self):
- schema = {'length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 'abc')
- self.assertEqual(_('Length of value "abc" of property "prop" must '
- 'be equal to "4".'), str(error))
-
- error = self.assertRaises(exception.ValidationError,
- constraint.validate,
- 'abcde')
- self.assertEqual(_('Length of value "abcde" of property "prop" must '
- 'be equal to "4".'), str(error))
-
- def test_invalid_min_length(self):
- schema = {'min_length': 'four'}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.STRING,
- schema)
- self.assertEqual(_('The property "min_length" expects an integer.'),
- str(error))
-
- def test_min_length_validate(self):
- schema = {'min_length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- self.assertIsNone(constraint.validate('abcd'))
- self.assertIsNone(constraint.validate('abcde'))
-
- def test_min_length_validate_fail(self):
- schema = {'min_length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 'abc')
- self.assertEqual(_('Length of value "abc" of property "prop" must '
- 'be at least "4".'), str(error))
-
- def test_invalid_max_length(self):
- schema = {'max_length': 'four'}
- error = self.assertRaises(exception.InvalidSchemaError, Constraint,
- 'prop', Schema.STRING,
- schema)
- self.assertEqual(_('The property "max_length" expects an integer.'),
- str(error))
-
- def test_max_length_validate(self):
- schema = {'max_length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- self.assertIsNone(constraint.validate('abcd'))
- self.assertIsNone(constraint.validate('abc'))
-
- def test_max_length_validate_fail(self):
- schema = {'max_length': 4}
- constraint = Constraint('prop', Schema.STRING, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate,
- 'abcde')
- self.assertEqual(_('Length of value "abcde" of property "prop" '
- 'must be no greater than "4".'),
- str(error))
-
- def test_pattern_validate(self):
- schema = {'pattern': '[0-9]*'}
- constraint = Constraint('prop', Schema.STRING, schema)
- self.assertIsNone(constraint.validate('123'))
-
- def test_pattern_validate_fail(self):
- schema = {'pattern': '[0-9]*'}
- constraint = Constraint('prop', Schema.STRING, schema)
- error = self.assertRaises(exception.ValidationError,
- constraint.validate, 'abc')
- self.assertEqual(_('The value "abc" of property "prop" does not '
- 'match pattern "[0-9]*".'), str(error))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_datatypes.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_datatypes.py
deleted file mode 100644
index c1a6de0..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_datatypes.py
+++ /dev/null
@@ -1,327 +0,0 @@
-# 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 os
-
-from testtools.testcase import skip
-from toscaparser.common import exception
-from toscaparser.dataentity import DataEntity
-from toscaparser.elements.datatype import DataType
-from toscaparser.parameters import Input
-from toscaparser.tests.base import TestCase
-from toscaparser.tosca_template import ToscaTemplate
-from toscaparser.utils.gettextutils import _
-from toscaparser.utils import yamlparser
-
-
-class DataTypeTest(TestCase):
-
- custom_type_schema = '''
- tosca.my.datatypes.PeopleBase:
- properties:
- name:
- type: string
- required: true
- constraints:
- - min_length: 2
- gender:
- type: string
- default: unknown
-
- tosca.my.datatypes.People:
- derived_from: tosca.my.datatypes.PeopleBase
- properties:
- addresses:
- type: map
- entry_schema:
- type: string
- contacts:
- type: list
- entry_schema:
- type: tosca.my.datatypes.ContactInfo
-
- tosca.my.datatypes.ContactInfo:
- description: simple contact information
- properties:
- contact_name:
- type: string
- required: true
- constraints:
- - min_length: 2
- contact_email:
- type: string
- contact_phone:
- type: string
- '''
- custom_type_def = yamlparser.simple_parse(custom_type_schema)
-
- def test_empty_template(self):
- value_snippet = ''
- value = yamlparser.simple_parse(value_snippet)
- self.assertEqual(value, {})
-
- def test_built_in_datatype(self):
- value_snippet = '''
- private_network:
- network_name: private
- network_id: 3e54214f-5c09-1bc9-9999-44100326da1b
- addresses: [ 10.111.128.10 ]
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.datatypes.network.NetworkInfo',
- value.get('private_network'))
- self.assertIsNotNone(data.validate())
-
- value_snippet = '''
- portspec_valid:
- protocol: tcp
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.datatypes.network.PortSpec',
- value.get('portspec_valid'))
- self.assertIsNotNone(data.validate())
-
- value_snippet = '''
- portspec_invalid:
- protocol: xyz
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.datatypes.network.PortSpec',
- value.get('portspec_invalid'))
- err = self.assertRaises(exception.ValidationError, data.validate)
- self.assertEqual(_('The value "xyz" of property "protocol" is not '
- 'valid. Expected a value from "[udp, tcp, igmp]".'
- ),
- err.__str__())
-
- def test_built_in_datatype_with_short_name(self):
- value_snippet = '''
- ethernet_port:
- port_name: port1
- port_id: 2c0c7a37-691a-23a6-7709-2d10ad041467
- network_id: 3e54214f-5c09-1bc9-9999-44100326da1b
- mac_address: f1:18:3b:41:92:1e
- addresses: [ 172.24.9.102 ]
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('PortInfo', value.get('ethernet_port'))
- self.assertIsNotNone(data.validate())
-
- def test_built_in_datatype_without_properties(self):
- value_snippet = '''
- 2
- '''
- value = yamlparser.simple_parse(value_snippet)
- datatype = DataType('PortDef')
- self.assertEqual('integer', datatype.value_type)
- data = DataEntity('PortDef', value)
- self.assertIsNotNone(data.validate())
-
- @skip('The example in TOSCA spec may have some problem.')
- def test_built_in_nested_datatype(self):
- value_snippet = '''
- user_port:
- protocol: tcp
- target: [50000]
- source: [9000]
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('PortSpec', value.get('user_port'))
- self.assertIsNotNone(data.validate())
-
- def test_built_in_nested_datatype_portdef(self):
- tpl_snippet = '''
- inputs:
- db_port:
- type: PortDef
- description: Port for the MySQL database
- '''
- inputs = yamlparser.simple_parse(tpl_snippet)['inputs']
- name, attrs = list(inputs.items())[0]
- input = Input(name, attrs)
- self.assertIsNone(input.validate(3360))
- err = self.assertRaises(exception.ValidationError, input.validate,
- 336000)
- self.assertEqual(_('The value "336000" of property "None" is out of '
- 'range "(min:1, max:65535)".'),
- err.__str__())
-
- def test_custom_datatype(self):
- value_snippet = '''
- name: Mike
- gender: male
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- self.assertIsNotNone(data.validate())
-
- def test_custom_datatype_with_parent(self):
- value_snippet = '''
- name: Mike
- gender: male
- contacts:
- - {contact_name: Tom,
- contact_email: tom@email.com,
- contact_phone: '123456789'}
- - {contact_name: Jerry,
- contact_email: jerry@email.com,
- contact_phone: '321654987'}
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.People', value,
- DataTypeTest.custom_type_def)
- self.assertIsNotNone(data.validate())
-
- # [Tom, Jerry] is not a dict, it can't be a value of datatype PeopleBase
- def test_non_dict_value_for_datatype(self):
- value_snippet = '''
- [Tom, Jerry]
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(exception.TypeMismatchError, data.validate)
- self.assertEqual(_('[\'Tom\', \'Jerry\'] must be of type '
- '"tosca.my.datatypes.PeopleBase".'),
- error.__str__())
-
- # 'nema' is an invalid field name
- def test_field_error_in_dataentity(self):
- value_snippet = '''
- nema: Mike
- gender: male
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(exception.UnknownFieldError, data.validate)
- self.assertEqual(_('Data value of type '
- '"tosca.my.datatypes.PeopleBase" contains unknown '
- 'field "nema". Refer to the definition to verify '
- 'valid values.'),
- error.__str__())
-
- def test_default_field_in_dataentity(self):
- value_snippet = '''
- name: Mike
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- data = data.validate()
- self.assertEqual('unknown', data.get('gender'))
-
- # required field 'name' is missing
- def test_missing_field_in_dataentity(self):
- value_snippet = '''
- gender: male
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(exception.MissingRequiredFieldError,
- data.validate)
- self.assertEqual(_('Data value of type '
- '"tosca.my.datatypes.PeopleBase" is missing '
- 'required field "[\'name\']".'),
- error.__str__())
-
- # the value of name field is not a string
- def test_type_error_in_dataentity(self):
- value_snippet = '''
- name: 123
- gender: male
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(ValueError, data.validate)
- self.assertEqual(_('"123" is not a string.'), error.__str__())
-
- # the value of name doesn't meet the defined constraint
- def test_value_error_in_dataentity(self):
- value_snippet = '''
- name: M
- gender: male
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.PeopleBase', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(exception.ValidationError, data.validate)
- self.assertEqual(_('Length of value "M" of property "name" must be '
- 'at least "2".'), error.__str__())
-
- # value of addresses doesn't fit the entry_schema
- def test_validation_in_collection_entry(self):
- value_snippet = '''
- name: Mike
- gender: male
- addresses: {Home: 1, Office: 9 bar avenue}
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.People', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(ValueError, data.validate)
- self.assertEqual(_('"1" is not a string.'), error.__str__())
-
- # contact_pone is an invalid field name in nested datatype
- def test_validation_in_nested_datatype(self):
- value_snippet = '''
- name: Mike
- gender: male
- contacts:
- - {contact_name: Tom,
- contact_email: tom@email.com,
- contact_pone: '123456789'}
- - {contact_name: Jerry,
- contact_email: jerry@email.com,
- contact_phone: '321654987'}
- '''
- value = yamlparser.simple_parse(value_snippet)
- data = DataEntity('tosca.my.datatypes.People', value,
- DataTypeTest.custom_type_def)
- error = self.assertRaises(exception.UnknownFieldError, data.validate)
- self.assertEqual(_('Data value of type '
- '"tosca.my.datatypes.ContactInfo" contains unknown '
- 'field "contact_pone". Refer to the definition to '
- 'verify valid values.'),
- error.__str__())
-
- def test_datatype_in_current_template(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/datatypes/test_custom_datatypes_in_current_template.yaml")
- self.assertIsNotNone(ToscaTemplate(tpl_path))
-
- def test_datatype_in_template_positive(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/datatypes/test_custom_datatypes_positive.yaml")
- self.assertIsNotNone(ToscaTemplate(tpl_path))
-
- def test_datatype_in_template_invalid_value(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/datatypes/test_custom_datatypes_value_error.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path)
- exception.ExceptionCollector.assertExceptionMessage(
- ValueError,
- _('"[\'1 foo street\', \'9 bar avenue\']" is not a map.'))
-
- def test_datatype_in_template_nested_datatype_error(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/datatypes/test_custom_datatypes_nested_datatype_error.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path)
- exception.ExceptionCollector.assertExceptionMessage(
- ValueError, _('"123456789" is not a string.'))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_exception.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_exception.py
deleted file mode 100644
index a404f4f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_exception.py
+++ /dev/null
@@ -1,42 +0,0 @@
-# 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.
-
-from toscaparser.common import exception
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-
-
-class ExceptionTest(TestCase):
-
- def setUp(self):
- super(TestCase, self).setUp()
- exception.TOSCAException.set_fatal_format_exception(False)
-
- def test_message(self):
- ex = exception.MissingRequiredFieldError(what='Template',
- required='type')
- self.assertEqual(_('Template is missing required field "type".'),
- ex.__str__())
-
- def test_set_flag(self):
- exception.TOSCAException.set_fatal_format_exception('True')
- self.assertFalse(
- exception.TOSCAException._FATAL_EXCEPTION_FORMAT_ERRORS)
-
- def test_format_error(self):
- ex = exception.UnknownFieldError(what='Template')
- self.assertEqual(_('An unknown exception occurred.'), ex.__str__(),)
- self.assertRaises(KeyError, self._formate_exception)
-
- def _formate_exception(self):
- exception.UnknownFieldError.set_fatal_format_exception(True)
- raise exception.UnknownFieldError(what='Template')
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_functions.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_functions.py
deleted file mode 100644
index ccc6f8b..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_functions.py
+++ /dev/null
@@ -1,204 +0,0 @@
-# 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 os
-import six
-from toscaparser.common import exception
-from toscaparser import functions
-from toscaparser.tests.base import TestCase
-from toscaparser.tosca_template import ToscaTemplate
-from toscaparser.utils.gettextutils import _
-
-
-class IntrinsicFunctionsTest(TestCase):
-
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_single_instance_wordpress.yaml")
- params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user'}
- tosca = ToscaTemplate(tosca_tpl, parsed_params=params)
-
- def _get_node(self, node_name):
- return [
- node for node in self.tosca.nodetemplates
- if node.name == node_name][0]
-
- def _get_operation(self, interfaces, operation):
- return [
- interface for interface in interfaces
- if interface.name == operation][0]
-
- def _get_property(self, node_template, property_name):
- return [prop.value for prop in node_template.get_properties_objects()
- if prop.name == property_name][0]
-
- def _get_inputs_dict(self):
- inputs = {}
- for input in self.tosca.inputs:
- inputs[input.name] = input.default
- return inputs
-
- def _get_input(self, name):
- self._get_inputs_dict()[name]
-
- def test_get_property(self):
- wordpress = self._get_node('wordpress')
- operation = self._get_operation(wordpress.interfaces, 'configure')
- wp_db_password = operation.inputs['wp_db_password']
- self.assertTrue(isinstance(wp_db_password, functions.GetProperty))
- result = wp_db_password.result()
- self.assertEqual('wp_pass', result)
-
- def test_get_property_with_input_param(self):
- wordpress = self._get_node('wordpress')
- operation = self._get_operation(wordpress.interfaces, 'configure')
- wp_db_user = operation.inputs['wp_db_user']
- self.assertTrue(isinstance(wp_db_user, functions.GetProperty))
- result = wp_db_user.result()
- self.assertEqual('my_db_user', result)
-
- def test_unknown_capability_property(self):
- self.assertRaises(exception.ValidationError, self._load_template,
- 'functions/test_unknown_capability_property.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- KeyError,
- _('\'Property "unknown" was not found in capability '
- '"database_endpoint" of node template "database" referenced '
- 'from node template "database".\''))
-
- def test_get_input_in_properties(self):
- mysql_dbms = self._get_node('mysql_dbms')
- expected_inputs = ['db_root_pwd', 'db_port']
- props = mysql_dbms.get_properties()
- for key in props.keys():
- prop = props[key]
- self.assertTrue(isinstance(prop.value, functions.GetInput))
- expected_inputs.remove(prop.value.input_name)
- self.assertListEqual(expected_inputs, [])
-
- def test_get_input_validation(self):
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_unknown_input_in_property.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownInputError,
- _('Unknown input "objectstore_name".'))
-
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_unknown_input_in_interface.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownInputError,
- _('Unknown input "image_id".'))
-
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_invalid_function_signature.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- ValueError,
- _('Expected one argument for function "get_input" but received '
- '"[\'cpus\', \'cpus\']".'))
-
- def test_get_input_default_value_result(self):
- mysql_dbms = self._get_node('mysql_dbms')
- dbms_port = self._get_property(mysql_dbms, 'port')
- self.assertEqual(3306, dbms_port.result())
- dbms_root_password = self._get_property(mysql_dbms,
- 'root_password')
- self.assertIsNone(dbms_root_password.result())
-
-
-class GetAttributeTest(TestCase):
-
- def _load_template(self, filename):
- return ToscaTemplate(os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- 'data',
- filename))
-
- def test_get_attribute_in_outputs(self):
- tpl = self._load_template('tosca_single_instance_wordpress.yaml')
- website_url_output = [
- x for x in tpl.outputs if x.name == 'website_url'][0]
- self.assertIsInstance(website_url_output.value, functions.GetAttribute)
- self.assertEqual('server', website_url_output.value.node_template_name)
- self.assertEqual('private_address',
- website_url_output.value.attribute_name)
-
- def test_get_attribute_invalid_args(self):
- expected_msg = _('Expected arguments: "node-template-name", '
- '"attribute-name"')
- err = self.assertRaises(ValueError,
- functions.get_function, None, None,
- {'get_attribute': []})
- self.assertIn(expected_msg, six.text_type(err))
- err = self.assertRaises(ValueError,
- functions.get_function, None, None,
- {'get_attribute': ['x']})
- self.assertIn(expected_msg, six.text_type(err))
- err = self.assertRaises(ValueError,
- functions.get_function, None, None,
- {'get_attribute': ['x', 'y', 'z']})
- self.assertIn(expected_msg, six.text_type(err))
-
- def test_get_attribute_unknown_node_template_name(self):
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_get_attribute_unknown_node_template_name.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- KeyError,
- _('\'Node template "unknown_node_template" was not found.\''))
-
- def test_get_attribute_unknown_attribute(self):
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_get_attribute_unknown_attribute_name.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- KeyError,
- _('\'Attribute "unknown_attribute" was not found in node template '
- '"server".\''))
-
- def test_get_attribute_host_keyword(self):
- tpl = self._load_template(
- 'functions/test_get_attribute_host_keyword.yaml')
-
- def assert_get_attribute_host_functionality(node_template_name):
- node = [x for x in tpl.nodetemplates
- if x.name == node_template_name][0]
- configure_op = [
- x for x in node.interfaces if x.name == 'configure'][0]
- ip_addr_input = configure_op.inputs['ip_address']
- self.assertIsInstance(ip_addr_input, functions.GetAttribute)
- self.assertEqual('server',
- ip_addr_input.get_referenced_node_template().name)
-
- assert_get_attribute_host_functionality('dbms')
- assert_get_attribute_host_functionality('database')
-
- def test_get_attribute_host_not_found(self):
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_get_attribute_host_not_found.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- ValueError,
- _('"get_attribute: [ HOST, ... ]" was used in node template '
- '"server" but "tosca.relationships.HostedOn" was not found in '
- 'the relationship chain.'))
-
- def test_get_attribute_illegal_host_in_outputs(self):
- self.assertRaises(
- exception.ValidationError, self._load_template,
- 'functions/test_get_attribute_illegal_host_in_outputs.yaml')
- exception.ExceptionCollector.assertExceptionMessage(
- ValueError,
- _('"get_attribute: [ HOST, ... ]" is not allowed in "outputs" '
- 'section of the TOSCA template.'))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_prereq.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_prereq.py
deleted file mode 100644
index 98d616f..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_prereq.py
+++ /dev/null
@@ -1,230 +0,0 @@
-# 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 os
-import shutil
-import zipfile
-
-from toscaparser.common.exception import URLException
-from toscaparser.common.exception import ValidationError
-from toscaparser.prereq.csar import CSAR
-from toscaparser.tests.base import TestCase
-import toscaparser.utils
-from toscaparser.utils.gettextutils import _
-
-
-class CSARPrereqTest(TestCase):
-
- base_path = os.path.dirname(os.path.abspath(__file__))
-
- def test_file_exists(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_not_there.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('"%s" does not exist.') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_file_is_zip(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_not_zip.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('"%s" is not a valid zip file.') % path, str(error))
-
- def test_url_is_zip(self):
- path = "https://github.com/openstack/tosca-parser/raw/master/" \
- "toscaparser/tests/data/CSAR/csar_not_zip.zip"
- csar = CSAR(path, False)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('"%s" is not a valid zip file.') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_metadata_file_exists(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_no_metadata_file.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('"%s" is not a valid CSAR as it does not contain '
- 'the required file "TOSCA.meta" in the folder '
- '"TOSCA-Metadata".') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_valid_metadata_file_exists(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_wrong_metadata_file.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('"%s" is not a valid CSAR as it does not contain '
- 'the required file "TOSCA.meta" in the folder '
- '"TOSCA-Metadata".') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_metadata_is_yaml(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_metadata_not_yaml.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('The file "TOSCA-Metadata/TOSCA.meta" in the CSAR '
- '"%s" does not contain valid YAML content.') % path,
- str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_metadata_exists(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_missing_metadata.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('The CSAR "%s" is missing the required metadata '
- '"Entry-Definitions" in '
- '"TOSCA-Metadata/TOSCA.meta".') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_entry_def_exists(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_invalid_entry_def.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.validate)
- self.assertEqual(_('The "Entry-Definitions" file defined in the CSAR '
- '"%s" does not exist.') % path, str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_csar_invalid_import_path(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_wordpress_invalid_import_path.zip")
- csar = CSAR(path)
- error = self.assertRaises(ImportError, csar.validate)
- self.assertEqual(_('Import "Definitions/wordpress.yaml" is not '
- 'valid.'), str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_csar_invalid_import_url(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_wordpress_invalid_import_url.zip")
- csar = CSAR(path)
- error = self.assertRaises(URLException, csar.validate)
- self.assertEqual(_('Failed to reach server '
- '"https://raw.githubusercontent.com/openstack/'
- 'tosca-parser/master/toscaparser/tests/data/CSAR/'
- 'tosca_single_instance_wordpress/Definitions/'
- 'wordpress1.yaml". Reason is: Not Found.'),
- str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_csar_invalid_script_path(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_wordpress_invalid_script_path.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValueError, csar.validate)
- self.assertTrue(
- str(error) == _('The resource "Scripts/WordPress/install.sh" does '
- 'not exist.') or
- str(error) == _('The resource "Scripts/WordPress/configure.sh" '
- 'does not exist.'))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_csar_invalid_script_url(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_wordpress_invalid_script_url.zip")
- csar = CSAR(path)
- error = self.assertRaises(URLException, csar.validate)
- self.assertEqual(_('The resource at '
- '"https://raw.githubusercontent.com/openstack/'
- 'tosca-parser/master/toscaparser/tests/data/CSAR/'
- 'tosca_single_instance_wordpress/Scripts/WordPress/'
- 'install1.sh" cannot be accessed.'),
- str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_valid_csar(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_hello_world.zip")
- csar = CSAR(path)
- self.assertTrue(csar.validate())
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_valid_csar_with_url_import_and_script(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_wordpress_with_url"
- "_import_and_script.zip")
- csar = CSAR(path)
- self.assertTrue(csar.validate())
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_metadata_invalid_csar(self):
- path = os.path.join(self.base_path,
- "data/CSAR/csar_metadata_not_yaml.zip")
- csar = CSAR(path)
- error = self.assertRaises(ValidationError, csar.get_author)
- self.assertEqual(_('The file "TOSCA-Metadata/TOSCA.meta" in the CSAR '
- '"%s" does not contain valid YAML content.') % path,
- str(error))
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_metadata_valid_csar(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_hello_world.zip")
- csar = CSAR(path)
- expected_meta = {'TOSCA-Meta-File-Version': 1.0,
- 'CSAR-Version': 1.1,
- 'Created-By': 'OASIS TOSCA TC',
- 'Entry-Definitions': 'tosca_helloworld.yaml'}
- self.assertEqual(expected_meta, csar.get_metadata(),
- 'The extracted metadata of the CSAR %(csar)s does '
- 'not match the expected metadata %(meta)s'
- % {'csar': path, 'meta': expected_meta.__str__()})
- self.assertEqual(1.1, csar.get_version())
- self.assertEqual('OASIS TOSCA TC', csar.get_author())
- self.assertEqual('tosca_helloworld.yaml', csar.get_main_template())
- self.assertEqual('Template for deploying a single server with '
- 'predefined properties.', csar.get_description())
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_csar_main_template(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_hello_world.zip")
- csar = CSAR(path)
- yaml_file = os.path.join(os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_helloworld.yaml")
- expected_yaml = toscaparser.utils.yamlparser.load_yaml(yaml_file)
- self.assertEqual(expected_yaml, csar.get_main_template_yaml())
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_decompress(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_hello_world.zip")
- csar = CSAR(path)
- csar.decompress()
- zf = zipfile.ZipFile(path)
- for name in zf.namelist():
- tmp_path = os.path.join(csar.temp_dir, name)
- self.assertTrue(os.path.isdir(tmp_path) or
- os.path.isfile(tmp_path))
- shutil.rmtree(csar.temp_dir)
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
-
- def test_alternate_csar_extension(self):
- path = os.path.join(self.base_path, "data/CSAR/csar_elk.csar")
- csar = CSAR(path)
- self.assertTrue(csar.validate())
- self.assertTrue(csar.temp_dir is None or
- not os.path.exists(csar.temp_dir))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_properties.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_properties.py
deleted file mode 100644
index 1896b1e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_properties.py
+++ /dev/null
@@ -1,236 +0,0 @@
-# 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.
-
-from toscaparser.common import exception
-from toscaparser.elements.property_definition import PropertyDef
-from toscaparser.properties import Property
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-from toscaparser.utils import yamlparser
-
-
-class PropertyTest(TestCase):
-
- def test_type(self):
- test_property_schema = {'type': 'string'}
- propertyInstance = Property('test_property', 'Hughes',
- test_property_schema)
- self.assertEqual('string', propertyInstance.type)
-
- def test_type_invalid(self):
- test_property_schema = {'type': 'Fish'}
- propertyInstance = Property('test_property', 'Hughes',
- test_property_schema)
- error = self.assertRaises(exception.InvalidTypeError,
- propertyInstance.validate)
- self.assertEqual(_('Type "Fish" is not a valid type.'), str(error))
-
- def test_list(self):
- test_property_schema = {'type': 'list'}
- propertyInstance = Property('test_property', ['a', 'b'],
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual(['a', 'b'], propertyInstance.value)
-
- def test_list_invalid(self):
- test_property_schema = {'type': 'list'}
- propertyInstance = Property('test_property', 'a',
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"a" is not a list.'), str(error))
-
- def test_list_entry_schema(self):
- test_property_schema = {'type': 'list',
- 'entry_schema': {'type': 'string'}}
- propertyInstance = Property('test_property', ['a', 'b'],
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual(['a', 'b'], propertyInstance.value)
-
- schema_snippet = '''
- type: list
- entry_schema:
- type: string
- constraints:
- - min_length: 2
- '''
- test_property_schema = yamlparser.simple_parse(schema_snippet)
- propertyInstance = Property('test_property', ['ab', 'cd'],
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual(['ab', 'cd'], propertyInstance.value)
-
- def test_list_entry_schema_invalid(self):
- test_property_schema = {'type': 'list',
- 'entry_schema': {'type': 'integer'}}
- propertyInstance = Property('test_property', [1, 'b'],
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"b" is not an integer.'), str(error))
-
- def test_map(self):
- test_property_schema = {'type': 'map'}
- propertyInstance = Property('test_property', {'a': 'b'},
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual({'a': 'b'}, propertyInstance.value)
-
- def test_map_invalid(self):
- test_property_schema = {'type': 'map'}
- propertyInstance = Property('test_property', 12,
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"12" is not a map.'), str(error))
-
- def test_map_entry_schema(self):
- test_property_schema = {'type': 'map',
- 'entry_schema': {'type': 'boolean'}}
- propertyInstance = Property('test_property',
- {'valid': True, 'required': True},
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual({'valid': True, 'required': True},
- propertyInstance.value)
-
- def test_map_entry_schema_invalid(self):
- test_property_schema = {'type': 'map',
- 'entry_schema': {'type': 'boolean'}}
- propertyInstance = Property('test_property',
- {'valid': True, 'contact_name': 123},
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"123" is not a boolean.'), str(error))
-
- def test_boolean(self):
- test_property_schema = {'type': 'boolean'}
- propertyInstance = Property('test_property', 'true',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- propertyInstance = Property('test_property', True,
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual(True, propertyInstance.value)
-
- def test_boolean_invalid(self):
- test_property_schema = {'type': 'boolean'}
- propertyInstance = Property('test_property', 12,
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"12" is not a boolean.'), str(error))
-
- def test_float(self):
- test_property_schema = {'type': 'float'}
- propertyInstance = Property('test_property', 0.1,
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual(0.1, propertyInstance.value)
-
- def test_float_invalid(self):
- test_property_schema = {'type': 'float'}
- propertyInstance = Property('test_property', 12,
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('"12" is not a float.'), str(error))
-
- def test_timestamp(self):
- test_property_schema = {'type': 'timestamp'}
- # canonical timestamp
- propertyInstance = Property('test_property', '2015-04-01T02:59:43.1Z',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual("2015-04-01T02:59:43.1Z", propertyInstance.value)
-
- # iso8601 timestamp
- propertyInstance = Property('test_property',
- '2015-04-01t21:59:43.10-05:00',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual("2015-04-01t21:59:43.10-05:00",
- propertyInstance.value)
-
- # space separated timestamp
- propertyInstance = Property('test_property',
- '2015-04-01 21:59:43.10 -5',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual("2015-04-01 21:59:43.10 -5", propertyInstance.value)
-
- # no time zone timestamp
- propertyInstance = Property('test_property', '2015-04-01 21:59:43.10',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual("2015-04-01 21:59:43.10", propertyInstance.value)
-
- # date (00:00:00Z)
- propertyInstance = Property('test_property', '2015-04-01',
- test_property_schema)
- self.assertIsNone(propertyInstance.validate())
- self.assertEqual("2015-04-01", propertyInstance.value)
-
- def test_timestamp_invalid(self):
- test_property_schema = {'type': 'timestamp'}
- # invalid timestamp - day out of range
- propertyInstance = Property('test_property', '2015-04-115T02:59:43.1Z',
- test_property_schema)
- error = self.assertRaises(ValueError, propertyInstance.validate)
- self.assertEqual(_('day is out of range for month'), str(error))
-
- def test_required(self):
- test_property_schema = {'type': 'string'}
- propertyInstance = Property('test_property', 'Foo',
- test_property_schema)
- self.assertEqual(True, propertyInstance.required)
-
- def test_proprety_inheritance(self):
- from toscaparser.nodetemplate import NodeTemplate
-
- tosca_custom_def = '''
- tosca.nodes.SoftwareComponent.MySoftware:
- derived_from: SoftwareComponent
- properties:
- install_path:
- required: false
- type: string
- default: /opt/mysoftware
- '''
-
- tosca_node_template = '''
- node_templates:
- mysoftware_instance:
- type: tosca.nodes.SoftwareComponent.MySoftware
- properties:
- component_version: 3.1
- '''
-
- expected_properties = ['component_version',
- 'install_path']
-
- nodetemplates = yamlparser.\
- simple_parse(tosca_node_template)['node_templates']
- custom_def = yamlparser.simple_parse(tosca_custom_def)
- name = list(nodetemplates.keys())[0]
- tpl = NodeTemplate(name, nodetemplates, custom_def)
- self.assertIsNone(tpl.validate())
- self.assertEqual(expected_properties,
- sorted(tpl.get_properties().keys()))
-
- def test_missing_property_type(self):
- tpl_snippet = '''
- properties:
- prop:
- typo: tosca.mytesttype.Test
- '''
- schema = yamlparser.simple_parse(tpl_snippet)
- error = self.assertRaises(exception.InvalidSchemaError, PropertyDef,
- 'prop', None, schema['properties']['prop'])
- self.assertEqual(_('Schema definition of "prop" must have a "type" '
- 'attribute.'), str(error))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_scalarunit.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_scalarunit.py
deleted file mode 100644
index 24864a1..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_scalarunit.py
+++ /dev/null
@@ -1,355 +0,0 @@
-# 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.
-
-from toscaparser.common import exception
-from toscaparser.elements.scalarunit import ScalarUnit_Frequency
-from toscaparser.elements.scalarunit import ScalarUnit_Size
-from toscaparser.elements.scalarunit import ScalarUnit_Time
-from toscaparser.nodetemplate import NodeTemplate
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-from toscaparser.utils import yamlparser
-
-
-class ScalarUnitPositiveTest(TestCase):
-
- scenarios = [
- (
- # tpl_snippet with mem_size given as number+space+MB
- 'mem_size_is_number_Space_MB',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- mem_size: 1024 MB
- ''',
- property='mem_size',
- expected='1024 MB')
- ),
- (
- # tpl_snippet with mem_size given as number+spaces+GB
- 'mem_size_is_number_Space_GB',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- mem_size: 1 GB
- ''',
- property='mem_size',
- expected='1 GB')
- ),
- (
- # tpl_snippet with mem_size given as number+tiB
- 'mem_size_is_number_NoSpace_GB',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- mem_size: 1tiB
- ''',
- property='mem_size',
- expected='1 TiB')
- ),
- (
- # tpl_snippet with mem_size given as number+Spaces+GIB
- 'mem_size_is_number_Spaces_GB',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- mem_size: 1 GIB
- ''',
- property='mem_size',
- expected='1 GiB')
- ),
- (
- # tpl_snippet with mem_size given as number+Space+tib
- 'mem_size_is_number_Spaces_GB',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- mem_size: 1 tib
- ''',
- property='mem_size',
- expected='1 TiB')
- ),
- (
- 'cpu_frequency_is_float_Space_GHz',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- cpu_frequency: 2.5 GHz
- ''',
- property='cpu_frequency',
- expected='2.5 GHz')
- ),
- (
- 'cpu_frequency_is_float_Space_MHz',
- dict(tpl_snippet='''
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- cpu_frequency: 800 MHz
- ''',
- property='cpu_frequency',
- expected='800 MHz')
- ),
- ]
-
- def test_scenario_scalar_unit_positive(self):
- tpl = self.tpl_snippet
- nodetemplates = yamlparser.simple_parse(tpl)
- nodetemplate = NodeTemplate('server', nodetemplates)
- props = nodetemplate.get_capability('host').get_properties()
- prop_name = self.property
- if props and prop_name in props.keys():
- prop = props[prop_name]
- self.assertIsNone(prop.validate())
- resolved = prop.value
- self.assertEqual(resolved, self.expected)
-
-
-class GetNumFromScalarUnitSizePositive(TestCase):
-
- scenarios = [
- ( # Note that (1 TB) / (1 GB) = 1000
- 'Input is TB, user input is GB',
- dict(InputMemSize='1 TB',
- UserInputUnit='gB',
- expected=1000)
- ),
- ( # Note that (1 Tib)/ (1 GB) = 1099
- 'Input is TiB, user input is GB',
- dict(InputMemSize='1 TiB',
- UserInputUnit='gB',
- expected=1099.511627776)
- ),
- ]
-
- def test_scenario_get_num_from_scalar_unit_size(self):
- resolved = (ScalarUnit_Size(self.InputMemSize).
- get_num_from_scalar_unit(self.UserInputUnit))
- self.assertEqual(resolved, self.expected)
-
-
-class GetNumFromScalarUnitFrequencyPositive(TestCase):
-
- scenarios = [
- ( # Note that (1 GHz) / (1 Hz) = 1000000000
- 'Input is GHz, user input is Hz',
- dict(InputMemSize='1 GHz',
- UserInputUnit='Hz',
- expected=1000000000)
- ),
- (
- 'Input is GHz, user input is Hz',
- dict(InputMemSize='2.4 GHz',
- UserInputUnit='Hz',
- expected=2400000000)
- ),
- ( # Note that (1 GHz)/ (1 MHz) = 1000
- 'Input is MHz, user input is GHz',
- dict(InputMemSize='800 MHz',
- UserInputUnit='GHz',
- expected=0.8)
- ),
- (
- 'Input is GHz, user input is Hz',
- dict(InputMemSize='0.9 GHz',
- UserInputUnit='MHz',
- expected=900)
- ),
- (
- 'Input is GHz, user input is Hz',
- dict(InputMemSize='2.7GHz',
- UserInputUnit='MHz',
- expected=2700)
- ),
- ]
-
- def test_scenario_get_num_from_scalar_unit_frequency(self):
- resolved = (ScalarUnit_Frequency(self.InputMemSize).
- get_num_from_scalar_unit(self.UserInputUnit))
- self.assertEqual(resolved, self.expected)
-
-
-class GetNumFromScalarUnitTimePositive(TestCase):
-
- scenarios = [
- ( # Note that (1 s) / (1 ms) = 1000
- 'Input is 500ms, user input is s',
- dict(InputMemSize='500 ms',
- UserInputUnit='s',
- expected=0.5)
- ),
- ( # Note that (1 h)/ (1 s) = 3600
- 'Input is h, user input is s',
- dict(InputMemSize='1 h',
- UserInputUnit='s',
- expected=3600)
- ),
- ( # Note that (1 m)/ (1 s) = 60
- 'Input is m, user input is s',
- dict(InputMemSize='0.5 m',
- UserInputUnit='s',
- expected=30)
- ),
- ( # Note that (1 d)/ (1 h) = 24
- 'Input is d, user input is h',
- dict(InputMemSize='1 d',
- UserInputUnit='h',
- expected=24)
- ),
- ]
-
- def test_scenario_get_num_from_scalar_unit_time(self):
- resolved = (ScalarUnit_Time(self.InputMemSize).
- get_num_from_scalar_unit(self.UserInputUnit))
- self.assertEqual(resolved, self.expected)
-
-
-class GetNumFromScalarUnitSizeNegative(TestCase):
-
- InputMemSize = '1 GB'
- UserInputUnit = 'qB'
-
- def test_get_num_from_scalar_unit_size_negative(self):
- try:
- (ScalarUnit_Size(self.InputMemSize).
- get_num_from_scalar_unit(self.UserInputUnit))
- except Exception as error:
- self.assertTrue(isinstance(error, ValueError))
- self.assertEqual(_('The unit "qB" is not valid. Valid units are '
- '"[\'B\', \'GB\', \'GiB\', \'KiB\', \'MB\', '
- '\'MiB\', \'TB\', \'TiB\', \'kB\']".'),
- error.__str__())
-
-
-class GetNumFromScalarUnitFrequencyNegative(TestCase):
-
- InputFrequency = '2.7 GHz'
- UserInputUnit = 'Jz'
-
- def test_get_num_from_scalar_unit_frequency_negative(self):
- try:
- (ScalarUnit_Frequency(self.InputFrequency).
- get_num_from_scalar_unit(self.UserInputUnit))
- except Exception as error:
- self.assertTrue(isinstance(error, ValueError))
- self.assertEqual(_('The unit "Jz" is not valid. Valid units are '
- '"[\'GHz\', \'Hz\', \'MHz\', \'kHz\']".'),
- error.__str__())
-
-
-class GetNumFromScalarUnitTimeNegative(TestCase):
-
- InputTime = '5 ms'
- UserInputUnit = 'D'
-
- def test_get_num_from_scalar_unit_frequency_negative(self):
- try:
- (ScalarUnit_Time(self.InputTime).
- get_num_from_scalar_unit(self.UserInputUnit))
- except Exception as error:
- self.assertTrue(isinstance(error, ValueError))
- self.assertEqual(_('"Jz" is not a valid scalar-unit.'),
- error.__str__())
-
-
-class ScalarUnitNegativeTest(TestCase):
-
- custom_def_snippet = '''
- tosca.my.nodes.Compute:
- derived_from: tosca.nodes.Root
- properties:
- cpu_frequency:
- required: no
- type: scalar-unit.frequency
- constraints:
- - greater_or_equal: 0.1 GHz
- disk_size:
- required: no
- type: scalar-unit.size
- constraints:
- - greater_or_equal: 1 GB
- mem_size:
- required: no
- type: scalar-unit.size
- constraints:
- - in_range: [1 MiB, 1 GiB]
- '''
- custom_def = yamlparser.simple_parse(custom_def_snippet)
-
- # disk_size doesn't provide a value, mem_size uses an invalid unit.
- def test_invalid_scalar_unit(self):
- tpl_snippet = '''
- server:
- type: tosca.my.nodes.Compute
- properties:
- cpu_frequency: 50.3.6 GHZ
- disk_size: MB
- mem_size: 1 QB
- '''
- nodetemplates = yamlparser.simple_parse(tpl_snippet)
- nodetemplate = NodeTemplate('server', nodetemplates, self.custom_def)
- for p in nodetemplate.get_properties_objects():
- self.assertRaises(ValueError, p.validate)
-
- # disk_size is less than 1 GB, mem_size is not in the required range.
- # Note: in the spec, the minimum value of mem_size is 1 MiB (> 1 MB)
- def test_constraint_for_scalar_unit(self):
- tpl_snippet = '''
- server:
- type: tosca.my.nodes.Compute
- properties:
- cpu_frequency: 0.05 GHz
- disk_size: 500 MB
- mem_size: 1 MB
- '''
- nodetemplates = yamlparser.simple_parse(tpl_snippet)
- nodetemplate = NodeTemplate('server', nodetemplates, self.custom_def)
- props = nodetemplate.get_properties()
- if 'cpu_frequency' in props.keys():
- error = self.assertRaises(exception.ValidationError,
- props['cpu_frequency'].validate)
- self.assertEqual(_('The value "0.05 GHz" of property '
- '"cpu_frequency" must be greater than or equal '
- 'to "0.1 GHz".'), error.__str__())
- if 'disk_size' in props.keys():
- error = self.assertRaises(exception.ValidationError,
- props['disk_size'].validate)
- self.assertEqual(_('The value "500 MB" of property "disk_size" '
- 'must be greater than or equal to "1 GB".'),
- error.__str__())
-
- if 'mem_size' in props.keys():
- error = self.assertRaises(exception.ValidationError,
- props['mem_size'].validate)
- self.assertEqual(_('The value "1 MB" of property "mem_size" is '
- 'out of range "(min:1 MiB, max:1 GiB)".'),
- error.__str__())
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_shell.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_shell.py
deleted file mode 100644
index e0b5a4e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_shell.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# 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 os
-
-from toscaparser.common import exception
-import toscaparser.shell as shell
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-
-
-class ShellTest(TestCase):
-
- tosca_helloworld = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_helloworld.yaml")
-
- errornous_template = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_multiple_validation_errors.yaml")
-
- def test_missing_arg(self):
- error = self.assertRaises(ValueError, shell.main, '')
- err_msg = _('The program requires a template or a CSAR file as an '
- 'argument. Please refer to the usage documentation.')
- self.assertEqual(err_msg, str(error))
-
- def test_invalid_arg(self):
- error = self.assertRaises(ValueError, shell.main, 'parse me')
- err_msg = _('The program expects "--template-file" as the first '
- 'argument. Please refer to the usage documentation.')
- self.assertEqual(err_msg, str(error))
-
- def test_template_not_exist(self):
- error = self.assertRaises(
- ValueError, shell.main, ['--template-file=template.txt'])
- self.assertEqual(_('"template.txt" is not a valid file.'), str(error))
-
- def test_template_invalid(self):
- arg = '--template-file=' + self.errornous_template
- self.assertRaises(exception.ValidationError, shell.main, [arg])
-
- def test_template_valid(self):
- arg = '--template-file=' + self.tosca_helloworld
- try:
- shell.main([arg])
- except Exception:
- self.fail(_('The program raised an exception unexpectedly.'))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_topology_template.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_topology_template.py
deleted file mode 100644
index d12037e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_topology_template.py
+++ /dev/null
@@ -1,160 +0,0 @@
-# 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 os
-
-from toscaparser.tests.base import TestCase
-from toscaparser.topology_template import TopologyTemplate
-from toscaparser.tosca_template import ToscaTemplate
-import toscaparser.utils.yamlparser
-
-YAML_LOADER = toscaparser.utils.yamlparser.load_yaml
-
-
-class TopologyTemplateTest(TestCase):
-
- def setUp(self):
- TestCase.setUp(self)
- '''TOSCA template.'''
- self.tosca_tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/topology_template/subsystem.yaml")
- self.tpl = YAML_LOADER(self.tosca_tpl_path)
- self.topo_tpl = self.tpl.get('topology_template')
- self.imports = self.tpl.get('imports')
- self.topo = TopologyTemplate(self.topo_tpl,
- self._get_all_custom_def())
-
- def _get_custom_def(self, type_definition):
- custom_defs = {}
- for definition in self.imports:
- if os.path.isabs(definition):
- def_file = definition
- else:
- tpl_dir = os.path.dirname(os.path.abspath(self.tosca_tpl_path))
- def_file = os.path.join(tpl_dir, definition)
- custom_type = YAML_LOADER(def_file)
- custom_defs.update(custom_type.get(type_definition))
- return custom_defs
-
- def _get_all_custom_def(self):
- custom_defs = {}
- custom_defs.update(self._get_custom_def('node_types'))
- custom_defs.update(self._get_custom_def('capability_types'))
- return custom_defs
-
- def test_description(self):
- expected_desc = 'Template of a database including its hosting stack.'
- self.assertEqual(expected_desc, self.topo.description)
-
- def test_inputs(self):
- self.assertEqual(
- ['mq_server_ip', 'my_cpus', 'receiver_port'],
- sorted([input.name for input in self.topo.inputs]))
-
- input_name = "receiver_port"
- expected_description = "Port to be used for receiving messages."
- for input in self.topo.inputs:
- if input.name == input_name:
- self.assertEqual(expected_description, input.description)
-
- def test_node_tpls(self):
- '''Test nodetemplate names.'''
- self.assertEqual(
- ['app', 'server', 'websrv'],
- sorted([tpl.name for tpl in self.topo.nodetemplates]))
-
- tpl_name = "app"
- expected_type = "example.SomeApp"
- expected_properties = ['admin_user', 'pool_size']
- expected_capabilities = ['message_receiver']
- expected_requirements = [{'host': {'node': 'websrv'}}]
- expected_relationshp = ['tosca.relationships.HostedOn']
- expected_host = ['websrv']
- for tpl in self.topo.nodetemplates:
- if tpl_name == tpl.name:
- '''Test node type.'''
- self.assertEqual(tpl.type, expected_type)
-
- '''Test properties.'''
- self.assertEqual(
- expected_properties,
- sorted(tpl.get_properties().keys()))
-
- '''Test capabilities.'''
- self.assertEqual(
- expected_capabilities,
- sorted(tpl.get_capabilities().keys()))
-
- '''Test requirements.'''
- self.assertEqual(
- expected_requirements, tpl.requirements)
-
- '''Test relationship.'''
- ''' TODO : skip tempororily. need to fix it
- '''
- self.assertEqual(
- expected_relationshp,
- [x.type for x in tpl.relationships.keys()])
- self.assertEqual(
- expected_host,
- [y.name for y in tpl.relationships.values()])
- '''Test interfaces.'''
- # TODO(hurf) add interface test when new template is available
-
- if tpl.name == 'server':
- '''Test property value'''
- props = tpl.get_properties()
- if props and 'mem_size' in props.keys():
- self.assertEqual(props['mem_size'].value, '4096 MB')
- '''Test capability'''
- caps = tpl.get_capabilities()
- self.assertIn('os', caps.keys())
- os_props_objs = None
- os_props = None
- os_type_prop = None
- if caps and 'os' in caps.keys():
- capability = caps['os']
- os_props_objs = capability.get_properties_objects()
- os_props = capability.get_properties()
- os_type_prop = capability.get_property_value('type')
- break
- self.assertEqual(
- ['Linux'],
- [p.value for p in os_props_objs if p.name == 'type'])
- self.assertEqual(
- 'Linux',
- os_props['type'].value if 'type' in os_props else '')
- self.assertEqual('Linux', os_props['type'].value)
- self.assertEqual('Linux', os_type_prop)
-
- def test_outputs(self):
- self.assertEqual(
- ['receiver_ip'],
- sorted([output.name for output in self.topo.outputs]))
-
- def test_groups(self):
- group = self.topo.groups[0]
- self.assertEqual('webserver_group', group.name)
- self.assertEqual(['websrv', 'server'], group.member_names)
- for node in group.members:
- if node.name == 'server':
- '''Test property value'''
- props = node.get_properties()
- if props and 'mem_size' in props.keys():
- self.assertEqual(props['mem_size'].value, '4096 MB')
-
- def test_system_template(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/topology_template/system.yaml")
- self.assertIsNotNone(ToscaTemplate(tpl_path))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscadef.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscadef.py
deleted file mode 100644
index 38d08d7..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscadef.py
+++ /dev/null
@@ -1,335 +0,0 @@
-# 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.
-
-from toscaparser.common import exception
-from toscaparser.elements.artifacttype import ArtifactTypeDef
-from toscaparser.elements.entity_type import EntityType
-import toscaparser.elements.interfaces as ifaces
-from toscaparser.elements.nodetype import NodeType
-from toscaparser.elements.policytype import PolicyType
-from toscaparser.tests.base import TestCase
-
-compute_type = NodeType('tosca.nodes.Compute')
-component_type = NodeType('tosca.nodes.SoftwareComponent')
-network_type = NodeType('tosca.nodes.network.Network')
-network_port_type = NodeType('tosca.nodes.network.Port')
-webserver_type = NodeType('tosca.nodes.WebServer')
-database_type = NodeType('tosca.nodes.Database')
-artif_root_type = ArtifactTypeDef('tosca.artifacts.Root')
-artif_file_type = ArtifactTypeDef('tosca.artifacts.File')
-artif_bash_type = ArtifactTypeDef('tosca.artifacts.Implementation.Bash')
-artif_python_type = ArtifactTypeDef('tosca.artifacts.Implementation.Python')
-artif_container_docker_type = ArtifactTypeDef('tosca.artifacts.'
- 'Deployment.Image.'
- 'Container.Docker')
-artif_vm_iso_type = ArtifactTypeDef('tosca.artifacts.'
- 'Deployment.Image.VM.ISO')
-artif_vm_qcow2_type = ArtifactTypeDef('tosca.artifacts.'
- 'Deployment.Image.VM.QCOW2')
-policy_root_type = PolicyType('tosca.policies.Root')
-policy_placement_type = PolicyType('tosca.policies.Placement')
-policy_scaling_type = PolicyType('tosca.policies.Scaling')
-policy_update_type = PolicyType('tosca.policies.Update')
-policy_performance_type = PolicyType('tosca.policies.Performance')
-
-
-class ToscaDefTest(TestCase):
- def test_type(self):
- self.assertEqual(compute_type.type, "tosca.nodes.Compute")
- self.assertRaises(exception.InvalidTypeError, NodeType,
- 'tosca.nodes.Invalid')
- self.assertEqual(network_type.type, "tosca.nodes.network.Network")
- self.assertEqual(network_port_type.type, "tosca.nodes.network.Port")
-
- def test_parent_type(self):
- self.assertEqual(compute_type.parent_type.type, "tosca.nodes.Root")
- self.assertEqual(network_type.parent_type.type, "tosca.nodes.Root")
- self.assertEqual(network_port_type.parent_type.type,
- "tosca.nodes.Root")
-
- def test_capabilities(self):
- self.assertEqual(
- sorted(['tosca.capabilities.Container',
- 'tosca.capabilities.OperatingSystem',
- 'tosca.capabilities.network.Bindable',
- 'tosca.capabilities.Scalable']),
- sorted([c.type for c in compute_type.get_capabilities_objects()]))
- self.assertEqual(
- ['tosca.capabilities.network.Linkable'],
- [c.type for c in network_type.get_capabilities_objects()])
- endpoint_properties = ['initiator', 'network_name', 'port',
- 'port_name', 'ports', 'protocol',
- 'secure', 'url_path']
- endpoint_props_def_objects = \
- self._get_capability_properties_def_objects(
- webserver_type.get_capabilities_objects(),
- 'tosca.capabilities.Endpoint')
- self.assertEqual(
- endpoint_properties,
- sorted([p.name for p in endpoint_props_def_objects]))
- for p in endpoint_props_def_objects:
- if p.name in endpoint_properties:
- self.assertFalse(p.required)
- endpoint_props_def = self._get_capability_properties_def(
- webserver_type.get_capabilities_objects(),
- 'tosca.capabilities.Endpoint')
- self.assertEqual(
- endpoint_properties,
- sorted(endpoint_props_def.keys()))
- endpoint_prop_def = self._get_capability_property_def(
- webserver_type.get_capabilities_objects(),
- 'tosca.capabilities.Endpoint',
- 'initiator')
- self.assertEqual(None, endpoint_prop_def)
-
- os_props = self._get_capability_properties_def_objects(
- compute_type.get_capabilities_objects(),
- 'tosca.capabilities.OperatingSystem')
- self.assertEqual(
- [('architecture', False), ('distribution', False), ('type', False),
- ('version', False)],
- sorted([(p.name, p.required) for p in os_props]))
-
- host_props = self._get_capability_properties_def_objects(
- compute_type.get_capabilities_objects(),
- 'tosca.capabilities.Container')
- self.assertEqual(
- [('cpu_frequency', False), ('disk_size', False),
- ('mem_size', False), ('num_cpus', False)],
- sorted([(p.name, p.required) for p in host_props]))
- endpoint_admin_properties = 'secure'
- endpoint_admin_props_def_objects = \
- self._get_capability_properties_def_objects(
- webserver_type.get_capabilities_objects(),
- 'tosca.capabilities.Endpoint.Admin')
- self.assertIn(
- endpoint_admin_properties,
- sorted([p.name for p in endpoint_admin_props_def_objects]))
-
- def _get_capability_properties_def_objects(self, caps, type):
- properties_def = None
- for cap in caps:
- if cap.type == type:
- properties_def = cap.get_properties_def_objects()
- break
- return properties_def
-
- def _get_capability_properties_def(self, caps, type):
- properties_def = None
- for cap in caps:
- if cap.type == type:
- properties_def = cap.get_properties_def()
- break
- return properties_def
-
- def _get_capability_property_def(self, caps, type, property):
- property_def = None
- for cap in caps:
- if cap.type == type:
- property_def = cap.get_property_def_value(property)
- break
- return property_def
-
- def test_properties_def(self):
- self.assertEqual(
- ['name', 'password', 'user'],
- sorted(database_type.get_properties_def().keys()))
-
- def test_attributes_def(self):
- self.assertEqual(
- ['private_address', 'public_address'],
- sorted(compute_type.get_attributes_def().keys()))
-
- def test_requirements(self):
- self.assertEqual(
- [{'host': {'capability': 'tosca.capabilities.Container',
- 'node': 'tosca.nodes.Compute',
- 'relationship': 'tosca.relationships.HostedOn'}}],
- [r for r in component_type.requirements])
-
- def test_relationship(self):
- self.assertEqual(
- [('tosca.relationships.HostedOn', 'tosca.nodes.Compute')],
- [(relation.type, node.type) for
- relation, node in component_type.relationship.items()])
- self.assertIn(
- ('tosca.relationships.HostedOn', ['tosca.capabilities.Container']),
- [(relation.type, relation.valid_target_types) for
- relation in list(component_type.relationship.keys())])
- self.assertIn(
- ('tosca.relationships.network.BindsTo', 'tosca.nodes.Compute'),
- [(relation.type, node.type) for
- relation, node in network_port_type.relationship.items()])
- self.assertIn(
- ('tosca.relationships.network.LinksTo',
- 'tosca.nodes.network.Network'),
- [(relation.type, node.type) for
- relation, node in network_port_type.relationship.items()])
-
- def test_interfaces(self):
- self.assertEqual(compute_type.interfaces, None)
- root_node = NodeType('tosca.nodes.Root')
- self.assertIn(ifaces.LIFECYCLE_SHORTNAME, root_node.interfaces)
-
- def test_artifacts(self):
- self.assertEqual('tosca.artifacts.Root',
- artif_file_type.parent_type)
- self.assertEqual({}, artif_file_type.parent_artifacts)
- self.assertEqual(sorted(['tosca.artifacts.Root'],
- key=lambda x: str(x)),
- sorted([artif_file_type.get_artifact(name)
- for name in artif_file_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.artifacts.Implementation',
- artif_bash_type.parent_type)
- self.assertEqual({'tosca.artifacts.Implementation':
- {'derived_from': 'tosca.artifacts.Root',
- 'description':
- 'TOSCA base type for implementation artifacts'}},
- artif_bash_type.parent_artifacts)
- self.assertEqual(sorted([['sh'], 'tosca.artifacts.Implementation',
- 'Script artifact for the Unix Bash shell',
- 'application/x-sh'], key=lambda x: str(x)),
- sorted([artif_bash_type.get_artifact(name)
- for name in artif_bash_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.artifacts.Implementation',
- artif_python_type.parent_type)
- self.assertEqual({'tosca.artifacts.Implementation':
- {'derived_from': 'tosca.artifacts.Root',
- 'description':
- 'TOSCA base type for implementation artifacts'}},
- artif_python_type.parent_artifacts)
- self.assertEqual(sorted([['py'], 'tosca.artifacts.Implementation',
- 'Artifact for the interpreted Python'
- ' language', 'application/x-python'],
- key=lambda x: str(x)),
- sorted([artif_python_type.get_artifact(name)
- for name in artif_python_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.artifacts.Deployment.Image',
- artif_container_docker_type.parent_type)
- self.assertEqual({'tosca.artifacts.Deployment':
- {'derived_from': 'tosca.artifacts.Root',
- 'description':
- 'TOSCA base type for deployment artifacts'},
- 'tosca.artifacts.Deployment.Image':
- {'derived_from': 'tosca.artifacts.Deployment'}},
- artif_container_docker_type.parent_artifacts)
- self.assertEqual(sorted(['tosca.artifacts.Deployment.Image',
- 'Docker container image'],
- key=lambda x: str(x)),
- sorted([artif_container_docker_type.
- get_artifact(name) for name in
- artif_container_docker_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.artifacts.Deployment.Image',
- artif_vm_iso_type.parent_type)
- self.assertEqual({'tosca.artifacts.Deployment':
- {'derived_from': 'tosca.artifacts.Root',
- 'description':
- 'TOSCA base type for deployment artifacts'},
- 'tosca.artifacts.Deployment.Image':
- {'derived_from': 'tosca.artifacts.Deployment'}},
- artif_vm_iso_type.parent_artifacts)
- self.assertEqual(sorted(['tosca.artifacts.Deployment.Image',
- 'Virtual Machine (VM) image in '
- 'ISO disk format',
- 'application/octet-stream', ['iso']],
- key=lambda x: str(x)),
- sorted([artif_vm_iso_type.
- get_artifact(name) for name in
- artif_vm_iso_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.artifacts.Deployment.Image',
- artif_vm_qcow2_type.parent_type)
- self.assertEqual({'tosca.artifacts.Deployment':
- {'derived_from': 'tosca.artifacts.Root',
- 'description':
- 'TOSCA base type for deployment artifacts'},
- 'tosca.artifacts.Deployment.Image':
- {'derived_from': 'tosca.artifacts.Deployment'}},
- artif_vm_qcow2_type.parent_artifacts)
- self.assertEqual(sorted(['tosca.artifacts.Deployment.Image',
- 'Virtual Machine (VM) image in QCOW v2 '
- 'standard disk format',
- 'application/octet-stream', ['qcow2']],
- key=lambda x: str(x)),
- sorted([artif_vm_qcow2_type.
- get_artifact(name) for name in
- artif_vm_qcow2_type.defs],
- key=lambda x: str(x)))
-
- def test_policies(self):
- self.assertEqual('tosca.policies.Root',
- policy_placement_type.parent_type)
- self.assertEqual({}, policy_placement_type.parent_policies)
- self.assertEqual(sorted(['tosca.policies.Root',
- 'The TOSCA Policy Type definition that is '
- 'used to govern placement of TOSCA nodes or '
- 'groups of nodes.'],
- key=lambda x: str(x)),
- sorted([policy_placement_type.get_policy(name)
- for name in policy_placement_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.policies.Root',
- policy_scaling_type.parent_type)
- self.assertEqual({}, policy_scaling_type.parent_policies)
- self.assertEqual(sorted(['tosca.policies.Root',
- 'The TOSCA Policy Type definition that is '
- 'used to govern scaling of TOSCA nodes or '
- 'groups of nodes.'],
- key=lambda x: str(x)),
- sorted([policy_scaling_type.get_policy(name)
- for name in policy_scaling_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.policies.Root',
- policy_update_type.parent_type)
- self.assertEqual({}, policy_update_type.parent_policies)
- self.assertEqual(sorted(['tosca.policies.Root',
- 'The TOSCA Policy Type definition that is '
- 'used to govern update of TOSCA nodes or '
- 'groups of nodes.'],
- key=lambda x: str(x)),
- sorted([policy_update_type.get_policy(name)
- for name in policy_update_type.defs],
- key=lambda x: str(x)))
-
- self.assertEqual('tosca.policies.Root',
- policy_performance_type.parent_type)
- self.assertEqual({}, policy_performance_type.parent_policies)
- self.assertEqual(sorted(['tosca.policies.Root',
- 'The TOSCA Policy Type definition that is '
- 'used to declare performance requirements '
- 'for TOSCA nodes or groups of nodes.'],
- key=lambda x: str(x)),
- sorted([policy_performance_type.get_policy(name)
- for name in policy_performance_type.defs],
- key=lambda x: str(x)))
-
- def test_port_spec(self):
- tosca_def = EntityType.TOSCA_DEF
- port_spec = tosca_def.get('tosca.datatypes.network.PortSpec')
- self.assertEqual(port_spec.get('derived_from'),
- 'tosca.datatypes.Root')
- properties = port_spec.get('properties')
- self.assertEqual(
- sorted(['protocol', 'target', 'target_range', 'source',
- 'source_range']),
- sorted(properties.keys()))
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatpl.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatpl.py
deleted file mode 100644
index 4372a83..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatpl.py
+++ /dev/null
@@ -1,544 +0,0 @@
-# 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 os
-import six
-
-from toscaparser.common import exception
-import toscaparser.elements.interfaces as ifaces
-from toscaparser.elements.nodetype import NodeType
-from toscaparser.functions import GetInput
-from toscaparser.functions import GetProperty
-from toscaparser.nodetemplate import NodeTemplate
-from toscaparser.tests.base import TestCase
-from toscaparser.tosca_template import ToscaTemplate
-from toscaparser.utils.gettextutils import _
-import toscaparser.utils.yamlparser
-
-
-class ToscaTemplateTest(TestCase):
-
- '''TOSCA template.'''
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_single_instance_wordpress.yaml")
- tosca = ToscaTemplate(tosca_tpl)
-
- tosca_elk_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_elk.yaml")
-
- def test_version(self):
- self.assertEqual(self.tosca.version, "tosca_simple_yaml_1_0")
-
- def test_description(self):
- expected_description = "TOSCA simple profile with wordpress, " \
- "web server and mysql on the same server."
- self.assertEqual(self.tosca.description, expected_description)
-
- def test_inputs(self):
- self.assertEqual(
- ['cpus', 'db_name', 'db_port',
- 'db_pwd', 'db_root_pwd', 'db_user'],
- sorted([input.name for input in self.tosca.inputs]))
-
- input_name = "db_port"
- expected_description = "Port for the MySQL database."
- for input in self.tosca.inputs:
- if input.name == input_name:
- self.assertEqual(input.description, expected_description)
-
- def test_node_tpls(self):
- '''Test nodetemplate names.'''
- self.assertEqual(
- ['mysql_database', 'mysql_dbms', 'server',
- 'webserver', 'wordpress'],
- sorted([tpl.name for tpl in self.tosca.nodetemplates]))
-
- tpl_name = "mysql_database"
- expected_type = "tosca.nodes.Database"
- expected_properties = ['name', 'password', 'user']
- expected_capabilities = ['database_endpoint']
- expected_requirements = [{'host': 'mysql_dbms'}]
- ''' TODO: needs enhancement in tosca_elk.yaml..
- expected_relationshp = ['tosca.relationships.HostedOn']
- expected_host = ['mysql_dbms']
- '''
- expected_interface = [ifaces.LIFECYCLE_SHORTNAME]
-
- for tpl in self.tosca.nodetemplates:
- if tpl_name == tpl.name:
- '''Test node type.'''
- self.assertEqual(tpl.type, expected_type)
-
- '''Test properties.'''
- self.assertEqual(
- expected_properties,
- sorted(tpl.get_properties().keys()))
-
- '''Test capabilities.'''
- self.assertEqual(
- expected_capabilities,
- sorted(tpl.get_capabilities().keys()))
-
- '''Test requirements.'''
- self.assertEqual(
- expected_requirements, tpl.requirements)
-
- '''Test relationship.'''
- ''' needs enhancements in tosca_elk.yaml
- self.assertEqual(
- expected_relationshp,
- [x.type for x in tpl.relationships.keys()])
- self.assertEqual(
- expected_host,
- [y.name for y in tpl.relationships.values()])
- '''
- '''Test interfaces.'''
- self.assertEqual(
- expected_interface,
- [x.type for x in tpl.interfaces])
-
- if tpl.name == 'server':
- '''Test property value'''
- props = tpl.get_properties()
- if props and 'mem_size' in props.keys():
- self.assertEqual(props['mem_size'].value, '4096 MB')
- '''Test capability'''
- caps = tpl.get_capabilities()
- self.assertIn('os', caps.keys())
- os_props_objs = None
- os_props = None
- os_type_prop = None
- if caps and 'os' in caps.keys():
- capability = caps['os']
- os_props_objs = capability.get_properties_objects()
- os_props = capability.get_properties()
- os_type_prop = capability.get_property_value('type')
- break
- self.assertEqual(
- ['Linux'],
- [p.value for p in os_props_objs if p.name == 'type'])
- self.assertEqual(
- 'Linux',
- os_props['type'].value if 'type' in os_props else '')
- self.assertEqual('Linux', os_props['type'].value)
- self.assertEqual('Linux', os_type_prop)
-
- def test_outputs(self):
- self.assertEqual(
- ['website_url'],
- sorted([output.name for output in self.tosca.outputs]))
-
- def test_interfaces(self):
- wordpress_node = [
- node for node in self.tosca.nodetemplates
- if node.name == 'wordpress'][0]
- interfaces = wordpress_node.interfaces
- self.assertEqual(2, len(interfaces))
- for interface in interfaces:
- if interface.name == 'create':
- self.assertEqual(ifaces.LIFECYCLE_SHORTNAME,
- interface.type)
- self.assertEqual('wordpress/wordpress_install.sh',
- interface.implementation)
- self.assertIsNone(interface.inputs)
- elif interface.name == 'configure':
- self.assertEqual(ifaces.LIFECYCLE_SHORTNAME,
- interface.type)
- self.assertEqual('wordpress/wordpress_configure.sh',
- interface.implementation)
- self.assertEqual(3, len(interface.inputs))
- TestCase.skip(self, 'bug #1440247')
- wp_db_port = interface.inputs['wp_db_port']
- self.assertTrue(isinstance(wp_db_port, GetProperty))
- self.assertEqual('get_property', wp_db_port.name)
- self.assertEqual(['SELF',
- 'database_endpoint',
- 'port'],
- wp_db_port.args)
- result = wp_db_port.result()
- self.assertTrue(isinstance(result, GetInput))
- else:
- raise AssertionError(
- 'Unexpected interface: {0}'.format(interface.name))
-
- def test_normative_type_by_short_name(self):
- # test template with a short name Compute
- template = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_tosca_normative_type_by_shortname.yaml")
-
- tosca_tpl = ToscaTemplate(template)
- expected_type = "tosca.nodes.Compute"
- for tpl in tosca_tpl.nodetemplates:
- self.assertEqual(tpl.type, expected_type)
- for tpl in tosca_tpl.nodetemplates:
- compute_type = NodeType(tpl.type)
- self.assertEqual(
- sorted(['tosca.capabilities.Container',
- 'tosca.capabilities.OperatingSystem',
- 'tosca.capabilities.network.Bindable',
- 'tosca.capabilities.Scalable']),
- sorted([c.type
- for c in compute_type.get_capabilities_objects()]))
-
- def test_template_with_no_inputs(self):
- tosca_tpl = self._load_template('test_no_inputs_in_template.yaml')
- self.assertEqual(0, len(tosca_tpl.inputs))
-
- def test_template_with_no_outputs(self):
- tosca_tpl = self._load_template('test_no_outputs_in_template.yaml')
- self.assertEqual(0, len(tosca_tpl.outputs))
-
- def test_relationship_interface(self):
- template = ToscaTemplate(self.tosca_elk_tpl)
- for node_tpl in template.nodetemplates:
- if node_tpl.name == 'logstash':
- config_interface = 'Configure'
- artifact = 'logstash/configure_elasticsearch.py'
- relation = node_tpl.relationships
- for key in relation.keys():
- rel_tpl = relation.get(key).get_relationship_template()
- if rel_tpl:
- interfaces = rel_tpl[0].interfaces
- for interface in interfaces:
- self.assertEqual(config_interface,
- interface.type)
- self.assertEqual('pre_configure_source',
- interface.name)
- self.assertEqual(artifact,
- interface.implementation)
-
- def test_template_macro(self):
- template = ToscaTemplate(self.tosca_elk_tpl)
- for node_tpl in template.nodetemplates:
- if node_tpl.name == 'mongo_server':
- self.assertEqual(
- ['disk_size', 'mem_size', 'num_cpus'],
- sorted(node_tpl.get_capability('host').
- get_properties().keys()))
-
- def test_template_requirements(self):
- """Test different formats of requirements
-
- The requirements can be defined in few different ways,
- 1. Requirement expressed as a capability with an implicit relationship.
- 2. Requirement expressed with explicit relationship.
- 3. Requirement expressed with a relationship template.
- 4. Requirement expressed via TOSCA types to provision a node
- with explicit relationship.
- 5. Requirement expressed via TOSCA types with a filter.
- """
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_requirements.yaml")
- tosca = ToscaTemplate(tosca_tpl)
- for node_tpl in tosca.nodetemplates:
- if node_tpl.name == 'my_app':
- expected_relationship = [
- ('tosca.relationships.ConnectsTo', 'mysql_database'),
- ('tosca.relationships.HostedOn', 'my_webserver')]
- actual_relationship = sorted([
- (relation.type, node.name) for
- relation, node in node_tpl.relationships.items()])
- self.assertEqual(expected_relationship, actual_relationship)
- if node_tpl.name == 'mysql_database':
- self.assertEqual(
- [('tosca.relationships.HostedOn', 'my_dbms')],
- [(relation.type, node.name) for
- relation,
- node in node_tpl.relationships.items()])
- if node_tpl.name == 'my_server':
- self.assertEqual(
- [('tosca.relationships.AttachesTo', 'my_storage')],
- [(relation.type, node.name) for
- relation,
- node in node_tpl.relationships.items()])
-
- def test_template_requirements_not_implemented(self):
- # TODO(spzala): replace this test with new one once TOSCA types look up
- # support is implemented.
- """Requirements that yet need to be implemented
-
- The following requirement formats are not yet implemented,
- due to look up dependency:
- 1. Requirement expressed via TOSCA types to provision a node
- with explicit relationship.
- 2. Requirement expressed via TOSCA types with a filter.
- """
- tpl_snippet_1 = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- description: Requires a particular node type and relationship.
- To be full-filled via lookup into node repository.
- requirements:
- - req1:
- node: tosca.nodes.DBMS
- relationship: tosca.relationships.HostedOn
- '''
-
- tpl_snippet_2 = '''
- node_templates:
- my_webserver:
- type: tosca.nodes.WebServer
- description: Requires a particular node type with a filter.
- To be full-filled via lookup into node repository.
- requirements:
- - req1:
- node: tosca.nodes.Compute
- target_filter:
- properties:
- num_cpus: { in_range: [ 1, 4 ] }
- mem_size: { greater_or_equal: 2 }
- capabilities:
- - tosca.capabilities.OS:
- properties:
- architecture: x86_64
- type: linux
- '''
-
- tpl_snippet_3 = '''
- node_templates:
- my_webserver2:
- type: tosca.nodes.WebServer
- description: Requires a node type with a particular capability.
- To be full-filled via lookup into node repository.
- requirements:
- - req1:
- node: tosca.nodes.Compute
- relationship: tosca.relationships.HostedOn
- capability: tosca.capabilities.Container
- '''
- self._requirements_not_implemented(tpl_snippet_1, 'mysql_database')
- self._requirements_not_implemented(tpl_snippet_2, 'my_webserver')
- self._requirements_not_implemented(tpl_snippet_3, 'my_webserver2')
-
- def _requirements_not_implemented(self, tpl_snippet, tpl_name):
- nodetemplates = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet))['node_templates']
- self.assertRaises(
- NotImplementedError,
- lambda: NodeTemplate(tpl_name, nodetemplates).relationships)
-
- def test_custom_capability_type_definition(self):
- tpl_snippet = '''
- node_templates:
- test_app:
- type: tosca.nodes.WebApplication.TestApp
- capabilities:
- test_cap:
- properties:
- test: 1
- '''
- # custom definition with capability type definition
- custom_def = '''
- tosca.nodes.WebApplication.TestApp:
- derived_from: tosca.nodes.WebApplication
- capabilities:
- test_cap:
- type: tosca.capabilities.TestCapability
- tosca.capabilities.TestCapability:
- derived_from: tosca.capabilities.Root
- properties:
- test:
- type: integer
- required: no
- '''
- expected_capabilities = ['test_cap']
- nodetemplates = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet))['node_templates']
- custom_def = (toscaparser.utils.yamlparser.
- simple_parse(custom_def))
- name = list(nodetemplates.keys())[0]
- tpl = NodeTemplate(name, nodetemplates, custom_def)
- self.assertEqual(
- expected_capabilities,
- sorted(tpl.get_capabilities().keys()))
-
- # custom definition without capability type definition
- custom_def = '''
- tosca.nodes.WebApplication.TestApp:
- derived_from: tosca.nodes.WebApplication
- capabilities:
- test_cap:
- type: tosca.capabilities.TestCapability
- '''
- custom_def = (toscaparser.utils.yamlparser.
- simple_parse(custom_def))
- tpl = NodeTemplate(name, nodetemplates, custom_def)
- err = self.assertRaises(
- exception.InvalidTypeError,
- lambda: NodeTemplate(name, nodetemplates,
- custom_def).get_capabilities_objects())
- self.assertEqual('Type "tosca.capabilities.TestCapability" is not '
- 'a valid type.', six.text_type(err))
-
- def test_local_template_with_local_relpath_import(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_single_instance_wordpress.yaml")
- tosca = ToscaTemplate(tosca_tpl)
- self.assertTrue(tosca.topology_template.custom_defs)
-
- def test_local_template_with_url_import(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_single_instance_wordpress_with_url_import.yaml")
- tosca = ToscaTemplate(tosca_tpl)
- self.assertTrue(tosca.topology_template.custom_defs)
-
- def test_url_template_with_local_relpath_import(self):
- tosca_tpl = ('https://raw.githubusercontent.com/openstack/'
- 'tosca-parser/master/toscaparser/tests/data/'
- 'tosca_single_instance_wordpress.yaml')
- tosca = ToscaTemplate(tosca_tpl, None, False)
- self.assertTrue(tosca.topology_template.custom_defs)
-
- def test_url_template_with_local_abspath_import(self):
- tosca_tpl = ('https://raw.githubusercontent.com/openstack/'
- 'tosca-parser/master/toscaparser/tests/data/'
- 'tosca_single_instance_wordpress_with_local_abspath_'
- 'import.yaml')
- self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl,
- None, False)
- err_msg = (_('Absolute file name "/tmp/tosca-parser/toscaparser/tests'
- '/data/custom_types/wordpress.yaml" cannot be used in a '
- 'URL-based input template "%(tpl)s".')
- % {'tpl': tosca_tpl})
- exception.ExceptionCollector.assertExceptionMessage(ImportError,
- err_msg)
-
- def test_url_template_with_url_import(self):
- tosca_tpl = ('https://raw.githubusercontent.com/openstack/'
- 'tosca-parser/master/toscaparser/tests/data/'
- 'tosca_single_instance_wordpress_with_url_import.yaml')
- tosca = ToscaTemplate(tosca_tpl, None, False)
- self.assertTrue(tosca.topology_template.custom_defs)
-
- def test_csar_parsing_wordpress(self):
- csar_archive = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- 'data/CSAR/csar_wordpress.zip')
- self.assertTrue(ToscaTemplate(csar_archive))
-
- def test_csar_parsing_elk_url_based(self):
- csar_archive = ('https://github.com/openstack/tosca-parser/raw/master/'
- 'toscaparser/tests/data/CSAR/csar_elk.zip')
- self.assertTrue(ToscaTemplate(csar_archive, None, False))
-
- def test_nested_imports_in_templates(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_instance_nested_imports.yaml")
- tosca = ToscaTemplate(tosca_tpl)
- expected_custom_types = ['tosca.nodes.WebApplication.WordPress',
- 'tosca.nodes.SoftwareComponent.Rsyslog',
- 'tosca.nodes.SoftwareComponent.Logstash',
- 'tosca.nodes.SoftwareComponent.Rsyslog.'
- 'TestRsyslogType']
- self.assertItemsEqual(tosca.topology_template.custom_defs.keys(),
- expected_custom_types)
-
- def test_invalid_template_file(self):
- template_file = 'invalid template file'
- expected_msg = (_('"%s" is not a valid file.') % template_file)
- self.assertRaises(
- exception.ValidationError,
- ToscaTemplate, template_file, None, False)
- exception.ExceptionCollector.assertExceptionMessage(ValueError,
- expected_msg)
-
- def test_multiple_validation_errors(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_multiple_validation_errors.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl,
- None)
- err1_msg = _('The template version "tosca_simple_yaml_1" is invalid. '
- 'Valid versions are "tosca_simple_yaml_1_0".')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.InvalidTemplateVersion, err1_msg)
-
- err2_msg = _('Import "custom_types/not_there.yaml" is not valid.')
- exception.ExceptionCollector.assertExceptionMessage(
- ImportError, err2_msg)
-
- err3_msg = _('Type "tosca.nodes.WebApplication.WordPress" is not a '
- 'valid type.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.InvalidTypeError, err3_msg)
-
- err4_msg = _('Node template "wordpress" contains unknown field '
- '"requirement". Refer to the definition to verify valid '
- 'values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err4_msg)
-
- err5_msg = _('\'Property "passwords" was not found in node template '
- '"mysql_database".\'')
- exception.ExceptionCollector.assertExceptionMessage(
- KeyError, err5_msg)
-
- err6_msg = _('Template "mysql_dbms" is missing required field "type".')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.MissingRequiredFieldError, err6_msg)
-
- err7_msg = _('Node template "mysql_dbms" contains unknown field '
- '"type1". Refer to the definition to verify valid '
- 'values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err7_msg)
-
- err8_msg = _('\'Node template "server1" was not found.\'')
- exception.ExceptionCollector.assertExceptionMessage(
- KeyError, err8_msg)
-
- err9_msg = _('"relationship" used in template "webserver" is missing '
- 'required field "type".')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.MissingRequiredFieldError, err9_msg)
-
- def test_invalid_section_names(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_invalid_section_names.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl,
- None)
- err1_msg = _('Template contains unknown field '
- '"tosca_definitions_versions". Refer to the definition '
- 'to verify valid values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err1_msg)
-
- err2_msg = _('Template contains unknown field "descriptions". '
- 'Refer to the definition to verify valid values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err2_msg)
-
- err3_msg = _('Template contains unknown field "import". Refer to '
- 'the definition to verify valid values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err3_msg)
-
- err4_msg = _('Template contains unknown field "topology_templates". '
- 'Refer to the definition to verify valid values.')
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError, err4_msg)
-
- def test_csar_with_alternate_extenstion(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/CSAR/csar_elk.csar")
- tosca = ToscaTemplate(tosca_tpl)
- self.assertTrue(tosca.topology_template.custom_defs)
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatplvalidation.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatplvalidation.py
deleted file mode 100644
index 714534e..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_toscatplvalidation.py
+++ /dev/null
@@ -1,1109 +0,0 @@
-# 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 os
-import six
-
-from toscaparser.common import exception
-from toscaparser.imports import ImportsLoader
-from toscaparser.nodetemplate import NodeTemplate
-from toscaparser.parameters import Input
-from toscaparser.parameters import Output
-from toscaparser.relationship_template import RelationshipTemplate
-from toscaparser.tests.base import TestCase
-from toscaparser.tosca_template import ToscaTemplate
-from toscaparser.utils.gettextutils import _
-
-import toscaparser.utils.yamlparser
-
-
-class ToscaTemplateValidationTest(TestCase):
-
- def test_well_defined_template(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/tosca_single_instance_wordpress.yaml")
- self.assertIsNotNone(ToscaTemplate(tpl_path))
-
- def test_first_level_sections(self):
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_tosca_top_level_error1.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path)
- exception.ExceptionCollector.assertExceptionMessage(
- exception.MissingRequiredFieldError,
- _('Template is missing required field '
- '"tosca_definitions_version".'))
-
- tpl_path = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_tosca_top_level_error2.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path)
- exception.ExceptionCollector.assertExceptionMessage(
- exception.UnknownFieldError,
- _('Template contains unknown field "node_template". Refer to the '
- 'definition to verify valid values.'))
-
- def test_inputs(self):
- tpl_snippet = '''
- inputs:
- cpus:
- type: integer
- description: Number of CPUs for the server.
- constraint:
- - valid_values: [ 1, 2, 4, 8 ]
- '''
- inputs = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet)['inputs'])
- name, attrs = list(inputs.items())[0]
- input = Input(name, attrs)
- err = self.assertRaises(exception.UnknownFieldError, input.validate)
- self.assertEqual(_('Input "cpus" contains unknown field "constraint". '
- 'Refer to the definition to verify valid values.'),
- err.__str__())
-
- def _imports_content_test(self, tpl_snippet, path, custom_type_def):
- imports = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet)['imports'])
- loader = ImportsLoader(imports, path, custom_type_def)
- return loader.get_custom_defs()
-
- def test_imports_without_templates(self):
- tpl_snippet = '''
- imports:
- # omitted here for brevity
- '''
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- errormsg = _('"imports" keyname is defined without including '
- 'templates.')
- err = self.assertRaises(exception.ValidationError,
- self._imports_content_test,
- tpl_snippet,
- path,
- "node_types")
- self.assertEqual(errormsg, err.__str__())
-
- def test_imports_with_name_without_templates(self):
- tpl_snippet = '''
- imports:
- - some_definitions:
- '''
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- errormsg = _('A template file name is not provided with import '
- 'definition "some_definitions".')
- err = self.assertRaises(exception.ValidationError,
- self._imports_content_test,
- tpl_snippet, path, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_imports_without_import_name(self):
- tpl_snippet = '''
- imports:
- - custom_types/paypalpizzastore_nodejs_app.yaml
- - https://raw.githubusercontent.com/openstack/\
-tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml
- '''
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- custom_defs = self._imports_content_test(tpl_snippet,
- path,
- "node_types")
- self.assertTrue(custom_defs)
-
- def test_imports_wth_import_name(self):
- tpl_snippet = '''
- imports:
- - some_definitions: custom_types/paypalpizzastore_nodejs_app.yaml
- - more_definitions:
- file: toscaparser/tests/data/custom_types/wordpress.yaml
- repository: tosca-parser/master
- namespace_uri: https://raw.githubusercontent.com/openstack
- namespace_prefix: single_instance_wordpress
- '''
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- custom_defs = self._imports_content_test(tpl_snippet,
- path,
- "node_types")
- self.assertTrue(custom_defs.get("tosca.nodes."
- "WebApplication.WordPress"))
-
- def test_imports_with_no_main_template(self):
- tpl_snippet = '''
- imports:
- - some_definitions: https://raw.githubusercontent.com/openstack/\
-tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml
- - some_definitions:
- file: my_defns/my_typesdefs_n.yaml
- '''
- errormsg = _('Input tosca template is not provided.')
- err = self.assertRaises(exception.ValidationError,
- self._imports_content_test,
- tpl_snippet, None, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_imports_duplicate_name(self):
- tpl_snippet = '''
- imports:
- - some_definitions: https://raw.githubusercontent.com/openstack/\
-tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml
- - some_definitions:
- file: my_defns/my_typesdefs_n.yaml
- '''
- errormsg = _('Duplicate import name "some_definitions" was found.')
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- err = self.assertRaises(exception.ValidationError,
- self._imports_content_test,
- tpl_snippet, path, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_imports_missing_req_field_in_def(self):
- tpl_snippet = '''
- imports:
- - more_definitions:
- file1: my_defns/my_typesdefs_n.yaml
- repository: my_company_repo
- namespace_uri: http://mycompany.com/ns/tosca/2.0
- namespace_prefix: mycompany
- '''
- errormsg = _('Import of template "more_definitions" is missing '
- 'required field "file".')
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- err = self.assertRaises(exception.MissingRequiredFieldError,
- self._imports_content_test,
- tpl_snippet, path, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_imports_file_with_uri(self):
- tpl_snippet = '''
- imports:
- - more_definitions:
- file: https://raw.githubusercontent.com/openstack/\
-tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml
- namespace_prefix: mycompany
- '''
- path = 'https://raw.githubusercontent.com/openstack/\
-tosca-parser/master/toscaparser/tests/data/\
-tosca_single_instance_wordpress_with_url_import.yaml'
- custom_defs = self._imports_content_test(tpl_snippet,
- path,
- "node_types")
- self.assertTrue(custom_defs.get("tosca.nodes."
- "WebApplication.WordPress"))
-
- def test_imports_file_namespace_fields(self):
- tpl_snippet = '''
- imports:
- - more_definitions:
- file: heat-translator/master/translator/tests/data/\
-custom_types/wordpress.yaml
- namespace_uri: https://raw.githubusercontent.com/openstack/
- namespace_prefix: mycompany
- '''
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- custom_defs = self._imports_content_test(tpl_snippet,
- path,
- "node_types")
- self.assertTrue(custom_defs.get("tosca.nodes."
- "WebApplication.WordPress"))
-
- def test_import_error_namespace_uri(self):
- tpl_snippet = '''
- imports:
- - more_definitions:
- file: toscaparser/tests/data/tosca_elk.yaml
- namespace_uri: mycompany.com/ns/tosca/2.0
- namespace_prefix: mycompany
- '''
- errormsg = _('namespace_uri "mycompany.com/ns/tosca/2.0" is not '
- 'valid in import definition "more_definitions".')
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- err = self.assertRaises(ImportError,
- self._imports_content_test,
- tpl_snippet, path, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_import_single_line_error(self):
- tpl_snippet = '''
- imports:
- - some_definitions: abc.com/tests/data/tosca_elk.yaml
- '''
- errormsg = _('Import "abc.com/tests/data/tosca_elk.yaml" is not '
- 'valid.')
- path = 'toscaparser/tests/data/tosca_elk.yaml'
- err = self.assertRaises(ImportError,
- self._imports_content_test,
- tpl_snippet, path, None)
- self.assertEqual(errormsg, err.__str__())
-
- def test_outputs(self):
- tpl_snippet = '''
- outputs:
- server_address:
- description: IP address of server instance.
- values: { get_property: [server, private_address] }
- '''
- outputs = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet)['outputs'])
- name, attrs = list(outputs.items())[0]
- output = Output(name, attrs)
- try:
- output.validate()
- except Exception as err:
- self.assertTrue(
- isinstance(err, exception.MissingRequiredFieldError))
- self.assertEqual(_('Output "server_address" is missing required '
- 'field "value".'), err.__str__())
-
- tpl_snippet = '''
- outputs:
- server_address:
- descriptions: IP address of server instance.
- value: { get_property: [server, private_address] }
- '''
- outputs = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet)['outputs'])
- name, attrs = list(outputs.items())[0]
- output = Output(name, attrs)
- try:
- output.validate()
- except Exception as err:
- self.assertTrue(isinstance(err, exception.UnknownFieldError))
- self.assertEqual(_('Output "server_address" contains unknown '
- 'field "descriptions". Refer to the definition '
- 'to verify valid values.'),
- err.__str__())
-
- def _custom_types(self):
- custom_types = {}
- def_file = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/custom_types/wordpress.yaml")
- custom_type = toscaparser.utils.yamlparser.load_yaml(def_file)
- node_types = custom_type['node_types']
- for name in node_types:
- defintion = node_types[name]
- custom_types[name] = defintion
- return custom_types
-
- def _single_node_template_content_test(self, tpl_snippet):
- nodetemplates = (toscaparser.utils.yamlparser.
- simple_ordered_parse(tpl_snippet))['node_templates']
- name = list(nodetemplates.keys())[0]
- nodetemplate = NodeTemplate(name, nodetemplates,
- self._custom_types())
- nodetemplate.validate()
- nodetemplate.requirements
- nodetemplate.get_capabilities_objects()
- nodetemplate.get_properties_objects()
- nodetemplate.interfaces
-
- def test_node_templates(self):
- tpl_snippet = '''
- node_templates:
- server:
- capabilities:
- host:
- properties:
- disk_size: 10
- num_cpus: 4
- mem_size: 4096
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- '''
- expectedmessage = _('Template "server" is missing required field '
- '"type".')
- err = self.assertRaises(
- exception.MissingRequiredFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_wrong_properties_keyname(self):
- """Node template keyname 'properties' given as 'propertiessss'."""
- tpl_snippet = '''
- node_templates:
- mysql_dbms:
- type: tosca.nodes.DBMS
- propertiessss:
- root_password: aaa
- port: 3376
- '''
- expectedmessage = _('Node template "mysql_dbms" contains unknown '
- 'field "propertiessss". Refer to the definition '
- 'to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_wrong_requirements_keyname(self):
- """Node template keyname 'requirements' given as 'requirement'."""
- tpl_snippet = '''
- node_templates:
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: aaa
- port: 3376
- requirement:
- - host: server
- '''
- expectedmessage = _('Node template "mysql_dbms" contains unknown '
- 'field "requirement". Refer to the definition to '
- 'verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_wrong_interfaces_keyname(self):
- """Node template keyname 'interfaces' given as 'interfac'."""
- tpl_snippet = '''
- node_templates:
- mysql_dbms:
- type: tosca.nodes.DBMS
- properties:
- root_password: aaa
- port: 3376
- requirements:
- - host: server
- interfac:
- Standard:
- configure: mysql_database_configure.sh
- '''
- expectedmessage = _('Node template "mysql_dbms" contains unknown '
- 'field "interfac". Refer to the definition to '
- 'verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_wrong_capabilities_keyname(self):
- """Node template keyname 'capabilities' given as 'capabilitiis'."""
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- properties:
- db_name: { get_input: db_name }
- db_user: { get_input: db_user }
- db_password: { get_input: db_pwd }
- capabilitiis:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- '''
- expectedmessage = _('Node template "mysql_database" contains unknown '
- 'field "capabilitiis". Refer to the definition to '
- 'verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_wrong_artifacts_keyname(self):
- """Node template keyname 'artifacts' given as 'artifactsss'."""
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- artifactsss:
- db_content:
- implementation: files/my_db_content.txt
- type: tosca.artifacts.File
- '''
- expectedmessage = _('Node template "mysql_database" contains unknown '
- 'field "artifactsss". Refer to the definition to '
- 'verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_with_multiple_wrong_keynames(self):
- """Node templates given with multiple wrong keynames."""
- tpl_snippet = '''
- node_templates:
- mysql_dbms:
- type: tosca.nodes.DBMS
- propertieees:
- root_password: aaa
- port: 3376
- requirements:
- - host: server
- interfacs:
- Standard:
- configure: mysql_database_configure.sh
- '''
- expectedmessage = _('Node template "mysql_dbms" contains unknown '
- 'field "propertieees". Refer to the definition to '
- 'verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- properties:
- name: { get_input: db_name }
- user: { get_input: db_user }
- password: { get_input: db_pwd }
- capabilitiiiies:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirementsss:
- - host:
- node: mysql_dbms
- interfac:
- Standard:
- configure: mysql_database_configure.sh
-
- '''
- expectedmessage = _('Node template "mysql_database" contains unknown '
- 'field "capabilitiiiies". Refer to the definition '
- 'to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_type(self):
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Databases
- properties:
- db_name: { get_input: db_name }
- db_user: { get_input: db_user }
- db_password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host: mysql_dbms
- interfaces:
- Standard:
- configure: mysql_database_configure.sh
- '''
- expectedmessage = _('Type "tosca.nodes.Databases" is not '
- 'a valid type.')
- err = self.assertRaises(
- exception.InvalidTypeError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements(self):
- tpl_snippet = '''
- node_templates:
- webserver:
- type: tosca.nodes.WebServer
- requirements:
- host: server
- interfaces:
- Standard:
- create: webserver_install.sh
- start: d.sh
- '''
- expectedmessage = _('"requirements" of template "webserver" must be '
- 'of type "list".')
- err = self.assertRaises(
- exception.TypeMismatchError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- properties:
- db_name: { get_input: db_name }
- db_user: { get_input: db_user }
- db_password: { get_input: db_pwd }
- capabilities:
- database_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host: mysql_dbms
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- configure: mysql_database_configure.sh
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "database_endpoint". '
- 'Refer to the definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_with_wrong_node_keyname(self):
- """Node template requirements keyname 'node' given as 'nodes'."""
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- nodes: mysql_dbms
-
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "nodes". Refer to the '
- 'definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_with_wrong_capability_keyname(self):
- """Incorrect node template requirements keyname
-
- Node template requirements keyname 'capability' given as
- 'capabilityy'.
- """
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- node: mysql_dbms
- - log_endpoint:
- node: logstash
- capabilityy: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
-
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "capabilityy". Refer to '
- 'the definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_with_wrong_relationship_keyname(self):
- """Incorrect node template requirements keyname
-
- Node template requirements keyname 'relationship' given as
- 'relationshipppp'.
- """
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- node: mysql_dbms
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationshipppp:
- type: tosca.relationships.ConnectsTo
-
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "relationshipppp". Refer '
- 'to the definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_with_wrong_occurrences_keyname(self):
- """Incorrect node template requirements keyname
-
- Node template requirements keyname 'occurrences' given as
- 'occurences'.
- """
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- node: mysql_dbms
- - log_endpoint:
- node: logstash
- capability: log_endpoint
- relationship:
- type: tosca.relationships.ConnectsTo
- occurences: [0, UNBOUNDED]
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "occurences". Refer to '
- 'the definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_with_multiple_wrong_keynames(self):
- """Node templates given with multiple wrong requirements keynames."""
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- node: mysql_dbms
- - log_endpoint:
- nod: logstash
- capabilit: log_endpoint
- relationshipppp:
- type: tosca.relationships.ConnectsTo
-
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "nod". Refer to the '
- 'definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- requirements:
- - host:
- node: mysql_dbms
- - log_endpoint:
- node: logstash
- capabilit: log_endpoint
- relationshipppp:
- type: tosca.relationships.ConnectsTo
-
- '''
- expectedmessage = _('"requirements" of template "mysql_database" '
- 'contains unknown field "capabilit". Refer to the '
- 'definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_invalid_occurrences(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: [0, -1]
- '''
- expectedmessage = _('Value of property "[0, -1]" is invalid.')
- err = self.assertRaises(
- exception.InvalidPropertyValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: [a, w]
- '''
- expectedmessage = _('"a" is not an integer.')
- err = self.assertRaises(
- ValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: -1
- '''
- expectedmessage = _('"-1" is not a list.')
- err = self.assertRaises(
- ValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: [5, 1]
- '''
- expectedmessage = _('Value of property "[5, 1]" is invalid.')
- err = self.assertRaises(
- exception.InvalidPropertyValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: [0, 0]
- '''
- expectedmessage = _('Value of property "[0, 0]" is invalid.')
- err = self.assertRaises(
- exception.InvalidPropertyValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_requirements_valid_occurrences(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- requirements:
- - log_endpoint:
- capability: log_endpoint
- occurrences: [2, 2]
- '''
- self._single_node_template_content_test(tpl_snippet)
-
- def test_node_template_capabilities(self):
- tpl_snippet = '''
- node_templates:
- mysql_database:
- type: tosca.nodes.Database
- properties:
- db_name: { get_input: db_name }
- db_user: { get_input: db_user }
- db_password: { get_input: db_pwd }
- capabilities:
- http_endpoint:
- properties:
- port: { get_input: db_port }
- requirements:
- - host: mysql_dbms
- interfaces:
- Standard:
- configure: mysql_database_configure.sh
- '''
- expectedmessage = _('"capabilities" of template "mysql_database" '
- 'contains unknown field "http_endpoint". Refer to '
- 'the definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_properties(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- properties:
- os_image: F18_x86_64
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- '''
- expectedmessage = _('"properties" of template "server" contains '
- 'unknown field "os_image". Refer to the '
- 'definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_interfaces(self):
- tpl_snippet = '''
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standards:
- create: wordpress_install.sh
- configure:
- implementation: wordpress_configure.sh
- inputs:
- wp_db_name: { get_property: [ mysql_database, db_name ] }
- wp_db_user: { get_property: [ mysql_database, db_user ] }
- wp_db_password: { get_property: [ mysql_database, \
- db_password ] }
- wp_db_port: { get_property: [ SELF, \
- database_endpoint, port ] }
- '''
- expectedmessage = _('"interfaces" of template "wordpress" contains '
- 'unknown field "Standards". Refer to the '
- 'definition to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress_install.sh
- config:
- implementation: wordpress_configure.sh
- inputs:
- wp_db_name: { get_property: [ mysql_database, db_name ] }
- wp_db_user: { get_property: [ mysql_database, db_user ] }
- wp_db_password: { get_property: [ mysql_database, \
- db_password ] }
- wp_db_port: { get_property: [ SELF, \
- database_endpoint, port ] }
- '''
- expectedmessage = _('"interfaces" of template "wordpress" contains '
- 'unknown field "config". Refer to the definition '
- 'to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- wordpress:
- type: tosca.nodes.WebApplication.WordPress
- requirements:
- - host: webserver
- - database_endpoint: mysql_database
- interfaces:
- Standard:
- create: wordpress_install.sh
- configure:
- implementation: wordpress_configure.sh
- input:
- wp_db_name: { get_property: [ mysql_database, db_name ] }
- wp_db_user: { get_property: [ mysql_database, db_user ] }
- wp_db_password: { get_property: [ mysql_database, \
- db_password ] }
- wp_db_port: { get_ref_property: [ database_endpoint, \
- database_endpoint, port ] }
- '''
- expectedmessage = _('"interfaces" of template "wordpress" contains '
- 'unknown field "input". Refer to the definition '
- 'to verify valid values.')
- err = self.assertRaises(
- exception.UnknownFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_relationship_template_properties(self):
- tpl_snippet = '''
- relationship_templates:
- storage_attachto:
- type: AttachesTo
- properties:
- device: test_device
- '''
- expectedmessage = _('"properties" of template "storage_attachto" is '
- 'missing required field "[\'location\']".')
- rel_template = (toscaparser.utils.yamlparser.
- simple_parse(tpl_snippet))['relationship_templates']
- name = list(rel_template.keys())[0]
- rel_template = RelationshipTemplate(rel_template[name], name)
- err = self.assertRaises(exception.MissingRequiredFieldError,
- rel_template.validate)
- self.assertEqual(expectedmessage, six.text_type(err))
-
- def test_invalid_template_version(self):
- tosca_tpl = os.path.join(
- os.path.dirname(os.path.abspath(__file__)),
- "data/test_invalid_template_version.yaml")
- self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl)
- valid_versions = ', '.join(ToscaTemplate.VALID_TEMPLATE_VERSIONS)
- exception.ExceptionCollector.assertExceptionMessage(
- exception.InvalidTemplateVersion,
- (_('The template version "tosca_xyz" is invalid. Valid versions '
- 'are "%s".') % valid_versions))
-
- def test_node_template_capabilities_properties(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- scalable:
- properties:
- min_instances: 1
- default_instances: 5
- '''
- expectedmessage = _('"properties" of template "server" is missing '
- 'required field "[\'max_instances\']".')
- err = self.assertRaises(
- exception.MissingRequiredFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- # validating capability property values
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.WebServer
- capabilities:
- data_endpoint:
- properties:
- initiator: test
- '''
- expectedmessage = _('The value "test" of property "initiator" is '
- 'not valid. Expected a value from "[source, '
- 'target, peer]".')
-
- err = self.assertRaises(
- exception.ValidationError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- capabilities:
- host:
- properties:
- disk_size: 10 GB
- num_cpus: { get_input: cpus }
- mem_size: 4096 MB
- os:
- properties:
- architecture: x86_64
- type: Linux
- distribution: Fedora
- version: 18.0
- scalable:
- properties:
- min_instances: 1
- max_instances: 3
- default_instances: 5
- '''
- expectedmessage = _('"properties" of template "server": '
- '"default_instances" value is not between '
- '"min_instances" and "max_instances".')
- err = self.assertRaises(
- exception.ValidationError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_objectstorage_without_required_property(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.ObjectStorage
- properties:
- maxsize: 1 GB
- '''
- expectedmessage = _('"properties" of template "server" is missing '
- 'required field "[\'name\']".')
- err = self.assertRaises(
- exception.MissingRequiredFieldError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_objectstorage_with_invalid_scalar_unit(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.ObjectStorage
- properties:
- name: test
- maxsize: -1
- '''
- expectedmessage = _('"-1" is not a valid scalar-unit.')
- err = self.assertRaises(
- ValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_node_template_objectstorage_with_invalid_scalar_type(self):
- tpl_snippet = '''
- node_templates:
- server:
- type: tosca.nodes.ObjectStorage
- properties:
- name: test
- maxsize: 1 XB
- '''
- expectedmessage = _('"1 XB" is not a valid scalar-unit.')
- err = self.assertRaises(
- ValueError,
- lambda: self._single_node_template_content_test(tpl_snippet))
- self.assertEqual(expectedmessage, err.__str__())
-
- def test_special_keywords(self):
- """Test special keywords
-
- Test that special keywords, e.g. metadata, which are not part
- of specification do not throw any validation error.
- """
- tpl_snippet_metadata_map = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- metadata:
- name: server A
- role: master
- '''
- self._single_node_template_content_test(tpl_snippet_metadata_map)
-
- tpl_snippet_metadata_inline = '''
- node_templates:
- server:
- type: tosca.nodes.Compute
- metadata: none
- '''
- self._single_node_template_content_test(tpl_snippet_metadata_inline)
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_utils.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_utils.py
deleted file mode 100644
index a0c8a6d..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_utils.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# 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.
-
-from toscaparser.common.exception import URLException
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-import toscaparser.utils.urlutils
-import toscaparser.utils.yamlparser
-
-YAML_LOADER = toscaparser.utils.yamlparser.load_yaml
-
-
-class UrlUtilsTest(TestCase):
-
- url_utils = toscaparser.utils.urlutils.UrlUtils
-
- def test_urlutils_validate_url(self):
- self.assertTrue(self.url_utils.validate_url("http://www.github.com/"))
- self.assertTrue(
- self.url_utils.validate_url("https://github.com:81/a/2/a.b"))
- self.assertTrue(self.url_utils.validate_url("ftp://github.com"))
- self.assertFalse(self.url_utils.validate_url("github.com"))
- self.assertFalse(self.url_utils.validate_url("123"))
- self.assertFalse(self.url_utils.validate_url("a/b/c"))
-
- def test_urlutils_join_url(self):
- self.assertEqual(
- self.url_utils.join_url("http://github.com/proj1", "proj2"),
- "http://github.com/proj2")
- self.assertEqual(
- self.url_utils.join_url("http://github.com/proj1/scripts/a.js",
- "b.js"),
- "http://github.com/proj1/scripts/b.js")
- self.assertEqual(
- self.url_utils.join_url("http://github.com/proj1/scripts", "b.js"),
- "http://github.com/proj1/b.js")
- self.assertEqual(
- self.url_utils.join_url("http://github.com/proj1/scripts",
- "scripts/b.js"),
- "http://github.com/proj1/scripts/b.js")
-
- def test_load_url_errors(self):
- url = "http://www.badurl."
- err_msg = (_('Failed to reach server "%(url)s". Reason is: '
- '[Errno -2] Name or service not known.')
- % {'url': url})
- err = self.assertRaises(URLException,
- YAML_LOADER,
- url,
- False)
- self.assertEqual(err_msg, err.__str__())
diff --git a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_validate_tosca_version.py b/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_validate_tosca_version.py
deleted file mode 100644
index e9a8ac2..0000000
--- a/tosca2heat/tosca-parser-0.3.0/toscaparser/tests/test_validate_tosca_version.py
+++ /dev/null
@@ -1,132 +0,0 @@
-# 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.
-
-from toscaparser.common.exception import (
- InvalidTOSCAVersionPropertyException)
-from toscaparser.tests.base import TestCase
-from toscaparser.utils.gettextutils import _
-from toscaparser.utils.validateutils import TOSCAVersionProperty
-
-
-class TOSCAVersionPropertyTest(TestCase):
-
- def test_tosca_version_property(self):
- version = '18.0.3.beta-1'
- expected_output = '18.0.3.beta-1'
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 18
- expected_output = '18.0'
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 18.0
- expected_output = '18.0'
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = '18.0.3'
- expected_output = '18.0.3'
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 0
- expected_output = None
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 00
- expected_output = None
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 0.0
- expected_output = None
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = 00.00
- expected_output = None
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- version = '0.0.0'
- expected_output = None
- output = TOSCAVersionProperty(version).get_version()
- self.assertEqual(output, expected_output)
-
- def test_tosca_version_property_invalid_major_version(self):
-
- version = 'x'
- exp_msg = _('Value of TOSCA version property "x" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- def test_tosca_version_property_invalid_minor_version(self):
-
- version = '18.x'
- exp_msg = _('Value of TOSCA version property "18.x" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- version = '18.x.y'
- exp_msg = _('Value of TOSCA version property "18.x.y" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- version = '18-2'
- exp_msg = _('Value of TOSCA version property "18-2" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- def test_tosca_version_property_invalid_fix_version(self):
-
- version = '18.0.a'
- exp_msg = _('Value of TOSCA version property "18.0.a" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- def test_tosca_version_property_invalid_qualifier(self):
-
- version = '18.0.1-xyz'
- exp_msg = _('Value of TOSCA version property "18.0.1-xyz" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- version = '0.0.0.abc'
- exp_msg = _('Value of TOSCA version property "0.0.0.abc" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- def test_tosca_version_property_invalid_build_version(self):
-
- version = '18.0.1.abc-x'
- exp_msg = _('Value of TOSCA version property '
- '"18.0.1.abc-x" is invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())
-
- version = '0.0.0.abc-x'
- exp_msg = _('Value of TOSCA version property "0.0.0.abc-x" is '
- 'invalid.')
- err = self.assertRaises(InvalidTOSCAVersionPropertyException,
- TOSCAVersionProperty, version)
- self.assertEqual(exp_msg, err.__str__())