mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
![Philip Mark M. Deazeta](/assets/img/avatar_default.png)
reverted back to double quoted string Conflicts: lib/fog/openstack/identity.rb lib/fog/openstack/requests/compute/get_volume_details.rb lib/fog/openstack/requests/compute/list_security_groups.rb lib/fog/openstack/requests/identity/list_tenants.rb lib/fog/openstack/requests/image/create_image.rb lib/fog/openstack/requests/image/list_public_images.rb lib/fog/openstack/requests/image/list_public_images_detailed.rb lib/fog/openstack/requests/image/update_image.rb tests/openstack/requests/compute/volume_tests.rb
46 lines
1.3 KiB
Ruby
46 lines
1.3 KiB
Ruby
Shindo.tests('Fog::Compute[:openstack] | quota requests', ['openstack']) do
|
|
|
|
@tenant_id = Fog::Compute[:openstack].list_tenants.body['tenants'].first['id']
|
|
@quota_set_format = {
|
|
'metadata_items' => Fixnum,
|
|
'injected_file_content_bytes' => Fixnum,
|
|
'injected_files' => Fixnum,
|
|
'gigabytes' => Fixnum,
|
|
'ram' => Fixnum,
|
|
'floating_ips' => Fixnum,
|
|
'instances' => Fixnum,
|
|
'volumes' => Fixnum,
|
|
'cores' => Fixnum,
|
|
'security_groups' => Fixnum,
|
|
'security_group_rules' => Fixnum,
|
|
'id' => String
|
|
}
|
|
|
|
tests('success') do
|
|
tests('#get_quota_defaults').formats({ 'quota_set' => @quota_set_format }) do
|
|
Fog::Compute[:openstack].get_quota_defaults(@tenant_id).body
|
|
end
|
|
|
|
tests('#get_quota').formats(@quota_set_format) do
|
|
@quota = Fog::Compute[:openstack].get_quota(@tenant_id).body['quota_set']
|
|
@quota
|
|
end
|
|
|
|
tests('#update_quota') do
|
|
new_values = @quota.merge({
|
|
'volumes' => @quota['volumes']/2,
|
|
'cores' => @quota['cores']/2
|
|
})
|
|
|
|
succeeds do
|
|
Fog::Compute[:openstack].update_quota(@tenant_id, new_values.clone)
|
|
end
|
|
|
|
returns(new_values, 'returns new values') do
|
|
Fog::Compute[:openstack].get_quota(@tenant_id).body['quota_set']
|
|
end
|
|
end
|
|
|
|
end
|
|
end
|
|
|