From 2d1db56c43b0024f14e05bfe4006e62b47290b6b Mon Sep 17 00:00:00 2001 From: spzala Date: Tue, 21 Apr 2015 00:15:39 -0700 Subject: [PATCH] TOSCA: organize test templates The test templates has two different locations, there is no overlapping but it makes sense to have them all to a common place for easy reference. Change-Id: I37badc8fb2fa6ae8286d0007a229ee76e8fb1986 --- translator/hot/tests/test_translate_outputs.py | 3 ++- translator/tests/test_blockstorage.py | 13 ++++++++----- translator/tests/test_elk.py | 2 +- translator/tests/test_network.py | 12 ++++++++---- .../hot_output}/tosca_one_server_one_network.yaml | 0 .../tosca_one_server_three_networks.yaml | 0 .../tosca_server_on_existing_network.yaml | 0 .../hot_output}/tosca_two_servers_one_network.yaml | 0 .../data/network}/tosca_one_server_one_network.yaml | 0 .../network}/tosca_one_server_three_networks.yaml | 0 .../network}/tosca_server_on_existing_network.yaml | 0 .../network}/tosca_two_servers_one_network.yaml | 0 .../tosca_blockstorage_with_attachment.yaml | 0 ...osca_blockstorage_with_attachment_notation1.yaml | 0 ...osca_blockstorage_with_attachment_notation2.yaml | 0 ...tosca_multiple_blockstorage_with_attachment.yaml | 0 .../data/tosca_nodejs_mongodb_two_instances.yaml} | 2 +- 17 files changed, 20 insertions(+), 12 deletions(-) rename translator/{tests/data/hot_ouput => toscalib/tests/data/hot_output}/tosca_one_server_one_network.yaml (100%) rename translator/{tests/data/hot_ouput => toscalib/tests/data/hot_output}/tosca_one_server_three_networks.yaml (100%) rename translator/{tests/data/hot_ouput => toscalib/tests/data/hot_output}/tosca_server_on_existing_network.yaml (100%) rename translator/{tests/data/hot_ouput => toscalib/tests/data/hot_output}/tosca_two_servers_one_network.yaml (100%) rename translator/{tests/data => toscalib/tests/data/network}/tosca_one_server_one_network.yaml (100%) rename translator/{tests/data => toscalib/tests/data/network}/tosca_one_server_three_networks.yaml (100%) rename translator/{tests/data => toscalib/tests/data/network}/tosca_server_on_existing_network.yaml (100%) rename translator/{tests/data => toscalib/tests/data/network}/tosca_two_servers_one_network.yaml (100%) rename translator/{tests/data => toscalib/tests/data/storage}/tosca_blockstorage_with_attachment.yaml (100%) rename translator/{tests/data => toscalib/tests/data/storage}/tosca_blockstorage_with_attachment_notation1.yaml (100%) rename translator/{tests/data => toscalib/tests/data/storage}/tosca_blockstorage_with_attachment_notation2.yaml (100%) rename translator/{tests/data => toscalib/tests/data/storage}/tosca_multiple_blockstorage_with_attachment.yaml (100%) rename translator/{tests/data/tosca_elk.yaml => toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml} (97%) diff --git a/translator/hot/tests/test_translate_outputs.py b/translator/hot/tests/test_translate_outputs.py index 6fb2d54c..dea02459 100644 --- a/translator/hot/tests/test_translate_outputs.py +++ b/translator/hot/tests/test_translate_outputs.py @@ -22,7 +22,8 @@ class ToscaTemplateOutputTest(TestCase): def test_translate_output(self): tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "../../tests/data/tosca_elk.yaml") + "../../toscalib/tests/data/" + "tosca_nodejs_mongodb_two_instances.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, []) hot_translation = translate.translate() diff --git a/translator/tests/test_blockstorage.py b/translator/tests/test_blockstorage.py index 9fd07ab0..4fea41b5 100644 --- a/translator/tests/test_blockstorage.py +++ b/translator/tests/test_blockstorage.py @@ -26,8 +26,8 @@ class ToscaBlockStorageTest(TestCase): '''TOSCA template with single BlockStorage and Attachment.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_blockstorage_with_attachment.yaml") - + "../toscalib/tests/data/storage/" + "tosca_blockstorage_with_attachment.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) output = translate.translate() @@ -63,7 +63,8 @@ class ToscaBlockStorageTest(TestCase): '''TOSCA template with single BlockStorage and Attachment.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_blockstorage_with_attachment_notation1.yaml") + "../toscalib/tests/data/storage/" + "tosca_blockstorage_with_attachment_notation1.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) @@ -92,7 +93,8 @@ class ToscaBlockStorageTest(TestCase): '''TOSCA template with single BlockStorage and Attachment.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_blockstorage_with_attachment_notation2.yaml") + "../toscalib/tests/data/storage/" + "tosca_blockstorage_with_attachment_notation2.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) @@ -128,7 +130,8 @@ class ToscaBlockStorageTest(TestCase): '''TOSCA template with multiple BlockStorage and Attachment.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_multiple_blockstorage_with_attachment.yaml") + "../toscalib/tests/data/storage/" + "tosca_multiple_blockstorage_with_attachment.yaml") tosca = ToscaTemplate(tosca_tpl) translated_volume_attachment = [] translate = TOSCATranslator(tosca, self.parsed_params) diff --git a/translator/tests/test_elk.py b/translator/tests/test_elk.py index d6463f80..84f43873 100755 --- a/translator/tests/test_elk.py +++ b/translator/tests/test_elk.py @@ -25,7 +25,7 @@ class ToscaMongoNodejsTest(TestCase): '''TOSCA template with nodejs, app and mongodb on 2 servers.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - "data/tosca_elk.yaml") + "../toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml") tosca = ToscaTemplate(tosca_tpl) def test_relationship_def(self): diff --git a/translator/tests/test_network.py b/translator/tests/test_network.py index e5c4f810..7ea12366 100644 --- a/translator/tests/test_network.py +++ b/translator/tests/test_network.py @@ -25,7 +25,8 @@ class ToscaNetworkTest(TestCase): '''TOSCA template with single Network and single Compute.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - 'data/tosca_one_server_one_network.yaml') + "../toscalib/tests/data/network/" + "tosca_one_server_one_network.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) @@ -78,7 +79,8 @@ class ToscaNetworkTest(TestCase): '''TOSCA template with single Network and two Computes.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - 'data/tosca_two_servers_one_network.yaml') + "../toscalib/tests/data/network/" + "tosca_two_servers_one_network.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) @@ -145,7 +147,8 @@ class ToscaNetworkTest(TestCase): '''TOSCA template with 1 server attached to existing network.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - 'data/tosca_server_on_existing_network.yaml') + "../toscalib/tests/data/network/" + "tosca_server_on_existing_network.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) @@ -176,7 +179,8 @@ class ToscaNetworkTest(TestCase): '''TOSCA template with three Networks and single Compute.''' tosca_tpl = os.path.join( os.path.dirname(os.path.abspath(__file__)), - 'data/tosca_one_server_three_networks.yaml') + "../toscalib/tests/data/network/" + "tosca_one_server_three_networks.yaml") tosca = ToscaTemplate(tosca_tpl) translate = TOSCATranslator(tosca, self.parsed_params) diff --git a/translator/tests/data/hot_ouput/tosca_one_server_one_network.yaml b/translator/toscalib/tests/data/hot_output/tosca_one_server_one_network.yaml similarity index 100% rename from translator/tests/data/hot_ouput/tosca_one_server_one_network.yaml rename to translator/toscalib/tests/data/hot_output/tosca_one_server_one_network.yaml diff --git a/translator/tests/data/hot_ouput/tosca_one_server_three_networks.yaml b/translator/toscalib/tests/data/hot_output/tosca_one_server_three_networks.yaml similarity index 100% rename from translator/tests/data/hot_ouput/tosca_one_server_three_networks.yaml rename to translator/toscalib/tests/data/hot_output/tosca_one_server_three_networks.yaml diff --git a/translator/tests/data/hot_ouput/tosca_server_on_existing_network.yaml b/translator/toscalib/tests/data/hot_output/tosca_server_on_existing_network.yaml similarity index 100% rename from translator/tests/data/hot_ouput/tosca_server_on_existing_network.yaml rename to translator/toscalib/tests/data/hot_output/tosca_server_on_existing_network.yaml diff --git a/translator/tests/data/hot_ouput/tosca_two_servers_one_network.yaml b/translator/toscalib/tests/data/hot_output/tosca_two_servers_one_network.yaml similarity index 100% rename from translator/tests/data/hot_ouput/tosca_two_servers_one_network.yaml rename to translator/toscalib/tests/data/hot_output/tosca_two_servers_one_network.yaml diff --git a/translator/tests/data/tosca_one_server_one_network.yaml b/translator/toscalib/tests/data/network/tosca_one_server_one_network.yaml similarity index 100% rename from translator/tests/data/tosca_one_server_one_network.yaml rename to translator/toscalib/tests/data/network/tosca_one_server_one_network.yaml diff --git a/translator/tests/data/tosca_one_server_three_networks.yaml b/translator/toscalib/tests/data/network/tosca_one_server_three_networks.yaml similarity index 100% rename from translator/tests/data/tosca_one_server_three_networks.yaml rename to translator/toscalib/tests/data/network/tosca_one_server_three_networks.yaml diff --git a/translator/tests/data/tosca_server_on_existing_network.yaml b/translator/toscalib/tests/data/network/tosca_server_on_existing_network.yaml similarity index 100% rename from translator/tests/data/tosca_server_on_existing_network.yaml rename to translator/toscalib/tests/data/network/tosca_server_on_existing_network.yaml diff --git a/translator/tests/data/tosca_two_servers_one_network.yaml b/translator/toscalib/tests/data/network/tosca_two_servers_one_network.yaml similarity index 100% rename from translator/tests/data/tosca_two_servers_one_network.yaml rename to translator/toscalib/tests/data/network/tosca_two_servers_one_network.yaml diff --git a/translator/tests/data/tosca_blockstorage_with_attachment.yaml b/translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment.yaml similarity index 100% rename from translator/tests/data/tosca_blockstorage_with_attachment.yaml rename to translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment.yaml diff --git a/translator/tests/data/tosca_blockstorage_with_attachment_notation1.yaml b/translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment_notation1.yaml similarity index 100% rename from translator/tests/data/tosca_blockstorage_with_attachment_notation1.yaml rename to translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment_notation1.yaml diff --git a/translator/tests/data/tosca_blockstorage_with_attachment_notation2.yaml b/translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment_notation2.yaml similarity index 100% rename from translator/tests/data/tosca_blockstorage_with_attachment_notation2.yaml rename to translator/toscalib/tests/data/storage/tosca_blockstorage_with_attachment_notation2.yaml diff --git a/translator/tests/data/tosca_multiple_blockstorage_with_attachment.yaml b/translator/toscalib/tests/data/storage/tosca_multiple_blockstorage_with_attachment.yaml similarity index 100% rename from translator/tests/data/tosca_multiple_blockstorage_with_attachment.yaml rename to translator/toscalib/tests/data/storage/tosca_multiple_blockstorage_with_attachment.yaml diff --git a/translator/tests/data/tosca_elk.yaml b/translator/toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml similarity index 97% rename from translator/tests/data/tosca_elk.yaml rename to translator/toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml index 596658f2..c2e32f2b 100644 --- a/translator/tests/data/tosca_elk.yaml +++ b/translator/toscalib/tests/data/tosca_nodejs_mongodb_two_instances.yaml @@ -4,7 +4,7 @@ description: > TOSCA simple profile with nodejs and mongodb. imports: - - ../../toscalib/tests/data/custom_types/nodejs.yaml + - custom_types/nodejs.yaml dsl_definitions: ubuntu_node: &ubuntu_node