fog 0.3.30 → 0.3.31

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fog (0.3.30)
4
+ fog (0.3.31)
5
5
  builder
6
- excon (>= 0.2.8)
6
+ excon (>= 0.3.3)
7
7
  formatador (>= 0.0.16)
8
8
  json
9
9
  mime-types
@@ -15,14 +15,14 @@ PATH
15
15
  GEM
16
16
  remote: http://rubygems.org/
17
17
  specs:
18
- builder (2.1.2)
19
- excon (0.2.8)
18
+ builder (3.0.0)
19
+ excon (0.3.3)
20
20
  formatador (0.0.16)
21
21
  gestalt (0.0.11)
22
22
  formatador (>= 0.0.12)
23
23
  json (1.4.6)
24
24
  mime-types (1.16)
25
- named-parameters (0.0.17)
25
+ named-parameters (0.0.18)
26
26
  net-ssh (2.0.23)
27
27
  nokogiri (1.4.4)
28
28
  rake (0.8.7)
@@ -37,7 +37,7 @@ PLATFORMS
37
37
 
38
38
  DEPENDENCIES
39
39
  builder
40
- excon (>= 0.2.8)
40
+ excon (>= 0.3.3)
41
41
  fog!
42
42
  formatador (>= 0.0.16)
43
43
  json
data/Rakefile CHANGED
@@ -91,7 +91,7 @@ task :release => :build do
91
91
  puts "You must be on the master branch to release!"
92
92
  exit!
93
93
  end
94
- sh "sudo gem install pkg/#{name}-#{version}.gem"
94
+ sh "gem install pkg/#{name}-#{version}.gem"
95
95
  sh "git commit --allow-empty -a -m 'Release #{version}'"
96
96
  sh "git tag v#{version}"
97
97
  sh "git push origin master"
@@ -7,8 +7,8 @@ Gem::Specification.new do |s|
7
7
  ## If your rubyforge_project name is different, then edit it and comment out
8
8
  ## the sub! line in the Rakefile
9
9
  s.name = 'fog'
10
- s.version = '0.3.30'
11
- s.date = '2010-12-08'
10
+ s.version = '0.3.31'
11
+ s.date = '2010-12-10'
12
12
  s.rubyforge_project = 'fog'
13
13
 
14
14
  ## Make sure your summary is short. The description may be as long
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
43
43
  ## List your runtime dependencies here. Runtime dependencies are those
44
44
  ## that are needed for an end user to actually USE your code.
45
45
  s.add_dependency('builder')
46
- s.add_dependency('excon', '>=0.2.8')
46
+ s.add_dependency('excon', '>=0.3.3')
47
47
  s.add_dependency('formatador', '>=0.0.16')
48
48
  s.add_dependency('json')
49
49
  s.add_dependency('mime-types')
@@ -766,6 +766,15 @@ Gem::Specification.new do |s|
766
766
  tests/brightbox/models/compute/flavors_tests.rb
767
767
  tests/brightbox/models/compute/server_tests.rb
768
768
  tests/brightbox/models/compute/servers_tests.rb
769
+ tests/brightbox/requests/compute/account_tests.rb
770
+ tests/brightbox/requests/compute/api_client_tests.rb
771
+ tests/brightbox/requests/compute/cloud_ip_tests.rb
772
+ tests/brightbox/requests/compute/image_tests.rb
773
+ tests/brightbox/requests/compute/interface_tests.rb
774
+ tests/brightbox/requests/compute/server_tests.rb
775
+ tests/brightbox/requests/compute/server_type_tests.rb
776
+ tests/brightbox/requests/compute/user_tests.rb
777
+ tests/brightbox/requests/compute/zone_tests.rb
769
778
  tests/go_grid/helper.rb
770
779
  tests/go_grid/requests/compute/image_tests.rb
771
780
  tests/google/models/storage/directories_tests.rb
data/lib/fog.rb CHANGED
@@ -19,7 +19,7 @@ module Fog
19
19
  @mocking = false
20
20
 
21
21
  unless const_defined?(:VERSION)
22
- VERSION = '0.3.30'
22
+ VERSION = '0.3.31'
23
23
  end
24
24
 
25
25
  module Mock
@@ -26,6 +26,10 @@ module Fog
26
26
  connection.map_cloud_ip(identity, :interface => interface_to_map)
27
27
  end
28
28
 
29
+ def mapped?
30
+ status == "mapped"
31
+ end
32
+
29
33
  def unmap
30
34
  requires :identity
31
35
  connection.unmap_cloud_ip(identity)
@@ -26,6 +26,10 @@ module Fog
26
26
  attribute :disk_size
27
27
  attribute :created_at
28
28
 
29
+ def ready?
30
+ status == "available"
31
+ end
32
+
29
33
  def save
30
34
  requires :source, :arch
