[glesys|compute] fix test formats and whitespaces

This commit is contained in:
Anton Lindström 2011-11-29 19:00:45 +01:00
parent 52b379629f
commit 6f1b9a3688
3 changed files with 92 additions and 69 deletions

View File

@ -4,7 +4,9 @@ class Glesys
module Servers
LIST = {
'arguments' => [],
'debug' => {
'input' => []
},
'servers' => [{
'serverid' => String,
'hostname' => String,
@ -18,17 +20,19 @@ class Glesys
}
CREATE = {
'arguments' => {
"rootpw" => String,
"disksize" => String,
"memorysize" => String,
"datacenter" => String,
"cpucores" => String,
"transfer" => String,
"template" => String,
"description" => String,
"hostname" => String,
"platform" => String
'debug' => {
'input' => {
"rootpw" => String,
"disksize" => String,
"memorysize" => String,
"datacenter" => String,
"cpucores" => String,
"transfer" => String,
"template" => String,
"description" => String,
"hostname" => String,
"platform" => String
}
},
'server' => {
'serverid' => String,
@ -46,9 +50,11 @@ class Glesys
}
DESTROY = {
'arguments' => {
'serverid' => String,
'keepip' => String,
'debug' => {
'input' => {
'serverid' => String,
'keepip' => String,
}
},
'status' => {
'code' => String,
@ -57,61 +63,68 @@ class Glesys
}
DETAILS = {
'arguments' => {
'serverid' => String
},
'debug' => {
'input' => {
'serverid' => String
}
},
'server' => {
'managedhosting' => String,
'cost' => {
'amount' => Float,
'timeperiod' => String,
'timeperiod' => String,
'currency' => String
},
'datacenter' => String,
'serverid' => String,
'datacenter' => String,
'memory' => String,
'cpucores' => String,
'transfer' => String,
'template' => String,
'cpucores' => String,
'transfer' => String,
'template' => String,
'iplist' => [{
'cost' => String,
'version' => String,
'cost' => String,
'version' => String,
'ip' => String
}],
'description' => String,
'hostname' => String,
'disk' => String,
'hostname' => String,
'disk' => String,
'platform' => String
},
},
'status' => {
'code' => String,
'code' => String,
'text' => String
}
}
STATUS = {
'arguments' => {
'serverid' => String
},
'debug' => {
'input' => {
'serverid' => String
}
},
'server' => {
'memory' => String,
'memory' => String,
'bandwidth' => {
'last30days' => Integer,
'last30days' => Integer,
'today' => Integer,
'max' => String
},
'cpu' => String,
'disk' => String,
},
'cpu' => String,
'disk' => String,
'state' => String
},
'status' => {
},
'status' => {
'code' => String,
'text' => String
}
}
START = {
'arguments' => {
'serverid' => String
'debug' => {
'input' => {
'serverid' => String
}
},
'status' => {
'code' => String,
@ -120,9 +133,11 @@ class Glesys
}
STOP = {
'arguments' => {
'serverid' => String,
'type' => String
'debug' => {
'input' => {
'serverid' => String,
'type' => String
}
},
'status' => {
'code' => String,
@ -132,9 +147,11 @@ class Glesys
end
module Ips
IPLIST = {
'arguments' => [],
'debug' => {
'input' => []
},
'iplist' => [{
'price' => {
'amount' => String,
@ -153,12 +170,14 @@ class Glesys
'text' => String
}
}
IPLIST_ALL = {
'arguments' => {
'datacenter' => String,
'ipversion' => String,
'platform' => String
'debug' => {
'input' => {
'datacenter' => String,
'ipversion' => String,
'platform' => String
}
},
'iplist' => [],
'status' => {
@ -173,11 +192,13 @@ class Glesys
}
IPLIST_CATCH_RELEASE = {
'arguments' => {
'ipaddress' => String,
},
'debug' => {
'input' => {
'ipaddress' => String,
}
},
'status' => {
'code' => String,
'code' => String,
'text' => String
}
}
@ -186,20 +207,22 @@ class Glesys
module Templates
LIST = {
'arguments' => [],
'templates' => {
'debug' => {
'input' => []
},
'templates' => {
'Xen' => [{
'name' => String,
'os' => String,
'min_mem_size' => String,
'min_disk_size' => String,
'os' => String,
'min_mem_size' => String,
'min_disk_size' => String,
'platform' => String
}],
'OpenVZ' => [{
'name' => String,
'os' => String,
'min_mem_size' => String,
'min_disk_size' => String,
'os' => String,
'min_mem_size' => String,
'min_disk_size' => String,
'platform' => String
}]
},

View File

@ -10,7 +10,7 @@ Shindo.tests('Fog::Compute[:glesys] | ip requests', ['glesys']) do
Fog::Compute[:glesys].ip_list_own.body['response']
end
tests("#ip_list_free(:datcenter => 'Falkenberg, :platform => 'Xen', :ipversion => 4)"
tests("#ip_list_free(:datacenter => 'Falkenberg, :platform => 'Xen', :ipversion => 4)"
).formats(Glesys::Compute::Formats::Ips::IPLIST_ALL) do
pending if Fog.mocking?
ips = Fog::Compute[:glesys].ip_list_free(

View File

@ -1,5 +1,5 @@
Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
@serverid = nil
@hostname = "fog-#{Time.now.to_i}"
@ -27,7 +27,7 @@ Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
:cpucores => "1",
:transfer => "500"
)
@serverid = vm.body['response']['server']['serverid']
vm.body['response']
end
@ -35,7 +35,7 @@ Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
unless Fog.mocking?
Fog::Compute[:glesys].servers.get(@serverid).wait_for { ready? }
end
tests("#server_details(#{@serverid})").formats(Glesys::Compute::Formats::Servers::DETAILS) do
pending if Fog.mocking?
Fog::Compute[:glesys].server_details(@serverid).body['response']
@ -55,7 +55,7 @@ Shindo.tests('Fog::Compute[:glesys] | server requests', ['glesys']) do
unless Fog.mocking?
pending if Fog.mocking?
s = Fog::Compute[:glesys].servers.get(@serverid)
s.wait_for { s.state == 'stopped' }
s.wait_for { s.state == 'stopped' }
end
tests("#start(:serverid => #{@serverid})").formats(Glesys::Compute::Formats::Servers::START) do