fog-maestrodev 1.14.0.20130806165225 → 1.15.0.20130829165835

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. data/changelog.txt +296 -0
  2. data/fog.gemspec +2 -2
  3. data/lib/fog/atmos/storage.rb +0 -3
  4. data/lib/fog/aws/cdn.rb +1 -2
  5. data/lib/fog/aws/compute.rb +52 -2
  6. data/lib/fog/aws/dns.rb +0 -1
  7. data/lib/fog/aws/models/auto_scaling/groups.rb +6 -3
  8. data/lib/fog/aws/models/compute/address.rb +1 -0
  9. data/lib/fog/aws/models/compute/flavors.rb +19 -0
  10. data/lib/fog/aws/models/compute/route_table.rb +69 -0
  11. data/lib/fog/aws/models/compute/route_tables.rb +92 -0
  12. data/lib/fog/aws/models/rds/instance_option.rb +21 -0
  13. data/lib/fog/aws/models/rds/instance_options.rb +30 -0
  14. data/lib/fog/aws/parsers/compute/associate_route_table.rb +20 -0
  15. data/lib/fog/aws/parsers/compute/create_route_table.rb +75 -0
  16. data/lib/fog/aws/parsers/compute/describe_account_attributes.rb +42 -0
  17. data/lib/fog/aws/parsers/compute/describe_route_tables.rb +85 -0
  18. data/lib/fog/aws/parsers/rds/describe_orderable_db_instance_options.rb +47 -0
  19. data/lib/fog/aws/rds.rb +5 -0
  20. data/lib/fog/aws/requests/auto_scaling/describe_auto_scaling_groups.rb +9 -1
  21. data/lib/fog/aws/requests/auto_scaling/describe_policies.rb +15 -1
  22. data/lib/fog/aws/requests/compute/associate_dhcp_options.rb +2 -2
  23. data/lib/fog/aws/requests/compute/associate_route_table.rb +75 -0
  24. data/lib/fog/aws/requests/compute/attach_internet_gateway.rb +2 -2
  25. data/lib/fog/aws/requests/compute/create_route.rb +89 -0
  26. data/lib/fog/aws/requests/compute/create_route_table.rb +70 -0
  27. data/lib/fog/aws/requests/compute/create_vpc.rb +16 -1
  28. data/lib/fog/aws/requests/compute/delete_dhcp_options.rb +2 -2
  29. data/lib/fog/aws/requests/compute/delete_internet_gateway.rb +2 -2
  30. data/lib/fog/aws/requests/compute/delete_network_interface.rb +2 -2
  31. data/lib/fog/aws/requests/compute/delete_route.rb +60 -0
  32. data/lib/fog/aws/requests/compute/delete_route_table.rb +51 -0
  33. data/lib/fog/aws/requests/compute/delete_subnet.rb +2 -2
  34. data/lib/fog/aws/requests/compute/delete_vpc.rb +2 -2
  35. data/lib/fog/aws/requests/compute/describe_account_attributes.rb +49 -0
  36. data/lib/fog/aws/requests/compute/describe_route_tables.rb +87 -0
  37. data/lib/fog/aws/requests/compute/detach_internet_gateway.rb +2 -2
  38. data/lib/fog/aws/requests/compute/detach_network_interface.rb +2 -2
  39. data/lib/fog/aws/requests/compute/disassociate_route_table.rb +57 -0
  40. data/lib/fog/aws/requests/compute/reset_network_interface_attribute.rb +2 -1
  41. data/lib/fog/aws/requests/elb/create_load_balancer.rb +23 -9
  42. data/lib/fog/aws/requests/iam/upload_server_certificate.rb +1 -1
  43. data/lib/fog/aws/requests/rds/describe_orderable_db_instance_options.rb +76 -0
  44. data/lib/fog/aws/storage.rb +0 -2
  45. data/lib/fog/brightbox/models/compute/collaboration.rb +10 -2
  46. data/lib/fog/brightbox/models/compute/collaborations.rb +26 -2
  47. data/lib/fog/brightbox/models/compute/user_collaboration.rb +16 -1
  48. data/lib/fog/brightbox/models/compute/user_collaborations.rb +10 -2
  49. data/lib/fog/cloudstack/models/compute/server.rb +4 -0
  50. data/lib/fog/core/collection.rb +18 -0
  51. data/lib/fog/core/credentials.rb +6 -1
  52. data/lib/fog/google/compute.rb +17 -0
  53. data/lib/fog/google/examples/get_list_images.rb +27 -0
  54. data/lib/fog/google/examples/get_list_snapshots.rb +20 -0
  55. data/lib/fog/google/examples/image_create.rb +18 -0
  56. data/lib/fog/google/examples/launch_micro_instance.rb +10 -5
  57. data/lib/fog/google/examples/network.rb +21 -0
  58. data/lib/fog/google/models/compute/disk.rb +16 -5
  59. data/lib/fog/google/models/compute/image.rb +36 -18
  60. data/lib/fog/google/models/compute/images.rb +36 -10
  61. data/lib/fog/google/models/compute/server.rb +41 -11
  62. data/lib/fog/google/models/compute/servers.rb +1 -1
  63. data/lib/fog/google/models/compute/snapshot.rb +36 -0
  64. data/lib/fog/google/models/compute/snapshots.rb +28 -0
  65. data/lib/fog/google/requests/compute/delete_disk.rb +5 -1
  66. data/lib/fog/google/requests/compute/get_disk.rb +2 -1
  67. data/lib/fog/google/requests/compute/get_snapshot.rb +34 -0
  68. data/lib/fog/google/requests/compute/insert_disk.rb +23 -7
  69. data/lib/fog/google/requests/compute/insert_image.rb +16 -9
  70. data/lib/fog/google/requests/compute/insert_server.rb +22 -10
  71. data/lib/fog/google/requests/compute/list_disks.rb +1 -1
  72. data/lib/fog/google/requests/compute/list_snapshots.rb +30 -0
  73. data/lib/fog/google/storage.rb +1 -3
  74. data/lib/fog/hp/storage.rb +0 -2
  75. data/lib/fog/internet_archive/storage.rb +0 -2
  76. data/lib/fog/local/storage.rb +0 -2
  77. data/lib/fog/ninefold/storage.rb +0 -1
  78. data/lib/fog/openstack/models/storage/file.rb +2 -0
  79. data/lib/fog/openstack/requests/compute/add_flavor_access.rb +1 -1
  80. data/lib/fog/openstack/requests/compute/create_volume.rb +8 -7
  81. data/lib/fog/openstack/requests/compute/list_tenants_with_flavor_access.rb +1 -1
  82. data/lib/fog/openstack/requests/compute/remove_flavor_access.rb +1 -1
  83. data/lib/fog/openstack/requests/image/create_image.rb +23 -23
  84. data/lib/fog/openstack/requests/image/update_image.rb +31 -33
  85. data/lib/fog/openstack/requests/storage/get_object_https_url.rb +3 -3
  86. data/lib/fog/openstack/requests/storage/post_set_meta_temp_url_key.rb +1 -1
  87. data/lib/fog/openstack/storage.rb +10 -11
  88. data/lib/fog/openstack.rb +10 -1
  89. data/lib/fog/rackspace/cdn.rb +13 -0
  90. data/lib/fog/rackspace/compute.rb +8 -4
  91. data/lib/fog/rackspace/compute_v2.rb +2 -0
  92. data/lib/fog/rackspace/databases.rb +4 -4
  93. data/lib/fog/rackspace/dns.rb +6 -6
  94. data/lib/fog/rackspace/examples/compute_v2/bootstrap_server.rb +98 -0
  95. data/lib/fog/rackspace/load_balancers.rb +5 -4
  96. data/lib/fog/rackspace/models/compute_v2/flavors.rb +1 -2
  97. data/lib/fog/rackspace/models/compute_v2/images.rb +35 -3
  98. data/lib/fog/rackspace/models/compute_v2/metadatum.rb +2 -2
  99. data/lib/fog/rackspace/models/identity/service_catalog.rb +34 -16
  100. data/lib/fog/rackspace/models/load_balancers/load_balancer.rb +8 -3
  101. data/lib/fog/rackspace/models/monitoring/alarm.rb +16 -8
  102. data/lib/fog/rackspace/models/monitoring/base.rb +2 -8
  103. data/lib/fog/rackspace/monitoring.rb +14 -6
  104. data/lib/fog/rackspace/requests/compute_v2/list_flavors_detail.rb +39 -0
  105. data/lib/fog/rackspace/requests/compute_v2/list_images.rb +15 -5
  106. data/lib/fog/rackspace/requests/compute_v2/list_images_detail.rb +53 -0
  107. data/lib/fog/rackspace/requests/identity/create_token.rb +1 -1
  108. data/lib/fog/rackspace/requests/load_balancers/create_load_balancer.rb +12 -0
  109. data/lib/fog/rackspace/requests/load_balancers/get_stats.rb +31 -0
  110. data/lib/fog/rackspace/requests/monitoring/get_entity.rb +33 -0
  111. data/lib/fog/rackspace/service.rb +7 -0
  112. data/lib/fog/rackspace/storage.rb +6 -3
  113. data/lib/fog/rackspace.rb +8 -5
  114. data/lib/fog/riakcs/provisioning.rb +0 -1
  115. data/lib/fog/riakcs/usage.rb +2 -3
  116. data/lib/fog/storage.rb +2 -0
  117. data/lib/fog/vcloud/examples/README.md +54 -0
  118. data/lib/fog/vcloud/examples/creating_a_connection.md +20 -0
  119. data/lib/fog/vcloud/examples/creating_a_vapp.md +17 -0
  120. data/lib/fog/vcloud/examples/get_network_information.md +10 -0
  121. data/lib/fog/vcloud/examples/get_vapp_information.md +10 -0
  122. data/lib/fog/vcloud/examples/more_on_vapps.md +23 -0
  123. data/lib/fog/version.rb +1 -1
  124. data/lib/tasks/changelog_task.rb +1 -0
  125. data/tests/aws/models/elb/model_tests.rb +5 -0
  126. data/tests/aws/models/rds/instance_option_tests.rb +14 -0
  127. data/tests/aws/requests/compute/client_tests.rb +25 -0
  128. data/tests/aws/requests/compute/route_tests.rb +277 -0
  129. data/tests/aws/requests/rds/helper.rb +22 -0
  130. data/tests/aws/requests/rds/instance_option_tests.rb +21 -0
  131. data/tests/core/credential_tests.rb +21 -0
  132. data/tests/core/service_tests.rb +26 -0
  133. data/tests/openstack/authenticate_tests.rb +22 -0
  134. data/tests/openstack/models/storage/file_tests.rb +20 -1
  135. data/tests/openstack/requests/compute/flavor_tests.rb +27 -12
  136. data/tests/openstack/requests/compute/volume_tests.rb +10 -12
  137. data/tests/openstack/requests/image/image_tests.rb +30 -15
  138. data/tests/rackspace/block_storage_tests.rb +9 -4
  139. data/tests/rackspace/cdn_tests.rb +14 -0
  140. data/tests/rackspace/compute_tests.rb +10 -4
  141. data/tests/rackspace/compute_v2_tests.rb +9 -4
  142. data/tests/rackspace/databases_tests.rb +9 -4
  143. data/tests/rackspace/dns_tests.rb +9 -4
  144. data/tests/rackspace/helper.rb +21 -2
  145. data/tests/rackspace/identity_tests.rb +9 -4
  146. data/tests/rackspace/load_balancer_tests.rb +8 -4
  147. data/tests/rackspace/models/compute_v2/server_tests.rb +18 -21
  148. data/tests/rackspace/models/identity/service_catalog_tests.rb +54 -29
  149. data/tests/rackspace/models/load_balancers/load_balancer_tests.rb +5 -0
  150. data/tests/rackspace/models/monitoring/alarm_examples_tests.rb +1 -1
  151. data/tests/rackspace/models/monitoring/alarm_tests.rb +2 -2
  152. data/tests/rackspace/monitoring_tests.rb +9 -4
  153. data/tests/rackspace/requests/compute_v2/flavor_tests.rb +6 -0
  154. data/tests/rackspace/requests/compute_v2/image_tests.rb +4 -0
  155. data/tests/rackspace/requests/compute_v2/server_tests.rb +2 -2
  156. data/tests/rackspace/requests/load_balancers/get_stats_tests.rb +13 -0
  157. data/tests/rackspace/requests/load_balancers/helper.rb +9 -0
  158. data/tests/rackspace/requests/monitoring/alarm_tests.rb +4 -5
  159. data/tests/rackspace/requests/monitoring/entity_tests.rb +9 -1
  160. data/tests/rackspace/requests/storage/large_object_tests.rb +12 -4
  161. data/tests/rackspace/storage_tests.rb +23 -4
  162. data/tests/rackspace/url_encoding_tests.rb +3 -1
  163. metadata +117 -133
  164. checksums.yaml +0 -15
  165. data/lib/fog/aws/parsers/compute/associate_dhcp_options.rb +0 -24
  166. data/lib/fog/aws/parsers/compute/attach_internet_gateway.rb +0 -24
  167. data/lib/fog/aws/parsers/compute/delete_dhcp_options.rb +0 -24
  168. data/lib/fog/aws/parsers/compute/delete_internet_gateway.rb +0 -24
  169. data/lib/fog/aws/parsers/compute/delete_network_interface.rb +0 -24
  170. data/lib/fog/aws/parsers/compute/delete_subnet.rb +0 -24
  171. data/lib/fog/aws/parsers/compute/delete_vpc.rb +0 -24
  172. data/lib/fog/aws/parsers/compute/detach_internet_gateway.rb +0 -24
  173. data/lib/fog/aws/parsers/compute/detach_network_interface.rb +0 -24
