mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
[rackspace] Fixes nesting of tests
Fog::Compute connection was called outside of the Shindo blocks and failing if rackspace credentials were not present.
This commit is contained in:
parent
281c33e214
commit
b7b7f51b0b
10 changed files with 31 additions and 37 deletions
|
@ -1,6 +1,5 @@
|
||||||
service = Fog::Rackspace::BlockStorage.new
|
|
||||||
|
|
||||||
Shindo.tests('Fog::Rackspace::BlockStorage | snapshot', ['rackspace']) do
|
Shindo.tests('Fog::Rackspace::BlockStorage | snapshot', ['rackspace']) do
|
||||||
|
service = Fog::Rackspace::BlockStorage.new
|
||||||
|
|
||||||
begin
|
begin
|
||||||
volume = service.volumes.create({
|
volume = service.volumes.create({
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | flavors', ['rackspace']) do
|
||||||
service = Fog::Compute::RackspaceV2.new
|
service = Fog::Compute::RackspaceV2.new
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | flavors', ['rackspace']) do
|
|
||||||
tests("success") do
|
tests("success") do
|
||||||
tests("#all").succeeds do
|
tests("#all").succeeds do
|
||||||
service.flavors.all
|
service.flavors.all
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | image', ['rackspace']) do
|
||||||
service = Fog::Compute::RackspaceV2.new
|
service = Fog::Compute::RackspaceV2.new
|
||||||
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
||||||
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | image', ['rackspace']) do
|
|
||||||
|
|
||||||
test_time = Time.now.to_i.to_s
|
test_time = Time.now.to_i.to_s
|
||||||
options = {
|
options = {
|
||||||
:name => "fog_server_#{test_time}",
|
:name => "fog_server_#{test_time}",
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
service = Fog::Compute::RackspaceV2.new
|
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | images', ['rackspace']) do
|
Shindo.tests('Fog::Compute::RackspaceV2 | images', ['rackspace']) do
|
||||||
|
service = Fog::Compute::RackspaceV2.new
|
||||||
|
|
||||||
image_id = nil
|
image_id = nil
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
||||||
service = Fog::Compute::RackspaceV2.new
|
service = Fog::Compute::RackspaceV2.new
|
||||||
cbs_service = Fog::Rackspace::BlockStorage.new
|
cbs_service = Fog::Rackspace::BlockStorage.new
|
||||||
|
|
||||||
|
@ -5,8 +6,6 @@ flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
||||||
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
||||||
image_id ||= Fog.mocking? ? service.images.first.id : service.images.find {|image| image.name =~ /Ubuntu/}.id # use the first Ubuntu image
|
image_id ||= Fog.mocking? ? service.images.first.id : service.images.find {|image| image.name =~ /Ubuntu/}.id # use the first Ubuntu image
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
||||||
|
|
||||||
options = {
|
options = {
|
||||||
:name => "fog_server_#{Time.now.to_i.to_s}",
|
:name => "fog_server_#{Time.now.to_i.to_s}",
|
||||||
:flavor_id => flavor_id,
|
:flavor_id => flavor_id,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | servers', ['rackspace']) do
|
||||||
connection = Fog::Compute::RackspaceV2.new
|
connection = Fog::Compute::RackspaceV2.new
|
||||||
flavor_id = Fog.credentials[:rackspace_flavor_id] || connection.flavors.first.id
|
flavor_id = Fog.credentials[:rackspace_flavor_id] || connection.flavors.first.id
|
||||||
image_id = Fog.credentials[:rackspace_image_id] || connection.images.first.id
|
image_id = Fog.credentials[:rackspace_image_id] || connection.images.first.id
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | servers', ['rackspace']) do
|
|
||||||
options = {
|
options = {
|
||||||
:name => "fog_server_#{Time.now.to_i.to_s}",
|
:name => "fog_server_#{Time.now.to_i.to_s}",
|
||||||
:flavor_id => flavor_id,
|
:flavor_id => flavor_id,
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
timeout = Fog.mocking? ? 1 : 10
|
|
||||||
Shindo.tests('Fog::Rackspace::BlockStorage | snapshot_tests', ['rackspace']) do
|
Shindo.tests('Fog::Rackspace::BlockStorage | snapshot_tests', ['rackspace']) do
|
||||||
|
timeout = Fog.mocking? ? 1 : 10
|
||||||
|
|
||||||
snapshot_format = {
|
snapshot_format = {
|
||||||
'id' => String,
|
'id' => String,
|
||||||
'status' => String,
|
'status' => String,
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | attachment_tests', ['rackspace']) do
|
||||||
compute_service = Fog::Compute::RackspaceV2.new
|
compute_service = Fog::Compute::RackspaceV2.new
|
||||||
block_storage_service = Fog::Rackspace::BlockStorage.new
|
block_storage_service = Fog::Rackspace::BlockStorage.new
|
||||||
image_id = Fog.credentials[:rackspace_image_id] || compute_service.images.first.id
|
image_id = Fog.credentials[:rackspace_image_id] || compute_service.images.first.id
|
||||||
flavor_id = Fog.credentials[:rackspace_flavor_id] || compute_service.flavors.first.id
|
flavor_id = Fog.credentials[:rackspace_flavor_id] || compute_service.flavors.first.id
|
||||||
timeout = Fog.mocking? ? 1 : 10
|
timeout = Fog.mocking? ? 1 : 10
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | attachment_tests', ['rackspace']) do
|
|
||||||
|
|
||||||
attachment_format = {
|
attachment_format = {
|
||||||
'volumeAttachment' => {
|
'volumeAttachment' => {
|
||||||
'id' => String,
|
'id' => String,
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | image_tests', ['rackspace']) do
|
||||||
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
|
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
|
||||||
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
||||||
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
image_id = Fog.credentials[:rackspace_image_id] || service.images.first.id
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | image_tests', ['rackspace']) do
|
|
||||||
|
|
||||||
image_format = {
|
image_format = {
|
||||||
'id' => String,
|
'id' => String,
|
||||||
'name' => String,
|
'name' => String,
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
|
Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
|
||||||
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
|
service = Fog::Compute.new(:provider => 'Rackspace', :version => 'V2')
|
||||||
image_id = Fog.credentials[:rackspace_image_id]
|
image_id = Fog.credentials[:rackspace_image_id]
|
||||||
image_id ||= Fog.mocking? ? service.images.first.id : service.images.find {|image| image.name =~ /Ubuntu/}.id # use the first Ubuntu image
|
image_id ||= Fog.mocking? ? service.images.first.id : service.images.find {|image| image.name =~ /Ubuntu/}.id # use the first Ubuntu image
|
||||||
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
flavor_id = Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
|
||||||
|
|
||||||
Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
|
|
||||||
|
|
||||||
link_format = {
|
link_format = {
|
||||||
'href' => String,
|
'href' => String,
|
||||||
'rel' => String
|
'rel' => String
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue