fog 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. data/Rakefile +1 -0
  2. data/changelog.txt +91 -0
  3. data/fog.gemspec +3 -3
  4. data/lib/fog.rb +1 -1
  5. data/lib/fog/aws/compute.rb +5 -4
  6. data/lib/fog/aws/models/compute/security_group.rb +7 -1
  7. data/lib/fog/aws/models/compute/subnet.rb +0 -1
  8. data/lib/fog/aws/parsers/compute/create_security_group.rb +24 -0
  9. data/lib/fog/aws/requests/cloud_watch/get_metric_statistics.rb +1 -1
  10. data/lib/fog/aws/requests/compute/authorize_security_group_ingress.rb +19 -11
  11. data/lib/fog/aws/requests/compute/create_security_group.rb +5 -3
  12. data/lib/fog/aws/requests/compute/describe_security_groups.rb +1 -1
  13. data/lib/fog/aws/requests/storage/get_object_http_url.rb +2 -2
  14. data/lib/fog/aws/requests/storage/get_object_https_url.rb +2 -2
  15. data/lib/fog/aws/simpledb.rb +6 -1
  16. data/lib/fog/bin.rb +1 -0
  17. data/lib/fog/bin/ibm.rb +34 -0
  18. data/lib/fog/compute.rb +3 -0
  19. data/lib/fog/core/errors.rb +2 -0
  20. data/lib/fog/ibm.rb +176 -0
  21. data/lib/fog/ibm/compute.rb +233 -0
  22. data/lib/fog/ibm/models/compute/address.rb +62 -0
  23. data/lib/fog/ibm/models/compute/addresses.rb +28 -0
  24. data/lib/fog/ibm/models/compute/image.rb +61 -0
  25. data/lib/fog/ibm/models/compute/images.rb +27 -0
  26. data/lib/fog/ibm/models/compute/instance-type.rb +14 -0
  27. data/lib/fog/ibm/models/compute/instance-types.rb +15 -0
  28. data/lib/fog/ibm/models/compute/key.rb +35 -0
  29. data/lib/fog/ibm/models/compute/keys.rb +35 -0
  30. data/lib/fog/ibm/models/compute/location.rb +15 -0
  31. data/lib/fog/ibm/models/compute/locations.rb +27 -0
  32. data/lib/fog/ibm/models/compute/server.rb +193 -0
  33. data/lib/fog/ibm/models/compute/servers.rb +27 -0
  34. data/lib/fog/ibm/models/storage/offering.rb +18 -0
  35. data/lib/fog/ibm/models/storage/offerings.rb +19 -0
  36. data/lib/fog/ibm/models/storage/volume.rb +95 -0
  37. data/lib/fog/ibm/models/storage/volumes.rb +27 -0
  38. data/lib/fog/ibm/requests/compute/clone_image.rb +48 -0
  39. data/lib/fog/ibm/requests/compute/create_address.rb +50 -0
  40. data/lib/fog/ibm/requests/compute/create_image.rb +56 -0
  41. data/lib/fog/ibm/requests/compute/create_instance.rb +80 -0
  42. data/lib/fog/ibm/requests/compute/create_key.rb +61 -0
  43. data/lib/fog/ibm/requests/compute/delete_address.rb +46 -0
  44. data/lib/fog/ibm/requests/compute/delete_image.rb +43 -0
  45. data/lib/fog/ibm/requests/compute/delete_instance.rb +52 -0
  46. data/lib/fog/ibm/requests/compute/delete_key.rb +41 -0
  47. data/lib/fog/ibm/requests/compute/get_image.rb +67 -0
  48. data/lib/fog/ibm/requests/compute/get_image_agreement.rb +66 -0
  49. data/lib/fog/ibm/requests/compute/get_image_manifest.rb +39 -0
  50. data/lib/fog/ibm/requests/compute/get_instance.rb +76 -0
  51. data/lib/fog/ibm/requests/compute/get_instance_logs.rb +25 -0
  52. data/lib/fog/ibm/requests/compute/get_key.rb +49 -0
  53. data/lib/fog/ibm/requests/compute/get_location.rb +55 -0
  54. data/lib/fog/ibm/requests/compute/get_request.rb +78 -0
  55. data/lib/fog/ibm/requests/compute/list_address_offerings.rb +58 -0
  56. data/lib/fog/ibm/requests/compute/list_addresses.rb +53 -0
  57. data/lib/fog/ibm/requests/compute/list_images.rb +58 -0
  58. data/lib/fog/ibm/requests/compute/list_instances.rb +57 -0
  59. data/lib/fog/ibm/requests/compute/list_keys.rb +57 -0
  60. data/lib/fog/ibm/requests/compute/list_locations.rb +37 -0
  61. data/lib/fog/ibm/requests/compute/list_vlans.rb +52 -0
  62. data/lib/fog/ibm/requests/compute/modify_instance.rb +71 -0
  63. data/lib/fog/ibm/requests/compute/modify_key.rb +52 -0
  64. data/lib/fog/ibm/requests/storage/create_volume.rb +66 -0
  65. data/lib/fog/ibm/requests/storage/delete_volume.rb +42 -0
  66. data/lib/fog/ibm/requests/storage/get_volume.rb +72 -0
  67. data/lib/fog/ibm/requests/storage/list_offerings.rb +76 -0
  68. data/lib/fog/ibm/requests/storage/list_volumes.rb +47 -0
  69. data/lib/fog/ibm/storage.rb +82 -0
  70. data/lib/fog/ovirt/compute.rb +1 -0
  71. data/lib/fog/ovirt/models/compute/server.rb +5 -0
  72. data/lib/fog/ovirt/requests/compute/vm_ticket.rb +21 -0
  73. data/lib/fog/providers.rb +1 -0
  74. data/lib/fog/storage.rb +3 -0
  75. data/tests/aws/requests/compute/security_group_tests.rb +37 -39
  76. data/tests/compute/helper.rb +4 -0
  77. data/tests/compute/models/flavors_tests.rb +1 -1
  78. data/tests/helper.rb +1 -1
  79. data/tests/helpers/mock_helper.rb +2 -0
  80. data/tests/ibm/models/compute/image_tests.rb +10 -0
  81. data/tests/ibm/models/compute/key_tests.rb +23 -0
  82. data/tests/ibm/models/compute/keys_tests.rb +35 -0
  83. data/tests/ibm/models/compute/locations_tests.rb +18 -0
  84. data/tests/ibm/models/compute/server_tests.rb +88 -0
  85. data/tests/ibm/models/compute/servers_tests.rb +37 -0
  86. data/tests/ibm/models/storage/volume_tests.rb +60 -0
  87. data/tests/ibm/requests/compute/address_tests.rb +44 -0
  88. data/tests/ibm/requests/compute/image_tests.rb +110 -0
  89. data/tests/ibm/requests/compute/instance_tests.rb +102 -0
  90. data/tests/ibm/requests/compute/key_tests.rb +50 -0
  91. data/tests/ibm/requests/compute/location_tests.rb +28 -0
  92. data/tests/ibm/requests/storage/volume_tests.rb +100 -0
  93. metadata +122 -43