@@ -4,35 +4,33 @@ Shindo.tests('Fog::Compute[:openstack] | volume requests', ['openstack']) do
4
4
 
5
5
  @volume_format = {
6
6
  'id' => String,
7
- 'name' => String,
7
+ 'displayName' => String,
8
8
  'size' => Integer,
9
- 'description' => String,
9
+ 'displayDescription' => String,
10
10
  'status' => String,
11
- 'snapshot_id' => Fog::Nullable::String,
12
- 'availability_zone' => String,
11
+ 'snapshotId' => Fog::Nullable::String,
12
+ 'availabilityZone' => String,
13
13
  'attachments' => Array,
14
- 'volume_type' => Fog::Nullable::String,
15
- 'created_at' => Time
14
+ 'volumeType' => Fog::Nullable::String,
15
+ 'createdAt' => String,
16
+ 'metadata' => Hash
16
17
  }
17
18
 
18
19
  tests('success') do
19
- tests('#create_volume').formats({'volume' => @volume_format}) do
20
- pending unless Fog.mocking?
20
+ tests('#create_volume').data_matches_schema({'volume' => @volume_format}) do
21
21
  Fog::Compute[:openstack].create_volume('loud', 'this is a loud volume', 3).body
22
22
  end
23
23
 
24
- tests('#list_volumes').formats({'volumes' => [@volume_format]}) do
24
+ tests('#list_volumes').data_matches_schema({'volumes' => [@volume_format]}) do
25
25
  Fog::Compute[:openstack].list_volumes.body
