2012-12-26 19:54:42 -05:00
|
|
|
Shindo.tests('Fog::Compute[:google] | server 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_server_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'user' => String,
|
|
|
|
'startTime' => String,
|
|
|
|
'insertTime' => String,
|
|
|
|
'operationType' => String,
|
|
|
|
'status' => String,
|
|
|
|
'progress' => Integer
|
|
|
|
}
|
|
|
|
|
|
|
|
@get_server_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'creationTimestamp' => String,
|
|
|
|
'name' => String,
|
|
|
|
'image' => String,
|
|
|
|
'machineType' => String,
|
|
|
|
'status' => String,
|
|
|
|
'zone' => String,
|
|
|
|
'disks' => [],
|
|
|
|
'networkInterfaces' => []
|
|
|
|
}
|
|
|
|
|
|
|
|
@delete_server_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
'name' => String,
|
|
|
|
'targetLink' => String,
|
|
|
|
'status' => String,
|
|
|
|
'user' => String,
|
|
|
|
'targetId' => String,
|
|
|
|
'progress' => Integer,
|
|
|
|
'insertTime' => String,
|
|
|
|
'startTime' => String,
|
|
|
|
'operationType' => String
|
|
|
|
}
|
|
|
|
|
|
|
|
@list_servers_format = {
|
|
|
|
'kind' => String,
|
|
|
|
'id' => String,
|
|
|
|
'selfLink' => String,
|
|
|
|
}
|
|
|
|
|
|
|
|
tests('success') do
|
|
|
|
|
|
|
|
server_name = 'new-server-test'
|
2013-11-22 11:14:46 -05:00
|
|
|
image_name = "centos-6-v20130813"
|
2013-04-29 17:48:25 -04:00
|
|
|
machine_type = "n1-standard-1"
|
|
|
|
zone_name = "us-central1-a"
|
2012-10-22 20:15:33 -04:00
|
|
|
|
|
|
|
tests("#insert_server").formats(@insert_server_format) do
|
2013-04-29 17:48:25 -04:00
|
|
|
@google.insert_server(
|
|
|
|
server_name,
|
|
|
|
zone_name,
|
2013-11-22 11:14:46 -05:00
|
|
|
{ 'image' => image_name, 'machineType' => machine_type }
|
2013-04-29 17:48:25 -04:00
|
|
|
).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
tests("#list_servers").formats(@list_servers_format) do
|
2013-04-29 17:48:25 -04:00
|
|
|
@google.list_servers(zone_name).body
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|
|
|
|
|
2013-04-29 19:55:38 -04:00
|
|
|
# Both of these tests require the server to be there...
|
2012-10-22 20:15:33 -04:00
|
|
|
|
2013-04-29 19:55:38 -04:00
|
|
|
#tests("#get_server").formats(@get_server_format) do
|
|
|
|
# @google.get_server(server_name, zone_name).body
|
|
|
|
#end
|
2012-10-22 20:15:33 -04:00
|
|
|
|
2013-04-29 19:55:38 -04:00
|
|
|
#tests("#delete_server").formats(@delete_server_format) do
|
|
|
|
# @google.delete_server(server_name, zone_name).body
|
|
|
|
#end
|
|
|
|
end
|
2012-10-22 20:15:33 -04:00
|
|
|
end
|