1
0
Fork 0
mirror of https://github.com/fog/fog-aws.git synced 2022-11-09 13:50:52 -05:00

Use Fog::Formatador

This commit is contained in:
starbelly 2015-01-16 18:37:35 -06:00
parent da2a4adc30
commit 4a08fc1910
5 changed files with 15 additions and 15 deletions

View file

@ -9,20 +9,20 @@ Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do
pending if Fog.mocking?
Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
Fog::Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
model_tests(Fog::AWS[:elasticache].clusters, cluster_params, false) do
@instance.reload # Reload to get the cluster info from AWS
Formatador.display_line "Waiting for #{@instance.id} "+
Fog::Formatador.display_line "Waiting for #{@instance.id} "+
"to become available (#{@instance.status})..."
@instance.wait_for {ready?}
end
# Single model is still deleting, so re-randomize the cluster ID
cluster_params[:id] = "fog-test-cluster-#{rand(999).to_s}"
Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
Fog::Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
collection_tests(Fog::AWS[:elasticache].clusters, cluster_params, false) do
@instance.reload # Reload to get the cluster info from AWS
Formatador.display_line "Waiting for #{@instance.id} "+
Fog::Formatador.display_line "Waiting for #{@instance.id} "+
"to become available (#{@instance.status})..."
@instance.wait_for {ready?}
end

View file

@ -69,7 +69,7 @@ Shindo.tests('AWS::ELB | models', ['aws', 'elb']) do
Fog::Compute[:aws].disable_ec2_classic if Fog.mocking?
if Fog::Compute[:aws].supported_platforms.include?("EC2")
Formatador.display_line("[yellow]Skipping test [bold]with default vpc[/][yellow] due to AWS account having EC2 available[/]")
Fog::Formatador.display_line("[yellow]Skipping test [bold]with default vpc[/][yellow] due to AWS account having EC2 available[/]")
else
elb2 = Fog::AWS[:elb].load_balancers.create(:id => "#{elb_id}-2", :availability_zones => @availability_zones[0])
tests("elb source group should start with default_elb_").returns(true) { !!(elb2.source_group["GroupName"] =~ /default_elb_/) }

View file

@ -1,8 +1,8 @@
Shindo.tests("AWS::RDS | tagging", ['aws', 'rds']) do
@server = Fog::AWS[:rds].servers.create(rds_default_server_params)
Formatador.display_line "Creating RDS instance #{@server.id}"
Formatador.display_line "Waiting for instance #{@server.id} to be ready"
Fog::Formatador.display_line "Creating RDS instance #{@server.id}"
Fog::Formatador.display_line "Waiting for instance #{@server.id} to be ready"
@server.wait_for { ready? }
tags1 = {'key1' => 'val1'}

View file

@ -46,7 +46,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
body
end
Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
tests(
@ -77,7 +77,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
c = Fog::AWS[:elasticache].clusters.get(CLUSTER_ID)
node_id = c.nodes.last['CacheNodeId']
Formatador.display_line "Rebooting node #{node_id}..."
Fog::Formatador.display_line "Rebooting node #{node_id}..."
body = Fog::AWS[:elasticache].reboot_cache_cluster(c.id, [ node_id ]).body
returns('rebooting cache cluster nodes') do
body['CacheCluster']['CacheClusterStatus']
@ -85,7 +85,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
body['CacheCluster']
end
Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
tests(
@ -93,7 +93,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
).formats(AWS::Elasticache::Formats::CACHE_CLUSTER_RUNNING) do
c = Fog::AWS[:elasticache].clusters.get(CLUSTER_ID)
node_id = c.nodes.last['CacheNodeId']
Formatador.display_line "Removing node #{node_id}..."
Fog::Formatador.display_line "Removing node #{node_id}..."
body = Fog::AWS[:elasticache].modify_cache_cluster(c.id,
{
:num_nodes => NUM_NODES - 1,
@ -106,7 +106,7 @@ Shindo.tests('AWS::Elasticache | cache cluster requests', ['aws', 'elasticache']
body['CacheCluster']
end
Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::Formatador.display_line "Waiting for cluster #{CLUSTER_ID}..."
Fog::AWS[:elasticache].clusters.get(CLUSTER_ID).wait_for {ready?}
tests(

View file

@ -1,11 +1,11 @@
Shindo.tests('AWS::RDS | tagging requests', ['aws', 'rds']) do
@rds = Fog::AWS[:rds]
@db_instance_id = "fog-test-#{rand(65536).to_s(16)}"
Formatador.display_line "Creating RDS instance #{@db_instance_id}"
Fog::Formatador.display_line "Creating RDS instance #{@db_instance_id}"
@rds.create_db_instance(@db_instance_id, 'AllocatedStorage' => 5,
'DBInstanceClass' => 'db.t1.micro', 'Engine' => 'mysql',
'MasterUsername' => 'foguser', 'MasterUserPassword' => 'fogpassword')
Formatador.display_line "Waiting for instance #{@db_instance_id} to be ready"
Fog::Formatador.display_line "Waiting for instance #{@db_instance_id} to be ready"
@db = @rds.servers.get(@db_instance_id)
@db.wait_for { ready? }
@ -73,6 +73,6 @@ Shindo.tests('AWS::RDS | tagging requests', ['aws', 'rds']) do
end
end
Formatador.display_line "Destroying DB instance #{@db_instance_id}"
Fog::Formatador.display_line "Destroying DB instance #{@db_instance_id}"
@db.destroy
end