26
26
  end
27
27
 
28
- tests('#get_volume_detail').formats({'volume' => @volume_format}) do
29
- pending unless Fog.mocking?
28
+ tests('#get_volume_detail').data_matches_schema({'volume' => @volume_format}) do
30
29
  volume_id = Fog::Compute[:openstack].volumes.all.first.id
31
30
  Fog::Compute[:openstack].get_volume_details(volume_id).body
32
31
  end
33
32
 
34
33
  tests('#delete_volume').succeeds do
35
- pending unless Fog.mocking?
36
34
  volume_id = Fog::Compute[:openstack].volumes.all.first.id
37
35
  Fog::Compute[:openstack].delete_volume(volume_id)
38
36
  end
@@ -1,15 +1,15 @@
1
1
  Shindo.tests('Fog::Image[:openstack] | image requests', ['openstack']) do
2
2
  openstack = Fog::Identity[:openstack]
3
3
  @image_attributes = {
4
- 'name' => 'new image',
5
- 'owner' => openstack.current_tenant['id'],
6
- 'is_public' => 'true',
7
- 'copy_from' => 'http://website.com/image.iso',
8
- 'disk_format' => 'iso',
9
- 'properties' =>
10
- {'user_id' => openstack.current_user['id'],
11
- 'owner_id' => openstack.current_tenant['id']},
12
- 'container_format'=> 'bare' }
4
+ :name => 'new image',
5
+ :owner => openstack.current_tenant['id'],
6
+ :is_public => true,
7
+ :copy_from => 'http://website.com/image.iso',
8
+ :disk_format => 'iso',
9
+ :properties =>
10
+ {:user_id => openstack.current_user['id'],
11
+ :owner_id => openstack.current_tenant['id']},
12
+ :container_format => 'bare' }
13
13
 
14
14
  @image_format = {
15
15
  'name' => String,
@@ -72,23 +72,38 @@ Shindo.tests('Fog::Image[:openstack] | image requests', ['openstack']) do
72
72
  ]
73
73
 
74
74
  tests('success') do
75
- tests('#list_public_images').formats({'images' => [@image_format]}) do
75
+ tests('#list_public_images').data_matches_schema({'images' => [@image_format]}) do
76
76
  Fog::Image[:openstack].list_public_images.body
77
77
  end
78
78
 
79
- tests('#list_public_images_detailed').formats({'images' => [@detailed_image_format]}) do
79
+ tests('#list_public_images_detailed').data_matches_schema({'images' => [@detailed_image_format]}) do
80
80
  Fog::Image[:openstack].list_public_images_detailed.body