31
35
  options = {
@@ -0,0 +1,370 @@
1
+ module Fog
2
+ module Brightbox
3
+ module Nullable
4
+ module String; end
5
+ module Account; end
6
+ module Image; end
7
+ module Interface; end
8
+ module Server; end
9
+ module Zone; end
10
+ end
11
+ end
12
+ end
13
+
14
+ String.send :include, Fog::Brightbox::Nullable::String
15
+ NilClass.send :include, Fog::Brightbox::Nullable::String
16
+
17
+ Hash.send :include, Fog::Brightbox::Nullable::Account
18
+ NilClass.send :include, Fog::Brightbox::Nullable::Account
19
+
20
+ Hash.send :include, Fog::Brightbox::Nullable::Image
21
+ NilClass.send :include, Fog::Brightbox::Nullable::Image
22
+
23
+ Hash.send :include, Fog::Brightbox::Nullable::Interface
24
+ NilClass.send :include, Fog::Brightbox::Nullable::Interface
25
+
26
+ Hash.send :include, Fog::Brightbox::Nullable::Server
27
+ NilClass.send :include, Fog::Brightbox::Nullable::Server
28
+
29
+ Hash.send :include, Fog::Brightbox::Nullable::Zone
30
+ NilClass.send :include, Fog::Brightbox::Nullable::Zone
31
+
32
+ class Brightbox
33
+ module Compute
34
+ module TestSupport
35
+ # image img-9vxqi = Ubuntu Maverick 10.10 server
36
+ IMAGE_IDENTIFER = "img-9vxqi"
37
+ end
38
+ module Formats
39
+ module Nested
40
+ ACCOUNT = {
41
+ "name" => String,
42
+ "ram_used" => Integer,
43
+ "resource_type" => String,
44
+ "ram_limit" => Integer,
45
+ "url" => String,
46
+ "id" => String,
47
+ "status" => String,
48
+ "limits_cloudips" => Integer
49
+ }
50
+
51
+ API_CLIENT = {
52
+ "id" => String,
53
+ "resource_type" => String,
54
+ "url" => String,
55
+ "name" => String,
56
+ "description" => String
57
+ }
58
+
59
+ CLOUD_IP = {
60
+ "id" => String,
61
+ "resource_type" => String,
62
+ "url" => String,
63
+ "public_ip" => String,
64
+ "status" => String,
65
+ "reverse_dns" => String
66
+ }
67
+
68
+ IMAGE = {
69
+ "name" => String,
70
+ "created_at" => String,
71
+ "resource_type" => String,
72
+ "arch" => String,
73
+ "url" => String,
74
+ "id" => String,
75
+ "description" => String,
76
+ "source" => String,
77
+ "status" => String,
78
+ "owner" => String
79
+ }
80
+
81
+ INTERFACE = {
82
+ "resource_type" => String,
83
+ "url" => String,
84
+ "id" => String,
85
+ "ipv4_address" => String,
86
+ "mac_address" => String
87
+ }
88
+
89
+ SERVER = {
90
+ "id" => String,
91
+ "resource_type" => String,
92
+ "url" => String,
93
+ "name" => String,
94
+ "status" => String,
95
+ "hostname" => String,
96
+ "created_at" => String,
97
+ "started_at" => Fog::Brightbox::Nullable::String,
98
+ "deleted_at" => Fog::Brightbox::Nullable::String
99
+ }
100
+
101
+ SERVER_TYPE = {
102
+ "name" => String,
103
+ "cores" => Integer,
104
+ "created_at" => String,
105
+ "resource_type" => String,
106
+ "updated_at" => String,
107
+ "disk_size" => Integer,
108
+ "default" => Fog::Boolean,
109
+ "url" => String,
110
+ "id" => String,
111
+ "ram" => Integer,
112
+ "status" => String
113
+ }
114
+
115
+ USER = {
116
+ "id" => String,
117
+ "resource_type" => String,
118
+ "url" => String,
119
+ "name" => String,
120
+ "email_address" => String
121
+ }
122
+
123
+ ZONE = {
124
+ "id" => String,
125
+ "resource_type" => String,
126
+ "url" => String,
127
+ "handle" => Fog::Brightbox::Nullable::String
128
+ }
129
+ end
130
+
131
+ module Collected
132
+ API_CLIENT = {
133
+ "id" => String,
134
+ "resource_type" => String,
135
+ "url" => String,
136
+ "name" => String,
137
+ "description" => String,
138
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
139
+ }
140
+
141
+ CLOUD_IP = {
142
+ "id" => String,
143
+ "resource_type" => String,
144
+ "url" => String,
145
+ "public_ip" => String,
146
+ "status" => String,
147
+ "reverse_dns" => String,
148
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
149
+ "interface" => Fog::Brightbox::Nullable::Interface,
150
+ "server" => Fog::Brightbox::Nullable::String
151
+ }
152
+
153
+ IMAGE = {
154
+ "name" => String,
155
+ "created_at" => String,
156
+ "resource_type" => String,
157
+ "arch" => String,
158
+ "url" => String,
159
+ "id" => String,
160
+ "description" => String,
161
+ "source" => String,
162
+ "source_type" => String,
163
+ "status" => String,
164
+ "owner" => String,
165
+ "public" => Fog::Boolean,
166
+ "official" => Fog::Boolean,
167
+ "compatibility_mode" => Fog::Boolean,
168
+ "virtual_size" => Integer,
169
+ "disk_size" => Integer,
170
+ "ancestor" => Fog::Brightbox::Nullable::Image
171
+ }
172
+
173
+ SERVER = {
174
+ "id" => String,
175
+ "resource_type" => String,
176
+ "url" => String,
177
+ "name" => String,
178
+ "status" => String,
179
+ "hostname" => String,
180
+ "created_at" => String,
181
+ "started_at" => Fog::Brightbox::Nullable::String,
182
+ "deleted_at" => Fog::Brightbox::Nullable::String,
183
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
184
+ "server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
185
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
186
+ "image" => Brightbox::Compute::Formats::Nested::IMAGE,
187
+ "snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
188
+ "interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
189
+ "zone" => Fog::Brightbox::Nullable::Zone
190
+ }
191
+
192
+ SERVER_TYPE = {
193
+ "id" => String,
194
+ "resource_type" => String,
195
+ "url" => String,
196
+ "handle" => Fog::Brightbox::Nullable::String,
197
+ "name" => String,
198
+ "status" => String,
199
+ "cores" => Integer,
200
+ "ram" => Integer,
201
+ "disk_size" => Integer
202
+ }
203
+
204
+ USER = {
205
+ "id" => String,
206
+ "resource_type" => String,
207
+ "url" => String,
208
+ "name" => String,
209
+ "email_address" => String,
210
+ "email_verified" => Fog::Boolean,
211
+ "accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
212
+ "default_account" => NilClass
213
+ }
214
+
215
+ ZONE = {
216
+ "id" => String,
217
+ "resource_type" => String,
218
+ "url" => String,
219
+ "handle" => Fog::Brightbox::Nullable::String
220
+ }
221
+ end
222
+
223
+ module Full
224
+ ACCOUNT = {
225
+ "id" => String,
226
+ "resource_type" => String,
227
+ "url" => String,
228
+ "name" => String,
229
+ "status" => String,
230
+ "address_1" => String,
231
+ "address_2" => String,
232
+ "city" => String,
233
+ "county" => String,
234
+ "postcode" => String,
235
+ "country_code" => String,
236
+ "country_name" => String,
237
+ "vat_registration_number" => Fog::Brightbox::Nullable::String,
238
+ "telephone_number" => String,
239
+ "telephone_verified" => Fog::Boolean,
240
+ "created_at" => String,
241
+ "ram_limit" => Integer,
242
+ "ram_used" => Integer,
243
+ "limits_cloudips" => Integer,
244
+ "library_ftp_host" => String,
245
+ "library_ftp_user" => String,
246
+ "library_ftp_password" => Fog::Brightbox::Nullable::String,
247
+ "owner" => Brightbox::Compute::Formats::Nested::USER,
248
+ "users" => [Brightbox::Compute::Formats::Nested::USER],
249
+ "clients" => [Brightbox::Compute::Formats::Nested::API_CLIENT],
250
+ "servers" => [Brightbox::Compute::Formats::Nested::SERVER],
251
+ "images" => [Brightbox::Compute::Formats::Nested::IMAGE],
252
+ "zones" => [Brightbox::Compute::Formats::Nested::ZONE]
253
+ }
254
+
255
+ API_CLIENT = {
256
+ "id" => String,
257
+ "resource_type" => String,
258
+ "url" => String,
259
+ "name" => String,
260
+ "description" => String,
261
+ "secret" => Fog::Brightbox::Nullable::String,
262
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT
263
+ }
264
+
265
+ CLOUD_IP = {
266
+ "id" => String,
267
+ "resource_type" => String,
268
+ "url" => String,
269
+ "public_ip" => String,
270
+ "status" => String,
271
+ "reverse_dns" => String,
272
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
273
+ "interface" => Fog::Brightbox::Nullable::Interface,
274
+ "server" => Fog::Brightbox::Nullable::Server
275
+ }
276
+
277
+ IMAGE = {
278
+ "name" => String,
279
+ "created_at" => String,
280
+ "resource_type" => String,
281
+ "arch" => String,
282
+ "url" => String,
283
+ "id" => String,
284
+ "description" => String,
285
+ "source" => String,
286
+ "source_type" => String,
287
+ "status" => String,
288
+ "owner" => String, # Account ID not object
289
+ "public" => Fog::Boolean,
290
+ "official" => Fog::Boolean,
291
+ "compatibility_mode" => Fog::Boolean,
292
+ "virtual_size" => Integer,
293
+ "disk_size" => Integer,
294
+ "ancestor" => Fog::Brightbox::Nullable::Image
295
+ }
296
+
297
+ INTERFACE = {
298
+ "resource_type" => String,
299
+ "url" => String,
300
+ "id" => String,
301
+ "ipv4_address" => String,
302
+ "mac_address" => String,
303
+ "server" => Brightbox::Compute::Formats::Nested::SERVER
304
+ }
305
+
306
+ SERVER = {
307
+ "id" => String,
308
+ "resource_type" => String,
309
+ "url" => String,
310
+ "name" => String,
311
+ "status" => String,
312
+ "hostname" => String,
313
+ "created_at" => String,
314
+ "started_at" => Fog::Brightbox::Nullable::String,
315
+ "deleted_at" => Fog::Brightbox::Nullable::String,
316
+ "user_data" => Fog::Brightbox::Nullable::String,
317
+ "account" => Brightbox::Compute::Formats::Nested::ACCOUNT,
318
+ "server_type" => Brightbox::Compute::Formats::Nested::SERVER_TYPE,
319
+ "cloud_ips" => [Brightbox::Compute::Formats::Nested::CLOUD_IP],
320
+ "image" => Brightbox::Compute::Formats::Nested::IMAGE,
321
+ "snapshots" => [Brightbox::Compute::Formats::Nested::IMAGE],
322
+ "interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
323
+ "zone" => Brightbox::Compute::Formats::Nested::ZONE
324
+ }
325
+
326
+ SERVER_TYPE = {
327
+ "id" => String,
328
+ "resource_type" => String,
329
+ "url" => String,
330
+ "handle" => Fog::Brightbox::Nullable::String,
331
+ "name" => String,
332
+ "status" => String,
333
+ "cores" => Integer,
334
+ "ram" => Integer,
335
+ "disk_size" => Integer
336
+ }
337
+
338
+ USER = {
339
+ "id" => String,
340
+ "resource_type" => String,
341
+ "url" => String,
342
+ "name" => String,
343
+ "email_address" => String,
344
+ "email_verified" => Fog::Boolean,
345
+ "accounts" => [Brightbox::Compute::Formats::Nested::ACCOUNT],
346
+ "default_account" => Fog::Brightbox::Nullable::Account,
347
+ "ssh_key" => Fog::Brightbox::Nullable::String
348
+ }
349
+
350
+ ZONE = {
351
+ "id" => String,
352
+ "resource_type" => String,
353
+ "url" => String,
354
+ "handle" => Fog::Brightbox::Nullable::String
355
+ }
356
+ end
357
+
358
+ module Collection
359
+ API_CLIENTS = [Brightbox::Compute::Formats::Collected::API_CLIENT]
360
+ CLOUD_IPS = [Brightbox::Compute::Formats::Collected::CLOUD_IP]
361
+ IMAGES = [Brightbox::Compute::Formats::Collected::IMAGE]
362
+ SERVERS = [Brightbox::Compute::Formats::Collected::SERVER]
363
+ SERVER_TYPES = [Brightbox::Compute::Formats::Collected::SERVER_TYPE]
364
+ USERS = [Brightbox::Compute::Formats::Collected::USER]
365
+ ZONES = [Brightbox::Compute::Formats::Collected::ZONE]
366
+ end
367
+
368
+ end
369
+ end
370
+ end
@@ -0,0 +1,29 @@
1
+ Shindo.tests('Brightbox::Compute | account requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ tests("#get_account()").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
6
+ Brightbox[:compute].get_account()
7
+ end
8
+
9
+ original_name = Brightbox[:compute].get_account["name"]
10
+ update_args = {:name => "New name from Fog test"}
11
+ tests("#update_account(#{update_args.inspect})").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
12
+ Brightbox[:compute].update_account(update_args)
13
+ end
14
+ Brightbox[:compute].update_account(:name => original_name)
15
+
16
+ tests("#reset_ftp_password_account()").formats(Brightbox::Compute::Formats::Full::ACCOUNT) do
17
+ Brightbox[:compute].reset_ftp_password_account()
18
+ end
19
+
20
+ end
21
+
22
+ tests('failure') do
23
+
24
+ tests("#update_account()").returns(nil) do
25
+ Brightbox[:compute].update_account()
26
+ end
27
+ end
28
+
29
+ end
@@ -0,0 +1,41 @@
1
+ Shindo.tests('Brightbox::Compute | api client requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ create_options = {:name => "Name from Fog test (#{Time.now.to_i})", :description => "Description from Fog test"}
6
+ tests("#create_api_client(#{create_options.inspect})").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
7
+ data = Brightbox[:compute].create_api_client(create_options)
8
+ @api_client_id = data["id"]
9
+ data
10
+ end
11
+
12
+ tests("#list_api_clients()").formats(Brightbox::Compute::Formats::Collection::API_CLIENTS) do
13
+ Brightbox[:compute].list_api_clients()
14
+ end
15
+
16
+ tests("#get_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
17
+ Brightbox[:compute].get_api_client(@api_client_id)
18
+ end
19
+
20
+ tests("#update_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
21
+ Brightbox[:compute].update_api_client(@api_client_id, :name => "New name from Fog test")
22
+ end
23
+
24
+ tests("#destroy_api_client('#{@api_client_id}')").formats(Brightbox::Compute::Formats::Full::API_CLIENT) do
25
+ Brightbox[:compute].destroy_api_client(@api_client_id)
26
+ end
27
+
28
+ end
29
+
30
+ tests('failure') do
31
+
32
+ tests("#get_api_client('cli-00000')").raises(Excon::Errors::NotFound) do
33
+ Brightbox[:compute].get_api_client('cli-00000')
34
+ end
35
+
36
+ tests("#get_api_client()").raises(ArgumentError) do
37
+ Brightbox[:compute].get_api_client()
38
+ end
39
+ end
40
+
41
+ end
@@ -0,0 +1,49 @@
1
+ Shindo.tests('Brightbox::Compute | cloud ip requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ tests("#create_cloud_ip()").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
6
+ data = Brightbox[:compute].create_cloud_ip()
7
+ @cloud_ip_id = data["id"]
8
+ data
9
+ end
10
+
11
+ tests("#list_cloud_ips()").formats(Brightbox::Compute::Formats::Collection::CLOUD_IPS) do
12
+ Brightbox[:compute].list_cloud_ips()
13
+ end
14
+
15
+ tests("#get_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
16
+ Brightbox[:compute].get_cloud_ip(@cloud_ip_id)
17
+ end
18
+
19
+ server = Brightbox[:compute].servers.first
20
+ interface_id = server.interfaces.first["id"]
21
+ map_options = {:interface => interface_id}
22
+ tests("#map_cloud_ip('#{@cloud_ip_id}', #{map_options.inspect})").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
23
+ Brightbox[:compute].map_cloud_ip(@cloud_ip_id, map_options)
24
+ end
25
+
26
+ Brightbox[:compute].cloud_ips.get(@cloud_ip_id).wait_for { mapped? }
27
+
28
+ tests("#unmap_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
29
+ Brightbox[:compute].unmap_cloud_ip(@cloud_ip_id)
30
+ end
31
+
32
+ tests("#destroy_cloud_ip('#{@cloud_ip_id}')").formats(Brightbox::Compute::Formats::Full::CLOUD_IP) do
33
+ Brightbox[:compute].destroy_cloud_ip(@cloud_ip_id)
34
+ end
35
+
36
+ end
37
+
38
+ tests('failure') do
39
+
40
+ tests("#get_cloud_ip('cip-00000')").raises(Excon::Errors::NotFound) do
41
+ Brightbox[:compute].get_cloud_ip('cip-00000')
42
+ end
43
+
44
+ tests("#get_cloud_ip()").raises(ArgumentError) do
45
+ Brightbox[:compute].get_cloud_ip()
46
+ end
47
+ end
48
+
49
+ end
@@ -0,0 +1,52 @@
1
+ Shindo.tests('Brightbox::Compute | image requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ ## Difficult to test without having uploaded an Image to your account to register
6
+ # creation_options = {
7
+ # "arch" => "i686",
8
+ # "source" => "fnord"
9
+ # }
10
+ # tests("#create_image(#{creation_options.inspect})").formats(Brightbox::Compute::Formats::Full::IMAGE) do
11
+ # data = Brightbox[:compute].create_image(creation_options)
12
+ # @image_id = data["id"]
13
+ # data
14
+ # end
15
+
16
+ # Brightbox[:compute].images.get(@image_id).wait_for { ready? }
17
+
18
+ tests("#list_images()").formats(Brightbox::Compute::Formats::Collection::IMAGES) do
19
+ data = Brightbox[:compute].list_images()
20
+ @image_id = data.first["id"]
21
+ data
22
+ end
23
+
24
+ tests("#get_image('#{@image_id}')").formats(Brightbox::Compute::Formats::Full::IMAGE) do
25
+ Brightbox[:compute].get_image(@image_id)
26
+ end
27
+
28
+ ## Until Image creation can be automated, we shouldn't be updating Images randomly
29
+ # update_options = {}
30
+ # tests("#update_image('#{@image_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::IMAGE) do
31
+ # Brightbox[:compute].update_image(@image_id, :name => "New name from Fog test")
32
+ # end
33
+
34
+ ## Same as other tests - can't be deleting them unless part of the test run
35
+ # tests("#destroy_server('#{@image_id}')").formats(Brightbox::Compute::Formats::Full::IMAGE) do
36
+ # Brightbox[:compute].destroy_image(@image_id)
37
+ # end
38
+
39
+ end
40
+
41
+ tests('failure') do
42
+
43
+ tests("#get_image('img-00000')").raises(Excon::Errors::NotFound) do
44
+ Brightbox[:compute].get_image('img-00000')
45
+ end
46
+
47
+ tests("#get_image()").raises(ArgumentError) do
48
+ Brightbox[:compute].get_image()
49
+ end
50
+ end
51
+
52
+ end
@@ -0,0 +1,24 @@
1
+ Shindo.tests('Brightbox::Compute | interface requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ server = Brightbox[:compute].servers.first
6
+ @interface_id = server.interfaces.first["id"]
7
+ tests("#get_interface('#{@interface_id}')").formats(Brightbox::Compute::Formats::Full::INTERFACE) do
8
+ Brightbox[:compute].get_interface(@interface_id)
9
+ end
10
+
11
+ end
12
+
13
+ tests('failure') do
14
+
15
+ tests("#get_interface('int-00000')").raises(Excon::Errors::Forbidden) do
16
+ Brightbox[:compute].get_interface('int-00000')
17
+ end
18
+
19
+ tests("#get_interface()").raises(ArgumentError) do
20
+ Brightbox[:compute].get_interface()
21
+ end
22
+ end
23
+
24
+ end
@@ -0,0 +1,57 @@
1
+ Shindo.tests('Brightbox::Compute | server requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ image_id = Brightbox::Compute::TestSupport::IMAGE_IDENTIFER
6
+ server_id = nil
7
+
8
+ tests("#create_server(:image => '#{image_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
9
+ data = Brightbox[:compute].create_server(:image => image_id)
10
+ server_id = data["id"]
11
+ data
12
+ end
13
+
14
+ Brightbox[:compute].servers.get(server_id).wait_for { ready? }
15
+
16
+ tests("#list_servers()").formats(Brightbox::Compute::Formats::Collection::SERVERS) do
17
+ Brightbox[:compute].list_servers()
18
+ end
19
+
20
+ tests("#get_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
21
+ Brightbox[:compute].get_server(server_id)
22
+ end
23
+
24
+ tests("#update_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
25
+ Brightbox[:compute].update_server(server_id, :name => "New name from Fog test")
26
+ end
27
+
28
+ tests("#stop_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
29
+ Brightbox[:compute].stop_server(server_id)
30
+ end
31
+
32
+ tests("#start_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
33
+ Brightbox[:compute].start_server(server_id)
34
+ end
35
+
36
+ tests("#shutdown_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
37
+ Brightbox[:compute].shutdown_server(server_id)
38
+ end
39
+
40
+ tests("#destroy_server('#{server_id}')").formats(Brightbox::Compute::Formats::Full::SERVER) do
41
+ Brightbox[:compute].destroy_server(server_id)
42
+ end
43
+
44
+ end
45
+
46
+ tests('failure') do
47
+
48
+ tests("#get_server('srv-00000')").raises(Excon::Errors::NotFound) do
49
+ Brightbox[:compute].get_server('srv-00000')
50
+ end
51
+
52
+ tests("#get_server()").raises(ArgumentError) do
53
+ Brightbox[:compute].get_server()
54
+ end
55
+ end
56
+
57
+ end
@@ -0,0 +1,28 @@
1
+ Shindo.tests('Brightbox::Compute | server type requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ tests("#list_server_types()").formats(Brightbox::Compute::Formats::Collection::SERVER_TYPES) do
6
+ data = Brightbox[:compute].list_server_types()
7
+ @server_type_id = data.first["id"]
8
+ data
9
+ end
10
+
11
+ tests("#get_server_type('#{@server_type_id}')").formats(Brightbox::Compute::Formats::Full::SERVER_TYPE) do
12
+ Brightbox[:compute].get_server_type(@server_type_id)
13
+ end
14
+
15
+ end
16
+
17
+ tests('failure') do
18
+
19
+ tests("#get_server_type('typ-00000')").raises(Excon::Errors::NotFound) do
20
+ Brightbox[:compute].get_server_type('typ-00000')
21
+ end
22
+
23
+ tests("#get_server()").raises(ArgumentError) do
24
+ Brightbox[:compute].get_server_type()
25
+ end
26
+ end
27
+
28
+ end
@@ -0,0 +1,33 @@
1
+ Shindo.tests('Brightbox::Compute | user requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ tests("#list_users()").formats(Brightbox::Compute::Formats::Collection::USERS) do
6
+ data = Brightbox[:compute].list_users()
7
+ @user_id = data.first["id"]
8
+ data
9
+ end
10
+
11
+ tests("#get_user('#{@user_id}')").formats(Brightbox::Compute::Formats::Full::USER) do
12
+ data = Brightbox[:compute].get_user(@user_id)
13
+ @original_name = data["name"]
14
+ data
15
+ end
16
+
17
+ update_options = { :name => "New name from Fog" }
18
+ tests("#update_user('#{@user_id}', #{update_options.inspect})").formats(Brightbox::Compute::Formats::Full::USER) do
19
+ Brightbox[:compute].update_user(@user_id, update_options)
20
+ end
21
+ Brightbox[:compute].update_user(@user_id, :name => @original_name)
22
+
23
+ end
24
+
25
+ tests('failure') do
26
+
27
+ tests("#update_user()").raises(ArgumentError) do
28
+ Brightbox[:compute].update_user()
29
+ end
30
+
31
+ end
32
+
33
+ end
@@ -0,0 +1,28 @@
1
+ Shindo.tests('Brightbox::Compute | zone requests', ['brightbox']) do
2
+
3
+ tests('success') do
4
+
5
+ tests("#list_zones()").formats(Brightbox::Compute::Formats::Collection::ZONES) do
6
+ data = Brightbox[:compute].list_zones()
7
+ @zone_id = data.first["id"]
8
+ data
9
+ end
10
+
11
+ tests("#get_zone('#{@zone_id}')").formats(Brightbox::Compute::Formats::Full::ZONE) do
12
+ Brightbox[:compute].get_zone(@zone_id)
13
+ end
14
+
15
+ end
16
+
17
+ tests('failure') do
18
+
19
+ tests("#get_zone('zon-00000')").raises(Excon::Errors::NotFound) do
20
+ Brightbox[:compute].get_zone('zon-00000')
21
+ end
22
+
23
+ tests("#get_zone()").raises(ArgumentError) do
24
+ Brightbox[:compute].get_zone()
25
+ end
26
+ end
27
+
28
+ end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 45
4
5
  prerelease: false
5
6
  segments:
6
7
  - 0
7
8
  - 3
8
- - 30
9
- version: 0.3.30
9
+ - 31
10
+ version: 0.3.31
10
11
  platform: ruby
11
12
  authors:
12
13
  - geemus (Wesley Beary)
@@ -14,167 +15,191 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-12-08 00:00:00 -08:00
18
+ date: 2010-12-10 00:00:00 -08:00
18
19
  default_executable: fog
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
- prerelease: false
22
- type: :runtime
23
- version_requirements: &id001 !ruby/object:Gem::Requirement
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
24
  requirements:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
+ hash: 3
27
28
  segments:
28
29
  - 0
29
30
  version: "0"
30
- requirement: *id001
31
+ type: :runtime
31
32
  name: builder
32
- - !ruby/object:Gem::Dependency
33
33
  prerelease: false
34
- type: :runtime
35
- version_requirements: &id002 !ruby/object:Gem::Requirement
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ requirement: &id002 !ruby/object:Gem::Requirement
37
+ none: false
36
38
  requirements:
37
39
  - - ">="
38
40
  - !ruby/object:Gem::Version
41
+ hash: 21
39
42
  segments:
40
43
  - 0
41
- - 2
42
- - 8
43
- version: 0.2.8
44
- requirement: *id002
44
+ - 3
45
+ - 3
46
+ version: 0.3.3
47
+ type: :runtime
45
48
  name: excon
46
- - !ruby/object:Gem::Dependency
47
49
  prerelease: false
48
- type: :runtime
49
- version_requirements: &id003 !ruby/object:Gem::Requirement
50
+ version_requirements: *id002
51
+ - !ruby/object:Gem::Dependency
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
50
54
  requirements:
51
55
  - - ">="
52
56
  - !ruby/object:Gem::Version
57
+ hash: 63
53
58
  segments:
54
59
  - 0
55
60
  - 0
56
61
  - 16
57
62
  version: 0.0.16
58
- requirement: *id003
63
+ type: :runtime
59
64
  name: formatador
60
- - !ruby/object:Gem::Dependency
61
65
  prerelease: false
62
- type: :runtime
63
- version_requirements: &id004 !ruby/object:Gem::Requirement
66
+ version_requirements: *id003
67
+ - !ruby/object:Gem::Dependency
68
+ requirement: &id004 !ruby/object:Gem::Requirement
69
+ none: false
64
70
  requirements:
65
71
  - - ">="
66
72
  - !ruby/object:Gem::Version
73
+ hash: 3
67
74
  segments:
68
75
  - 0
69
76
  version: "0"
70
- requirement: *id004
77
+ type: :runtime
71
78
  name: json
72
- - !ruby/object:Gem::Dependency
73
79
  prerelease: false
74
- type: :runtime
75
- version_requirements: &id005 !ruby/object:Gem::Requirement
80
+ version_requirements: *id004
81
+ - !ruby/object:Gem::Dependency
82
+ requirement: &id005 !ruby/object:Gem::Requirement
83
+ none: false
76
84
  requirements:
77
85
  - - ">="
78
86
  - !ruby/object:Gem::Version
87
+ hash: 3
79
88
  segments:
80
89
  - 0
81
90
  version: "0"
82
- requirement: *id005
91
+ type: :runtime
83
92
  name: mime-types
84
- - !ruby/object:Gem::Dependency
85
93
  prerelease: false
86
- type: :runtime
87
- version_requirements: &id006 !ruby/object:Gem::Requirement
94
+ version_requirements: *id005
95
+ - !ruby/object:Gem::Dependency
96
+ requirement: &id006 !ruby/object:Gem::Requirement
97
+ none: false
88
98
  requirements:
89
99
  - - ">="
90
100
  - !ruby/object:Gem::Version
101
+ hash: 61
91
102
  segments:
92
103
  - 0
93
104
  - 0
94
105
  - 17
95
106
  version: 0.0.17
96
- requirement: *id006
107
+ type: :runtime
97
108
  name: named-parameters
98
- - !ruby/object:Gem::Dependency
99
109
  prerelease: false
100
- type: :runtime
101
- version_requirements: &id007 !ruby/object:Gem::Requirement
110
+ version_requirements: *id006
111
+ - !ruby/object:Gem::Dependency
112
+ requirement: &id007 !ruby/object:Gem::Requirement
113
+ none: false
102
114
  requirements:
103
115
  - - ">="
104
116
  - !ruby/object:Gem::Version
117
+ hash: 33
105
118
  segments:
106
119
  - 2
107
120
  - 0
108
121
  - 23
109
122
  version: 2.0.23
110
- requirement: *id007
123
+ type: :runtime
111
124
  name: net-ssh
112
- - !ruby/object:Gem::Dependency
113
125
  prerelease: false
114
- type: :runtime
115
- version_requirements: &id008 !ruby/object:Gem::Requirement
126
+ version_requirements: *id007
127
+ - !ruby/object:Gem::Dependency
128
+ requirement: &id008 !ruby/object:Gem::Requirement
129
+ none: false
116
130
  requirements:
117
131
  - - ">="
118
132
  - !ruby/object:Gem::Version
133
+ hash: 15
119
134
  segments:
120
135
  - 1
121
136
  - 4
122
137
  - 4
123
138
  version: 1.4.4
124
- requirement: *id008
139
+ type: :runtime
125
140
  name: nokogiri
126
- - !ruby/object:Gem::Dependency
127
141
  prerelease: false
128
- type: :runtime
129
- version_requirements: &id009 !ruby/object:Gem::Requirement
142
+ version_requirements: *id008
143
+ - !ruby/object:Gem::Dependency
144
+ requirement: &id009 !ruby/object:Gem::Requirement
145
+ none: false
130
146
  requirements:
131
147
  - - ">="
132
148
  - !ruby/object:Gem::Version
149
+ hash: 3
133
150
  segments:
134
151
  - 0
135
152
  version: "0"
136
- requirement: *id009
153
+ type: :runtime
137
154
  name: ruby-hmac
138
- - !ruby/object:Gem::Dependency
139
155
  prerelease: false
140
- type: :development
141
- version_requirements: &id010 !ruby/object:Gem::Requirement
156
+ version_requirements: *id009
157
+ - !ruby/object:Gem::Dependency
158
+ requirement: &id010 !ruby/object:Gem::Requirement
159
+ none: false
142
160
  requirements:
143
161
  - - ">="
144
162
  - !ruby/object:Gem::Version
163
+ hash: 3
145
164
  segments:
146
165
  - 0
147
166
  version: "0"
148
- requirement: *id010
167
+ type: :development
149
168
  name: rake
150
- - !ruby/object:Gem::Dependency
151
169
  prerelease: false
152
- type: :development
153
- version_requirements: &id011 !ruby/object:Gem::Requirement
170
+ version_requirements: *id010
171
+ - !ruby/object:Gem::Dependency
172
+ requirement: &id011 !ruby/object:Gem::Requirement
173
+ none: false
154
174
  requirements:
155
175
  - - "="
156
176
  - !ruby/object:Gem::Version
177
+ hash: 25
157
178
  segments:
158
179
  - 1
159
180
  - 3
160
181
  - 1
161
182
  version: 1.3.1
162
- requirement: *id011
183
+ type: :development
163
184
  name: rspec
164
- - !ruby/object:Gem::Dependency
165
185
  prerelease: false
166
- type: :development
167
- version_requirements: &id012 !ruby/object:Gem::Requirement
186
+ version_requirements: *id011
187
+ - !ruby/object:Gem::Dependency
188
+ requirement: &id012 !ruby/object:Gem::Requirement
189
+ none: false
168
190
  requirements:
169
191
  - - "="
170
192
  - !ruby/object:Gem::Version
193
+ hash: 15
171
194
  segments:
172
195
  - 0
173
196
  - 1
174
197
  - 10
175
198
  version: 0.1.10
176
- requirement: *id012
199
+ type: :development
177
200
  name: shindo
201
+ prerelease: false
202
+ version_requirements: *id012
178
203
  description: The Ruby cloud computing library.
179
204
  email: geemus@gmail.com
180
205
  executables:
@@ -887,6 +912,15 @@ files:
887
912
  - tests/brightbox/models/compute/flavors_tests.rb
888
913
  - tests/brightbox/models/compute/server_tests.rb
889
914
  - tests/brightbox/models/compute/servers_tests.rb
915
+ - tests/brightbox/requests/compute/account_tests.rb
916
+ - tests/brightbox/requests/compute/api_client_tests.rb
917
+ - tests/brightbox/requests/compute/cloud_ip_tests.rb
918
+ - tests/brightbox/requests/compute/image_tests.rb
919
+ - tests/brightbox/requests/compute/interface_tests.rb
920
+ - tests/brightbox/requests/compute/server_tests.rb
921
+ - tests/brightbox/requests/compute/server_type_tests.rb
922
+ - tests/brightbox/requests/compute/user_tests.rb
923
+ - tests/brightbox/requests/compute/zone_tests.rb
890
924
  - tests/go_grid/helper.rb
891
925
  - tests/go_grid/requests/compute/image_tests.rb
892
926
  - tests/google/models/storage/directories_tests.rb
@@ -949,23 +983,27 @@ rdoc_options:
949
983
  require_paths:
950
984
  - lib
951
985
  required_ruby_version: !ruby/object:Gem::Requirement
986
+ none: false
952
987
  requirements:
953
988
  - - ">="
954
989
  - !ruby/object:Gem::Version
990
+ hash: 3
955
991
  segments:
956
992
  - 0
957
993
  version: "0"
958
994
  required_rubygems_version: !ruby/object:Gem::Requirement
995
+ none: false
959
996
  requirements:
960
997
  - - ">="
961
998
  - !ruby/object:Gem::Version
999
+ hash: 3
962
1000
  segments:
963
1001
  - 0
964
1002
  version: "0"
965
1003
  requirements: []
966
1004
 
967
1005
  rubyforge_project: fog
968
- rubygems_version: 1.3.6
1006
+ rubygems_version: 1.3.7
969
1007
  signing_key:
970
1008
  specification_version: 2
971
1009
  summary: brings clouds to you