Browse files

[ecloud|compute] Fixes tagging of some tests

Internet Service and Server tests were not tagged "ecloud" so were being
ran along live tests and failing if credentials were not in place.

Adding the tags skips the tests if credentials are missing.
  • Loading branch information...
1 parent 44e84f5 commit 716f3f13be5fbfb710b8476e9cf91c5ff0376173 @tokengeek tokengeek committed Jan 8, 2013
View
12 tests/ecloud/compute/models/internet_service_tests.rb
@@ -1,11 +1,11 @@
provider, config = :ecloud, compute_providers[:ecloud]
-connection = Fog::Compute[provider]
-organization = connection.organizations.first
-environment = organization.environments.detect { |e| e.name == config[:ecloud_environment_name] } || organization.environments.first
-public_ips = environment.public_ips
-public_ip = public_ips.detect { |i| i.name == config[:ecloud_public_ip_name] } || public_ips.first
-Shindo.tests("Fog::Compute[:#{provider}] | internet_services", "queries") do
+Shindo.tests("Fog::Compute[:#{provider}] | internet_services", [provider.to_s, "queries"]) do
+ connection = Fog::Compute[provider]
+ organization = connection.organizations.first
+ environment = organization.environments.detect { |e| e.name == config[:ecloud_environment_name] } || organization.environments.first
+ public_ips = environment.public_ips
+ public_ip = public_ips.detect { |i| i.name == config[:ecloud_public_ip_name] } || public_ips.first
@internet_services = public_ip.internet_services
tests('#all').succeeds do
View
18 tests/ecloud/compute/models/server_tests.rb
@@ -1,14 +1,14 @@
provider, config = :ecloud, compute_providers[:ecloud]
-connection = Fog::Compute[provider]
-organization = connection.organizations.first
-environment = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
-public_ip = environment.public_ips.first
-compute_pool = environment.compute_pools.first
-image_href = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
-ssh_key = organization.admin.ssh_keys.detect { |key| key.name == "root" }
-
-Shindo.tests("Fog::Compute[:#{provider}] | servers", "operations") do
+Shindo.tests("Fog::Compute[:#{provider}] | servers", [provider.to_s, "operations"]) do
+ connection = Fog::Compute[provider]
+ organization = connection.organizations.first
+ environment = organization.environments.find{|e| e.name == config[:server_attributes][:environment_name]} || organization.environments.first
+ public_ip = environment.public_ips.first
+ compute_pool = environment.compute_pools.first
+ image_href = Fog.credentials[:ecloud_image_href] || compute_pool.templates.first.href
+ ssh_key = organization.admin.ssh_keys.detect { |key| key.name == "root" }
+
@network = environment.networks.first
options = config[:server_attributes].merge(:network_uri => @network.href, :ssh_key_uri => ssh_key.href)
#if Fog.credentials[:ecloud_ssh_key_id]

0 comments on commit 716f3f1

Please sign in to comment.