81
81
  end
82
82
 
83
- tests('#create_image').formats({'image' => @detailed_image_format}) do
84
- @instance = Fog::Image[:openstack].create_image(@image_attributes).body
83
+ tests('#create_image').data_matches_schema({'image' => @detailed_image_format}) do
84
+ begin
85
+ if Fog.mocking?
86
+ image_attributes = @image_attributes
87
+ else
88
+ require 'tempfile'
89
+ image_attributes = @image_attributes.dup
90
+ image_attributes.delete(:copy_from)
91
+ test_iso = Tempfile.new(['fog_test_iso', '.iso'])
92
+ test_iso.write Fog::Mock.random_hex(32)
93
+ test_iso.close
94
+ image_attributes[:location] = test_iso.path
95
+ end
96
+ @instance = Fog::Image[:openstack].create_image(image_attributes).body
97
+ ensure
98
+ test_iso.delete if test_iso
99
+ end
85
100
  end
86
101
 
87
- tests('#get_image').formats(@image_meta_format) do
102
+ tests('#get_image').data_matches_schema(@image_meta_format) do
88
103
  Fog::Image[:openstack].get_image(@instance['image']['id']).headers
89
104
  end
90
105
 
91
- tests('#update_image').formats(@detailed_image_format) do
106
+ tests('#update_image').data_matches_schema(@detailed_image_format) do
92
107
  Fog::Image[:openstack].update_image({:id => @instance['image']['id'],
93
108
  :name => 'edit image'}).body['image']
94
109
  end
@@ -105,10 +105,15 @@ Shindo.tests('Fog::Rackspace::BlockStorage', ['rackspace']) do
105
105
  tests('reauthentication') do
106
106
  pending if Fog.mocking?
107
107
 
108
- @service = Fog::Rackspace::BlockStorage.new :rackspace_region => :ord
109
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
110
- @service.instance_variable_set("@auth_token", "bad-token")
111
- returns(200) { @service.list_volumes.status }
108
+ tests('should reauth with valid credentials') do
109
+ @service = Fog::Rackspace::BlockStorage.new :rackspace_region => :ord
110
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
111
+ @service.instance_variable_set("@auth_token", "bad-token")
112
+ returns(200) { @service.list_volumes.status }
113
+ end
114
+ tests('should terminate with incorrect credentials') do
115
+ raises(Excon::Errors::Unauthorized) {Fog::Rackspace::BlockStorage.new :rackspace_api_key => 'bad_key' }
116
+ end
112
117
  end
113
118
 
114
119
  end
@@ -96,6 +96,20 @@ Shindo.tests('Fog::CDN::Rackspace', ['rackspace']) do
96
96
  end
97
97
  end
98
98
 
99
+ tests('reauthentication') do
100
+ pending if Fog.mocking?
101
+
102
+ tests('should reauth with valid credentials') do
103
+ @service = Fog::CDN::Rackspace.new :rackspace_region => :ord
104
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
105
+ @service.instance_variable_set("@auth_token", "bad-token")
106
+ returns(true) { [200, 204].include? @service.get_containers.status }
107
+ end
108
+ tests('should terminate with incorrect credentials') do
109
+ raises(Excon::Errors::Unauthorized) { Fog::CDN::Rackspace.new :rackspace_api_key => 'bad_key' }
110
+ end
111
+ end
112
+
99
113
  pending if Fog.mocking?
100
114
 
101
115
  def container_meta_attributes
@@ -91,9 +91,15 @@ Shindo.tests('Rackspace | Compute', ['rackspace']) do
91
91
  tests('reauthentication') do
92
92
  pending if Fog.mocking?
93
93
 
94
- @service = Fog::Compute::Rackspace.new
95
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
96
- @service.instance_variable_set("@auth_token", "bad-token")
97
- returns(true) { [200, 203].include?(@service.list_flavors.status) }
94
+ tests('should reauth with valid credentials') do
95
+ @service = Fog::Compute::Rackspace.new
96
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
97
+ @service.instance_variable_set("@auth_token", "bad-token")
98
+ returns(true) { [200, 203].include?(@service.list_flavors.status) }
99
+ end
100
+ tests('should terminate with incorrect credentials') do
101
+ raises(Excon::Errors::Unauthorized) { Fog::Compute::Rackspace.new :rackspace_api_key => 'bad_key' }
102
+ end
103
+
98
104
  end
99
105
  end
@@ -104,10 +104,15 @@ Shindo.tests('Fog::Compute::RackspaceV2', ['rackspace']) do
104
104
  tests('reauthentication') do
105
105
  pending if Fog.mocking?
106
106
 
107
- @service = Fog::Compute::RackspaceV2.new
108
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
109
- @service.instance_variable_set("@auth_token", "bad_token")
110
- returns(true) { [200, 203].include? @service.list_flavors.status }
107
+ tests('should reauth with valid credentials') do
108
+ @service = Fog::Compute::RackspaceV2.new
109
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
110
+ @service.instance_variable_set("@auth_token", "bad_token")
111
+ returns(true) { [200, 203].include? @service.list_flavors.status }
112
+ end
113
+ tests('should terminate with incorrect credentials') do
114
+ raises(Excon::Errors::Unauthorized) { Fog::Compute::RackspaceV2.new :rackspace_api_key => 'bad_key' }
115
+ end
111
116
  end
112
117
 
113
118
  end
@@ -105,10 +105,15 @@ Shindo.tests('Fog::Rackspace::Databases', ['rackspace']) do |variable|
105
105
  tests('reauthentication') do
106
106
  pending if Fog.mocking?
107
107
 
108
- @service = Fog::Rackspace::Databases.new
109
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
110
- @service.instance_variable_set("@auth_token", "bad_token")
111
- returns(200) { @service.list_flavors.status }
108
+ tests('should reauth with valid credentials') do
109
+ @service = Fog::Rackspace::Databases.new
110
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
111
+ @service.instance_variable_set("@auth_token", "bad_token")
112
+ returns(200) { @service.list_flavors.status }
113
+ end
114
+ tests('should terminate with incorrect credentials') do
115
+ raises(Excon::Errors::Unauthorized) { Fog::Rackspace::Databases.new :rackspace_api_key => 'bad_key' }
116
+ end
112
117
  end