@@ -0,0 +1,47 @@
1
+ module Fog
2
+ module Storage
3
+ class IBM
4
+ class Real
5
+
6
+ # Returns the list of storage volumes
7
+ #
8
+ # ==== Parameters
9
+ # No parameters
10
+ #
11
+ # ==== Returns
12
+ # * response<~Excon::Response>:
13
+ # * body<~Hash>:
14
+ # * 'volumes'<~Array>: list of images
15
+ # * 'name'<~String>: Name of image
16
+ # * 'format'<~String>: filesystem volume is formatted with
17
+ # * 'location'<~String>: datacenter location string
18
+ # * 'createdTime'<~Integer>: creation time in Epoch int
19
+ # * 'size'<~String>: size in GB's (as a string)
20
+ # * 'productCodes'<~Array>: unsure..
21
+ # * 'offeringId'<~String>:
22
+ # * 'id'<~String>: volume id
23
+ # * 'owner'<~String>: owner's email address
24
+ # * 'state'<~Integer>: known so far: 4 provisioned, unattached; 5 provisioned, attached
25
+ def list_volumes
26
+ request(
27
+ :method => 'GET',
28
+ :expects => 200,
29
+ :path => '/storage'
30
+ )
31
+ end
32
+
33
+ end
34
+
35
+ class Mock
36
+
37
+ def list_volumes
38
+ response = Excon::Response.new
39
+ response.status = 200
40
+ response.body = { 'volumes' => format_list_volumes_response }
41
+ response
42
+ end
43
+
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,82 @@
1
+ require File.expand_path(File.join(File.dirname(__FILE__), '..', 'ibm'))
2
+ require 'fog/storage'
3
+
4
+ module Fog
5
+ module Storage
6
+ class IBM < Fog::Service
7
+
8
+ requires :ibm_username, :ibm_password
9
+ recognizes :location
10
+
11
+ model_path 'fog/ibm/models/storage'
12
+
13
+ model :offering
14
+ collection :offerings
15
+ model :volume
16
+ collection :volumes
17
+
18
+ request_path 'fog/ibm/requests/storage'
19
+
20
+ request :list_offerings
21
+
22
+ request :list_volumes
23
+ request :create_volume
24
+ request :delete_volume
25
+ request :get_volume
26
+
27
+ class Real
28
+ def initialize(options={})
29
+ @connection = Fog::IBM::Connection.new(options[:ibm_username], options[:ibm_password])
30
+ end
31
+
32
+ private
33
+
34
+ def request(options)
35
+ begin
36
+ @connection.request(options)
37
+ rescue Excon::Errors::HTTPStatusError => error
38
+ raise case error
39
+ when Excon::Errors::NotFound
40
+ Fog::Storage::IBM::NotFound.slurp(error)
41
+ else
42
+ error
43
+ end
44
+ end
45
+ end
46
+
47
+ end
48
+
49
+ class Mock
50
+
51
+ def self.data
52
+ @data ||= Hash.new do |hash, key|
53
+ hash[key] = {
54
+ :volumes => {},
55
+ }
56
+ end
57
+ end
58
+
59
+ def self.reset
60
+ @data = nil
61
+ end
62
+
63
+ def data
64
+ self.class.data[@ibm_username]
65
+ end
66
+
67
+ def reset_data
68
+ self.class.data.delete(@ibm_username)
69
+ @data = self.class.data[@ibm_username]
70
+ end
71
+
72
+ def initialize(options={})
73
+ @ibm_username = options[:ibm_username]
74
+ @ibm_password = options[:ibm_password]
75
+ @data = self.class.data[@ibm_username]
76
+ end
77
+
78
+ end
79
+
80
+ end
81
+ end
82
+ end
@@ -36,6 +36,7 @@ module Fog
36
36
  request :list_vm_interfaces
