2012-12-26 19:54:42 -05:00
|
|
|
Shindo.tests('Fog::Compute[:google] | image requests', ['google']) do
|
2012-10-22 20:15:33 -04:00
|
|
|
|
2012-12-26 19:54:42 -05:00
|
|
|
@google = Fog::Compute[:google]
|
2012-10-22 20:15:33 -04:00
|
|
|
|
|
|
|
@insert_image_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'status' => String,
|
|
|
|
'user' => String,
|
|
|
|
'progress' => Integer,
|
|
|
|
'insertTime' => String,
|
|
|
|
'startTime' => String,
|
|
|
|
'operationType' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@get_image_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'creationTimestamp' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'description' => String,
|
|
|
|
'sourceType' => String,
|
|
|
|
'preferredKernel' => String,
|
|
|
|
'rawDisk' => {
|
|
|
|
'containerType' => String,
|
|
|
|
'source' => String
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@delete_image_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'status' => String,
|
|
|
|
'user' => String,
|
|
|
|
'progress' => Integer,
|
|
|
|
'insertTime' => String,
|
|
|
|
'startTime' => String,
|
|
|
|
'operationType' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@list_images_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'items' => []
|
|
|
|
}
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
image_name = 'ubuntu-12-04-v20120912'
|
|
|
|
source_type = 'RAW'
|
|
|
|
|
|
|
|
tests("#insert_image").formats(@insert_image_format) do
|
2012-12-04 15:02:51 -05:00
|
|
|
@google.insert_image(image_name, source_type).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#get_image").formats(@get_image_format) do
|
2012-12-04 15:02:51 -05:00
|
|
|
@google.get_image(image_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_images").formats(@list_images_format) do
|
2012-12-04 15:02:51 -05:00
|
|
|
@google.list_images.body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#delete_image").formats(@delete_image_format) do
|
2012-12-04 15:02:51 -05:00
|
|
|
@google.delete_image(image_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|