113
118
 
114
119
  @service = Fog::Rackspace::Databases.new
@@ -85,10 +85,15 @@ Shindo.tests('Fog::DNS::Rackspace', ['rackspace']) do
85
85
  tests('reauthentication') do
86
86
  pending if Fog.mocking?
87
87
 
88
- @service =Fog::DNS::Rackspace.new
89
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
90
- @service.instance_variable_set("@auth_token", "bad_token")
91
- returns(200) { @service.list_domains.status }
88
+ tests('should reauth with valid credentials') do
89
+ @service = Fog::DNS::Rackspace.new
90
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
91
+ @service.instance_variable_set("@auth_token", "bad_token")
92
+ returns(200) { @service.list_domains.status }
93
+ end
94
+ tests('should terminate with incorrect credentials') do
95
+ raises(Excon::Errors::Unauthorized) { Fog::DNS::Rackspace.new :rackspace_api_key => 'bad_key' }
96
+ end
92
97
  end
93
98
 
94
99
  tests('array_to_query_string') do
@@ -66,5 +66,24 @@ module Shindo
66
66
  @flavor_id ||= Fog.credentials[:rackspace_flavor_id] || service.flavors.first.id
67
67
  end
68
68
 
69
- end
70
- end
69
+ # After a server has been successfully deleted they are still being reported as attached to a cloud network
70
+ # causing delete calls to fail. This method attempts to address that.
71
+ def delete_test_network(network)
72
+ return false if Fog.mocking? || network.nil?
73
+ attempt = 0
74
+ begin
75
+ network.destroy
76
+ rescue Fog::Compute::RackspaceV2::ServiceError => e
77
+ if attempt == 3
78
+ Fog::Logger.warning "Unable to delete #{network.label}"
79
+ return false
80
+ end
81
+ Fog::Logger.warning "Network #{network.label} Delete Fail Attempt #{attempt}- #{e.inspect}"
82
+ attempt += 1
83
+ sleep 60
84
+ retry
85
+ end
86
+ return true
87
+ end
88
+ end
89
+ end
@@ -16,10 +16,15 @@ Shindo.tests('Fog::Rackspace::Identity', ['rackspace']) do
16
16
  tests('reauthentication') do
17
17
  pending if Fog.mocking?
18
18
 
19
- @service = Fog::Rackspace::Identity.new :rackspace_region => :ord
20
- returns(true, "auth token populated") { !@service.auth_token.nil? }
21
- @service.instance_variable_set("@auth_token", "bad-token")
22
- returns(true) { [200, 203].include? @service.list_tenants.status }
19
+ tests('should reauth with valid credentials') do
20
+ @service = Fog::Rackspace::Identity.new :rackspace_region => :ord
21
+ returns(true, "auth token populated") { !@service.auth_token.nil? }
22
+ @service.instance_variable_set("@auth_token", "bad-token")
23
+ returns(true) { [200, 203].include? @service.list_tenants.status }
24
+ end
25
+ tests('should terminate with incorrect credentials') do
26
+ raises(Excon::Errors::Unauthorized) { Fog::Rackspace::Identity.new :rackspace_api_key => 'bad_key' }
27
+ end
23
28
  end
24
29
 
25
30
  end
@@ -105,10 +105,14 @@ Shindo.tests('Fog::Rackspace::LoadBalancers', ['rackspace']) do
105
105
  tests('reauthentication') do
106
106
  pending if Fog.mocking?
107
107
 
108
- @service = Fog::Rackspace::LoadBalancers.new
109
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
110
- @service.instance_variable_set("@auth_token", "bad-token")
111
- returns(200) { @service.list_load_balancers.status }
108
+ tests('should reauth with valid credentials') do
109
+ @service = Fog::Rackspace::LoadBalancers.new
110
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
111
+ @service.instance_variable_set("@auth_token", "bad-token")
112
+ returns(200) { @service.list_load_balancers.status } end
113
+ tests('should terminate with incorrect credentials') do
114
+ raises(Excon::Errors::Unauthorized) { Fog::Rackspace::LoadBalancers.new:rackspace_api_key => 'bad_key' }
115
+ end
112
116
  end
113
117
 
114
118
  pending if Fog.mocking?
@@ -77,7 +77,8 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
77
77
  end
78
78
 
79
79
  tests('#update').succeeds do
80
- @instance.name = "fog_server_update"
80
+ new_name = "fog_server_update#{Time.now.to_i.to_s}"
81
+ @instance.name = new_name
81
82
  @instance.access_ipv4_address= "10.10.0.1"
82
83
  @instance.access_ipv6_address= "::1"
83
84
  @instance.save
@@ -85,7 +86,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
85
86
  @instance.reload
86
87
  returns("10.10.0.1") { @instance.access_ipv4_address }
87
88
  returns("::1") { @instance.access_ipv6_address }
88
- returns("fog_server_update") { @instance.name }
89
+ returns(new_name) { @instance.name }
89
90
  end
90
91
 
91
92
  tests('#reboot("SOFT")').succeeds do
@@ -98,18 +99,6 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
98
99
  @instance.reboot('HARD')
99
100
  returns('HARD_REBOOT') { @instance.state }
100
101
  end
101
-
102
- @instance.wait_for { ready? }
103
- @test_image = nil
104
- begin
105
- tests('#create_image').succeeds do
106
- @test_image = @instance.create_image('fog-test-image')
107
- @test_image.reload
108
- returns('SAVING') { @test_image.state }
109
- end
110
- ensure
111
- @test_image.destroy unless @test_image.nil? || Fog.mocking?
112
- end
113
102
 
114
103
  sleep 30 unless Fog.mocking?
115
104
  @instance.wait_for { ready? }
@@ -165,6 +154,18 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
165
154
  returns('somerandompassword') { @instance.password }
