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,
'zoneid' => Integer,
'zonename' => String,
'status' => String,
'size' => Integer,
'status' => Fog::Nullable::String,
'size' => Fog::Nullable::Integer,
'templatetype' => String,
'hypervisor' => String,
'domain' => String,

View File

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

View File

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