37
37
  request :list_template_interfaces
38
38
  request :list_networks
39
+ request :vm_ticket
39
40
 
40
41
  module Shared
41
42
  # converts an OVIRT object into an hash for fog to consume.
@@ -92,6 +92,11 @@ module Fog
92
92
  connection.destroy_vm(:id => id)
93
93
  end
94
94
 
95
+ def ticket(options = {})
96
+ raise "Can not set console ticket, Server is not ready. Server status: #{status}" unless ready?
97
+ connection.vm_ticket(id, options)
98
+ end
99
+
95
100
  def save
96
101
  if identity
97
102
  connection.update_vm(attributes)
@@ -0,0 +1,21 @@
1
+ module Fog
2
+ module Compute
3
+ class Ovirt
4
+ class Real
5
+
6
+ def vm_ticket(id, options = {})
7
+ client.set_ticket(id, options)
8
+ end
9
+
10
+ end
11
+
12
+ class Mock
13
+
14
+ def vm_ticket(id, options = {})
15
+ "Secret"
16
+ end
17
+
18
+ end
19
+ end
20
+ end
21
+ end
@@ -10,6 +10,7 @@ require 'fog/ecloud'
10
10
  require 'fog/glesys'
11
11
  require 'fog/go_grid'
12
12
  require 'fog/google'
13
+ require 'fog/ibm'
13
14
  require 'fog/joyent'
14
15
  require 'fog/libvirt'
15
16
  require 'fog/linode'
@@ -14,6 +14,9 @@ module Fog
14
14
  when :google
15
15
  require 'fog/google/storage'
16
16
  Fog::Storage::Google.new(attributes)
17
+ when :ibm
18
+ require 'fog/ibm/storage'
19
+ Fog::Storage::IBM.new(attributes)
17
20
  when :local
