2011-09-07 16:22:31 -04:00
|
|
|
Shindo.tests('AWS::Elasticache | cache clusters', ['aws', 'elasticache']) do
|
|
|
|
cluster_params = {
|
2011-09-08 12:04:46 -04:00
|
|
|
:id => "fog-test-cluster-#{rand(999).to_s}",
|
2011-09-07 16:22:31 -04:00
|
|
|
:node_type => 'cache.m1.large',
|
|
|
|
:security_groups => ['default'],
|
|
|
|
:engine => 'memcached',
|
|
|
|
:num_nodes => 1
|
|
|
|
}
|
|
|
|
|
|
|
|
pending if Fog.mocking?
|
|
|
|
|
2011-09-08 13:04:46 -04:00
|
|
|
Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
|
2011-09-07 16:22:31 -04:00
|
|
|
model_tests(AWS[:elasticache].clusters, cluster_params, false) do
|
2011-09-08 12:04:07 -04:00
|
|
|
@instance.reload # Reload to get the cluster info from AWS
|
2011-09-08 13:04:46 -04:00
|
|
|
Formatador.display_line "Waiting for #{@instance.id} "+
|
|
|
|
"to become available (#{@instance.status})..."
|
2011-09-08 12:04:07 -04:00
|
|
|
@instance.wait_for {ready?}
|
2011-09-07 16:22:31 -04:00
|
|
|
end
|
|
|
|
|
2011-09-08 12:04:07 -04:00
|
|
|
# Single model is still deleting, so re-randomize the cluster ID
|
|
|
|
cluster_params[:id] = "fog-test-cluster-#{rand(999).to_s}"
|
2011-09-08 13:04:46 -04:00
|
|
|
Formatador.display_line "Creating cluster #{cluster_params[:id]}..."
|
2011-09-07 16:22:31 -04:00
|
|
|
collection_tests(AWS[:elasticache].clusters, cluster_params, false) do
|
2011-09-08 12:04:07 -04:00
|
|
|
@instance.reload # Reload to get the cluster info from AWS
|
2011-09-08 13:04:46 -04:00
|
|
|
Formatador.display_line "Waiting for #{@instance.id} "+
|
|
|
|
"to become available (#{@instance.status})..."
|
2011-09-08 12:04:07 -04:00
|
|
|
@instance.wait_for {ready?}
|
2011-09-07 16:22:31 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|