diff --git a/doc/source/usage.rst b/doc/source/usage.rst index cd7945a4..17fb1ba7 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -13,7 +13,7 @@ you can install 0.3.0 or higher PyPI release of TOSCA-Parser as available at the https://pypi.python.org/project/tosca-parser and test use the parser via CLI entry point as:: - tosca-parser --template-file=toscaparser/tests/data/tosca_helloworld.yaml + tosca-parser --template-file=samples/tests/data/tosca_helloworld.yaml The value to the --template-file is required to be a relative or an absolute path. diff --git a/toscaparser/tests/data/CSAR/csar_elk.csar b/samples/tests/data/CSAR/csar_elk.csar similarity index 100% rename from toscaparser/tests/data/CSAR/csar_elk.csar rename to samples/tests/data/CSAR/csar_elk.csar diff --git a/toscaparser/tests/data/CSAR/csar_elk.zip b/samples/tests/data/CSAR/csar_elk.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_elk.zip rename to samples/tests/data/CSAR/csar_elk.zip diff --git a/toscaparser/tests/data/CSAR/csar_hello_world.zip b/samples/tests/data/CSAR/csar_hello_world.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_hello_world.zip rename to samples/tests/data/CSAR/csar_hello_world.zip diff --git a/toscaparser/tests/data/CSAR/csar_invalid_entry_def.zip b/samples/tests/data/CSAR/csar_invalid_entry_def.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_invalid_entry_def.zip rename to samples/tests/data/CSAR/csar_invalid_entry_def.zip diff --git a/toscaparser/tests/data/CSAR/csar_invalid_multilevel_imports_validation.zip b/samples/tests/data/CSAR/csar_invalid_multilevel_imports_validation.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_invalid_multilevel_imports_validation.zip rename to samples/tests/data/CSAR/csar_invalid_multilevel_imports_validation.zip diff --git a/toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zip b/samples/tests/data/CSAR/csar_metadata_not_yaml.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_metadata_not_yaml.zip rename to samples/tests/data/CSAR/csar_metadata_not_yaml.zip diff --git a/toscaparser/tests/data/CSAR/csar_missing_metadata.zip b/samples/tests/data/CSAR/csar_missing_metadata.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_missing_metadata.zip rename to samples/tests/data/CSAR/csar_missing_metadata.zip diff --git a/toscaparser/tests/data/CSAR/csar_multiple_deployment_flavour.zip b/samples/tests/data/CSAR/csar_multiple_deployment_flavour.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_multiple_deployment_flavour.zip rename to samples/tests/data/CSAR/csar_multiple_deployment_flavour.zip diff --git a/toscaparser/tests/data/CSAR/csar_no_metadata_file.zip b/samples/tests/data/CSAR/csar_no_metadata_file.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_no_metadata_file.zip rename to samples/tests/data/CSAR/csar_no_metadata_file.zip diff --git a/toscaparser/tests/data/CSAR/csar_not_zip.zip b/samples/tests/data/CSAR/csar_not_zip.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_not_zip.zip rename to samples/tests/data/CSAR/csar_not_zip.zip diff --git a/toscaparser/tests/data/CSAR/csar_relative_path_import_check.zip b/samples/tests/data/CSAR/csar_relative_path_import_check.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_relative_path_import_check.zip rename to samples/tests/data/CSAR/csar_relative_path_import_check.zip diff --git a/toscaparser/tests/data/CSAR/csar_root_level_yaml.zip b/samples/tests/data/CSAR/csar_root_level_yaml.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_root_level_yaml.zip rename to samples/tests/data/CSAR/csar_root_level_yaml.zip diff --git a/toscaparser/tests/data/CSAR/csar_root_level_yaml_and_tosca_metadata.zip b/samples/tests/data/CSAR/csar_root_level_yaml_and_tosca_metadata.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_root_level_yaml_and_tosca_metadata.zip rename to samples/tests/data/CSAR/csar_root_level_yaml_and_tosca_metadata.zip diff --git a/toscaparser/tests/data/CSAR/csar_root_yaml_with_tosca_definition1_0.zip b/samples/tests/data/CSAR/csar_root_yaml_with_tosca_definition1_0.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_root_yaml_with_tosca_definition1_0.zip rename to samples/tests/data/CSAR/csar_root_yaml_with_tosca_definition1_0.zip diff --git a/toscaparser/tests/data/CSAR/csar_two_root_level_yaml.zip b/samples/tests/data/CSAR/csar_two_root_level_yaml.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_two_root_level_yaml.zip rename to samples/tests/data/CSAR/csar_two_root_level_yaml.zip diff --git a/toscaparser/tests/data/CSAR/csar_valid_multilevel_imports_validation.zip b/samples/tests/data/CSAR/csar_valid_multilevel_imports_validation.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_valid_multilevel_imports_validation.zip rename to samples/tests/data/CSAR/csar_valid_multilevel_imports_validation.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress.zip b/samples/tests/data/CSAR/csar_wordpress.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress.zip rename to samples/tests/data/CSAR/csar_wordpress.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_artifact.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_artifact.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_artifact.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_artifact.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_artifact_multi.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_artifact_multi.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_artifact_multi.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_artifact_multi.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_import_path.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_path.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_import_path.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_import_url.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_import_url.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_import_url.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_script_path.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_path.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_script_path.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zip b/samples/tests/data/CSAR/csar_wordpress_invalid_script_url.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_invalid_script_url.zip rename to samples/tests/data/CSAR/csar_wordpress_invalid_script_url.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_valid_artifact.zip b/samples/tests/data/CSAR/csar_wordpress_valid_artifact.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_valid_artifact.zip rename to samples/tests/data/CSAR/csar_wordpress_valid_artifact.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_valid_artifact_multi.zip b/samples/tests/data/CSAR/csar_wordpress_valid_artifact_multi.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_valid_artifact_multi.zip rename to samples/tests/data/CSAR/csar_wordpress_valid_artifact_multi.zip diff --git a/toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip b/samples/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip rename to samples/tests/data/CSAR/csar_wordpress_with_url_import_and_script.zip diff --git a/toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zip b/samples/tests/data/CSAR/csar_wrong_metadata_file.zip similarity index 100% rename from toscaparser/tests/data/CSAR/csar_wrong_metadata_file.zip rename to samples/tests/data/CSAR/csar_wrong_metadata_file.zip diff --git a/toscaparser/tests/data/CSAR/multi_level_imports_response.yaml b/samples/tests/data/CSAR/multi_level_imports_response.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/multi_level_imports_response.yaml rename to samples/tests/data/CSAR/multi_level_imports_response.yaml diff --git a/toscaparser/tests/data/CSAR/root_level_file.yaml b/samples/tests/data/CSAR/root_level_file.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/root_level_file.yaml rename to samples/tests/data/CSAR/root_level_file.yaml diff --git a/toscaparser/tests/data/CSAR/tosca_meta_file.yaml b/samples/tests/data/CSAR/tosca_meta_file.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/tosca_meta_file.yaml rename to samples/tests/data/CSAR/tosca_meta_file.yaml diff --git a/toscaparser/tests/artifacts/collectd/config.py b/samples/tests/data/artifacts/collectd/config.py similarity index 100% rename from toscaparser/tests/artifacts/collectd/config.py rename to samples/tests/data/artifacts/collectd/config.py diff --git a/toscaparser/tests/artifacts/collectd/create.sh b/samples/tests/data/artifacts/collectd/create.sh similarity index 100% rename from toscaparser/tests/artifacts/collectd/create.sh rename to samples/tests/data/artifacts/collectd/create.sh diff --git a/toscaparser/tests/artifacts/collectd/start.sh b/samples/tests/data/artifacts/collectd/start.sh similarity index 100% rename from toscaparser/tests/artifacts/collectd/start.sh rename to samples/tests/data/artifacts/collectd/start.sh diff --git a/toscaparser/tests/artifacts/elasticsearch/create.sh b/samples/tests/data/artifacts/elasticsearch/create.sh similarity index 100% rename from toscaparser/tests/artifacts/elasticsearch/create.sh rename to samples/tests/data/artifacts/elasticsearch/create.sh diff --git a/toscaparser/tests/artifacts/elasticsearch/start.sh b/samples/tests/data/artifacts/elasticsearch/start.sh similarity index 100% rename from toscaparser/tests/artifacts/elasticsearch/start.sh rename to samples/tests/data/artifacts/elasticsearch/start.sh diff --git a/toscaparser/tests/artifacts/kibana/config.sh b/samples/tests/data/artifacts/kibana/config.sh similarity index 100% rename from toscaparser/tests/artifacts/kibana/config.sh rename to samples/tests/data/artifacts/kibana/config.sh diff --git a/toscaparser/tests/artifacts/kibana/create.sh b/samples/tests/data/artifacts/kibana/create.sh similarity index 100% rename from toscaparser/tests/artifacts/kibana/create.sh rename to samples/tests/data/artifacts/kibana/create.sh diff --git a/toscaparser/tests/artifacts/kibana/start.sh b/samples/tests/data/artifacts/kibana/start.sh similarity index 100% rename from toscaparser/tests/artifacts/kibana/start.sh rename to samples/tests/data/artifacts/kibana/start.sh diff --git a/toscaparser/tests/artifacts/logstash/configure_collectd.py b/samples/tests/data/artifacts/logstash/configure_collectd.py similarity index 100% rename from toscaparser/tests/artifacts/logstash/configure_collectd.py rename to samples/tests/data/artifacts/logstash/configure_collectd.py diff --git a/toscaparser/tests/artifacts/logstash/configure_elasticsearch.py b/samples/tests/data/artifacts/logstash/configure_elasticsearch.py similarity index 100% rename from toscaparser/tests/artifacts/logstash/configure_elasticsearch.py rename to samples/tests/data/artifacts/logstash/configure_elasticsearch.py diff --git a/toscaparser/tests/artifacts/logstash/configure_rsyslog.py b/samples/tests/data/artifacts/logstash/configure_rsyslog.py similarity index 100% rename from toscaparser/tests/artifacts/logstash/configure_rsyslog.py rename to samples/tests/data/artifacts/logstash/configure_rsyslog.py diff --git a/toscaparser/tests/artifacts/logstash/create.sh b/samples/tests/data/artifacts/logstash/create.sh similarity index 100% rename from toscaparser/tests/artifacts/logstash/create.sh rename to samples/tests/data/artifacts/logstash/create.sh diff --git a/toscaparser/tests/artifacts/logstash/start.sh b/samples/tests/data/artifacts/logstash/start.sh similarity index 100% rename from toscaparser/tests/artifacts/logstash/start.sh rename to samples/tests/data/artifacts/logstash/start.sh diff --git a/toscaparser/tests/artifacts/mongodb/config.sh b/samples/tests/data/artifacts/mongodb/config.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/mongodb/config.sh rename to samples/tests/data/artifacts/mongodb/config.sh diff --git a/toscaparser/tests/artifacts/mongodb/create.sh b/samples/tests/data/artifacts/mongodb/create.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/mongodb/create.sh rename to samples/tests/data/artifacts/mongodb/create.sh diff --git a/toscaparser/tests/artifacts/mongodb/create_database.sh b/samples/tests/data/artifacts/mongodb/create_database.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/mongodb/create_database.sh rename to samples/tests/data/artifacts/mongodb/create_database.sh diff --git a/toscaparser/tests/artifacts/mongodb/start.sh b/samples/tests/data/artifacts/mongodb/start.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/mongodb/start.sh rename to samples/tests/data/artifacts/mongodb/start.sh diff --git a/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh b/samples/tests/data/artifacts/mysql/mysql_database_configure.sh similarity index 100% rename from toscaparser/tests/artifacts/mysql/mysql_database_configure.sh rename to samples/tests/data/artifacts/mysql/mysql_database_configure.sh diff --git a/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh b/samples/tests/data/artifacts/mysql/mysql_dbms_configure.sh similarity index 100% rename from toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh rename to samples/tests/data/artifacts/mysql/mysql_dbms_configure.sh diff --git a/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh b/samples/tests/data/artifacts/mysql/mysql_dbms_install.sh similarity index 100% rename from toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh rename to samples/tests/data/artifacts/mysql/mysql_dbms_install.sh diff --git a/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh b/samples/tests/data/artifacts/mysql/mysql_dbms_start.sh similarity index 100% rename from toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh rename to samples/tests/data/artifacts/mysql/mysql_dbms_start.sh diff --git a/toscaparser/tests/artifacts/nodejs/config.sh b/samples/tests/data/artifacts/nodejs/config.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/nodejs/config.sh rename to samples/tests/data/artifacts/nodejs/config.sh diff --git a/toscaparser/tests/artifacts/nodejs/create.sh b/samples/tests/data/artifacts/nodejs/create.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/nodejs/create.sh rename to samples/tests/data/artifacts/nodejs/create.sh diff --git a/toscaparser/tests/artifacts/nodejs/start.sh b/samples/tests/data/artifacts/nodejs/start.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/nodejs/start.sh rename to samples/tests/data/artifacts/nodejs/start.sh diff --git a/toscaparser/tests/artifacts/rsyslog/config.sh b/samples/tests/data/artifacts/rsyslog/config.sh old mode 100644 new mode 100755 similarity index 100% rename from toscaparser/tests/artifacts/rsyslog/config.sh rename to samples/tests/data/artifacts/rsyslog/config.sh diff --git a/toscaparser/tests/artifacts/rsyslog/create.sh b/samples/tests/data/artifacts/rsyslog/create.sh similarity index 100% rename from toscaparser/tests/artifacts/rsyslog/create.sh rename to samples/tests/data/artifacts/rsyslog/create.sh diff --git a/toscaparser/tests/artifacts/rsyslog/start.sh b/samples/tests/data/artifacts/rsyslog/start.sh similarity index 100% rename from toscaparser/tests/artifacts/rsyslog/start.sh rename to samples/tests/data/artifacts/rsyslog/start.sh diff --git a/toscaparser/tests/artifacts/webserver/webserver_install.sh b/samples/tests/data/artifacts/webserver/webserver_install.sh similarity index 100% rename from toscaparser/tests/artifacts/webserver/webserver_install.sh rename to samples/tests/data/artifacts/webserver/webserver_install.sh diff --git a/toscaparser/tests/artifacts/webserver/webserver_start.sh b/samples/tests/data/artifacts/webserver/webserver_start.sh similarity index 100% rename from toscaparser/tests/artifacts/webserver/webserver_start.sh rename to samples/tests/data/artifacts/webserver/webserver_start.sh diff --git a/toscaparser/tests/artifacts/wordpress/wordpress_configure.sh b/samples/tests/data/artifacts/wordpress/wordpress_configure.sh similarity index 100% rename from toscaparser/tests/artifacts/wordpress/wordpress_configure.sh rename to samples/tests/data/artifacts/wordpress/wordpress_configure.sh diff --git a/toscaparser/tests/artifacts/wordpress/wordpress_install.sh b/samples/tests/data/artifacts/wordpress/wordpress_install.sh similarity index 100% rename from toscaparser/tests/artifacts/wordpress/wordpress_install.sh rename to samples/tests/data/artifacts/wordpress/wordpress_install.sh diff --git a/toscaparser/tests/data/containers/test_container_docker_mysql.yaml b/samples/tests/data/containers/test_container_docker_mysql.yaml similarity index 100% rename from toscaparser/tests/data/containers/test_container_docker_mysql.yaml rename to samples/tests/data/containers/test_container_docker_mysql.yaml diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml b/samples/tests/data/custom_types/collectd.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/tosca_elk/Definitions/collectd.yaml rename to samples/tests/data/custom_types/collectd.yaml diff --git a/toscaparser/tests/data/custom_types/compute_with_attribute_list.yaml b/samples/tests/data/custom_types/compute_with_attribute_list.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/compute_with_attribute_list.yaml rename to samples/tests/data/custom_types/compute_with_attribute_list.yaml diff --git a/toscaparser/tests/data/custom_types/compute_with_nested_atributes.yaml b/samples/tests/data/custom_types/compute_with_nested_atributes.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/compute_with_nested_atributes.yaml rename to samples/tests/data/custom_types/compute_with_nested_atributes.yaml diff --git a/toscaparser/tests/data/custom_types/compute_with_prop.yaml b/samples/tests/data/custom_types/compute_with_prop.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/compute_with_prop.yaml rename to samples/tests/data/custom_types/compute_with_prop.yaml diff --git a/toscaparser/tests/data/custom_types/container_cap_child.yaml b/samples/tests/data/custom_types/container_cap_child.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/container_cap_child.yaml rename to samples/tests/data/custom_types/container_cap_child.yaml diff --git a/toscaparser/tests/data/custom_types/custom_cap.yaml b/samples/tests/data/custom_types/custom_cap.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_cap.yaml rename to samples/tests/data/custom_types/custom_cap.yaml diff --git a/toscaparser/tests/data/custom_types/custom_cap_with_datatype.yaml b/samples/tests/data/custom_types/custom_cap_with_datatype.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_cap_with_datatype.yaml rename to samples/tests/data/custom_types/custom_cap_with_datatype.yaml diff --git a/toscaparser/tests/data/custom_types/custom_caps_def.yaml b/samples/tests/data/custom_types/custom_caps_def.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_caps_def.yaml rename to samples/tests/data/custom_types/custom_caps_def.yaml diff --git a/toscaparser/tests/data/custom_types/custom_data_type.yaml b/samples/tests/data/custom_types/custom_data_type.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_data_type.yaml rename to samples/tests/data/custom_types/custom_data_type.yaml diff --git a/toscaparser/tests/data/custom_types/custom_interface.yaml b/samples/tests/data/custom_types/custom_interface.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_interface.yaml rename to samples/tests/data/custom_types/custom_interface.yaml diff --git a/toscaparser/tests/data/custom_types/custom_nested_data_types.yaml b/samples/tests/data/custom_types/custom_nested_data_types.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_nested_data_types.yaml rename to samples/tests/data/custom_types/custom_nested_data_types.yaml diff --git a/toscaparser/tests/data/custom_types/custom_policy.yaml b/samples/tests/data/custom_types/custom_policy.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_policy.yaml rename to samples/tests/data/custom_types/custom_policy.yaml diff --git a/toscaparser/tests/data/custom_types/custom_relationship_type_defs.yaml b/samples/tests/data/custom_types/custom_relationship_type_defs.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/custom_relationship_type_defs.yaml rename to samples/tests/data/custom_types/custom_relationship_type_defs.yaml diff --git a/toscaparser/tests/data/custom_types/db_with_list_param.yaml b/samples/tests/data/custom_types/db_with_list_param.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/db_with_list_param.yaml rename to samples/tests/data/custom_types/db_with_list_param.yaml diff --git a/toscaparser/tests/data/custom_types/elasticsearch.yaml b/samples/tests/data/custom_types/elasticsearch.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/elasticsearch.yaml rename to samples/tests/data/custom_types/elasticsearch.yaml diff --git a/toscaparser/tests/data/custom_types/imported_sample.yaml b/samples/tests/data/custom_types/imported_sample.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/imported_sample.yaml rename to samples/tests/data/custom_types/imported_sample.yaml diff --git a/toscaparser/tests/data/custom_types/invalid_template_version.yaml b/samples/tests/data/custom_types/invalid_template_version.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/invalid_template_version.yaml rename to samples/tests/data/custom_types/invalid_template_version.yaml diff --git a/toscaparser/tests/data/custom_types/kibana.yaml b/samples/tests/data/custom_types/kibana.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/kibana.yaml rename to samples/tests/data/custom_types/kibana.yaml diff --git a/toscaparser/tests/data/custom_types/logstash.yaml b/samples/tests/data/custom_types/logstash.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/logstash.yaml rename to samples/tests/data/custom_types/logstash.yaml diff --git a/toscaparser/tests/data/custom_types/nested_rsyslog.yaml b/samples/tests/data/custom_types/nested_rsyslog.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/nested_rsyslog.yaml rename to samples/tests/data/custom_types/nested_rsyslog.yaml diff --git a/toscaparser/tests/data/custom_types/nested_test_kibana.yaml b/samples/tests/data/custom_types/nested_test_kibana.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/nested_test_kibana.yaml rename to samples/tests/data/custom_types/nested_test_kibana.yaml diff --git a/toscaparser/tests/data/custom_types/nested_test_wordpress.yaml b/samples/tests/data/custom_types/nested_test_wordpress.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/nested_test_wordpress.yaml rename to samples/tests/data/custom_types/nested_test_wordpress.yaml diff --git a/toscaparser/tests/data/custom_types/node_with_cap.yaml b/samples/tests/data/custom_types/node_with_cap.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/node_with_cap.yaml rename to samples/tests/data/custom_types/node_with_cap.yaml diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml b/samples/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/tosca_elk/Definitions/paypalpizzastore_nodejs_app.yaml rename to samples/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml b/samples/tests/data/custom_types/rsyslog.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/tosca_elk/Definitions/rsyslog.yaml rename to samples/tests/data/custom_types/rsyslog.yaml diff --git a/toscaparser/tests/data/custom_types/template_metadata.yaml b/samples/tests/data/custom_types/template_metadata.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/template_metadata.yaml rename to samples/tests/data/custom_types/template_metadata.yaml diff --git a/toscaparser/tests/data/custom_types/template_version_1_3.yaml b/samples/tests/data/custom_types/template_version_1_3.yaml similarity index 100% rename from toscaparser/tests/data/custom_types/template_version_1_3.yaml rename to samples/tests/data/custom_types/template_version_1_3.yaml diff --git a/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml b/samples/tests/data/custom_types/wordpress.yaml similarity index 100% rename from toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/wordpress.yaml rename to samples/tests/data/custom_types/wordpress.yaml diff --git a/toscaparser/tests/data/custom_types/wordpress.yml b/samples/tests/data/custom_types/wordpress.yml similarity index 100% rename from toscaparser/tests/data/custom_types/wordpress.yml rename to samples/tests/data/custom_types/wordpress.yml diff --git a/toscaparser/tests/data/datatypes/custom_datatype_def.yaml b/samples/tests/data/datatypes/custom_datatype_def.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/custom_datatype_def.yaml rename to samples/tests/data/datatypes/custom_datatype_def.yaml diff --git a/toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml b/samples/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml rename to samples/tests/data/datatypes/test_custom_datatypes_in_current_template.yaml diff --git a/toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml b/samples/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml rename to samples/tests/data/datatypes/test_custom_datatypes_nested_datatype_error.yaml diff --git a/toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml b/samples/tests/data/datatypes/test_custom_datatypes_positive.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/test_custom_datatypes_positive.yaml rename to samples/tests/data/datatypes/test_custom_datatypes_positive.yaml diff --git a/toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml b/samples/tests/data/datatypes/test_custom_datatypes_value_error.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/test_custom_datatypes_value_error.yaml rename to samples/tests/data/datatypes/test_custom_datatypes_value_error.yaml diff --git a/toscaparser/tests/data/datatypes/test_datatype_portspec_add_req.yaml b/samples/tests/data/datatypes/test_datatype_portspec_add_req.yaml similarity index 100% rename from toscaparser/tests/data/datatypes/test_datatype_portspec_add_req.yaml rename to samples/tests/data/datatypes/test_datatype_portspec_add_req.yaml diff --git a/toscaparser/tests/data/dsl_definitions/test_nested_dsl_def.yaml b/samples/tests/data/dsl_definitions/test_nested_dsl_def.yaml similarity index 100% rename from toscaparser/tests/data/dsl_definitions/test_nested_dsl_def.yaml rename to samples/tests/data/dsl_definitions/test_nested_dsl_def.yaml diff --git a/toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml b/samples/tests/data/extensions/tosca_helloworld_nfv.yaml similarity index 100% rename from toscaparser/extensions/nfv/tests/data/tosca_helloworld_nfv.yaml rename to samples/tests/data/extensions/tosca_helloworld_nfv.yaml diff --git a/toscaparser/tests/data/functions/test_capabilties_inheritance.yaml b/samples/tests/data/functions/test_capabilties_inheritance.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_capabilties_inheritance.yaml rename to samples/tests/data/functions/test_capabilties_inheritance.yaml diff --git a/toscaparser/tests/data/functions/test_concat.yaml b/samples/tests/data/functions/test_concat.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_concat.yaml rename to samples/tests/data/functions/test_concat.yaml diff --git a/toscaparser/tests/data/functions/test_concat_invalid.yaml b/samples/tests/data/functions/test_concat_invalid.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_concat_invalid.yaml rename to samples/tests/data/functions/test_concat_invalid.yaml diff --git a/toscaparser/tests/data/functions/test_container_cap_child.yaml b/samples/tests/data/functions/test_container_cap_child.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_container_cap_child.yaml rename to samples/tests/data/functions/test_container_cap_child.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_custom_data_type.yaml b/samples/tests/data/functions/test_get_attribute_custom_data_type.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_custom_data_type.yaml rename to samples/tests/data/functions/test_get_attribute_custom_data_type.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml b/samples/tests/data/functions/test_get_attribute_host_keyword.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_host_keyword.yaml rename to samples/tests/data/functions/test_get_attribute_host_keyword.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml b/samples/tests/data/functions/test_get_attribute_host_not_found.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_host_not_found.yaml rename to samples/tests/data/functions/test_get_attribute_host_not_found.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml b/samples/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml rename to samples/tests/data/functions/test_get_attribute_illegal_host_in_outputs.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_nested_data_types.yaml b/samples/tests/data/functions/test_get_attribute_nested_data_types.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_nested_data_types.yaml rename to samples/tests/data/functions/test_get_attribute_nested_data_types.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_source_target_keywords.yaml b/samples/tests/data/functions/test_get_attribute_source_target_keywords.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_source_target_keywords.yaml rename to samples/tests/data/functions/test_get_attribute_source_target_keywords.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml b/samples/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml rename to samples/tests/data/functions/test_get_attribute_unknown_attribute_name.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml b/samples/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml rename to samples/tests/data/functions/test_get_attribute_unknown_node_template_name.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_with_index.yaml b/samples/tests/data/functions/test_get_attribute_with_index.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_with_index.yaml rename to samples/tests/data/functions/test_get_attribute_with_index.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml b/samples/tests/data/functions/test_get_attribute_with_index_error.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_with_index_error.yaml rename to samples/tests/data/functions/test_get_attribute_with_index_error.yaml diff --git a/toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml b/samples/tests/data/functions/test_get_attribute_with_nested_params.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_attribute_with_nested_params.yaml rename to samples/tests/data/functions/test_get_attribute_with_nested_params.yaml diff --git a/toscaparser/tests/data/functions/test_get_implicit_attribute.yaml b/samples/tests/data/functions/test_get_implicit_attribute.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_implicit_attribute.yaml rename to samples/tests/data/functions/test_get_implicit_attribute.yaml diff --git a/toscaparser/tests/data/functions/test_get_prop_cap_bool.yaml b/samples/tests/data/functions/test_get_prop_cap_bool.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_prop_cap_bool.yaml rename to samples/tests/data/functions/test_get_prop_cap_bool.yaml diff --git a/toscaparser/tests/data/functions/test_get_prop_cap_host.yaml b/samples/tests/data/functions/test_get_prop_cap_host.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_prop_cap_host.yaml rename to samples/tests/data/functions/test_get_prop_cap_host.yaml diff --git a/toscaparser/tests/data/functions/test_get_property_source_target_keywords.yaml b/samples/tests/data/functions/test_get_property_source_target_keywords.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_property_source_target_keywords.yaml rename to samples/tests/data/functions/test_get_property_source_target_keywords.yaml diff --git a/toscaparser/tests/data/functions/test_get_property_with_host.yaml b/samples/tests/data/functions/test_get_property_with_host.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_get_property_with_host.yaml rename to samples/tests/data/functions/test_get_property_with_host.yaml diff --git a/toscaparser/tests/data/functions/test_invalid_function_signature.yaml b/samples/tests/data/functions/test_invalid_function_signature.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_invalid_function_signature.yaml rename to samples/tests/data/functions/test_invalid_function_signature.yaml diff --git a/toscaparser/tests/data/functions/test_token.yaml b/samples/tests/data/functions/test_token.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_token.yaml rename to samples/tests/data/functions/test_token.yaml diff --git a/toscaparser/tests/data/functions/test_token_invalid.yaml b/samples/tests/data/functions/test_token_invalid.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_token_invalid.yaml rename to samples/tests/data/functions/test_token_invalid.yaml diff --git a/toscaparser/tests/data/functions/test_unknown_capability_property.yaml b/samples/tests/data/functions/test_unknown_capability_property.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_unknown_capability_property.yaml rename to samples/tests/data/functions/test_unknown_capability_property.yaml diff --git a/toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml b/samples/tests/data/functions/test_unknown_input_in_interface.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_unknown_input_in_interface.yaml rename to samples/tests/data/functions/test_unknown_input_in_interface.yaml diff --git a/toscaparser/tests/data/functions/test_unknown_input_in_property.yaml b/samples/tests/data/functions/test_unknown_input_in_property.yaml similarity index 100% rename from toscaparser/tests/data/functions/test_unknown_input_in_property.yaml rename to samples/tests/data/functions/test_unknown_input_in_property.yaml diff --git a/toscaparser/tests/data/functions/tosca_nested_property_names_indexes.yaml b/samples/tests/data/functions/tosca_nested_property_names_indexes.yaml similarity index 100% rename from toscaparser/tests/data/functions/tosca_nested_property_names_indexes.yaml rename to samples/tests/data/functions/tosca_nested_property_names_indexes.yaml diff --git a/toscaparser/tests/data/interfaces/test_custom_interface_in_template.yaml b/samples/tests/data/interfaces/test_custom_interface_in_template.yaml similarity index 100% rename from toscaparser/tests/data/interfaces/test_custom_interface_in_template.yaml rename to samples/tests/data/interfaces/test_custom_interface_in_template.yaml diff --git a/toscaparser/tests/data/interfaces/test_custom_interface_invalid_operation.yaml b/samples/tests/data/interfaces/test_custom_interface_invalid_operation.yaml similarity index 100% rename from toscaparser/tests/data/interfaces/test_custom_interface_invalid_operation.yaml rename to samples/tests/data/interfaces/test_custom_interface_invalid_operation.yaml diff --git a/toscaparser/tests/data/node_filter/test_node_filter.yaml b/samples/tests/data/node_filter/test_node_filter.yaml similarity index 100% rename from toscaparser/tests/data/node_filter/test_node_filter.yaml rename to samples/tests/data/node_filter/test_node_filter.yaml diff --git a/toscaparser/tests/data/policies/custom_definitions.yaml b/samples/tests/data/policies/custom_definitions.yaml similarity index 100% rename from toscaparser/tests/data/policies/custom_definitions.yaml rename to samples/tests/data/policies/custom_definitions.yaml diff --git a/toscaparser/tests/data/policies/tacker_defs.yaml b/samples/tests/data/policies/tacker_defs.yaml similarity index 100% rename from toscaparser/tests/data/policies/tacker_defs.yaml rename to samples/tests/data/policies/tacker_defs.yaml diff --git a/toscaparser/tests/data/policies/tacker_nfv_defs.yaml b/samples/tests/data/policies/tacker_nfv_defs.yaml similarity index 100% rename from toscaparser/tests/data/policies/tacker_nfv_defs.yaml rename to samples/tests/data/policies/tacker_nfv_defs.yaml diff --git a/toscaparser/tests/data/policies/test_policies_without_required_property.yaml b/samples/tests/data/policies/test_policies_without_required_property.yaml similarity index 100% rename from toscaparser/tests/data/policies/test_policies_without_required_property.yaml rename to samples/tests/data/policies/test_policies_without_required_property.yaml diff --git a/toscaparser/tests/data/policies/test_tosca_nfv_multiple_policies.yaml b/samples/tests/data/policies/test_tosca_nfv_multiple_policies.yaml similarity index 100% rename from toscaparser/tests/data/policies/test_tosca_nfv_multiple_policies.yaml rename to samples/tests/data/policies/test_tosca_nfv_multiple_policies.yaml diff --git a/toscaparser/tests/data/policies/tosca_custom_policy_template.yaml b/samples/tests/data/policies/tosca_custom_policy_template.yaml similarity index 100% rename from toscaparser/tests/data/policies/tosca_custom_policy_template.yaml rename to samples/tests/data/policies/tosca_custom_policy_template.yaml diff --git a/toscaparser/tests/data/policies/tosca_policy_template.yaml b/samples/tests/data/policies/tosca_policy_template.yaml similarity index 100% rename from toscaparser/tests/data/policies/tosca_policy_template.yaml rename to samples/tests/data/policies/tosca_policy_template.yaml diff --git a/toscaparser/tests/data/relationship/test_custom_relationship.yaml b/samples/tests/data/relationship/test_custom_relationship.yaml similarity index 100% rename from toscaparser/tests/data/relationship/test_custom_relationship.yaml rename to samples/tests/data/relationship/test_custom_relationship.yaml diff --git a/toscaparser/tests/data/repositories/test_repositories_definition.yaml b/samples/tests/data/repositories/test_repositories_definition.yaml similarity index 100% rename from toscaparser/tests/data/repositories/test_repositories_definition.yaml rename to samples/tests/data/repositories/test_repositories_definition.yaml diff --git a/toscaparser/tests/data/repositories/tosca_repositories_test_definition.yaml b/samples/tests/data/repositories/tosca_repositories_test_definition.yaml similarity index 100% rename from toscaparser/tests/data/repositories/tosca_repositories_test_definition.yaml rename to samples/tests/data/repositories/tosca_repositories_test_definition.yaml diff --git a/toscaparser/tests/data/requirements/test_requirements.yaml b/samples/tests/data/requirements/test_requirements.yaml similarity index 100% rename from toscaparser/tests/data/requirements/test_requirements.yaml rename to samples/tests/data/requirements/test_requirements.yaml diff --git a/toscaparser/tests/data/test_attributes_inheritance.yaml b/samples/tests/data/test_attributes_inheritance.yaml similarity index 100% rename from toscaparser/tests/data/test_attributes_inheritance.yaml rename to samples/tests/data/test_attributes_inheritance.yaml diff --git a/toscaparser/tests/data/test_available_rel_tpls.yaml b/samples/tests/data/test_available_rel_tpls.yaml similarity index 100% rename from toscaparser/tests/data/test_available_rel_tpls.yaml rename to samples/tests/data/test_available_rel_tpls.yaml diff --git a/toscaparser/tests/data/test_capability_without_properties.yaml b/samples/tests/data/test_capability_without_properties.yaml similarity index 100% rename from toscaparser/tests/data/test_capability_without_properties.yaml rename to samples/tests/data/test_capability_without_properties.yaml diff --git a/toscaparser/tests/data/test_credential_datatype.yaml b/samples/tests/data/test_credential_datatype.yaml similarity index 100% rename from toscaparser/tests/data/test_credential_datatype.yaml rename to samples/tests/data/test_credential_datatype.yaml diff --git a/toscaparser/tests/data/test_custom_capabilty.yaml b/samples/tests/data/test_custom_capabilty.yaml similarity index 100% rename from toscaparser/tests/data/test_custom_capabilty.yaml rename to samples/tests/data/test_custom_capabilty.yaml diff --git a/toscaparser/tests/data/test_custom_caps_def.yaml b/samples/tests/data/test_custom_caps_def.yaml similarity index 100% rename from toscaparser/tests/data/test_custom_caps_def.yaml rename to samples/tests/data/test_custom_caps_def.yaml diff --git a/toscaparser/tests/data/test_custom_caps_with_datatype.yaml b/samples/tests/data/test_custom_caps_with_datatype.yaml similarity index 100% rename from toscaparser/tests/data/test_custom_caps_with_datatype.yaml rename to samples/tests/data/test_custom_caps_with_datatype.yaml diff --git a/toscaparser/tests/data/test_endpoint_on_compute.yaml b/samples/tests/data/test_endpoint_on_compute.yaml similarity index 100% rename from toscaparser/tests/data/test_endpoint_on_compute.yaml rename to samples/tests/data/test_endpoint_on_compute.yaml diff --git a/toscaparser/tests/data/test_import_invalid_template_version.yaml b/samples/tests/data/test_import_invalid_template_version.yaml similarity index 100% rename from toscaparser/tests/data/test_import_invalid_template_version.yaml rename to samples/tests/data/test_import_invalid_template_version.yaml diff --git a/toscaparser/tests/data/test_import_metadata.yml b/samples/tests/data/test_import_metadata.yml similarity index 100% rename from toscaparser/tests/data/test_import_metadata.yml rename to samples/tests/data/test_import_metadata.yml diff --git a/toscaparser/tests/data/test_import_tosca_version_1_3.yaml b/samples/tests/data/test_import_tosca_version_1_3.yaml similarity index 100% rename from toscaparser/tests/data/test_import_tosca_version_1_3.yaml rename to samples/tests/data/test_import_tosca_version_1_3.yaml diff --git a/toscaparser/tests/data/test_instance_nested_imports.yaml b/samples/tests/data/test_instance_nested_imports.yaml similarity index 100% rename from toscaparser/tests/data/test_instance_nested_imports.yaml rename to samples/tests/data/test_instance_nested_imports.yaml diff --git a/toscaparser/tests/data/test_invalid_input_defaults.yaml b/samples/tests/data/test_invalid_input_defaults.yaml similarity index 100% rename from toscaparser/tests/data/test_invalid_input_defaults.yaml rename to samples/tests/data/test_invalid_input_defaults.yaml diff --git a/toscaparser/tests/data/test_invalid_section_names.yaml b/samples/tests/data/test_invalid_section_names.yaml similarity index 100% rename from toscaparser/tests/data/test_invalid_section_names.yaml rename to samples/tests/data/test_invalid_section_names.yaml diff --git a/toscaparser/tests/data/test_invalid_template_version.yaml b/samples/tests/data/test_invalid_template_version.yaml similarity index 100% rename from toscaparser/tests/data/test_invalid_template_version.yaml rename to samples/tests/data/test_invalid_template_version.yaml diff --git a/toscaparser/tests/data/test_long_rel.yaml b/samples/tests/data/test_long_rel.yaml similarity index 100% rename from toscaparser/tests/data/test_long_rel.yaml rename to samples/tests/data/test_long_rel.yaml diff --git a/toscaparser/tests/data/test_multiple_validation_errors.yaml b/samples/tests/data/test_multiple_validation_errors.yaml similarity index 100% rename from toscaparser/tests/data/test_multiple_validation_errors.yaml rename to samples/tests/data/test_multiple_validation_errors.yaml diff --git a/toscaparser/tests/data/test_no_inputs_in_template.yaml b/samples/tests/data/test_no_inputs_in_template.yaml similarity index 100% rename from toscaparser/tests/data/test_no_inputs_in_template.yaml rename to samples/tests/data/test_no_inputs_in_template.yaml diff --git a/toscaparser/tests/data/test_no_outputs_in_template.yaml b/samples/tests/data/test_no_outputs_in_template.yaml similarity index 100% rename from toscaparser/tests/data/test_no_outputs_in_template.yaml rename to samples/tests/data/test_no_outputs_in_template.yaml diff --git a/toscaparser/tests/data/test_nodetype_without_relationship.yaml b/samples/tests/data/test_nodetype_without_relationship.yaml similarity index 100% rename from toscaparser/tests/data/test_nodetype_without_relationship.yaml rename to samples/tests/data/test_nodetype_without_relationship.yaml diff --git a/toscaparser/tests/data/test_normative_type_properties_override.yaml b/samples/tests/data/test_normative_type_properties_override.yaml similarity index 100% rename from toscaparser/tests/data/test_normative_type_properties_override.yaml rename to samples/tests/data/test_normative_type_properties_override.yaml diff --git a/toscaparser/tests/data/test_scalar_unit_without_unit.yaml b/samples/tests/data/test_scalar_unit_without_unit.yaml similarity index 100% rename from toscaparser/tests/data/test_scalar_unit_without_unit.yaml rename to samples/tests/data/test_scalar_unit_without_unit.yaml diff --git a/toscaparser/tests/data/test_tosca_custom_rel.yaml b/samples/tests/data/test_tosca_custom_rel.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_custom_rel.yaml rename to samples/tests/data/test_tosca_custom_rel.yaml diff --git a/toscaparser/tests/data/test_tosca_custom_rel_with_script.yaml b/samples/tests/data/test_tosca_custom_rel_with_script.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_custom_rel_with_script.yaml rename to samples/tests/data/test_tosca_custom_rel_with_script.yaml diff --git a/toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml b/samples/tests/data/test_tosca_normative_type_by_shortname.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_normative_type_by_shortname.yaml rename to samples/tests/data/test_tosca_normative_type_by_shortname.yaml diff --git a/toscaparser/tests/data/test_tosca_top_level_error1.yaml b/samples/tests/data/test_tosca_top_level_error1.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_top_level_error1.yaml rename to samples/tests/data/test_tosca_top_level_error1.yaml diff --git a/toscaparser/tests/data/test_tosca_top_level_error2.yaml b/samples/tests/data/test_tosca_top_level_error2.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_top_level_error2.yaml rename to samples/tests/data/test_tosca_top_level_error2.yaml diff --git a/toscaparser/tests/data/test_tosca_version_1_3.yaml b/samples/tests/data/test_tosca_version_1_3.yaml similarity index 100% rename from toscaparser/tests/data/test_tosca_version_1_3.yaml rename to samples/tests/data/test_tosca_version_1_3.yaml diff --git a/toscaparser/tests/data/topology_template/databasesubsystem.yaml b/samples/tests/data/topology_template/databasesubsystem.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/databasesubsystem.yaml rename to samples/tests/data/topology_template/databasesubsystem.yaml diff --git a/toscaparser/tests/data/topology_template/definitions.yaml b/samples/tests/data/topology_template/definitions.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/definitions.yaml rename to samples/tests/data/topology_template/definitions.yaml diff --git a/toscaparser/tests/data/topology_template/definitions_1_2.yaml b/samples/tests/data/topology_template/definitions_1_2.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/definitions_1_2.yaml rename to samples/tests/data/topology_template/definitions_1_2.yaml diff --git a/toscaparser/tests/data/topology_template/queuingsubsystem.yaml b/samples/tests/data/topology_template/queuingsubsystem.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/queuingsubsystem.yaml rename to samples/tests/data/topology_template/queuingsubsystem.yaml diff --git a/toscaparser/tests/data/topology_template/system.yaml b/samples/tests/data/topology_template/system.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/system.yaml rename to samples/tests/data/topology_template/system.yaml diff --git a/toscaparser/tests/data/topology_template/transactionsubsystem.yaml b/samples/tests/data/topology_template/transactionsubsystem.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/transactionsubsystem.yaml rename to samples/tests/data/topology_template/transactionsubsystem.yaml diff --git a/toscaparser/tests/data/topology_template/validate/queuingsubsystem_invalid_input.yaml b/samples/tests/data/topology_template/validate/queuingsubsystem_invalid_input.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/validate/queuingsubsystem_invalid_input.yaml rename to samples/tests/data/topology_template/validate/queuingsubsystem_invalid_input.yaml diff --git a/toscaparser/tests/data/topology_template/validate/system_invalid_input.yaml b/samples/tests/data/topology_template/validate/system_invalid_input.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/validate/system_invalid_input.yaml rename to samples/tests/data/topology_template/validate/system_invalid_input.yaml diff --git a/toscaparser/tests/data/topology_template/validate/test_example_app_substitution_mappings.yaml b/samples/tests/data/topology_template/validate/test_example_app_substitution_mappings.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/validate/test_example_app_substitution_mappings.yaml rename to samples/tests/data/topology_template/validate/test_example_app_substitution_mappings.yaml diff --git a/toscaparser/tests/data/topology_template/validate/test_substitution_mappings_invalid_output.yaml b/samples/tests/data/topology_template/validate/test_substitution_mappings_invalid_output.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/validate/test_substitution_mappings_invalid_output.yaml rename to samples/tests/data/topology_template/validate/test_substitution_mappings_invalid_output.yaml diff --git a/toscaparser/tests/data/topology_template/validate/test_substitution_mappings_valid_output.yaml b/samples/tests/data/topology_template/validate/test_substitution_mappings_valid_output.yaml similarity index 100% rename from toscaparser/tests/data/topology_template/validate/test_substitution_mappings_valid_output.yaml rename to samples/tests/data/topology_template/validate/test_substitution_mappings_valid_output.yaml diff --git a/toscaparser/tests/data/tosca_elk.yaml b/samples/tests/data/tosca_elk.yaml similarity index 100% rename from toscaparser/tests/data/tosca_elk.yaml rename to samples/tests/data/tosca_elk.yaml diff --git a/toscaparser/tests/data/tosca_helloworld.yaml b/samples/tests/data/tosca_helloworld.yaml similarity index 100% rename from toscaparser/tests/data/tosca_helloworld.yaml rename to samples/tests/data/tosca_helloworld.yaml diff --git a/toscaparser/tests/data/tosca_imports_validation.yaml b/samples/tests/data/tosca_imports_validation.yaml similarity index 100% rename from toscaparser/tests/data/tosca_imports_validation.yaml rename to samples/tests/data/tosca_imports_validation.yaml diff --git a/toscaparser/tests/data/tosca_single_instance_wordpress.yaml b/samples/tests/data/tosca_single_instance_wordpress.yaml similarity index 100% rename from toscaparser/tests/data/tosca_single_instance_wordpress.yaml rename to samples/tests/data/tosca_single_instance_wordpress.yaml diff --git a/toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml b/samples/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml similarity index 100% rename from toscaparser/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml rename to samples/tests/data/tosca_single_instance_wordpress_with_local_abspath_import.yaml diff --git a/toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml b/samples/tests/data/tosca_single_instance_wordpress_with_url_import.yaml similarity index 100% rename from toscaparser/tests/data/tosca_single_instance_wordpress_with_url_import.yaml rename to samples/tests/data/tosca_single_instance_wordpress_with_url_import.yaml diff --git a/toscaparser/tests/data/tosca_test_get_operation_output.yaml b/samples/tests/data/tosca_test_get_operation_output.yaml similarity index 100% rename from toscaparser/tests/data/tosca_test_get_operation_output.yaml rename to samples/tests/data/tosca_test_get_operation_output.yaml diff --git a/toscaparser/tests/base.py b/toscaparser/tests/base.py index b7856250..7a2b2f8d 100644 --- a/toscaparser/tests/base.py +++ b/toscaparser/tests/base.py @@ -61,9 +61,21 @@ class TestCase(testscenarios.TestWithScenarios, testtools.TestCase): :return: ToscaTemplate """ return ToscaTemplate(os.path.join( - os.path.dirname(os.path.abspath(__file__)), - 'data', - filename)) + TestCase.test_sample('data'), filename)) + + @staticmethod + def sample_root(): + return os.path.abspath(os.path.join(os.path.dirname(__file__), + '../../samples')) + + @staticmethod + def test_sample_root(): + # {tosca-parser}/samples/tests + return os.path.join(TestCase.sample_root(), 'tests') + + @staticmethod + def test_sample(*p): + return os.path.join(TestCase.test_sample_root(), *p) class MockTestClass(): diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml b/toscaparser/tests/data/CSAR/tosca_elk/Definitions/elasticsearch.yaml deleted file mode 100644 index 4a1770f9..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml b/toscaparser/tests/data/CSAR/tosca_elk/Definitions/kibana.yaml deleted file mode 100644 index 3a4351c4..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml b/toscaparser/tests/data/CSAR/tosca_elk/Definitions/logstash.yaml deleted file mode 100644 index 84959549..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml b/toscaparser/tests/data/CSAR/tosca_elk/Definitions/tosca_elk.yaml deleted file mode 100644 index 932f1315..00000000 --- a/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://: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/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py b/toscaparser/tests/data/CSAR/tosca_elk/Python/collectd/config.py deleted file mode 100755 index 686bbd1a..00000000 --- a/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 - - Server "%s" "25826" - - """ % (os.environ['logstash_ip'])) diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py b/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_collectd.py deleted file mode 100755 index 18fdacff..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py b/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_elasticsearch.py deleted file mode 100755 index 2e5389cc..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py b/toscaparser/tests/data/CSAR/tosca_elk/Python/logstash/configure_rsyslog.py deleted file mode 100755 index fc610c2e..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/README.txt b/toscaparser/tests/data/CSAR/tosca_elk/README.txt deleted file mode 100644 index 382c9b06..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/create.sh deleted file mode 100755 index a483b88b..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/collectd/start.sh deleted file mode 100755 index 7e8e0331..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/create.sh deleted file mode 100755 index c34126c6..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/elasticsearch/start.sh deleted file mode 100755 index bbc0347d..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/config.sh deleted file mode 100755 index f28215a3..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/create.sh deleted file mode 100755 index 41914b14..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/kibana/start.sh deleted file mode 100755 index 5149bb30..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/create.sh deleted file mode 100755 index 77cc8fd8..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/logstash/start.sh deleted file mode 100755 index a73cf610..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/config.sh deleted file mode 100644 index 78f484e7..00000000 --- a/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 = -# 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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create.sh deleted file mode 100644 index d84c2750..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/create_database.sh deleted file mode 100644 index 16f1358d..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/mongodb/start.sh deleted file mode 100644 index ac200a50..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/config.sh deleted file mode 100644 index 1e149a22..00000000 --- a/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 <> /var/log/nodeapp.log 2>&1 & -end script -EOS diff --git a/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/create.sh deleted file mode 100644 index 04fd6c62..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/nodejs/start.sh deleted file mode 100644 index 6939cb75..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/config.sh deleted file mode 100644 index 630767d8..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/create.sh deleted file mode 100755 index affdd6e0..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh b/toscaparser/tests/data/CSAR/tosca_elk/Scripts/rsyslog/start.sh deleted file mode 100755 index 3de82d18..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta b/toscaparser/tests/data/CSAR/tosca_elk/TOSCA-Metadata/TOSCA.meta deleted file mode 100644 index feb3d4f5..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Definitions/tosca_single_instance_wordpress.yaml deleted file mode 100644 index 1dd195ad..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/README.txt deleted file mode 100644 index e882ff6e..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/configure.sh deleted file mode 100644 index d4ef6b4b..00000000 --- a/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" /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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/install.sh deleted file mode 100644 index 38628b98..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDBMS/start.sh deleted file mode 100644 index 33786701..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/MYSQLDatabase/configure.sh deleted file mode 100644 index 092136a1..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/install.sh deleted file mode 100644 index 4ca9b4ed..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WebServer/start.sh deleted file mode 100644 index e962ca59..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/configure.sh deleted file mode 100644 index 5598b4fa..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/Scripts/WordPress/install.sh deleted file mode 100644 index 13204432..00000000 --- a/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/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta b/toscaparser/tests/data/CSAR/tosca_single_instance_wordpress/TOSCA-Metadata/TOSCA.meta deleted file mode 100644 index 5208113e..00000000 --- a/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/toscaparser/tests/data/custom_types/collectd.yaml b/toscaparser/tests/data/custom_types/collectd.yaml deleted file mode 100644 index 1ac0935b..00000000 --- a/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/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml b/toscaparser/tests/data/custom_types/paypalpizzastore_nodejs_app.yaml deleted file mode 100644 index cdabeaed..00000000 --- a/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: false - 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/toscaparser/tests/data/custom_types/rsyslog.yaml b/toscaparser/tests/data/custom_types/rsyslog.yaml deleted file mode 100644 index 4614ee77..00000000 --- a/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/toscaparser/tests/data/custom_types/wordpress.yaml b/toscaparser/tests/data/custom_types/wordpress.yaml deleted file mode 100644 index 5899ed9a..00000000 --- a/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/toscaparser/tests/data/groups/definitions.yaml b/toscaparser/tests/data/groups/definitions.yaml deleted file mode 100644 index 40c1d8b7..00000000 --- a/toscaparser/tests/data/groups/definitions.yaml +++ /dev/null @@ -1,10 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0 - -group_types: - mycompany.mytypes.groups.placement: - description: My company's group type for placing nodes of type Compute - members: [ tosca.nodes.Compute ] - metadata: - type: map - entry_schema: - type: string diff --git a/toscaparser/tests/data/groups/tosca_group_template.yaml b/toscaparser/tests/data/groups/tosca_group_template.yaml deleted file mode 100644 index 0e94240e..00000000 --- a/toscaparser/tests/data/groups/tosca_group_template.yaml +++ /dev/null @@ -1,54 +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 ] - - node_templates: - 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 - - groups: - webserver_group: - type: mycompany.mytypes.groups.placement - members: [ websrv, server ] diff --git a/toscaparser/tests/data/load_balancer/tosca_load_balancer.yaml b/toscaparser/tests/data/load_balancer/tosca_load_balancer.yaml deleted file mode 100644 index 2fcdb486..00000000 --- a/toscaparser/tests/data/load_balancer/tosca_load_balancer.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Note: this could eventually be translated to a Neutron Load Balancer -# However, in Heat/HOT the preferred way of doing this is creating an Autoscale Group -# -#heat_template_version: 2015-04-30 ... -#resources: -#load_bal_resource: -# type: OS::Neutron::Pool -# properties: -# admin_state_up: Boolean -# description: String -# lb_method: String -# monitors: [Value, Value, ...] -# name: String -# protocol: String -# provider: String -# subnet: String -# vip: { -# "description": String, -# "name": String, -# "connection_limit": Integer, -# "protocol_port": Integer, -# "subnet": String, -# "address": String, -# "admin_state_up": Boolean, -# "session_persistence": -# { -# "cookie_name": String, -# "type": String} -# } -# -# example from: https://gist.github.com/therve/9231701 -# -#resources: -# web_server_group: -# type: AWS::AutoScaling::AutoScalingGroup -# properties: -# AvailabilityZones: [nova] -# LaunchConfigurationName: {get_resource: launch_config} -# MinSize: 1 -# MaxSize: 3 -# LoadBalancerNames: -# - {get_resource: mylb} -# mypool: -# type: OS::Neutron::Pool -# properties: -# protocol: HTTP -# monitors: [{get_resource: mymonitor}] -# subnet_id: {get_param: subnet_id} -# lb_method: ROUND_ROBIN -# vip: -# protocol_port: 80 -# mylb: -# type: OS::Neutron::LoadBalancer -# properties: -# protocol_port: 80 -# pool_id: {get_resource: mypool} - -tosca_definitions_version: tosca_simple_yaml_1_0 - -description: Template for deploying a load balancer with predefined endpoint properties. - -topology_template: - node_templates: - simple_load_balancer: - type: tosca.nodes.LoadBalancer - capabilities: - # properties: - # algorithm: DEFAULT (define new keyword, ROUND_ROBIN?) - # Client, public facing endpoint - client: - properties: - network_name: PUBLIC - floating: true - dns_name: http://mycompany.com/ - diff --git a/toscaparser/tests/extensions/nfv/__init__.py b/toscaparser/tests/extensions/nfv/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml b/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_one_network.yaml deleted file mode 100644 index 8e58fa94..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml b/toscaparser/tests/spec_samples/v1.0/network/tosca_one_server_three_networks.yaml deleted file mode 100644 index d791b170..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml b/toscaparser/tests/spec_samples/v1.0/network/tosca_server_on_existing_network.yaml deleted file mode 100644 index 7fedc130..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml b/toscaparser/tests/spec_samples/v1.0/network/tosca_two_servers_one_network.yaml deleted file mode 100644 index 1473a8da..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment.yaml deleted file mode 100644 index 460fa4ca..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation1.yaml deleted file mode 100644 index df22d725..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_attachment_notation2.yaml deleted file mode 100644 index cb1c17aa..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_custom_relationship_type.yaml deleted file mode 100644 index 932f89e2..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_blockstorage_with_relationship_template.yaml deleted file mode 100644 index c31a4da5..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_multiple_blockstorage_with_attachment.yaml deleted file mode 100644 index aa4647e7..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml b/toscaparser/tests/spec_samples/v1.0/storage/tosca_single_object_store.yaml deleted file mode 100644 index 869af488..00000000 --- a/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/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml b/toscaparser/tests/spec_samples/v1.0/tosca_nodejs_mongodb_two_instances.yaml deleted file mode 100644 index f6110716..00000000 --- a/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://: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/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml b/toscaparser/tests/spec_samples/v1.0/tosca_single_server.yaml deleted file mode 100644 index c4cce9d7..00000000 --- a/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/toscaparser/tests/test_custom_relationships.py b/toscaparser/tests/test_custom_relationships.py index 5fc58d83..2317e390 100644 --- a/toscaparser/tests/test_custom_relationships.py +++ b/toscaparser/tests/test_custom_relationships.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import os - from toscaparser.tests.base import TestCase from toscaparser.tosca_template import ToscaTemplate @@ -19,8 +17,7 @@ from toscaparser.tosca_template import ToscaTemplate class CustomRelationshipTypesTest(TestCase): '''TOSCA template.''' - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/relationship/test_custom_relationship.yaml") tosca = ToscaTemplate(tosca_tpl) diff --git a/toscaparser/tests/test_datatypes.py b/toscaparser/tests/test_datatypes.py index 0a6cfe0b..d6fa07d7 100644 --- a/toscaparser/tests/test_datatypes.py +++ b/toscaparser/tests/test_datatypes.py @@ -10,8 +10,6 @@ # 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 @@ -343,20 +341,17 @@ class DataTypeTest(TestCase): error.__str__()) def test_datatype_in_current_template(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "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__)), + tpl_path = TestCase.test_sample( "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__)), + tpl_path = TestCase.test_sample( "data/datatypes/test_custom_datatypes_value_error.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( @@ -364,8 +359,7 @@ class DataTypeTest(TestCase): _('"[\'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__)), + tpl_path = TestCase.test_sample( "data/datatypes/test_custom_datatypes_nested_datatype_error.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( diff --git a/toscaparser/tests/test_functions.py b/toscaparser/tests/test_functions.py index 2a382705..bb86db9c 100644 --- a/toscaparser/tests/test_functions.py +++ b/toscaparser/tests/test_functions.py @@ -21,8 +21,7 @@ from toscaparser.utils.gettextutils import _ class IntrinsicFunctionsTest(TestCase): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': '12345678'} @@ -120,8 +119,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual(dbms_root_password.result(), '12345678') def test_get_property_with_host(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_get_property_with_host.yaml") mysql_database = self._get_node('mysql_database', ToscaTemplate(tosca_tpl, @@ -139,8 +137,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual(1, result) def test_get_property_with_nested_params(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/tosca_nested_property_names_indexes.yaml") webserver = self._get_node('wordpress', ToscaTemplate(tosca_tpl, @@ -155,8 +152,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual(3, wp_list_prop.result()) def test_get_property_with_capabilties_inheritance(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_capabilties_inheritance.yaml") some_node = self._get_node('some_node', ToscaTemplate(tosca_tpl, @@ -168,8 +164,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual('someval', some_input.result()) def test_get_property_source_target_keywords(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_get_property_source_target_keywords.yaml") tosca = ToscaTemplate(tosca_tpl, parsed_params={'db_root_pwd': '1234'}) @@ -189,8 +184,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual(3306, source_port.result()) def test_get_prop_cap_host(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_get_prop_cap_host.yaml") some_node = self._get_node('some_node', ToscaTemplate(tosca_tpl)) @@ -199,8 +193,7 @@ class IntrinsicFunctionsTest(TestCase): self.assertEqual('someval', some_prop.value.result()) def test_get_prop_cap_bool(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_get_prop_cap_bool.yaml") some_node = self._get_node('software', ToscaTemplate(tosca_tpl)) @@ -213,9 +206,7 @@ class GetAttributeTest(TestCase): def _load_template(self, filename): return ToscaTemplate(os.path.join( - os.path.dirname(os.path.abspath(__file__)), - 'data', - filename), + TestCase.test_sample('data'), filename), parsed_params={'db_root_pwd': '1234'}) def _get_operation(self, interfaces, operation): @@ -312,8 +303,7 @@ class GetAttributeTest(TestCase): 'Unexpected attribute/index value "0"')) def test_get_attribute_source_target_keywords(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/functions/test_get_attribute_source_target_keywords.yaml") tosca = ToscaTemplate(tosca_tpl, parsed_params={'db_root_pwd': '12345678'}) @@ -354,9 +344,7 @@ class GetAttributeTest(TestCase): class ConcatTest(TestCase): def _load_template(self, filename): - return ToscaTemplate(os.path.join( - os.path.dirname(os.path.abspath(__file__)), - filename)) + return ToscaTemplate(TestCase.test_sample(filename)) def test_validate_concat(self): tosca = self._load_template("data/functions/test_concat.yaml") @@ -377,9 +365,7 @@ class ConcatTest(TestCase): class TokenTest(TestCase): def _load_template(self, filename): - return ToscaTemplate(os.path.join( - os.path.dirname(os.path.abspath(__file__)), - filename)) + return ToscaTemplate(TestCase.test_sample(filename)) def test_validate_token(self): tosca = self._load_template("data/functions/test_token.yaml") diff --git a/toscaparser/tests/test_prereq.py b/toscaparser/tests/test_prereq.py index cefcdb45..24585775 100644 --- a/toscaparser/tests/test_prereq.py +++ b/toscaparser/tests/test_prereq.py @@ -30,7 +30,7 @@ from toscaparser.utils.urlutils import UrlUtils class CSARPrereqTest(TestCase): - base_path = os.path.dirname(os.path.abspath(__file__)) + base_path = TestCase.test_sample_root() def setUp(self): super(CSARPrereqTest, self).setUp() @@ -59,7 +59,7 @@ class CSARPrereqTest(TestCase): content: bytes response = TestResponse() - file_path = os.path.join(self.base_path, "data/CSAR/csar_not_zip.zip") + file_path = TestCase.test_sample("data/CSAR/csar_not_zip.zip") with open(file_path, 'br') as f: response.content = f.read() @@ -192,9 +192,8 @@ class CSARPrereqTest(TestCase): mock_path = "https://example.com/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(self.base_path, - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method mock_url_accessible.return_value = True csar = CSAR(path) @@ -235,8 +234,7 @@ class CSARPrereqTest(TestCase): 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") + yaml_file = TestCase.test_sample("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 @@ -266,8 +264,7 @@ class CSARPrereqTest(TestCase): path = os.path.join(self.base_path, "data/CSAR/csar_root_level_yaml.zip") csar = CSAR(path) - yaml_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/CSAR/root_level_file.yaml") + yaml_file = TestCase.test_sample("data/CSAR/root_level_file.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 @@ -288,8 +285,7 @@ class CSARPrereqTest(TestCase): "data/CSAR/csar_root_level_" "yaml_and_tosca_metadata.zip") csar = CSAR(path) - yaml_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/CSAR/tosca_meta_file.yaml") + yaml_file = TestCase.test_sample("data/CSAR/tosca_meta_file.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 @@ -311,8 +307,8 @@ class CSARPrereqTest(TestCase): self.base_path, "data/CSAR/csar_valid_multilevel_imports_validation.zip") csar = CSAR(path) - yaml_file = os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/CSAR/multi_level_imports_response.yaml") + yaml_file = TestCase.test_sample( + "data/CSAR/multi_level_imports_response.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 diff --git a/toscaparser/tests/test_shell.py b/toscaparser/tests/test_shell.py index bb163ff9..9f3a8dcf 100644 --- a/toscaparser/tests/test_shell.py +++ b/toscaparser/tests/test_shell.py @@ -10,8 +10,6 @@ # 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 @@ -20,12 +18,9 @@ from toscaparser.utils.gettextutils import _ class ShellTest(TestCase): - tosca_helloworld = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_helloworld.yaml") + tosca_helloworld = TestCase.test_sample("data/tosca_helloworld.yaml") - errornous_template = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + errornous_template = TestCase.test_sample( "data/test_multiple_validation_errors.yaml") def test_missing_arg(self): diff --git a/toscaparser/tests/test_topology_template.py b/toscaparser/tests/test_topology_template.py index 695aa93e..0117fd18 100644 --- a/toscaparser/tests/test_topology_template.py +++ b/toscaparser/tests/test_topology_template.py @@ -28,8 +28,7 @@ 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__)), + self.tosca_tpl_path = TestCase.test_sample( "data/topology_template/transactionsubsystem.yaml") self.tpl = YAML_LOADER(self.tosca_tpl_path) self.topo_tpl = self.tpl.get('topology_template') @@ -57,8 +56,7 @@ class TopologyTemplateTest(TestCase): def _get_custom_types(self): custom_types = {} - def_file = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + def_file = TestCase.test_sample( "data/topology_template/definitions.yaml") custom_type = YAML_LOADER(def_file) node_types = custom_type['node_types'] @@ -169,8 +167,7 @@ class TopologyTemplateTest(TestCase): 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__)), + tpl_path = TestCase.test_sample( "data/topology_template/system.yaml") system_tosca_template = ToscaTemplate(tpl_path) self.assertIsNotNone(system_tosca_template) @@ -240,11 +237,9 @@ class TopologyTemplateTest(TestCase): self.assertEqual(expected_message, err.__str__()) def test_system_with_input_validation(self): - tpl_path0 = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path0 = TestCase.test_sample( "data/topology_template/validate/system_invalid_input.yaml") - tpl_path1 = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path1 = TestCase.test_sample( "data/topology_template/validate/" "queuingsubsystem_invalid_input.yaml") errormsg = _('SubstitutionMappings with node_type ' @@ -264,15 +259,13 @@ class TopologyTemplateTest(TestCase): exception.MissingRequiredInputError, errormsg) def test_substitution_mappings_valid_output(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/topology_template/validate/" "test_substitution_mappings_valid_output.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_system_with_unknown_output_validation(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/topology_template/validate/" "test_substitution_mappings_invalid_output.yaml") errormsg = _('\'Attribute "my_cpu_output" was not found in node ' diff --git a/toscaparser/tests/extensions/nfv/test_tosca_nfv_tpl.py b/toscaparser/tests/test_tosca_nfv_tpl.py similarity index 87% rename from toscaparser/tests/extensions/nfv/test_tosca_nfv_tpl.py rename to toscaparser/tests/test_tosca_nfv_tpl.py index b166d835..5d00d664 100644 --- a/toscaparser/tests/extensions/nfv/test_tosca_nfv_tpl.py +++ b/toscaparser/tests/test_tosca_nfv_tpl.py @@ -10,8 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import os - from toscaparser.tests.base import TestCase from toscaparser.tosca_template import ToscaTemplate @@ -19,9 +17,8 @@ from toscaparser.tosca_template import ToscaTemplate class ToscaNFVTemplateTest(TestCase): '''TOSCA NFV template.''' - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_helloworld_nfv.yaml") + tosca_tpl = TestCase.test_sample( + "data/extensions/tosca_helloworld_nfv.yaml") tosca = ToscaTemplate(tosca_tpl) def test_version(self): diff --git a/toscaparser/tests/test_toscatpl.py b/toscaparser/tests/test_toscatpl.py index 02b5b7db..89245bcc 100644 --- a/toscaparser/tests/test_toscatpl.py +++ b/toscaparser/tests/test_toscatpl.py @@ -32,17 +32,13 @@ import toscaparser.utils.yamlparser class ToscaTemplateTest(TestCase): '''TOSCA template.''' - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': '12345678'} tosca = ToscaTemplate(tosca_tpl, parsed_params=params) - tosca_elk_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") - tosca_repo_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_elk_tpl = TestCase.test_sample("data/tosca_elk.yaml") + tosca_repo_tpl = TestCase.test_sample( "data/repositories/tosca_repositories_test_definition.yaml") def test_version(self): @@ -165,8 +161,7 @@ class ToscaTemplateTest(TestCase): "sample.SC", ) - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_nodetype_without_relationship.yaml") tosca = ToscaTemplate(tosca_tpl) @@ -224,8 +219,7 @@ class ToscaTemplateTest(TestCase): 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__)), + template = TestCase.test_sample( "data/test_tosca_normative_type_by_shortname.yaml") tosca_tpl = ToscaTemplate(template) @@ -325,8 +319,7 @@ class ToscaTemplateTest(TestCase): with explicit relationship. 5. Requirement expressed via TOSCA types with a filter. """ - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/requirements/test_requirements.yaml") tosca = ToscaTemplate(tosca_tpl) for node_tpl in tosca.nodetemplates: @@ -497,8 +490,7 @@ class ToscaTemplateTest(TestCase): } } - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_capability_without_properties.yaml") tosca = ToscaTemplate(tosca_tpl) @@ -510,8 +502,7 @@ class ToscaTemplateTest(TestCase): ) def test_local_template_with_local_relpath_import(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': '12345678'} @@ -520,11 +511,9 @@ class ToscaTemplateTest(TestCase): @mock.patch.object(ToscaTemplate, '_tpl_imports') def test_local_template_with_url_import(self, mock_tpl_imports): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress_with_url_import.yaml") - import_file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + import_file_path = TestCase.test_sample( "data/custom_types/wordpress.yaml") mock_tpl_imports.return_value = [import_file_path] tosca = ToscaTemplate(tosca_tpl, @@ -533,19 +522,16 @@ class ToscaTemplateTest(TestCase): @mock.patch.object(urllib.request, 'urlopen') def test_url_template_with_local_relpath_import(self, mock_urlopen): - filenames = ['tosca_single_instance_wordpress.yaml', - 'wordpress.yaml'] - tosca_tpl = f'https://example.com/{filenames[0]}' - mock_path = f'https://example.com/custom_types/{filenames[1]}' + tosca_tpl = ('https://example.com/tosca_single_instance_' + 'wordpress.yaml') + mock_path = 'https://example.com/custom_types/wordpress.yaml' mockclass = MockTestClass() - mockclass.comp_urldict = { - tosca_tpl: os.path.join(os.path.dirname(os.path.abspath(__file__)), - f'data/{filenames[0]}'), - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - f'data/custom_types/{filenames[1]}')} + mockclass.comp_urldict = {tosca_tpl: TestCase.test_sample( + "data/tosca_single_instance_wordpress.yaml"), + mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method - tosca = ToscaTemplate(tosca_tpl, a_file=False, parsed_params={"db_name": "mysql", "db_user": "mysql", @@ -557,15 +543,13 @@ class ToscaTemplateTest(TestCase): @mock.patch.object(urllib.request, 'urlopen') def test_url_template_with_local_abspath_import(self, mock_urlopen): - filename = ('tosca_single_instance_wordpress_with_local_abspath_' - 'import.yaml') - tosca_tpl = f'https://example.com/{filename}' + tosca_tpl = ('https://example.com/tosca_single_instance_wordpress_' + 'with_local_abspath_import.yaml') mockclass = MockTestClass() - mockclass.comp_urldict = { - tosca_tpl: os.path.join(os.path.dirname(os.path.abspath(__file__)), - f'data/{filename}')} - + mockclass.comp_urldict = {tosca_tpl: TestCase.test_sample( + "data/tosca_single_instance_wordpress_with_local_abspath_" + "import.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl, None, False) @@ -582,20 +566,16 @@ class ToscaTemplateTest(TestCase): @mock.patch.object(urllib.request, 'urlopen') def test_url_template_with_url_import( self, mock_urlopen, mock_tpl_imports, mock_isabs, mock_join_url): - filename = 'tosca_single_instance_wordpress_with_url_import.yaml' - tosca_tpl = f'https://example.com/{filename}' - - import_file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml") + tosca_tpl = ('https://example.com/tosca_single_instance_wordpress_' + 'with_url_import.yaml') mockclass = MockTestClass() - mockclass.comp_urldict = { - tosca_tpl: os.path.join(os.path.dirname(os.path.abspath(__file__)), - f'data/{filename}') - } - + mockclass.comp_urldict = {tosca_tpl: TestCase.test_sample( + "data/tosca_single_instance_wordpress_with_url_import.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method + + import_file_path = TestCase.test_sample( + "data/custom_types/wordpress.yaml") mock_tpl_imports.return_value = [import_file_path] mock_isabs.return_value = False mock_join_url.return_value = import_file_path @@ -605,9 +585,7 @@ class ToscaTemplateTest(TestCase): 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') + csar_archive = TestCase.test_sample("data/CSAR/csar_wordpress.zip") self.assertTrue(ToscaTemplate(csar_archive, parsed_params={"db_name": "mysql", "db_user": "mysql", @@ -624,9 +602,7 @@ class ToscaTemplateTest(TestCase): content: bytes response = TestResponse() - file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/CSAR/csar_elk.zip") + file_path = TestCase.test_sample("data/CSAR/csar_elk.zip") with open(file_path, 'br') as f: response.content = f.read() @@ -637,8 +613,7 @@ class ToscaTemplateTest(TestCase): parsed_params={"my_cpus": 4})) def test_nested_imports_in_templates(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_instance_nested_imports.yaml") tosca = ToscaTemplate(tosca_tpl) expected_custom_types = ['tosca.nodes.SoftwareComponent.Kibana', @@ -662,8 +637,7 @@ class ToscaTemplateTest(TestCase): expected_msg) def test_multiple_validation_errors(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_multiple_validation_errors.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl, None) @@ -718,8 +692,7 @@ class ToscaTemplateTest(TestCase): exception.InvalidTypeError, err10_msg) def test_invalid_section_names(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_invalid_section_names.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl, None) @@ -745,16 +718,12 @@ class ToscaTemplateTest(TestCase): 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_tpl = TestCase.test_sample("data/CSAR/csar_elk.csar") tosca = ToscaTemplate(tosca_tpl, parsed_params={"my_cpus": 2}) self.assertTrue(tosca.topology_template.custom_defs) def test_available_rel_tpls(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_available_rel_tpls.yaml") + tosca_tpl = TestCase.test_sample("data/test_available_rel_tpls.yaml") tosca = ToscaTemplate(tosca_tpl) for node in tosca.nodetemplates: for relationship, target in node.relationships.items(): @@ -772,9 +741,7 @@ class ToscaTemplateTest(TestCase): err_msg) def test_path_and_yaml_dict_tpl_input(self): - test_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_helloworld.yaml") + test_tpl = TestCase.test_sample("data/tosca_helloworld.yaml") yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl) @@ -783,9 +750,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(tosca.version, "tosca_simple_yaml_1_0") def test_yaml_dict_tpl_input(self): - test_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_helloworld.yaml") + test_tpl = TestCase.test_sample("data/tosca_helloworld.yaml") yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl) @@ -795,16 +760,14 @@ class ToscaTemplateTest(TestCase): @mock.patch.object(ToscaTemplate, '_tpl_imports') def test_yaml_dict_tpl_with_params_and_url_import(self, mock_tpl_imports): - test_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + test_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress_with_url_import.yaml") yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl) params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': 'mypasswd'} - import_file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + import_file_path = TestCase.test_sample( "data/custom_types/wordpress.yaml") mock_tpl_imports.return_value = [import_file_path] @@ -814,8 +777,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(tosca.version, "tosca_simple_yaml_1_0") def test_yaml_dict_tpl_with_rel_import(self): - test_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + test_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl) @@ -829,14 +791,13 @@ class ToscaTemplateTest(TestCase): err_msg) def test_yaml_dict_tpl_with_fullpath_import(self): - test_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + test_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") yaml_dict_tpl = toscaparser.utils.yamlparser.load_yaml(test_tpl) - yaml_dict_tpl['imports'] = [os.path.join(os.path.dirname( - os.path.abspath(__file__)), "data/custom_types/wordpress.yaml")] + yaml_dict_tpl['imports'] = [TestCase.test_sample( + "data/custom_types/wordpress.yaml")] params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': 'mypasswd'} @@ -847,8 +808,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(tosca.version, "tosca_simple_yaml_1_0") def test_policies_for_node_templates(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/policies/tosca_policy_template.yaml") tosca = ToscaTemplate(tosca_tpl) @@ -869,8 +829,7 @@ class ToscaTemplateTest(TestCase): '4096 MB') def test_policies_for_groups(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/policies/tosca_policy_template.yaml") tosca = ToscaTemplate(tosca_tpl) @@ -902,8 +861,7 @@ class ToscaTemplateTest(TestCase): def test_policies_for_custom(self): host_prop = {} - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/policies/tosca_custom_policy_template.yaml") tosca = ToscaTemplate(tosca_tpl) @@ -934,47 +892,38 @@ class ToscaTemplateTest(TestCase): '512 MB') def test_node_filter(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/node_filter/test_node_filter.yaml") ToscaTemplate(tosca_tpl) def test_attributes_inheritance(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_attributes_inheritance.yaml") ToscaTemplate(tosca_tpl) @mock.patch.object(urllib.request, 'urlopen') def test_repositories_definition(self, mock_urlopen): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/repositories/test_repositories_definition.yaml") - filename = 'compute_with_prop.yaml' - mock_path = f'https://example.com/custom_types/{filename}' + mock_path = "https://example.com/custom_types/compute_with_prop.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - f'data/custom_types/{filename}')} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/compute_with_prop.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method ToscaTemplate(tosca_tpl) def test_custom_caps_def(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_custom_caps_def.yaml") + tosca_tpl = TestCase.test_sample("data/test_custom_caps_def.yaml") ToscaTemplate(tosca_tpl) def test_custom_caps_with_custom_datatype(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_custom_caps_with_datatype.yaml") ToscaTemplate(tosca_tpl) def test_custom_rel_with_script(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_tosca_custom_rel_with_script.yaml") tosca = ToscaTemplate(tosca_tpl) rel = tosca.relationship_templates[0] @@ -984,8 +933,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(rel.interfaces[0].type, "Configure") def test_various_portspec_errors(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/datatypes/test_datatype_portspec_add_req.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl, None) @@ -1021,26 +969,21 @@ class ToscaTemplateTest(TestCase): exception.RangeValueError, msg) def test_containers(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/containers/test_container_docker_mysql.yaml") ToscaTemplate(tosca_tpl, parsed_params={"mysql_root_pwd": "12345678"}) def test_endpoint_on_compute(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_endpoint_on_compute.yaml") + tosca_tpl = TestCase.test_sample("data/test_endpoint_on_compute.yaml") ToscaTemplate(tosca_tpl) def test_nested_dsl_def(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/dsl_definitions/test_nested_dsl_def.yaml") self.assertIsNotNone(ToscaTemplate(tosca_tpl)) def test_multiple_policies(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/policies/test_tosca_nfv_multiple_policies.yaml") tosca = ToscaTemplate(tosca_tpl) self.assertEqual( @@ -1048,21 +991,17 @@ class ToscaTemplateTest(TestCase): sorted([policy.name for policy in tosca.policies])) def test_custom_capability(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_custom_capabilty.yaml") + tosca_tpl = TestCase.test_sample("data/test_custom_capabilty.yaml") ToscaTemplate(tosca_tpl) def test_csar_multilevel_imports_relative_path(self): - csar_archive = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - 'data/CSAR/csar_relative_path_import_check.zip') + csar_archive = TestCase.test_sample( + "data/CSAR/csar_relative_path_import_check.zip") self.assertTrue(ToscaTemplate(csar_archive)) def test_csar_multiple_deployment_flavours(self): - csar_archive = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - 'data/CSAR/csar_multiple_deployment_flavour.zip') + csar_archive = TestCase.test_sample( + "data/CSAR/csar_multiple_deployment_flavour.zip") tosca = ToscaTemplate(csar_archive) flavours = list() for tp in tosca.nested_tosca_templates_with_topology: @@ -1073,9 +1012,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(flavours[1]['flavour_id'], 'complex') def test_custom_rel_get_type(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_tosca_custom_rel.yaml") + tosca_tpl = TestCase.test_sample("data/test_tosca_custom_rel.yaml") tosca = ToscaTemplate(tosca_tpl) for src in tosca.nodetemplates: for rel, trgt in src.relationships.items(): @@ -1084,8 +1021,7 @@ class ToscaTemplateTest(TestCase): self.assertEqual(rel_tpls[0].type, "MyAttachesTo") def test_policies_without_required_property(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/policies/test_policies_without_required_property.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl, None) @@ -1094,21 +1030,17 @@ class ToscaTemplateTest(TestCase): def test_local_custom_defs(self, mock_tpl_imports): """Compare if custom defs on local and remote the same.""" - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/tosca_single_instance_wordpress_with_url_import.yaml") - local_def = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml") + local_def = TestCase.test_sample("data/custom_types/wordpress.yaml") remote_def = ( "https://example.com/custom_types/wordpress.yaml") local_defs = {remote_def: local_def} params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': '12345678'} - import_file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + import_file_path = TestCase.test_sample( "data/custom_types/wordpress.yaml") mock_tpl_imports.return_value = [import_file_path] tosca = ToscaTemplate(tosca_tpl, parsed_params=params) diff --git a/toscaparser/tests/test_toscatplvalidation.py b/toscaparser/tests/test_toscatplvalidation.py index 7c5bfef8..30b74bd9 100644 --- a/toscaparser/tests/test_toscatplvalidation.py +++ b/toscaparser/tests/test_toscatplvalidation.py @@ -10,7 +10,6 @@ # License for the specific language governing permissions and limitations # under the License. -import os from unittest import mock import urllib @@ -35,22 +34,19 @@ 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__)), + tpl_path = TestCase.test_sample( "data/tosca_single_instance_wordpress.yaml") params = {'db_name': 'my_wordpress', 'db_user': 'my_db_user', 'db_root_pwd': '12345678'} self.assertIsNotNone(ToscaTemplate(tpl_path, params)) def test_custom_interface_allowed(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/interfaces/test_custom_interface_in_template.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_custom_interface_invalid_operation(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/interfaces/test_custom_interface_invalid_operation.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) @@ -61,8 +57,7 @@ class ToscaTemplateValidationTest(TestCase): 'Refer to the definition to verify valid values.')) def test_first_level_sections(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_tosca_top_level_error1.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( @@ -70,8 +65,7 @@ class ToscaTemplateValidationTest(TestCase): _('Template is missing required field ' '"tosca_definitions_version".')) - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_tosca_top_level_error2.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( @@ -80,9 +74,7 @@ class ToscaTemplateValidationTest(TestCase): 'definition to verify valid values.')) def test_template_with_imports_validation(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_imports_validation.yaml") + tpl_path = TestCase.test_sample("data/tosca_imports_validation.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( exception.UnknownFieldError, @@ -309,7 +301,7 @@ class ToscaTemplateValidationTest(TestCase): imports: # omitted here for brevity ''' - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") errormsg = _('"imports" keyname is defined without including ' 'templates.') err = self.assertRaises(exception.ValidationError, @@ -324,7 +316,7 @@ class ToscaTemplateValidationTest(TestCase): imports: - some_definitions: ''' - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") errormsg = _('A template file name is not provided with import ' 'definition "some_definitions".') err = self.assertRaises(exception.ValidationError, @@ -342,13 +334,10 @@ class ToscaTemplateValidationTest(TestCase): mock_path = "https://example.com/custom_types/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method - path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + path = TestCase.test_sample("data/tosca_elk.yaml") custom_defs = self._imports_content_test(tpl_snippet, path, "node_types") @@ -366,13 +355,10 @@ class ToscaTemplateValidationTest(TestCase): mock_path = "https://example.com/custom_types/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method - path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + path = TestCase.test_sample("data/tosca_elk.yaml") custom_defs = self._imports_content_test(tpl_snippet, path, "node_types") @@ -386,7 +372,7 @@ class ToscaTemplateValidationTest(TestCase): file: custom_types/nested_rsyslog.yaml namespace_prefix: testprefix ''' - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") custom_defs = self._imports_content_test(tpl_snippet, path, "node_types") @@ -417,14 +403,11 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml mock_path = "https://example.com/custom_types/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method errormsg = _('Duplicate import name "some_definitions" was found.') - path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + path = TestCase.test_sample("data/tosca_elk.yaml") err = self.assertRaises(exception.ValidationError, self._imports_content_test, tpl_snippet, path, None) @@ -441,7 +424,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml ''' errormsg = _('Import of template "more_definitions" is missing ' 'required field "file".') - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") err = self.assertRaises(exception.MissingRequiredFieldError, self._imports_content_test, tpl_snippet, path, None) @@ -459,14 +442,11 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml 'with_url_import.yaml') mock_path = "https://example.com/custom_types/wordpress.yaml" - mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} - mock_urlopen.side_effect = mockclass.mock_urlopen_method - import_file_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + import_file_path = TestCase.test_sample( "data/custom_types/wordpress.yaml") + mockclass = MockTestClass() + mockclass.comp_urldict = {mock_path: import_file_path} + mock_urlopen.side_effect = mockclass.mock_urlopen_method mock_tpl_imports.return_value = [import_file_path] custom_defs = self._imports_content_test(tpl_snippet, path, @@ -486,13 +466,10 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml mock_path = "https://example.com/custom_types/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method - path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + path = TestCase.test_sample("data/tosca_elk.yaml") custom_defs = self._imports_content_test(tpl_snippet, path, "node_types") @@ -509,9 +486,8 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml mock_path = "https://example.com/custom_types/wordpress.yaml" mockclass = MockTestClass() - mockclass.comp_urldict = { - mock_path: os.path.join(os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml")} + mockclass.comp_urldict = {mock_path: TestCase.test_sample( + "data/custom_types/wordpress.yaml")} mock_urlopen.side_effect = mockclass.mock_urlopen_method tpl_snippet = ''' @@ -520,9 +496,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml '''.format(ctypes["remote"]) local_defs = {ctypes["remote"]: ctypes["local"]} - path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + path = TestCase.test_sample("data/tosca_elk.yaml") imports = (toscaparser.utils.yamlparser. simple_parse(tpl_snippet)['imports']) ld1 = ImportsLoader(imports, path, "node_types") @@ -534,7 +508,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml imports: - custom_types/wordpress.yml ''' - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") custom_defs = self._imports_content_test(tpl_snippet, path, "node_types") @@ -550,7 +524,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml namespace_prefix: mycompany namespace_uri: http://docs.oasis-open.org/tosca/ns/simple/yaml/1.0 ''' - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") self.assertRaises(ImportError, self._imports_content_test, tpl_snippet, path, None) @@ -562,7 +536,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml ''' errormsg = _('Import "abc.com/tests/data/tosca_elk.yaml" is not ' 'valid.') - path = 'toscaparser/tests/data/tosca_elk.yaml' + path = TestCase.test_sample("data/tosca_elk.yaml") err = self.assertRaises(ImportError, self._imports_content_test, tpl_snippet, path, None) @@ -845,9 +819,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml def _custom_types(self): custom_types = {} - def_file = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/wordpress.yaml") + def_file = TestCase.test_sample("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: @@ -857,9 +829,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml def _custom_types_policy(self): custom_types = {} - def_file = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/custom_types/custom_policy.yaml") + def_file = TestCase.test_sample("data/custom_types/custom_policy.yaml") custom_type = toscaparser.utils.yamlparser.load_yaml(def_file) policy_types = custom_type['policy_types'] for name in policy_types: @@ -1525,20 +1495,17 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml self.assertEqual(expectedmessage, str(err)) def test_tosca_version_1_3(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_tosca_version_1_3.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_import_tosca_version_1_3(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_import_tosca_version_1_3.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_invalid_template_version(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_invalid_template_version.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl) valid_versions = '", "'.join(ToscaTemplate.VALID_TEMPLATE_VERSIONS) @@ -1548,8 +1515,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml 'are "%s".') % valid_versions)) def test_import_invalid_template_version(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tosca_tpl = TestCase.test_sample( "data/test_import_invalid_template_version.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tosca_tpl) valid_versions = '", "'.join(ToscaTemplate.VALID_TEMPLATE_VERSIONS) @@ -1560,9 +1526,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml ' is invalid. Valid versions are "%s".') % valid_versions)) def test_import_template_metadata(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_import_metadata.yml") + tosca_tpl = TestCase.test_sample("data/test_import_metadata.yml") ToscaTemplate(tosca_tpl) def test_node_template_capabilities_properties(self): @@ -1872,14 +1836,11 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml self.assertEqual(expectedmessage, err.__str__()) def test_credential_datatype(self): - tosca_tpl = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_credential_datatype.yaml") + tosca_tpl = TestCase.test_sample("data/test_credential_datatype.yaml") self.assertIsNotNone(ToscaTemplate(tosca_tpl)) def test_invalid_default_value(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_invalid_input_defaults.yaml") self.assertRaises(exception.ValidationError, ToscaTemplate, tpl_path) exception.ExceptionCollector.assertExceptionMessage( @@ -1986,15 +1947,12 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml self._single_node_template_content_test(tpl_snippet3)) def test_properties_override_with_flavor_and_image(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_normative_type_properties_override.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_long_rel(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), - "data/test_long_rel.yaml") + tpl_path = TestCase.test_sample("data/test_long_rel.yaml") self.assertIsNotNone(ToscaTemplate(tpl_path)) def test_policy_reservation_valid_keyname_heat_resources(self): @@ -2048,8 +2006,7 @@ tosca-parser/master/toscaparser/tests/data/custom_types/wordpress.yaml self.assertEqual(expectedmessage, err.__str__()) def test_scalar_unit_without_unit(self): - tpl_path = os.path.join( - os.path.dirname(os.path.abspath(__file__)), + tpl_path = TestCase.test_sample( "data/test_scalar_unit_without_unit.yaml") self.assertRaises(exception.ValidationError, lambda: ToscaTemplate(tpl_path))