18
21
  require 'fog/local/storage'
19
22
  Fog::Storage::Local.new(attributes)
@@ -1,4 +1,9 @@
1
1
  Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
2
+ @create_security_group_format = {
3
+ 'requestId' => String,
4
+ 'groupId' => String,
5
+ 'return' => Fog::Boolean
6
+ }
2
7
 
3
8
  @security_groups_format = {
4
9
  'requestId' => String,
@@ -8,7 +13,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
8
13
  'groupName' => String,
9
14
  'ipPermissions' => [{
10
15
  'fromPort' => Fog::Nullable::Integer,
11
- 'groups' => [{ 'groupName' => Fog::Nullable::String, 'userId' => String }],
16
+ 'groups' => [{ 'groupName' => Fog::Nullable::String, 'userId' => String, 'groupId' => String }],
12
17
  'ipProtocol' => String,
13
18
  'ipRanges' => [],
14
19
  'toPort' => Fog::Nullable::Integer,
@@ -20,17 +25,17 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
20
25
  }
21
26
 
22
27
  @owner_id = Fog::Compute[:aws].describe_security_groups('group-name' => 'default').body['securityGroupInfo'].first['ownerId']
28
+ @group_id_default = Fog::Compute[:aws].describe_security_groups('group-name' => 'default').body['securityGroupInfo'].first['groupId']
23
29
 
24
30
  tests('success') do
25
31
 
26
- tests("#create_security_group('fog_security_group', 'tests group')").formats(AWS::Compute::Formats::BASIC) do
32
+ tests("#create_security_group('fog_security_group', 'tests group')").formats(@create_security_group_format) do
27
33
  Fog::Compute[:aws].create_security_group('fog_security_group', 'tests group').body
28
34
  end
29
-
30
- tests("#create_security_group('fog_security_group_two', 'tests group')").formats(AWS::Compute::Formats::BASIC) do
35
+ tests("#create_security_group('fog_security_group_two', 'tests group')").formats(@create_security_group_format) do
31
36
  Fog::Compute[:aws].create_security_group('fog_security_group_two', 'tests group').body
32
37
  end
33
-
38
+ @group_id_two = Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group_two').body['securityGroupInfo'].first['groupId']
34
39
  group_id = Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['groupId']
35
40
  to_be_revoked = []
36
41
  expected_permissions = []
@@ -43,17 +48,17 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
43
48
  to_be_revoked.push([permission, expected_permissions.dup])
44
49
 
45
50
  expected_permissions = [
46
- {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
51
+ {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
47
52
  "fromPort"=>1,
48
53
  "ipRanges"=>[],
49
54
  "ipProtocol"=>"tcp",
50
55
  "toPort"=>65535},
51
- {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
56
+ {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
52
57
  "fromPort"=>1,
53
58
  "ipRanges"=>[],
54
59
  "ipProtocol"=>"udp",
55
60
  "toPort"=>65535},
56
- {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id}],
61
+ {"groups"=>[{"groupName"=>"default", "userId"=>@owner_id, "groupId"=>@group_id_default}],
57
62
  "fromPort"=>-1,
58
63
  "ipRanges"=>[],
59
64
  "ipProtocol"=>"icmp",
@@ -77,22 +82,22 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
77
82
 
78
83
  expected_permissions = [
79
84
  {"groups"=>
80
- [{"userId"=>@owner_id, "groupName"=>"default"},
81
- {"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
85
+ [{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
86
+ {"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
82
87
  "ipRanges"=>[],
83
88
  "ipProtocol"=>"tcp",
84
89
  "fromPort"=>1,
85
90
  "toPort"=>65535},
86
91
  {"groups"=>
87
- [{"userId"=>@owner_id, "groupName"=>"default"},
88
- {"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
92
+ [{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
93
+ {"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
89
94
  "ipRanges"=>[],
90
95
  "ipProtocol"=>"udp",
91
96
  "fromPort"=>1,
92
97
  "toPort"=>65535},
93
98
  {"groups"=>
94
- [{"userId"=>@owner_id, "groupName"=>"default"},
95
- {"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
99
+ [{"userId"=>@owner_id, "groupName"=>"default", "groupId"=>@group_id_default},
100
+ {"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
96
101
  "ipRanges"=>[],
97
102
  "ipProtocol"=>"icmp",
98
103
  "fromPort"=>-1,
@@ -194,13 +199,12 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
194
199
  to_be_revoked.push([permissions, expected_permissions.dup])
195
200
 
196
201
  expected_permissions += [
197
- {"groups"=>[{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
202
+ {"groups"=>[{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
198
203
  "ipRanges"=>[],
199
204
  "ipProtocol"=>"tcp",
200
205
  "fromPort"=>8000,
201
206
  "toPort"=>8000}
202
207
  ]
203
-
204
208
  tests("#describe_security_groups('group-name' => 'fog_security_group')").returns([]) do
205
209
  array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'fog_security_group').body['securityGroupInfo'].first['ipPermissions'])
206
210
  end
@@ -224,7 +228,7 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
224
228
 
225
229
  expected_permissions += [
226
230
  {"groups"=>
227
- [{"userId"=>@owner_id, "groupName"=>"fog_security_group_two"}],
231
+ [{"userId"=>@owner_id, "groupName"=>"fog_security_group_two", "groupId"=>@group_id_two}],
228
232
  "ipRanges"=>[{"cidrIp"=>"172.16.0.0/24"}],
229
233
  "ipProtocol"=>"tcp",
230
234
  "fromPort"=>9000,
@@ -264,38 +268,28 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
264
268
  vpc_id = Fog::Compute[:aws].create_vpc('10.255.254.64/28').body['vpcSet'].first['vpcId']
265
269
 
266
270
  # Create security group in VPC
267
- tests("#create_security_group('vpc_security_group', 'tests group')").formats(AWS::Compute::Formats::BASIC) do
271
+ tests("#create_security_group('vpc_security_group', 'tests group')").formats(@create_security_group_format) do
268
272
  Fog::Compute[:aws].create_security_group('vpc_security_group', 'tests group', vpc_id).body
269
273
  end
270
274
 
271
275
  group_id = Fog::Compute[:aws].describe_security_groups('group-name' => 'vpc_security_group').body['securityGroupInfo'].first['groupId']
272
276
 
273
- # Access group with name in options array
274
- permission = { 'IpProtocol' => '42', 'FromPort' => '22', 'ToPort' => '22', 'CidrIp' => '10.0.0.0/8' }
277
+ permissions = {
278
+ 'IpPermissions' => [
279
+ {
280
+ 'IpProtocol' => '42',
281
+ 'IpRanges' => [{ 'CidrIp' => '10.0.0.0/8' }],
282
+ }
283
+ ]
284
+ }
285
+
275
286
  expected_permissions = [
276
287
  {"groups"=>[],
277
288
  "ipRanges"=>[{"cidrIp"=>"10.0.0.0/8"}],
278
- "ipProtocol"=>"42",
279
- "fromPort"=>22,
280
- "toPort"=>22}
289
+ "ipProtocol"=>"42"}
281
290
  ]
282
291
 
283
- options = permission.clone
284
- options['GroupName'] = 'vpc_security_group'
285
- tests("#authorize_security_group_ingress(#{options.inspect})").formats(AWS::Compute::Formats::BASIC) do
286
- Fog::Compute[:aws].authorize_security_group_ingress(options).body
287
- end
288
-
289
- tests("#describe_security_groups('group-name' => 'vpc_security_group')").returns([]) do
290
- array_differences(expected_permissions, Fog::Compute[:aws].describe_security_groups('group-name' => 'vpc_security_group').body['securityGroupInfo'].first['ipPermissions'])
291
- end
292
-
293
- tests("#revoke_security_group_ingress(#{options.inspect})").formats(AWS::Compute::Formats::BASIC) do
294
- Fog::Compute[:aws].revoke_security_group_ingress(options).body
295
- end
296
-
297
- # Access group with id in options array
298
- options = permission.clone
292
+ options = permissions.clone
299
293
  options['GroupId'] = group_id
300
294
  tests("#authorize_security_group_ingress(#{options.inspect})").formats(AWS::Compute::Formats::BASIC) do
301
295
  Fog::Compute[:aws].authorize_security_group_ingress(options).body
@@ -309,9 +303,13 @@ Shindo.tests('Fog::Compute[:aws] | security group requests', ['aws']) do
309
303
  Fog::Compute[:aws].revoke_security_group_ingress(options).body
310
304
  end
311
305
 
306
+ vpc_group=Fog::Compute[:aws].security_groups.get_by_id(group_id)
307
+ vpc_group.destroy
308
+
312
309
  Fog::Compute[:aws].delete_vpc(vpc_id)
313
310
 
314
311
  end
312
+ ## Rate limiting seems to want us to take a break otherwise it will throw errors
315
313
  tests('failure') do
316
314
 
317
315
  @security_group = Fog::Compute[:aws].security_groups.create(:description => 'tests group', :name => 'fog_security_group')
@@ -22,6 +22,10 @@ def compute_providers
22
22
  :glesys => {
23
23
  :mocked => false
24
24
  },
25
+ :ibm => {
26
+ :server_attributes => {},
27
+ :mocked => true
28
+ },
25
29
  :joyent => {
26
30
  :mocked => false
27
31
  },
@@ -1,6 +1,6 @@
1
1
  for provider, config in compute_providers
2
2
 
3
- next if [:glesys, :voxel].include?(provider)
3
+ next if [:glesys, :voxel, :ibm].include?(provider)
4
4
 
5
5
  Shindo.tests("Fog::Compute[:#{provider}] | flavors", [provider]) do
6
6
 
@@ -12,7 +12,7 @@ def array_differences(array_a, array_b)
12
12
  end
13
13
 
14
14
  # check to see which credentials are available and add others to the skipped tags list
15
- all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'joyent', 'linode', 'local', 'ninefold', 'baremetalcloud', 'openstack', 'ovirt', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'vsphere', 'zerigo']
15
+ all_providers = ['aws', 'bluebox', 'brightbox', 'dnsimple', 'dnsmadeeasy', 'dynect', 'ecloud', 'glesys', 'gogrid', 'google', 'ibm', 'joyent', 'linode', 'local', 'ninefold', 'baremetalcloud', 'openstack', 'ovirt', 'rackspace', 'slicehost', 'stormondemand', 'voxel', 'vsphere', 'zerigo']
16
16
  available_providers = Fog.available_providers.map {|provider| provider.downcase}
17
17
  for provider in (all_providers - available_providers)
18
18
  Formatador.display_line("[yellow]Skipping tests for [bold]#{provider}[/] [yellow]due to lacking credentials (add some to '~/.fog' to run them)[/]")
@@ -30,6 +30,8 @@ if Fog.mock?
30
30
  :go_grid_shared_secret => 'go_grid_shared_secret',
31
31
  :google_storage_access_key_id => 'google_storage_access_key_id',
32
32
  :google_storage_secret_access_key => 'google_storage_secret_access_key',
33
+ :ibm_username => 'ibm_username',
34
+ :ibm_password => 'ibm_password',
33
35
  :joyent_username => "joyentuser",
34
36
  :joyent_password => "joyentpass",
35
37
  :linode_api_key => 'linode_api_key',
@@ -0,0 +1,10 @@
1
+ Shindo.tests('Fog::Compute[:ibm] | image', ['ibm']) do
2
+
3
+ @image_id = '20010001'
4
+ @image = Fog::Compute[:ibm].images.get(@image_id)
5
+
6
+ tests('success') do
7
+
8
+ end
9
+
10
+ end
@@ -0,0 +1,23 @@
1
+ Shindo.tests('Fog::Compute[:ibm] | key', ['ibm']) do
2
+
3
+ tests('success') do
4
+
5
+ @key_name = 'fog-test-key-' + Time.now.to_i.to_s(32)
6
+ @key = nil
7
+
8
+ tests("Fog::Compute::IBM::Key.create(:name => '#{@key_name}')") do
9
+ @key = Fog::Compute[:ibm].keys.create(:name => @key_name)
10
+ returns(@key_name) { @key.name }
11
+ end
12
+
13
+ tests("Fog::Compute::IBM::Key#instances") do
14
+ returns([]) { @key.instances }
15
+ end
16
+
17
+ tests('Fog::Compute::IBM::Key#destroy') do
18
+ returns(true) { @key.destroy }
19
+ end
20
+
21
+ end
22
+
23
+ end