166
155
  end
167
156
 
157
+ @instance.wait_for { ready? }
158
+ @test_image = nil
159
+ begin
160
+ tests('#create_image').succeeds do
161
+ @test_image = @instance.create_image('fog-test-image')
162
+ @test_image.reload
163
+ returns('SAVING') { @test_image.state }
164
+ end
165
+ ensure
166
+ @test_image.destroy unless @test_image.nil? || Fog.mocking?
167
+ end
168
+
168
169
  tests('attachments') do
169
170
  begin
170
171
  @volume = cbs_service.volumes.create(:size => 100, :display_name => "fog-#{Time.now.to_i.to_s}")
@@ -189,13 +190,6 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
189
190
  @instance.wait_for { ready? }
190
191
  end
191
192
 
192
- wait_for_server_deletion(@instance)
193
- sleep 60 unless Fog.mocking?
194
-
195
- tests("delete network #{@network.label}").succeeds do
196
- @network.destroy if @network
197
- end
198
-
199
193
  #When after testing resize/resize_confirm we get a 409 when we try to resize_revert so I am going to split it into two blocks
200
194
  model_tests(service.servers, options, true) do
201
195
  @instance.wait_for { ready? }
@@ -211,4 +205,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
211
205
  end
212
206
  @instance.wait_for { ready? }
213
207
  end
208
+
209
+ wait_for_server_deletion(@instance)
210
+ delete_test_network(@network)
214
211
  end
@@ -3,35 +3,60 @@ require 'fog/rackspace/models/identity/service_catalog'
3
3
  Shindo.tests('Fog::Rackspace::ServiceCatalog | users', ['rackspace']) do
4
4
 
5
5
  tests('#from_response') do
