1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

updated cloudstack tests for user level permissions, added ssh key, disk offering, service offering, os type, security group tests

This commit is contained in:
Brian Dorry 2012-01-09 19:20:37 -05:00
parent bdfb60fbb7
commit 26c51e0af6
11 changed files with 169 additions and 37 deletions

View file

@ -0,0 +1,29 @@
Shindo.tests('Fog::Compute[:cloudstack] | disk offering requests', ['cloudstack']) do
@disk_offerings_format = {
'listdiskofferingsresponse' => {
'count' => Integer,
'diskoffering' => [
'id' => Integer,
'created' => String,
'disksize' => Integer,
'displaytext' => String,
'domain' => Fog::Nullable::String,
'domainid' => Fog::Nullable::Integer,
'iscustomized' => Fog::Boolean,
'name' => String,
'tags' => Fog::Nullable::String
]
}
}
tests('success') do
tests('#list_disk_offerings').formats(@disk_offerings_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_disk_offerings
end
end
end

View file

@ -0,0 +1,38 @@
Shindo.tests('Fog::Compute[:cloudstack] | os type requests', ['cloudstack']) do
@os_types_format = {
'listostypesresponse' => {
'count' => Integer,
'ostype' => [
'id' => Integer,
'description' => String,
'oscategoryid' => Integer
]
}
}
@os_categories_format = {
'listoscategoriesresponse' => {
'count' => Integer,
'oscategory' => [
'id' => Integer,
'name' => String
]
}
}
tests('success') do
tests('#list_os_types').formats(@os_types_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_os_types
end
tests('#list_os_categories').formats(@os_categories_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_os_categories
end
end
end

View file

@ -0,0 +1,29 @@
Shindo.tests('Fog::Compute[:cloudstack] | security group requests', ['cloudstack']) do
@security_groups_format = {
'listsecuritygroupsresponse' => {
'count' => Integer,
'securitygroup' => [
'id' => Integer,
'account' => String,
'description' => Fog::Nullable::String,
'domain' => String,
'domainid' => Integer,
'jobid' => Fog::Nullable::Integer,
'jobstatus' => Fog::Nullable::String,
'name' => String,
'ingressrule' => Fog::Nullable::Array
]
}
}
tests('success') do
tests('#list_security_groups').formats(@security_groups_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_security_groups
end
end
end

View file

@ -0,0 +1,38 @@
Shindo.tests('Fog::Compute[:cloudstack] | service offering requests', ['cloudstack']) do
@service_offerings_format = {
'listserviceofferingsresponse' => {
'count' => Integer,
'serviceoffering' => [
'id' => Integer,
'cpuspeed' => Integer,
'cpunumber' => Integer,
'created' => String,
'defaultuse' => Fog::Boolean,
'displaytext' => String,
'domain' => Fog::Nullable::String,
'domainid' => Fog::Nullable::Integer,
'hosttags' => Fog::Nullable::String,
'issystem' => Fog::Boolean,
'limitcpuuse' => Fog::Boolean,
'memory' => Integer,
'name' => String,
'networkrate' => Integer,
'offerha' => Fog::Boolean,
'storagetype' => String,
'systemvmtype' => Fog::Nullable::String,
'tags' => Fog::Nullable::String
]
}
}
tests('success') do
tests('#list_service_offerings').formats(@service_offerings_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_service_offerings
end
end
end

View file

@ -0,0 +1,23 @@
Shindo.tests('Fog::Compute[:cloudstack] | ssh key pairs requests', ['cloudstack']) do
@ssh_keys_format = {
'listsshkeypairsresponse' => {
'count' => Integer,
'sshkeypair' => [
'fingerprint' => String,
'name' => String,
'privatekey' => Fog::Nullable::String
]
}
}
tests('success') do
tests('#list_ssh_key_pairs').formats(@ssh_keys_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_ssh_key_pairs
end
end
end

View file

@ -19,8 +19,8 @@ Shindo.tests('Fog::Compute[:cloudstack] | template requests', ['cloudstack']) do
'account' => String, 'account' => String,
'zoneid' => Integer, 'zoneid' => Integer,
'zonename' => String, 'zonename' => String,
'status' => String, 'status' => Fog::Nullable::String,
'size' => Integer, 'size' => Fog::Nullable::Integer,
'templatetype' => String, 'templatetype' => String,
'hypervisor' => String, 'hypervisor' => String,
'domain' => String, 'domain' => String,

View file

@ -15,7 +15,7 @@ Shindo.tests('Fog::Compute[:cloudstack] | virtual machine requests', ['cloudstac
'haenable' => Fog::Boolean, 'haenable' => Fog::Boolean,
'zoneid' => Integer, 'zoneid' => Integer,
'zonename' => String, 'zonename' => String,
'hostid' => Integer, 'hostid' => Fog::Nullable::String,
'hostname' => Fog::Nullable::String, 'hostname' => Fog::Nullable::String,
'templateid' => Integer, 'templateid' => Integer,
'templatename' => String, 'templatename' => String,

View file

@ -6,16 +6,17 @@ Shindo.tests('Fog::Compute[:cloudstack] | zone requests', ['cloudstack']) do
'zone' => [ 'zone' => [
'id' => Integer, 'id' => Integer,
'name' => String, 'name' => String,
'dns1' => String, 'dns1' => Fog::Nullable::String,
'dns2' => String, 'dns2' => Fog::Nullable::String,
'internaldns1' => String, 'internaldns1' => Fog::Nullable::String,
'internaldns2' => String, 'internaldns2' => Fog::Nullable::String,
'vlan' => String, 'vlan' => Fog::Nullable::String,
'guestcidraddress' => String, 'guestcidraddress' => Fog::Nullable::String,
'networktype' => String, 'networktype' => String,
'securitygroupsenabled' => [TrueClass,FalseClass], 'securitygroupsenabled' => Fog::Nullable::Boolean,
'allocationstate' => String, 'allocationstate' => String,
'dhcpprovider' => String 'dhcpprovider' => String,
'zonetoken' => Fog::Nullable::String
] ]
} }
} }

View file

@ -1,26 +0,0 @@
Shindo.tests('Fog::Compute[:cloudstack] | domain requests', ['cloudstack']) do
@domains_format = {
'listdomainsresponse' => {
'count' => Integer,
'domain' => [
'id' => Integer,
'name' => String,
'level' => Integer,
'haschild' => Fog::Boolean,
'parentdomainid' => Fog::Nullable::Integer,
'parentdomainname' => Fog::Nullable::String
]
}
}
tests('success') do
tests('#list_domains').formats(@domains_format) do
pending if Fog.mocking?
Fog::Compute[:cloudstack].list_domains
end
end
end