fog-openstack 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +12 -28
- data/docs/workflow.md +129 -0
- data/examples/workflow/workflow-examples.rb +387 -0
- data/gemfiles/Gemfile-1.9 +1 -0
- data/lib/fog/openstack.rb +5 -1
- data/lib/fog/openstack/baremetal.rb +14 -38
- data/lib/fog/openstack/compute.rb +4 -33
- data/lib/fog/openstack/core.rb +104 -50
- data/lib/fog/openstack/identity.rb +2 -1
- data/lib/fog/openstack/identity_v2.rb +0 -2
- data/lib/fog/openstack/identity_v3.rb +0 -2
- data/lib/fog/openstack/image_v1.rb +6 -6
- data/lib/fog/openstack/image_v2.rb +7 -6
- data/lib/fog/openstack/introspection.rb +10 -35
- data/lib/fog/openstack/metering.rb +16 -35
- data/lib/fog/openstack/monitoring.rb +5 -31
- data/lib/fog/openstack/network.rb +5 -34
- data/lib/fog/openstack/nfv.rb +10 -35
- data/lib/fog/openstack/orchestration.rb +5 -40
- data/lib/fog/openstack/planning.rb +11 -36
- data/lib/fog/openstack/requests/compute/get_limits.rb +8 -7
- data/lib/fog/openstack/requests/network/update_router.rb +1 -1
- data/lib/fog/openstack/requests/workflow_v2/create_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/create_action_execution.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/create_cron_trigger.rb +55 -0
- data/lib/fog/openstack/requests/workflow_v2/create_environment.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/create_execution.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/create_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/create_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_action.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_action_execution.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_cron_trigger.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_environment.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_execution.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_workbook.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/delete_workflow.rb +25 -0
- data/lib/fog/openstack/requests/workflow_v2/get_action.rb +27 -0
- data/lib/fog/openstack/requests/workflow_v2/get_action_execution.rb +26 -0
- data/lib/fog/openstack/requests/workflow_v2/get_cron_trigger.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_environment.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_execution.rb +26 -0
- data/lib/fog/openstack/requests/workflow_v2/get_task.rb +27 -0
- data/lib/fog/openstack/requests/workflow_v2/get_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/get_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_action_executions.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_actions.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/list_cron_triggers.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_environments.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_executions.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_services.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_tasks.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_workbooks.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/list_workflows.rb +30 -0
- data/lib/fog/openstack/requests/workflow_v2/rerun_task.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/update_action_execution.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_environment.rb +31 -0
- data/lib/fog/openstack/requests/workflow_v2/update_execution.rb +33 -0
- data/lib/fog/openstack/requests/workflow_v2/update_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/update_workflow.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_action.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_workbook.rb +28 -0
- data/lib/fog/openstack/requests/workflow_v2/validate_workflow.rb +28 -0
- data/lib/fog/openstack/storage.rb +4 -35
- data/lib/fog/openstack/version.rb +1 -1
- data/lib/fog/openstack/volume_v1.rb +7 -5
- data/lib/fog/openstack/volume_v2.rb +7 -5
- data/lib/fog/openstack/workflow.rb +12 -0
- data/lib/fog/openstack/workflow_v2.rb +160 -0
- metadata +48 -95
- data/lib/fog/openstack/common.rb +0 -44
- data/tests/openstack/models/compute/images_tests.rb +0 -13
- data/tests/openstack/models/compute/security_group_tests.rb +0 -54
- data/tests/openstack/models/compute/server_tests.rb +0 -220
- data/tests/openstack/models/compute/service_tests.rb +0 -17
- data/tests/openstack/models/image/image_tests.rb +0 -36
- data/tests/openstack/models/image/images_tests.rb +0 -19
- data/tests/openstack/models/network/floating_ip_tests.rb +0 -35
- data/tests/openstack/models/network/floating_ips_tests.rb +0 -19
- data/tests/openstack/models/network/ike_policies_tests.rb +0 -28
- data/tests/openstack/models/network/ike_policy_tests.rb +0 -36
- data/tests/openstack/models/network/ipsec_policies_tests.rb +0 -26
- data/tests/openstack/models/network/ipsec_policy_tests.rb +0 -36
- data/tests/openstack/models/network/ipsec_site_connection_tests.rb +0 -50
- data/tests/openstack/models/network/ipsec_site_connections_tests.rb +0 -32
- data/tests/openstack/models/network/lb_health_monitor_tests.rb +0 -52
- data/tests/openstack/models/network/lb_health_monitors_tests.rb +0 -21
- data/tests/openstack/models/network/lb_member_tests.rb +0 -28
- data/tests/openstack/models/network/lb_members_tests.rb +0 -21
- data/tests/openstack/models/network/lb_pool_tests.rb +0 -53
- data/tests/openstack/models/network/lb_pools_tests.rb +0 -20
- data/tests/openstack/models/network/lb_vip_tests.rb +0 -39
- data/tests/openstack/models/network/lb_vips_tests.rb +0 -21
- data/tests/openstack/models/network/network_tests.rb +0 -61
- data/tests/openstack/models/network/networks_tests.rb +0 -21
- data/tests/openstack/models/network/port_tests.rb +0 -28
- data/tests/openstack/models/network/ports_tests.rb +0 -25
- data/tests/openstack/models/network/router_tests.rb +0 -39
- data/tests/openstack/models/network/routers_tests.rb +0 -21
- data/tests/openstack/models/network/security_group_rule_tests.rb +0 -27
- data/tests/openstack/models/network/security_group_rules_tests.rb +0 -25
- data/tests/openstack/models/network/security_group_tests.rb +0 -17
- data/tests/openstack/models/network/security_groups_tests.rb +0 -16
- data/tests/openstack/models/network/subnet_tests.rb +0 -30
- data/tests/openstack/models/network/subnets_tests.rb +0 -27
- data/tests/openstack/models/network/vpn_service_tests.rb +0 -27
- data/tests/openstack/models/network/vpn_services_tests.rb +0 -22
- data/tests/openstack/models/nfv/vnf_tests.rb +0 -35
- data/tests/openstack/models/nfv/vnfd_tests.rb +0 -23
- data/tests/openstack/models/nfv/vnfds_tests.rb +0 -31
- data/tests/openstack/models/nfv/vnfs_tests.rb +0 -38
- data/tests/openstack/models/planning/.gitkeep +0 -0
- data/tests/openstack/models/planning/plan_tests.rb +0 -51
- data/tests/openstack/models/planning/plans_tests.rb +0 -18
- data/tests/openstack/models/planning/role_tests.rb +0 -14
- data/tests/openstack/models/storage/file_tests.rb +0 -251
- data/tests/openstack/requests/compute/address_tests.rb +0 -58
- data/tests/openstack/requests/compute/aggregate_tests.rb +0 -59
- data/tests/openstack/requests/compute/availability_zone_tests.rb +0 -18
- data/tests/openstack/requests/compute/flavor_tests.rb +0 -95
- data/tests/openstack/requests/compute/helper.rb +0 -41
- data/tests/openstack/requests/compute/image_tests.rb +0 -58
- data/tests/openstack/requests/compute/keypair_tests.rb +0 -30
- data/tests/openstack/requests/compute/limit_tests.rb +0 -59
- data/tests/openstack/requests/compute/quota_tests.rb +0 -60
- data/tests/openstack/requests/compute/security_group_tests.rb +0 -61
- data/tests/openstack/requests/compute/server_tests.rb +0 -289
- data/tests/openstack/requests/compute/service_tests.rb +0 -33
- data/tests/openstack/requests/compute/tenant_tests.rb +0 -19
- data/tests/openstack/requests/compute/volume_tests.rb +0 -38
- data/tests/openstack/requests/image/image_tests.rb +0 -135
- data/tests/openstack/requests/metering/event_tests.rb +0 -17
- data/tests/openstack/requests/metering/meter_tests.rb +0 -52
- data/tests/openstack/requests/metering/resource_tests.rb +0 -19
- data/tests/openstack/requests/network/ike_policy_tests.rb +0 -65
- data/tests/openstack/requests/network/ipsec_policy_tests.rb +0 -65
- data/tests/openstack/requests/network/ipsec_site_connection_tests.rb +0 -82
- data/tests/openstack/requests/network/lb_health_monitor_tests.rb +0 -93
- data/tests/openstack/requests/network/lb_member_tests.rb +0 -60
- data/tests/openstack/requests/network/lb_pool_tests.rb +0 -80
- data/tests/openstack/requests/network/lb_vip_tests.rb +0 -71
- data/tests/openstack/requests/network/network_tests.rb +0 -107
- data/tests/openstack/requests/network/port_tests.rb +0 -66
- data/tests/openstack/requests/network/quota_tests.rb +0 -65
- data/tests/openstack/requests/network/router_tests.rb +0 -73
- data/tests/openstack/requests/network/security_group_rule_tests.rb +0 -58
- data/tests/openstack/requests/network/security_group_tests.rb +0 -43
- data/tests/openstack/requests/network/subnet_tests.rb +0 -66
- data/tests/openstack/requests/network/vpn_service_tests.rb +0 -61
- data/tests/openstack/requests/nfv/vnf_tests.rb +0 -70
- data/tests/openstack/requests/nfv/vnfd_tests.rb +0 -44
- data/tests/openstack/requests/orchestration/stack_tests.rb +0 -64
- data/tests/openstack/requests/planning/.gitkeep +0 -0
- data/tests/openstack/requests/planning/plan_tests.rb +0 -65
- data/tests/openstack/requests/planning/role_tests.rb +0 -16
- data/tests/openstack/requests/storage/container_tests.rb +0 -64
- data/tests/openstack/requests/storage/large_object_tests.rb +0 -372
- data/tests/openstack/requests/storage/object_tests.rb +0 -208
- data/tests/openstack/requests/volume/availability_zone_tests.rb +0 -13
- data/tests/openstack/requests/volume/quota_tests.rb +0 -50
- data/tests/openstack/requests/volume/volume_type_tests.rb +0 -32
@@ -1,208 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Storage[:openstack] | object requests', ["openstack"]) do
|
2
|
-
|
3
|
-
unless Fog.mocking?
|
4
|
-
@directory = Fog::Storage[:openstack].directories.create(:key => 'fogobjecttests')
|
5
|
-
end
|
6
|
-
|
7
|
-
module OpenStackStorageHelpers
|
8
|
-
def override_path(path)
|
9
|
-
@path = path
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
13
|
-
tests('success') do
|
14
|
-
|
15
|
-
tests("#put_object('fogobjecttests', 'fog_object')").succeeds do
|
16
|
-
pending if Fog.mocking?
|
17
|
-
Fog::Storage[:openstack].put_object('fogobjecttests', 'fog_object', lorem_file)
|
18
|
-
end
|
19
|
-
|
20
|
-
tests("#get_object('fogobjectests', 'fog_object')").succeeds do
|
21
|
-
pending if Fog.mocking?
|
22
|
-
Fog::Storage[:openstack].get_object('fogobjecttests', 'fog_object').body == lorem_file.read
|
23
|
-
end
|
24
|
-
|
25
|
-
tests("#get_object('fogobjecttests', 'fog_object', &block)").succeeds do
|
26
|
-
pending if Fog.mocking?
|
27
|
-
data = ''
|
28
|
-
Fog::Storage[:openstack].get_object('fogobjecttests', 'fog_object') do |chunk, remaining_bytes, total_bytes|
|
29
|
-
data << chunk
|
30
|
-
end
|
31
|
-
data == lorem_file.read
|
32
|
-
end
|
33
|
-
|
34
|
-
tests("#public_url('fogobjectests', 'fog_object')").succeeds do
|
35
|
-
pending if Fog.mocking?
|
36
|
-
Fog::Storage[:openstack].directories.first.files.first.public_url
|
37
|
-
end
|
38
|
-
|
39
|
-
tests("#public_url('fogobjectests')").succeeds do
|
40
|
-
pending if Fog.mocking?
|
41
|
-
Fog::Storage[:openstack].directories.first.public_url
|
42
|
-
end
|
43
|
-
|
44
|
-
tests("#head_object('fogobjectests', 'fog_object')").succeeds do
|
45
|
-
pending if Fog.mocking?
|
46
|
-
Fog::Storage[:openstack].head_object('fogobjecttests', 'fog_object')
|
47
|
-
end
|
48
|
-
|
49
|
-
tests("#delete_object('fogobjecttests', 'fog_object')").succeeds do
|
50
|
-
pending if Fog.mocking?
|
51
|
-
Fog::Storage[:openstack].delete_object('fogobjecttests', 'fog_object')
|
52
|
-
end
|
53
|
-
|
54
|
-
def test_temp_url(url_s, time, desired_scheme)
|
55
|
-
object_url = URI.parse(url_s)
|
56
|
-
query_params = URI.decode_www_form(object_url.query)
|
57
|
-
|
58
|
-
tests("the link is #{desired_scheme}").returns(desired_scheme) { object_url.scheme }
|
59
|
-
tests('the container and object are present in the path').returns(true) do
|
60
|
-
(object_url.path =~ /\/#{@directory.identity}\/fog_object/) != nil
|
61
|
-
end
|
62
|
-
tests('a temp_url_sig is present').returns(true) do
|
63
|
-
query_params.any? { |p| p[0] == 'temp_url_sig' }
|
64
|
-
end
|
65
|
-
tests('temp_url_expires matches the expiration').returns(true) do
|
66
|
-
query_params.any? { |p| p == ['temp_url_expires', time.to_i.to_s] }
|
67
|
-
end
|
68
|
-
end
|
69
|
-
|
70
|
-
tests("#get_object_http_url('directory.identity', 'fog_object', expiration timestamp)").succeeds do
|
71
|
-
pending if Fog.mocking?
|
72
|
-
ts = Time.at(1395343213)
|
73
|
-
url_s = Fog::Storage[:openstack].get_object_http_url(@directory.identity, 'fog_object', ts)
|
74
|
-
test_temp_url(url_s, ts, 'http')
|
75
|
-
end
|
76
|
-
|
77
|
-
tests("#get_object_https_url('directory.identity', 'fog_object', expiration timestamp)").succeeds do
|
78
|
-
pending if Fog.mocking?
|
79
|
-
ts = Time.at(1395343215)
|
80
|
-
url_s = Fog::Storage[:openstack].get_object_https_url(@directory.identity, 'fog_object', ts)
|
81
|
-
test_temp_url(url_s, ts, 'https')
|
82
|
-
end
|
83
|
-
|
84
|
-
tests("put_object with block") do
|
85
|
-
pending if Fog.mocking?
|
86
|
-
|
87
|
-
tests("#put_object('fogobjecttests', 'fog_object', &block)").succeeds do
|
88
|
-
begin
|
89
|
-
file = lorem_file
|
90
|
-
buffer_size = file.stat.size / 2 # chop it up into two buffers
|
91
|
-
Fog::Storage[:openstack].put_object('fogobjecttests', 'fog_block_object', nil) do
|
92
|
-
file.read(buffer_size).to_s
|
93
|
-
end
|
94
|
-
ensure
|
95
|
-
file.close
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
tests('#get_object').succeeds do
|
100
|
-
Fog::Storage[:openstack].get_object('fogobjecttests', 'fog_block_object').body == lorem_file.read
|
101
|
-
end
|
102
|
-
|
103
|
-
tests('#delete_object').succeeds do
|
104
|
-
Fog::Storage[:openstack].delete_object('fogobjecttests', 'fog_block_object')
|
105
|
-
end
|
106
|
-
end
|
107
|
-
|
108
|
-
tests('#delete_multiple_objects') do
|
109
|
-
pending if Fog.mocking?
|
110
|
-
|
111
|
-
Fog::Storage[:openstack].put_object('fogobjecttests', 'fog_object', lorem_file)
|
112
|
-
Fog::Storage[:openstack].put_object('fogobjecttests', 'fog_object2', lorem_file)
|
113
|
-
Fog::Storage[:openstack].directories.create(:key => 'fogobjecttests2')
|
114
|
-
Fog::Storage[:openstack].put_object('fogobjecttests2', 'fog_object', lorem_file)
|
115
|
-
|
116
|
-
expected = {
|
117
|
-
"Number Not Found" => 0,
|
118
|
-
"Response Status" => "200 OK",
|
119
|
-
"Errors" => [],
|
120
|
-
"Number Deleted" => 2,
|
121
|
-
"Response Body" => ""
|
122
|
-
}
|
123
|
-
|
124
|
-
returns(expected, 'deletes multiple objects') do
|
125
|
-
Fog::Storage[:openstack].delete_multiple_objects('fogobjecttests', ['fog_object', 'fog_object2']).body
|
126
|
-
end
|
127
|
-
|
128
|
-
returns(expected, 'deletes object and container') do
|
129
|
-
Fog::Storage[:openstack].delete_multiple_objects(nil, ['fogobjecttests2/fog_object', 'fogobjecttests2']).body
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
end
|
134
|
-
|
135
|
-
tests('failure') do
|
136
|
-
|
137
|
-
tests("#get_object('fogobjecttests', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
138
|
-
pending if Fog.mocking?
|
139
|
-
Fog::Storage[:openstack].get_object('fogobjecttests', 'fog_non_object')
|
140
|
-
end
|
141
|
-
|
142
|
-
tests("#get_object('fognoncontainer', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
143
|
-
pending if Fog.mocking?
|
144
|
-
Fog::Storage[:openstack].get_object('fognoncontainer', 'fog_non_object')
|
145
|
-
end
|
146
|
-
|
147
|
-
tests("#head_object('fogobjecttests', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
148
|
-
pending if Fog.mocking?
|
149
|
-
Fog::Storage[:openstack].head_object('fogobjecttests', 'fog_non_object')
|
150
|
-
end
|
151
|
-
|
152
|
-
tests("#head_object('fognoncontainer', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
153
|
-
pending if Fog.mocking?
|
154
|
-
Fog::Storage[:openstack].head_object('fognoncontainer', 'fog_non_object')
|
155
|
-
end
|
156
|
-
|
157
|
-
tests("#delete_object('fogobjecttests', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
158
|
-
pending if Fog.mocking?
|
159
|
-
Fog::Storage[:openstack].delete_object('fogobjecttests', 'fog_non_object')
|
160
|
-
end
|
161
|
-
|
162
|
-
tests("#delete_object('fognoncontainer', 'fog_non_object')").raises(Fog::Storage::OpenStack::NotFound) do
|
163
|
-
pending if Fog.mocking?
|
164
|
-
Fog::Storage[:openstack].delete_object('fognoncontainer', 'fog_non_object')
|
165
|
-
end
|
166
|
-
|
167
|
-
tests('#delete_multiple_objects') do
|
168
|
-
pending if Fog.mocking?
|
169
|
-
|
170
|
-
expected = {
|
171
|
-
"Number Not Found" => 2,
|
172
|
-
"Response Status" => "200 OK",
|
173
|
-
"Errors" => [],
|
174
|
-
"Number Deleted" => 0,
|
175
|
-
"Response Body" => ""
|
176
|
-
}
|
177
|
-
|
178
|
-
returns(expected, 'reports missing objects') do
|
179
|
-
Fog::Storage[:openstack].delete_multiple_objects('fogobjecttests', ['fog_non_object', 'fog_non_object2']).body
|
180
|
-
end
|
181
|
-
|
182
|
-
returns(expected, 'reports missing container') do
|
183
|
-
Fog::Storage[:openstack].delete_multiple_objects('fognoncontainer', ['fog_non_object', 'fog_non_object2']).body
|
184
|
-
end
|
185
|
-
|
186
|
-
tests('deleting non-empty container') do
|
187
|
-
Fog::Storage[:openstack].put_object('fogobjecttests', 'fog_object', lorem_file)
|
188
|
-
|
189
|
-
expected = {
|
190
|
-
"Number Not Found" => 0,
|
191
|
-
"Response Status" => "400 Bad Request",
|
192
|
-
"Errors" => [['fogobjecttests', '409 Conflict']],
|
193
|
-
"Number Deleted" => 1,
|
194
|
-
"Response Body" => ""
|
195
|
-
}
|
196
|
-
|
197
|
-
returns(expected, 'deletes object but not container') do
|
198
|
-
Fog::Storage[:openstack].delete_multiple_objects(nil, ['fogobjecttests', 'fogobjecttests/fog_object']).body
|
199
|
-
end
|
200
|
-
end
|
201
|
-
end
|
202
|
-
end
|
203
|
-
|
204
|
-
unless Fog.mocking?
|
205
|
-
@directory.destroy
|
206
|
-
end
|
207
|
-
|
208
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Volume[:openstack] | availability zone requests', ['openstack']) do
|
2
|
-
|
3
|
-
@flavor_format = {
|
4
|
-
'zoneName' => String,
|
5
|
-
'zoneState' => Hash,
|
6
|
-
}
|
7
|
-
|
8
|
-
tests('success') do
|
9
|
-
tests('#list_zones').data_matches_schema({'availabilityZoneInfo' => [@flavor_format]}) do
|
10
|
-
Fog::Volume[:openstack].list_zones.body
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Volume[:openstack] | quota requests', ['openstack']) do
|
2
|
-
|
3
|
-
@tenant_id = Fog::Compute[:openstack].list_tenants.body['tenants'].first['id']
|
4
|
-
@quota_set_format = {
|
5
|
-
'volumes' => Fog::Nullable::Integer,
|
6
|
-
'gigabytes' => Fog::Nullable::Integer,
|
7
|
-
'snapshots' => Fog::Nullable::Integer,
|
8
|
-
'id' => String
|
9
|
-
}
|
10
|
-
|
11
|
-
tests('success') do
|
12
|
-
|
13
|
-
tests('#get_quota_defaults').formats({ 'quota_set' => @quota_set_format }) do
|
14
|
-
Fog::Volume[:openstack].get_quota_defaults(@tenant_id).body
|
15
|
-
end
|
16
|
-
|
17
|
-
tests('#get_quota').formats(@quota_set_format) do
|
18
|
-
@quota = Fog::Volume[:openstack].get_quota(@tenant_id).body['quota_set']
|
19
|
-
@quota
|
20
|
-
end
|
21
|
-
|
22
|
-
tests('#update_quota') do
|
23
|
-
|
24
|
-
new_values = @quota.merge({
|
25
|
-
'volumes' => @quota['volumes']/2,
|
26
|
-
'snapshots' => @quota['snapshots']/2
|
27
|
-
})
|
28
|
-
|
29
|
-
succeeds do
|
30
|
-
Fog::Volume[:openstack].update_quota(@tenant_id, new_values.clone)
|
31
|
-
end
|
32
|
-
|
33
|
-
returns(new_values, 'returns new values') do
|
34
|
-
Fog::Volume[:openstack].get_quota(@tenant_id).body['quota_set']
|
35
|
-
end
|
36
|
-
|
37
|
-
# set quota back to old values
|
38
|
-
succeeds do
|
39
|
-
Fog::Volume[:openstack].update_quota(@tenant_id, @quota.clone)
|
40
|
-
end
|
41
|
-
|
42
|
-
# ensure old values are restored
|
43
|
-
returns(@quota, 'old values restored') do
|
44
|
-
Fog::Volume[:openstack].get_quota(@tenant_id).body['quota_set']
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
|
49
|
-
end
|
50
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
Shindo.tests('Fog::Volume[:openstack] | volume_type requests', ['openstack']) do
|
2
|
-
|
3
|
-
@volume_type_format = {
|
4
|
-
'name' => String,
|
5
|
-
'extra_specs' => Hash,
|
6
|
-
'id' => String
|
7
|
-
}
|
8
|
-
|
9
|
-
tests('success') do
|
10
|
-
tests('#create_volume_type').formats(@volume_type_format) do
|
11
|
-
@volume_type = Fog::Volume[:openstack].create_volume_type(:name => 'test_volume_type').body['volume_type']
|
12
|
-
@volume_type
|
13
|
-
end
|
14
|
-
|
15
|
-
tests('#update_volume_type').formats(@volume_type_format) do
|
16
|
-
Fog::Volume[:openstack].update_volume_type(@volume_type['id'],
|
17
|
-
:name => 'test_volume_type_1').body['volume_type']
|
18
|
-
end
|
19
|
-
|
20
|
-
tests('#get_volume_type').formats(@volume_type_format) do
|
21
|
-
Fog::Volume[:openstack].get_volume_type_details(@volume_type['id']).body['volume_type']
|
22
|
-
end
|
23
|
-
|
24
|
-
tests('#list_volume_type').formats([@volume_type_format]) do
|
25
|
-
Fog::Volume[:openstack].list_volume_types.body['volume_types']
|
26
|
-
end
|
27
|
-
|
28
|
-
succeeds do
|
29
|
-
Fog::Volume[:openstack].delete_volume_type(@volume_type['id'])
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|