1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00
fog--fog/tests/serverlove/requests/compute/image_tests.rb
Sean Handley aaabc1d6a9 Shindo tests pass.
Turns out our UUIDs for pre-built drives are way out of date.
2012-06-22 16:26:11 +01:00

48 lines
1.5 KiB
Ruby

Shindo.tests('Fog::Compute[:serverlove] | drive requests', ['serverlove']) do
@image_format = {
'drive' => String,
'name' => String,
'user' => String,
'size' => Integer,
'claimed' => Fog::Nullable::String,
'status' => String,
'encryption:cipher' => String,
'read:bytes' => String,
'write:bytes' => String,
'read:requests' => String,
'write:requests' => String
}
tests('success') do
attributes = { 'name' => 'Test', 'size' => '4234567890' }
tests("#create_image").formats(@image_format) do
@image = Fog::Compute[:serverlove].create_image(attributes).body
end
tests("#list_images").succeeds do
Fog::Compute[:serverlove].images
end
tests("#update_image").returns(true) do
@image['name'] = "Diff"
Fog::Compute[:serverlove].update_image(@image['drive'], { name: @image['name'], size: @image['size']})
Fog::Compute[:serverlove].images.get(@image['drive']).name == "Diff"
end
tests("#load_standard_image").returns(true) do
# Load centos
Fog::Compute[:serverlove].load_standard_image(@image['drive'], '88ed067f-d2b8-42ce-a25f-5297818a3b6f')
Fog::Compute[:serverlove].images.get(@image['drive']).imaging != "" # This will be "x%" when imaging
end
tests("#destroy_image").succeeds do
Fog::Compute[:serverlove].destroy_image(@image['drive'])
end
end
end