6
- before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"},
7
- "serviceCatalog"=>[{"type"=>"volume", "endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777"},
8
- {"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}], "name"=>"cloudBlockStorage"},
9
- {"type"=>"rax:load-balancer", "endpoints"=>[{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"},
10
- {"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudLoadBalancers"},
11
- {"type"=>"object-store", "endpoints"=>[{"internalURL"=>"https://snet-storage101.dfw1.clouddrive.com/v1/Mosso777", "region"=>"DFW",
12
- "tenantId"=>"Mosso777",
13
- "publicURL"=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777"},
14
- {"internalURL"=>"https://snet-storage101.ord1.clouddrive.com/v1/Mosso777", "region"=>"ORD",
15
- "tenantId"=>"Mosso777",
16
- "publicURL"=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFiles"}, {"type"=>"rax:database",
17
- "endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777"}, {"region"=>"ORD", "tenantId"=>"777",
18
- "publicURL"=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDatabases"}, {"type"=>"rax:dns", "endpoints"=>[{"tenantId"=>"777",
19
- "publicURL"=>"https://dns.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDNS"}, {"type"=>"compute", "endpoints"=>[{"versionId"=>"1.0", "tenantId"=>"777",
20
- "versionList"=>"https://servers.api.rackspacecloud.com/", "versionInfo"=>"https://servers.api.rackspacecloud.com/v1.0",
21
- "publicURL"=>"https://servers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudServers"}, {"type"=>"compute", "endpoints"=>[{"region"=>"DFW", "versionId"=>"2",
22
- "tenantId"=>"777", "versionList"=>"https://dfw.servers.api.rackspacecloud.com/", "versionInfo"=>"https://dfw.servers.api.rackspacecloud.com/v2",
23
- "publicURL"=>"https://dfw.servers.api.rackspacecloud.com/v2/777"}, {"region"=>"ORD", "versionId"=>"2", "tenantId"=>"777",
24
- "versionList"=>"https://ord.servers.api.rackspacecloud.com/", "versionInfo"=>"https://ord.servers.api.rackspacecloud.com/v2",
25
- "publicURL"=>"https://ord.servers.api.rackspacecloud.com/v2/777"}], "name"=>"cloudServersOpenStack"}, {"type"=>"rax:monitor", "endpoints"=>[{"tenantId"=>"777",
26
- "publicURL"=>"https://monitoring.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudMonitoring"}, {"type"=>"rax:object-cdn", "endpoints"=>[{"region"=>"DFW",
27
- "tenantId"=>"Mosso777", "publicURL"=>"https://cdn1.clouddrive.com/v1/Mosso777"},
28
- {"region"=>"ORD", "tenantId"=>"Mosso777",
29
- "publicURL"=>"https://cdn2.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFilesCDN"}], "user"=>{"roles"=>[{"description"=>"User Admin
30
- Role.", "name"=>"identity:user-admin", "id"=>"3"}], "name"=>"joe-racker", "RAX-AUTH:defaultRegion"=>"", "id"=>"TK421"}}}
6
+ tests('missing serviceCatalog node') do
7
+ before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"}}}
8
+ after_hash = {}
9
+ service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
10
+ returns(after_hash) { service_catalog.catalog }
11
+ end
12
+
13
+ tests('missing serviceCatalog node') do
14
+ before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"}, "serviceCatalog"=>[{"type"=>"volume", "name"=>"cloudBlockStorage", "endpoints" =>[{"region"=>"DFW", "tenantId"=>"777" }]}, {"type"=>"rax:load-balancer","name"=>"cloudLoadBalancers", "endpoints"=>[{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}] }] }}
15
+
16
+ after_hash = {:cloudBlockStorage=>nil, :cloudLoadBalancers=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}
17
+ service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
18
+ returns(after_hash) { service_catalog.catalog }
19
+ end
20
+
21
+ tests('missing region') do
22
+ before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"}, "serviceCatalog"=> [{"type"=>"rax:load-balancer","name"=>"cloudLoadBalancers", "endpoints"=>[{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}, {"tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}] }] }}
31
23
 
32
- after_hash = {:cloudServers=>"https://servers.api.rackspacecloud.com/v1.0/777", :cloudServersOpenStack=>{:dfw=>"https://dfw.servers.api.rackspacecloud.com/v2/777", :ord=>"https://ord.servers.api.rackspacecloud.com/v2/777"}, :cloudFiles=>{:dfw=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777", :ord=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}, :cloudBlockStorage=>{:dfw=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777", :ord=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}, :cloudMonitoring=>"https://monitoring.api.rackspacecloud.com/v1.0/777", :cloudLoadBalancers=>{:dfw=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}, :cloudFilesCDN=>{:dfw=>"https://cdn1.clouddrive.com/v1/Mosso777", :ord=>"https://cdn2.clouddrive.com/v1/Mosso777"}, :cloudDatabases=>{:dfw=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}, :cloudDNS=>"https://dns.api.rackspacecloud.com/v1.0/777"}
33
- @service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
34
- returns(after_hash) { @service_catalog.catalog }
24
+ after_hash = {:cloudLoadBalancers=>{:ord=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777", :global=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}}
25
+ service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
26
+ returns(after_hash) { service_catalog.catalog }
27
+ end
28
+
29
+ tests('successful') do
30
+ before_hash = {"access"=>{"token"=>{"expires"=>"2013-02-20T10:31:00.000-06:00", "tenant"=>{"name"=>"777", "id"=>"777"}, "id"=>"6ca10877-7c50-4a5c-b58f-004d835c39c3"},
31
+ "serviceCatalog"=>[{"type"=>"volume", "endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777"},
32
+ {"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}], "name"=>"cloudBlockStorage"},
33
+ {"type"=>"rax:load-balancer", "endpoints"=>[{"region"=>"ORD", "tenantId"=>"777", "publicURL"=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"},
34
+ {"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudLoadBalancers"},
35
+ {"type"=>"object-store", "endpoints"=>[{"internalURL"=>"https://snet-storage101.dfw1.clouddrive.com/v1/Mosso777", "region"=>"DFW",
36
+ "tenantId"=>"Mosso777",
37
+ "publicURL"=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777"},
38
+ {"internalURL"=>"https://snet-storage101.ord1.clouddrive.com/v1/Mosso777", "region"=>"ORD",
39
+ "tenantId"=>"Mosso777",
40
+ "publicURL"=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFiles"}, {"type"=>"rax:database",
41
+ "endpoints"=>[{"region"=>"DFW", "tenantId"=>"777", "publicURL"=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777"}, {"region"=>"ORD", "tenantId"=>"777",
42
+ "publicURL"=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDatabases"}, {"type"=>"rax:dns", "endpoints"=>[{"tenantId"=>"777",
43
+ "publicURL"=>"https://dns.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudDNS"}, {"type"=>"compute", "endpoints"=>[{"versionId"=>"1.0", "tenantId"=>"777",
44
+ "versionList"=>"https://servers.api.rackspacecloud.com/", "versionInfo"=>"https://servers.api.rackspacecloud.com/v1.0",
45
+ "publicURL"=>"https://servers.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudServers"}, {"type"=>"compute", "endpoints"=>[{"region"=>"DFW", "versionId"=>"2",
46
+ "tenantId"=>"777", "versionList"=>"https://dfw.servers.api.rackspacecloud.com/", "versionInfo"=>"https://dfw.servers.api.rackspacecloud.com/v2",
47
+ "publicURL"=>"https://dfw.servers.api.rackspacecloud.com/v2/777"}, {"region"=>"ORD", "versionId"=>"2", "tenantId"=>"777",
48
+ "versionList"=>"https://ord.servers.api.rackspacecloud.com/", "versionInfo"=>"https://ord.servers.api.rackspacecloud.com/v2",
49
+ "publicURL"=>"https://ord.servers.api.rackspacecloud.com/v2/777"}], "name"=>"cloudServersOpenStack"}, {"type"=>"rax:monitor", "endpoints"=>[{"tenantId"=>"777",
50
+ "publicURL"=>"https://monitoring.api.rackspacecloud.com/v1.0/777"}], "name"=>"cloudMonitoring"}, {"type"=>"rax:object-cdn", "endpoints"=>[{"region"=>"DFW",
51
+ "tenantId"=>"Mosso777", "publicURL"=>"https://cdn1.clouddrive.com/v1/Mosso777"},
52
+ {"region"=>"ORD", "tenantId"=>"Mosso777",
53
+ "publicURL"=>"https://cdn2.clouddrive.com/v1/Mosso777"}], "name"=>"cloudFilesCDN"}], "user"=>{"roles"=>[{"description"=>"User Admin
54
+ Role.", "name"=>"identity:user-admin", "id"=>"3"}], "name"=>"joe-racker", "RAX-AUTH:defaultRegion"=>"", "id"=>"TK421"}}}
55
+
56
+ after_hash = {:cloudServers=>"https://servers.api.rackspacecloud.com/v1.0/777", :cloudServersOpenStack=>{:dfw=>"https://dfw.servers.api.rackspacecloud.com/v2/777", :ord=>"https://ord.servers.api.rackspacecloud.com/v2/777"}, :cloudFiles=>{:dfw=>"https://storage101.dfw1.clouddrive.com/v1/Mosso777", :ord=>"https://storage101.ord1.clouddrive.com/v1/Mosso777"}, :cloudBlockStorage=>{:dfw=>"https://dfw.blockstorage.api.rackspacecloud.com/v1/777", :ord=>"https://ord.blockstorage.api.rackspacecloud.com/v1/777"}, :cloudMonitoring=>"https://monitoring.api.rackspacecloud.com/v1.0/777", :cloudLoadBalancers=>{:dfw=>"https://dfw.loadbalancers.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.loadbalancers.api.rackspacecloud.com/v1.0/777"}, :cloudFilesCDN=>{:dfw=>"https://cdn1.clouddrive.com/v1/Mosso777", :ord=>"https://cdn2.clouddrive.com/v1/Mosso777"}, :cloudDatabases=>{:dfw=>"https://dfw.databases.api.rackspacecloud.com/v1.0/777", :ord=>"https://ord.databases.api.rackspacecloud.com/v1.0/777"}, :cloudDNS=>"https://dns.api.rackspacecloud.com/v1.0/777"}
57
+ @service_catalog = Fog::Rackspace::Identity::ServiceCatalog.from_response(nil, before_hash)
58
+ returns(after_hash) { @service_catalog.catalog }
59
+ end
35
60
  end
36
61
 
37
62
  tests('services') do
@@ -75,7 +100,7 @@ Shindo.tests('Fog::Rackspace::ServiceCatalog | users', ['rackspace']) do
75
100
  returns("http:///fake-endpoint.com") { service.service_catalog.get_endpoint :fakeService }
76
101
  service_catalog.reload
77
102
  raises(RuntimeError) { service_catalog.get_endpoint :fakeService }
78
- raises(RuntimeError) { service.service_catalog.get_endpoint :fakeService }
103
+ raises(RuntimeError) { service.service_catalog.get_endpoint :fakeService }
79
104
 
80
105
  end
81
106
  end
@@ -20,6 +20,11 @@ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer', ['rackspace']) do
20
20
  end
21
21
 
22
22
  @instance.wait_for { ready? }
23
+
24
+ tests('#stats').succeeds do
25
+ @instance.stats
26
+ end
27
+
23
28
  tests('#enable_connection_logging').succeeds do
24
29
  @instance.enable_connection_logging
25
30
  returns(true) { @instance.connection_logging }
@@ -1,5 +1,5 @@
1
1
  Shindo.tests('Fog::Rackspace::Monitoring | alarm_examples', ['rackspace','rackspace_monitoring']) do
2
- pending if Fog.mocking? && !mocks_implemented
2
+ pending if Fog.mocking?
3
3
 
4
4
  service = Fog::Rackspace::Monitoring.new
5
5
  alarm_example_id = 'remote.http_body_match_1'
@@ -17,10 +17,10 @@ Shindo.tests('Fog::Rackspace::Monitoring | alarm', ['rackspace','rackspace_monit
17
17
  check = Fog::Rackspace::Monitoring::Check.new(:id => check_id)
18
18
  check.entity = entity
19
19
  alarm = Fog::Rackspace::Monitoring::Alarm.new
20
- alarm.check_id = check.id
20
+ alarm.check = check.id
21
21
 
22
22
  returns(Fog::Rackspace::Monitoring::Alarm) { alarm.class }
23
- returns(check_id) { alarm.check_id }
23
+ returns(check_id) { alarm.check.id }
24
24
  end
25
25
  end
26
26
 
@@ -63,10 +63,15 @@ Shindo.tests('Fog::Rackspace::Monitoring', ['rackspace','rackspace_monitoring'])
63
63
  tests('reauthentication') do
64
64
  pending if Fog.mocking?
65
65
 
66
- @service = Fog::Rackspace::Monitoring.new
67
- returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
68
- @service.instance_variable_set("@auth_token", "bad_token")
69
- returns(true) { [200, 203].include? @service.list_entities.status }
66
+ tests('should reauth with valid credentials') do
67
+ @service = Fog::Rackspace::Monitoring.new
68
+ returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
69
+ @service.instance_variable_set("@auth_token", "bad_token")
70
+ returns(true) { [200, 203].include? @service.list_entities.status }
71
+ end
72
+ tests('should terminate with incorrect credentials') do
73
+ raises(Excon::Errors::Unauthorized) { Fog::Rackspace::Monitoring.new :rackspace_api_key => 'bad_key' }
74
+ end
70
75
  end
71
76
 
72
77
  end
@@ -34,6 +34,12 @@ Shindo.tests('Fog::Compute::RackspaceV2 | flavor_tests', ['rackspace']) do
34
34
  body
35
35
  end
36
36
 
37
+ tests('#list_flavors_detail').formats(list_flavor_format) do
38
+ body = service.list_flavors_detail.body
39
+ flavor_id = body['flavors'][0]['id']
40
+ body
41
+ end
42
+
37
43
  tests('#get_flavor').formats(get_flavor_format) do
38
44
  service.get_flavor(flavor_id).body
39
45
  end
@@ -48,6 +48,10 @@ Shindo.tests('Fog::Compute::RackspaceV2 | image_tests', ['rackspace']) do
48
48
  service.list_images.body
49
49
  end
50
50
 
51
+ tests('#list_images_detail').formats(list_image_format) do
52
+ service.list_images_detail.body
53
+ end
54
+
51
55
  tests('#get_image').formats(get_image_format, false) do
52
56
  service.get_image(@image_id).body
53
57
  end
@@ -106,7 +106,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
106
106
  sleep 120 unless Fog.mocking?
107
107
 
108
108
  tests('#resize_server').succeeds do
109
- resize_flavor_id = flavor_id
109
+ resize_flavor_id = Fog.mocking? ? flavor_id : service.flavors[1].id
110
110
  service.resize_server(server_id, resize_flavor_id)
111
111
  end
112
112
  wait_for_server_state(service, server_id, 'VERIFY_RESIZE', 'ACTIVE')
@@ -117,7 +117,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server_tests', ['rackspace']) do
117
117
  wait_for_server_state(service, server_id, 'ACTIVE', 'ERROR')
118
118
 
119
119
  tests('#resize_server').succeeds do
120
- resize_flavor_id = flavor_id
120
+ resize_flavor_id = Fog.mocking? ? flavor_id : service.flavors[1].id
121
121
  service.resize_server(server_id, resize_flavor_id)
122
122
  end
123
123
  wait_for_server_state(service, server_id, 'VERIFY_RESIZE', 'ACTIVE')
@@ -0,0 +1,13 @@
1
+ Shindo.tests('Fog::Rackspace::LoadBalancers | load_balancer_get_stats', ['rackspace']) do
2
+
3
+ given_a_load_balancer_service do
4
+ given_a_load_balancer do
5
+ tests('success') do
6
+ @lb.wait_for { ready? }
7
+ tests("#get_stats(#{@lb.id})").formats(LOAD_BALANCER_STATS_FORMAT) do
8
+ @service.get_stats(@lb.id).body
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end