2012-12-26 19:54:42 -05:00
|
|
|
Shindo.tests('Fog::Compute[:google] | disk 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_disk_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'status' => String,
|
|
|
|
'user' => String,
|
|
|
|
'progress' => Integer,
|
2013-04-16 23:42:54 -04:00
|
|
|
'zone' => String,
|
2012-10-22 20:15:33 -04:00
|
|
|
'insertTime' => String,
|
|
|
|
'startTime' => String,
|
|
|
|
'operationType' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@get_disk_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'creationTimestamp' => String,
|
|
|
|
'name' => String,
|
|
|
|
'zone' => String,
|
|
|
|
'status' => String,
|
|
|
|
'sizeGb' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@delete_disk_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'targetId' => String,
|
|
|
|
'status' => String,
|
|
|
|
'user' => String,
|
|
|
|
'progress' => Integer,
|
|
|
|
'insertTime' => String,
|
2013-04-16 23:42:54 -04:00
|
|
|
'zone' => String,
|
2012-10-22 20:15:33 -04:00
|
|
|
'startTime' => String,
|
|
|
|
'operationType' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@list_disks_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
2013-04-16 23:42:54 -04:00
|
|
|
'items' => [{
|
|
|
|
'kind'=> String,
|
|
|
|
'id'=> String,
|
|
|
|
'creationTimestamp'=>String,
|
|
|
|
'selfLink'=>String,
|
|
|
|
'name'=> String,
|
|
|
|
'sizeGb'=> String,
|
|
|
|
'zone'=> String,
|
|
|
|
'status'=>String,
|
|
|
|
}]
|
2012-10-22 20:15:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
disk_name = 'new-disk-test'
|
|
|
|
disk_size = '2'
|
2013-04-16 23:42:54 -04:00
|
|
|
zone_name = 'us-central1-a'
|
2013-11-22 11:14:46 -05:00
|
|
|
image_name = 'centos-6-v20130813'
|
2012-10-22 20:15:33 -04:00
|
|
|
|
2013-04-29 16:57:04 -04:00
|
|
|
# These will all fail if errors happen on insert
|
2012-10-22 20:15:33 -04:00
|
|
|
tests("#insert_disk").formats(@insert_disk_format) do
|
2013-11-22 11:14:46 -05:00
|
|
|
@google.insert_disk(disk_name, zone_name, image_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#get_disk").formats(@get_disk_format) do
|
2013-04-16 23:42:54 -04:00
|
|
|
@google.get_disk(disk_name, zone_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_disks").formats(@list_disks_format) do
|
2013-04-16 23:42:54 -04:00
|
|
|
@google.list_disks(zone_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#delete_disk").formats(@delete_disk_format) do
|
2013-04-16 23:42:54 -04:00
|
|
|
@google.delete_disk(disk_name, zone_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|