Skip to content

Commit

Permalink
cleaning up/repairing errant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
geemus committed Oct 12, 2010
1 parent 56b114d commit 856334f
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 23 deletions.
11 changes: 6 additions & 5 deletions lib/fog/bluebox/models/compute/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ class Server < Fog::Model

identity :id

attribute :memory
attribute :storage
attribute :hostname
attribute :cpu
attribute :ips
attribute :status
attribute :description
attribute :flavor_id
attribute :hostname
attribute :image_id
attribute :ips
attribute :memory
attribute :status
attribute :storage
attribute :template

attr_accessor :password
Expand Down
2 changes: 1 addition & 1 deletion lib/fog/bluebox/requests/compute/get_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def get_blocks

class Mock

def get_slices
def get_blocks
Fog::Mock.not_implemented
end

Expand Down
5 changes: 3 additions & 2 deletions tests/aws/requests/compute/image_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
'kernelId' => String,
'productCodes' => [],
'ramdiskId' => String,
'rootDeviceType' => String
'rootDeviceType' => String,
'tagSet' => {}
}],
'requestId' => String,
}

tests('success') do

# the result for this is HUGE an relatively uninteresting...de
# the result for this is HUGE and relatively uninteresting...
# tests("#describe_images").formats(@images_format) do
# AWS[:compute].describe_images.body
# end
Expand Down
3 changes: 2 additions & 1 deletion tests/aws/requests/compute/instance_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
'ipAddress' => String,
'privateDnsName' => String,
'privateIpAddress' => String,
'stateReason' => {}
'stateReason' => {},
'tagSet' => {}
)],
'ownerId' => String,
'reservationId' => String
Expand Down
2 changes: 1 addition & 1 deletion tests/aws/requests/compute/snapshot_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@snapshots_format = {
'requestId' => String,
'snapshotSet' => [@snapshot_format]
'snapshotSet' => [@snapshot_format.merge('tagSet' => {})]
}

@volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
Expand Down
19 changes: 10 additions & 9 deletions tests/bluebox/requests/compute/block_tests.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do

@block_format = {
'cpu' => Float,
'hostname' => String,
'id' => String,
'ips' => [{'address' => String}],
'memory' => Integer,
'product' => Bluebox::Compute::Formats::PRODUCT,
'status' => String,
'storage' => Integer,
'template' => String
'cpu' => Float,
'description' => String,
'hostname' => String,
'id' => String,
'ips' => [{'address' => String}],
'memory' => Integer,
'product' => Bluebox::Compute::Formats::PRODUCT,
'status' => String,
'storage' => Integer,
'template' => String
}

tests('success') do
Expand Down
8 changes: 4 additions & 4 deletions tests/rackspace/requests/compute/image_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
'id' => Integer,
'name' => String,
'status' => String,
'updated' => String
'updated' => String,
'serverId' => Integer,
}

@image_format = @images_format.merge({
'created' => String,
'progress' => Integer,
'serverId' => Integer,
})

tests('success') do
Expand All @@ -19,15 +19,15 @@
@server.wait_for { ready? }
@image_id = nil

tests("#create_image(#{@server.id})").formats(@images_format) do
tests("#create_image(#{@server.id})").formats(@images_format.merge('serverId' => Integer)) do
data = Rackspace[:compute].create_image(@server.id).body['image']
@image_id = data['id']
data
end

Rackspace[:compute].images.get(@image_id).wait_for { ready? }

tests("#get_image_details(#{@image_id})").formats(@image_format) do
tests("#get_image_details(#{@image_id})").formats(@images_format) do
Rackspace[:compute].get_image_details(@image_id).body['image']
end

Expand Down
6 changes: 6 additions & 0 deletions tests/rackspace/requests/compute/server_tests.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@
Rackspace[:compute].list_servers_detail.body
end

Rackspace[:compute].servers.get(@server_id).wait_for { ready? }

tests("#update_server(#{@server_id}, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')").succeeds do
Rackspace[:compute].update_server(@server_id, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')
end

Rackspace[:compute].servers.get(@server_id).wait_for { ready? }

tests("#reboot_server(#{@server_id}, 'HARD')").succeeds do
Rackspace[:compute].reboot_server(@server_id, 'HARD')
end

Rackspace[:compute].servers.get(@server_id).wait_for { ready? }

tests("#reboot_server(#{@server_id}, 'SOFT')").succeeds do
Rackspace[:compute].reboot_server(@server_id, 'SOFT')
end
Expand Down

0 comments on commit 856334f

Please sign in to comment.