fog 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (355) hide show
  1. data/.travis.yml +21 -0
  2. data/README.md +3 -1
  3. data/Rakefile +4 -1
  4. data/changelog.txt +462 -0
  5. data/docs/storage/index.markdown +4 -4
  6. data/fog.gemspec +2 -2
  7. data/lib/fog.rb +1 -1
  8. data/lib/fog/atmos.rb +11 -0
  9. data/lib/fog/atmos/models/storage/directories.rb +48 -0
  10. data/lib/fog/atmos/models/storage/directory.rb +53 -0
  11. data/lib/fog/atmos/models/storage/file.rb +107 -0
  12. data/lib/fog/atmos/models/storage/files.rb +73 -0
  13. data/lib/fog/atmos/requests/storage/delete_namespace.rb +19 -0
  14. data/lib/fog/atmos/requests/storage/get_namespace.rb +20 -0
  15. data/lib/fog/atmos/requests/storage/head_namespace.rb +20 -0
  16. data/lib/fog/atmos/requests/storage/post_namespace.rb +20 -0
  17. data/lib/fog/atmos/requests/storage/put_namespace.rb +20 -0
  18. data/lib/fog/atmos/storage.rb +186 -0
  19. data/lib/fog/aws.rb +2 -0
  20. data/lib/fog/aws/auto_scaling.rb +15 -1
  21. data/lib/fog/aws/compute.rb +26 -17
  22. data/lib/fog/aws/elb.rb +14 -2
  23. data/lib/fog/aws/glacier.rb +172 -0
  24. data/lib/fog/aws/iam.rb +35 -29
  25. data/lib/fog/aws/models/auto_scaling/group.rb +1 -1
  26. data/lib/fog/aws/models/compute/flavors.rb +11 -0
  27. data/lib/fog/aws/models/compute/security_group.rb +22 -6
  28. data/lib/fog/aws/models/compute/server.rb +5 -1
  29. data/lib/fog/aws/models/compute/spot_request.rb +12 -0
  30. data/lib/fog/aws/models/compute/spot_requests.rb +1 -2
  31. data/lib/fog/aws/models/compute/volume.rb +7 -1
  32. data/lib/fog/aws/models/glacier/archive.rb +70 -0
  33. data/lib/fog/aws/models/glacier/archives.rb +30 -0
  34. data/lib/fog/aws/models/glacier/job.rb +65 -0
  35. data/lib/fog/aws/models/glacier/jobs.rb +45 -0
  36. data/lib/fog/aws/models/glacier/vault.rb +53 -0
  37. data/lib/fog/aws/models/glacier/vaults.rb +28 -0
  38. data/lib/fog/aws/models/rds/server.rb +3 -1
  39. data/lib/fog/aws/models/rds/snapshot.rb +1 -0
  40. data/lib/fog/aws/models/rds/snapshots.rb +3 -0
  41. data/lib/fog/aws/models/storage/file.rb +4 -3
  42. data/lib/fog/aws/parsers/auto_scaling/describe_auto_scaling_groups.rb +8 -1
  43. data/lib/fog/aws/parsers/compute/create_volume.rb +2 -2
  44. data/lib/fog/aws/parsers/compute/describe_instance_status.rb +8 -1
  45. data/lib/fog/aws/parsers/compute/describe_instances.rb +2 -0
  46. data/lib/fog/aws/parsers/compute/describe_reserved_instances_offerings.rb +1 -1
  47. data/lib/fog/aws/parsers/compute/describe_volumes.rb +2 -2
  48. data/lib/fog/aws/parsers/compute/run_instances.rb +2 -0
  49. data/lib/fog/aws/parsers/compute/spot_instance_requests.rb +1 -1
  50. data/lib/fog/aws/parsers/dns/list_resource_record_sets.rb +3 -1
  51. data/lib/fog/aws/parsers/rds/db_parser.rb +3 -1
  52. data/lib/fog/aws/parsers/rds/snapshot_parser.rb +1 -0
  53. data/lib/fog/aws/rds.rb +9 -9
  54. data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +1 -0
  55. data/lib/fog/aws/requests/auto_scaling/delete_auto_scaling_group.rb +1 -1
  56. data/lib/fog/aws/requests/compute/create_volume.rb +53 -14
  57. data/lib/fog/aws/requests/compute/describe_instance_status.rb +2 -0
  58. data/lib/fog/aws/requests/compute/describe_instances.rb +3 -1
  59. data/lib/fog/aws/requests/compute/describe_internet_gateways.rb +13 -7
  60. data/lib/fog/aws/requests/compute/describe_spot_instance_requests.rb +1 -0
  61. data/lib/fog/aws/requests/compute/describe_subnets.rb +13 -7
  62. data/lib/fog/aws/requests/compute/describe_volumes.rb +2 -0
  63. data/lib/fog/aws/requests/compute/describe_vpcs.rb +12 -6
  64. data/lib/fog/aws/requests/compute/request_spot_instances.rb +2 -0
  65. data/lib/fog/aws/requests/compute/run_instances.rb +8 -2
  66. data/lib/fog/aws/requests/dns/change_resource_record_sets.rb +20 -1
  67. data/lib/fog/aws/requests/elb/create_load_balancer.rb +2 -2
  68. data/lib/fog/aws/requests/elb/describe_load_balancers.rb +1 -1
  69. data/lib/fog/aws/requests/glacier/abort_multipart_upload.rb +35 -0
  70. data/lib/fog/aws/requests/glacier/complete_multipart_upload.rb +42 -0
  71. data/lib/fog/aws/requests/glacier/create_archive.rb +43 -0
  72. data/lib/fog/aws/requests/glacier/create_vault.rb +34 -0
  73. data/lib/fog/aws/requests/glacier/delete_archive.rb +35 -0
  74. data/lib/fog/aws/requests/glacier/delete_vault.rb +34 -0
  75. data/lib/fog/aws/requests/glacier/delete_vault_notification_configuration.rb +33 -0
  76. data/lib/fog/aws/requests/glacier/describe_job.rb +35 -0
  77. data/lib/fog/aws/requests/glacier/describe_vault.rb +34 -0
  78. data/lib/fog/aws/requests/glacier/get_job_output.rb +41 -0
  79. data/lib/fog/aws/requests/glacier/get_vault_notification_configuration.rb +34 -0
  80. data/lib/fog/aws/requests/glacier/initiate_job.rb +41 -0
  81. data/lib/fog/aws/requests/glacier/initiate_multipart_upload.rb +38 -0
  82. data/lib/fog/aws/requests/glacier/list_jobs.rb +39 -0
  83. data/lib/fog/aws/requests/glacier/list_multipart_uploads.rb +37 -0
  84. data/lib/fog/aws/requests/glacier/list_parts.rb +37 -0
  85. data/lib/fog/aws/requests/glacier/list_vaults.rb +36 -0
  86. data/lib/fog/aws/requests/glacier/set_vault_notification_configuration.rb +37 -0
  87. data/lib/fog/aws/requests/glacier/upload_part.rb +46 -0
  88. data/lib/fog/aws/requests/rds/create_db_instance.rb +7 -5
  89. data/lib/fog/aws/requests/rds/create_db_instance_read_replica.rb +41 -1
  90. data/lib/fog/aws/requests/rds/create_db_snapshot.rb +1 -1
  91. data/lib/fog/aws/requests/rds/describe_db_instances.rb +8 -10
  92. data/lib/fog/aws/requests/rds/describe_db_security_groups.rb +1 -1
  93. data/lib/fog/aws/requests/rds/describe_db_snapshots.rb +2 -0
  94. data/lib/fog/aws/requests/rds/modify_db_instance.rb +7 -6
  95. data/lib/fog/aws/requests/rds/reboot_db_instance.rb +6 -5
  96. data/lib/fog/aws/requests/storage/get_object.rb +45 -2
  97. data/lib/fog/aws/requests/storage/upload_part.rb +1 -0
  98. data/lib/fog/aws/signaturev4.rb +73 -0
  99. data/lib/fog/aws/sqs.rb +2 -6
  100. data/lib/fog/bare_metal_cloud/compute.rb +3 -1
  101. data/lib/fog/bare_metal_cloud/requests/compute/add_server_by_configuration.rb +33 -0
  102. data/lib/fog/bare_metal_cloud/requests/compute/get_server.rb +17 -12
  103. data/lib/fog/bare_metal_cloud/requests/compute/list_configurations.rb +27 -0
  104. data/lib/fog/bare_metal_cloud/requests/compute/list_images.rb +4 -4
  105. data/lib/fog/bare_metal_cloud/requests/compute/list_plans.rb +7 -7
  106. data/lib/fog/bare_metal_cloud/requests/compute/list_servers.rb +2 -2
  107. data/lib/fog/bin.rb +7 -0
  108. data/lib/fog/bin/atmos.rb +31 -0
  109. data/lib/fog/bin/aws.rb +4 -0
  110. data/lib/fog/bin/ecloud.rb +4 -0
  111. data/lib/fog/bin/rackspace.rb +7 -0
  112. data/lib/fog/bin/serverlove.rb +31 -0
  113. data/lib/fog/bluebox/requests/compute/create_block.rb +18 -4
  114. data/lib/fog/brightbox/compute.rb +52 -0
  115. data/lib/fog/brightbox/models/compute/cloud_ip.rb +2 -0
  116. data/lib/fog/brightbox/models/compute/image.rb +1 -0
  117. data/lib/fog/brightbox/models/compute/server.rb +46 -3
  118. data/lib/fog/brightbox/requests/compute/create_cloud_ip.rb +3 -3
  119. data/lib/fog/cloudstack/compute.rb +4 -1
  120. data/lib/fog/cloudstack/models/compute/images.rb +15 -6
  121. data/lib/fog/cloudstack/models/compute/job.rb +1 -1
  122. data/lib/fog/cloudstack/requests/compute/attach_volume.rb +1 -1
  123. data/lib/fog/cloudstack/requests/compute/register_template.rb +35 -0
  124. data/lib/fog/compute.rb +15 -3
  125. data/lib/fog/core/errors.rb +1 -0
  126. data/lib/fog/core/time.rb +4 -0
  127. data/lib/fog/dynect/dns.rb +5 -5
  128. data/lib/fog/ecloud.rb +6 -0
  129. data/lib/fog/ecloud/compute.rb +3 -1
  130. data/lib/fog/ecloud/models/compute/ip_addresses.rb +1 -0
  131. data/lib/fog/ecloud/models/compute/networks.rb +1 -0
  132. data/lib/fog/ecloud/models/compute/server.rb +31 -1
  133. data/lib/fog/ecloud/requests/compute/virtual_machine_add_ip.rb +40 -0
  134. data/lib/fog/ecloud/requests/compute/virtual_machine_upload_file.rb +31 -0
  135. data/lib/fog/google/models/storage/directory.rb +2 -2
  136. data/lib/fog/google/models/storage/file.rb +2 -2
  137. data/lib/fog/google/requests/storage/get_bucket.rb +1 -2
  138. data/lib/fog/google/requests/storage/put_object.rb +1 -2
  139. data/lib/fog/google/storage.rb +1 -1
  140. data/lib/fog/hp/models/compute/image.rb +1 -1
  141. data/lib/fog/hp/models/compute/server.rb +4 -0
  142. data/lib/fog/hp/requests/compute/delete_security_group_rule.rb +4 -4
  143. data/lib/fog/hp/requests/storage/get_object.rb +8 -2
  144. data/lib/fog/hp/storage.rb +1 -0
  145. data/lib/fog/libvirt/models/compute/server.rb +1 -1
  146. data/lib/fog/libvirt/models/compute/templates/server.xml.erb +1 -1
  147. data/lib/fog/openstack.rb +7 -0
  148. data/lib/fog/openstack/compute.rb +4 -1
  149. data/lib/fog/openstack/models/compute/server.rb +1 -1
  150. data/lib/fog/openstack/requests/compute/create_server.rb +8 -2
  151. data/lib/fog/openstack/requests/identity/list_roles_for_user_on_tenant.rb +1 -1
  152. data/lib/fog/openstack/requests/identity/list_tenants.rb +1 -0
  153. data/lib/fog/providers.rb +2 -0
  154. data/lib/fog/rackspace.rb +9 -7
  155. data/lib/fog/rackspace/block_storage.rb +114 -0
  156. data/lib/fog/rackspace/compute_v2.rb +123 -0
  157. data/lib/fog/rackspace/models/block_storage/snapshot.rb +46 -0
  158. data/lib/fog/rackspace/models/block_storage/snapshots.rb +25 -0
  159. data/lib/fog/rackspace/models/block_storage/volume.rb +58 -0
  160. data/lib/fog/rackspace/models/block_storage/volume_type.rb +14 -0
  161. data/lib/fog/rackspace/models/block_storage/volume_types.rb +25 -0
  162. data/lib/fog/rackspace/models/block_storage/volumes.rb +25 -0
  163. data/lib/fog/rackspace/models/compute_v2/attachment.rb +34 -0
  164. data/lib/fog/rackspace/models/compute_v2/attachments.rb +25 -0
  165. data/lib/fog/rackspace/models/compute_v2/flavor.rb +17 -0
  166. data/lib/fog/rackspace/models/compute_v2/flavors.rb +25 -0
  167. data/lib/fog/rackspace/models/compute_v2/image.rb +30 -0
  168. data/lib/fog/rackspace/models/compute_v2/images.rb +25 -0
  169. data/lib/fog/rackspace/models/compute_v2/server.rb +147 -0
  170. data/lib/fog/rackspace/models/compute_v2/servers.rb +25 -0
  171. data/lib/fog/rackspace/models/storage/directory.rb +3 -3
  172. data/lib/fog/rackspace/requests/block_storage/create_snapshot.rb +26 -0
  173. data/lib/fog/rackspace/requests/block_storage/create_volume.rb +27 -0
  174. data/lib/fog/rackspace/requests/block_storage/delete_snapshot.rb +15 -0
  175. data/lib/fog/rackspace/requests/block_storage/delete_volume.rb +15 -0
  176. data/lib/fog/rackspace/requests/block_storage/get_snapshot.rb +15 -0
  177. data/lib/fog/rackspace/requests/block_storage/get_volume.rb +15 -0
  178. data/lib/fog/rackspace/requests/block_storage/get_volume_type.rb +15 -0
  179. data/lib/fog/rackspace/requests/block_storage/list_snapshots.rb +15 -0
  180. data/lib/fog/rackspace/requests/block_storage/list_volume_types.rb +15 -0
  181. data/lib/fog/rackspace/requests/block_storage/list_volumes.rb +15 -0
  182. data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +23 -0
  183. data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +22 -0
  184. data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +20 -0
  185. data/lib/fog/rackspace/requests/compute_v2/create_server.rb +28 -0
  186. data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +15 -0
  187. data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +15 -0
  188. data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +15 -0
  189. data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +15 -0
  190. data/lib/fog/rackspace/requests/compute_v2/get_image.rb +15 -0
  191. data/lib/fog/rackspace/requests/compute_v2/get_server.rb +15 -0
  192. data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +15 -0
  193. data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +15 -0
  194. data/lib/fog/rackspace/requests/compute_v2/list_images.rb +15 -0
  195. data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +15 -0
  196. data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +22 -0
  197. data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +22 -0
  198. data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +22 -0
  199. data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +20 -0
  200. data/lib/fog/rackspace/requests/compute_v2/update_server.rb +22 -0
  201. data/lib/fog/rackspace/requests/storage/delete_object.rb +1 -1
  202. data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +51 -0
  203. data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +37 -0
  204. data/lib/fog/rackspace/storage.rb +4 -0
  205. data/lib/fog/serverlove.rb +10 -0
  206. data/lib/fog/serverlove/compute.rb +97 -0
  207. data/lib/fog/serverlove/models/compute/image.rb +57 -0
  208. data/lib/fog/serverlove/models/compute/images.rb +26 -0
  209. data/lib/fog/serverlove/models/compute/server.rb +72 -0
  210. data/lib/fog/serverlove/models/compute/servers.rb +26 -0
  211. data/lib/fog/serverlove/requests/compute/create_image.rb +32 -0
  212. data/lib/fog/serverlove/requests/compute/create_server.rb +34 -0
  213. data/lib/fog/serverlove/requests/compute/destroy_image.rb +13 -0
  214. data/lib/fog/serverlove/requests/compute/destroy_server.rb +13 -0
  215. data/lib/fog/serverlove/requests/compute/get_image.rb +13 -0
  216. data/lib/fog/serverlove/requests/compute/get_images.rb +13 -0
  217. data/lib/fog/serverlove/requests/compute/get_server.rb +13 -0
  218. data/lib/fog/serverlove/requests/compute/get_servers.rb +13 -0
  219. data/lib/fog/serverlove/requests/compute/load_standard_image.rb +13 -0
  220. data/lib/fog/serverlove/requests/compute/reset_server.rb +13 -0
  221. data/lib/fog/serverlove/requests/compute/shutdown_server.rb +13 -0
  222. data/lib/fog/serverlove/requests/compute/start_server.rb +13 -0
  223. data/lib/fog/serverlove/requests/compute/stop_server.rb +13 -0
  224. data/lib/fog/serverlove/requests/compute/update_image.rb +15 -0
  225. data/lib/fog/serverlove/requests/compute/update_server.rb +15 -0
  226. data/lib/fog/serverlove/util/compute/password_generator.rb +11 -0
  227. data/lib/fog/storage.rb +3 -0
  228. data/lib/fog/terremark/models/shared/image.rb +22 -0
  229. data/lib/fog/terremark/models/shared/images.rb +48 -0
  230. data/lib/fog/terremark/models/shared/internetservice.rb +67 -0
  231. data/lib/fog/terremark/models/shared/internetservices.rb +42 -0
  232. data/lib/fog/terremark/models/shared/nodeservice.rb +52 -0
  233. data/lib/fog/terremark/models/shared/nodeservices.rb +32 -0
  234. data/lib/fog/terremark/models/shared/server.rb +114 -15
  235. data/lib/fog/terremark/models/shared/servers.rb +7 -8
  236. data/lib/fog/terremark/models/shared/vdc.rb +6 -1
  237. data/lib/fog/terremark/parsers/shared/get_catalog.rb +7 -2
  238. data/lib/fog/terremark/parsers/shared/get_keys_list.rb +56 -0
  239. data/lib/fog/terremark/requests/shared/add_internet_service.rb +10 -9
  240. data/lib/fog/terremark/requests/shared/add_node_service.rb +10 -12
  241. data/lib/fog/terremark/requests/shared/configure_vapp.rb +61 -0
  242. data/lib/fog/terremark/requests/shared/create_internet_service.rb +16 -11
  243. data/lib/fog/terremark/requests/shared/delete_internet_service.rb +2 -1
  244. data/lib/fog/terremark/requests/shared/delete_node_service.rb +2 -1
  245. data/lib/fog/terremark/requests/shared/delete_public_ip.rb +2 -1
  246. data/lib/fog/terremark/requests/shared/get_internet_services.rb +2 -1
  247. data/lib/fog/terremark/requests/shared/get_keys_list.rb +36 -0
  248. data/lib/fog/terremark/requests/shared/get_node_services.rb +2 -1
  249. data/lib/fog/terremark/requests/shared/instantiate_vapp_template.rb +11 -1
  250. data/lib/fog/terremark/shared.rb +19 -1
  251. data/lib/fog/terremark/vcloud.rb +10 -1
  252. data/lib/fog/vcloud/compute.rb +13 -13
  253. data/lib/fog/vcloud/models/compute/catalog_items.rb +6 -2
  254. data/lib/fog/vcloud/models/compute/organizations.rb +1 -2
  255. data/lib/fog/vcloud/models/compute/server.rb +37 -3
  256. data/lib/fog/vcloud/models/compute/vapps.rb +1 -1
  257. data/lib/fog/vcloud/requests/compute/configure_org_network.rb +141 -0
  258. data/lib/fog/vcloud/requests/compute/configure_vm_cpus.rb +38 -0
  259. data/lib/fog/vcloud/requests/compute/configure_vm_memory.rb +11 -12
  260. data/lib/fog/vcloud/requests/compute/configure_vm_password.rb +39 -0
  261. data/lib/fog/vcloud/requests/compute/undeploy.rb +9 -1
  262. data/lib/fog/vsphere/requests/compute/vm_reboot.rb +1 -1
  263. data/tests/atmos/models/storage/file_update_tests.rb +19 -0
  264. data/tests/atmos/models/storage/nested_directories_tests.rb +23 -0
  265. data/tests/aws/models/compute/security_group_tests.rb +21 -12
  266. data/tests/aws/models/dns/records_tests.rb +8 -2
  267. data/tests/aws/models/glacier/model_tests.rb +47 -0
  268. data/tests/aws/models/iam/policies_tests.rb +2 -2
  269. data/tests/aws/models/rds/server_tests.rb +5 -2
  270. data/tests/aws/models/storage/directory_tests.rb +1 -1
  271. data/tests/aws/models/storage/file_tests.rb +1 -1
  272. data/tests/aws/models/storage/files_tests.rb +1 -1
  273. data/tests/aws/models/storage/url_tests.rb +8 -8
  274. data/tests/aws/models/storage/version_tests.rb +1 -1
  275. data/tests/aws/models/storage/versions_tests.rb +1 -1
  276. data/tests/aws/requests/auto_scaling/auto_scaling_tests.rb +5 -0
  277. data/tests/aws/requests/auto_scaling/helper.rb +2 -1
  278. data/tests/aws/requests/compute/instance_tests.rb +17 -23
  279. data/tests/aws/requests/compute/spot_instance_tests.rb +2 -1
  280. data/tests/aws/requests/compute/tag_tests.rb +1 -0
  281. data/tests/aws/requests/compute/volume_tests.rb +45 -4
  282. data/tests/aws/requests/elb/helper.rb +2 -2
  283. data/tests/aws/requests/elb/listener_tests.rb +2 -2
  284. data/tests/aws/requests/elb/load_balancer_tests.rb +1 -1
  285. data/tests/aws/requests/glacier/archive_tests.rb +13 -0
  286. data/tests/aws/requests/glacier/multipart_upload_tests.rb +30 -0
  287. data/tests/aws/requests/glacier/tree_hash_tests.rb +63 -0
  288. data/tests/aws/requests/glacier/vault_tests.rb +35 -0
  289. data/tests/aws/requests/rds/helper.rb +11 -5
  290. data/tests/aws/requests/rds/instance_tests.rb +0 -2
  291. data/tests/aws/requests/storage/acl_utils_tests.rb +1 -1
  292. data/tests/aws/requests/storage/bucket_tests.rb +1 -1
  293. data/tests/aws/requests/storage/multipart_upload_tests.rb +1 -1
  294. data/tests/aws/requests/storage/object_tests.rb +8 -0
  295. data/tests/aws/requests/storage/versioning_tests.rb +1 -1
  296. data/tests/aws/signaturev4_tests.rb +41 -0
  297. data/tests/brightbox/compute_tests.rb +9 -0
  298. data/tests/brightbox/requests/compute/helper.rb +21 -6
  299. data/tests/cloudstack/compute/models/volume_tests.rb +1 -1
  300. data/tests/cloudstack/requests/volume_tests.rb +1 -1
  301. data/tests/compute/helper.rb +10 -4
  302. data/tests/dynect/requests/dns/dns_tests.rb +39 -0
  303. data/tests/google/requests/storage/bucket_tests.rb +2 -3
  304. data/tests/google/requests/storage/object_tests.rb +1 -1
  305. data/tests/helper.rb +10 -3
  306. data/tests/helpers/formats_helper.rb +4 -2
  307. data/tests/helpers/formats_helper_tests.rb +9 -0
  308. data/tests/helpers/mock_helper.rb +6 -1
  309. data/tests/helpers/model_helper.rb +0 -3
  310. data/tests/hp/models/compute/address_tests.rb +1 -1
  311. data/tests/hp/models/compute/addresses_tests.rb +1 -1
  312. data/tests/hp/models/compute/key_pair_tests.rb +1 -1
  313. data/tests/hp/models/compute/key_pairs_tests.rb +1 -1
  314. data/tests/hp/models/compute/security_group_tests.rb +1 -1
  315. data/tests/hp/models/compute/security_groups_tests.rb +1 -1
  316. data/tests/hp/requests/cdn/container_tests.rb +1 -1
  317. data/tests/hp/requests/compute/address_tests.rb +1 -1
  318. data/tests/hp/requests/compute/flavor_tests.rb +1 -1
  319. data/tests/hp/requests/compute/image_tests.rb +1 -1
  320. data/tests/hp/requests/compute/key_pair_tests.rb +1 -1
  321. data/tests/hp/requests/compute/security_group_rule_tests.rb +1 -1
  322. data/tests/hp/requests/compute/security_group_tests.rb +1 -1
  323. data/tests/hp/requests/compute/server_address_tests.rb +1 -1
  324. data/tests/hp/requests/compute/server_tests.rb +1 -1
  325. data/tests/hp/requests/storage/container_tests.rb +1 -1
  326. data/tests/hp/requests/storage/object_tests.rb +1 -1
  327. data/tests/local/models/file_tests.rb +1 -1
  328. data/tests/rackspace/models/block_storage/snapshot_tests.rb +20 -0
  329. data/tests/rackspace/models/block_storage/snapshots_tests.rb +20 -0
  330. data/tests/rackspace/models/block_storage/volume_tests.rb +27 -0
  331. data/tests/rackspace/models/block_storage/volume_types_tests.rb +20 -0
  332. data/tests/rackspace/models/block_storage/volumes_tests.rb +11 -0
  333. data/tests/rackspace/models/compute_v2/flavors_tests.rb +20 -0
  334. data/tests/rackspace/models/compute_v2/images_tests.rb +22 -0
  335. data/tests/rackspace/models/compute_v2/server_tests.rb +62 -0
  336. data/tests/rackspace/models/compute_v2/servers_tests.rb +14 -0
  337. data/tests/rackspace/requests/block_storage/snapshot_tests.rb +81 -0
  338. data/tests/rackspace/requests/block_storage/volume_tests.rb +61 -0
  339. data/tests/rackspace/requests/block_storage/volume_type_tests.rb +31 -0
  340. data/tests/rackspace/requests/compute_v2/attachment_tests.rb +68 -0
  341. data/tests/rackspace/requests/compute_v2/flavor_tests.rb +43 -0
  342. data/tests/rackspace/requests/compute_v2/image_tests.rb +47 -0
  343. data/tests/rackspace/requests/compute_v2/server_tests.rb +147 -0
  344. data/tests/rackspace/requests/storage/account_tests.rb +17 -0
  345. data/tests/rackspace/requests/storage/container_tests.rb +1 -1
  346. data/tests/rackspace/requests/storage/large_object_tests.rb +1 -1
  347. data/tests/rackspace/requests/storage/object_tests.rb +41 -2
  348. data/tests/serverlove/requests/compute/image_tests.rb +57 -0
  349. data/tests/serverlove/requests/compute/server_tests.rb +85 -0
  350. data/tests/serverlove/util/compute/password_generator_tests.rb +19 -0
  351. data/tests/storage/models/directories_tests.rb +1 -1
  352. data/tests/storage/models/directory_test.rb +1 -1
  353. data/tests/storage/models/file_tests.rb +1 -1
  354. data/tests/storage/models/files_tests.rb +1 -1
  355. metadata +188 -3
@@ -37,7 +37,7 @@ class AWS
37
37
  })
38
38
 
39
39
  DESCRIBE_LOAD_BALANCERS = BASIC.merge({
40
- 'DescribeLoadBalancersResult' => {'LoadBalancerDescriptions' => [LOAD_BALANCER]}
40
+ 'DescribeLoadBalancersResult' => {'LoadBalancerDescriptions' => [LOAD_BALANCER], 'NextMarker' => Fog::Nullable::String}
41
41
  })
42
42
 
43
43
  POLICY_ATTRIBUTE_DESCRIPTION = {
@@ -70,7 +70,7 @@ class AWS
70
70
  }
71
71
 
72
72
  DESCRIBE_LOAD_BALANCER_POLICY_TYPES = BASIC.merge({
73
- 'DescribeLoadBalancerPolicyTypesResult' => { 'PolicyTypeDescriptions' => [POLICY_TYPE] }
73
+ 'DescribeLoadBalancerPolicyTypesResult' => {'PolicyTypeDescriptions' => [POLICY_TYPE] }
74
74
  })
75
75
 
76
76
  CONFIGURE_HEALTH_CHECK = BASIC.merge({
@@ -8,8 +8,8 @@ Shindo.tests('AWS::ELB | listener_tests', ['aws', 'elb']) do
8
8
 
9
9
  tests("#create_load_balancer_listeners").formats(AWS::ELB::Formats::BASIC) do
10
10
  listeners = [
11
- {'Protocol' => 'TCP','InstanceProtocol' => 'TCP', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => @certificate['Arn']},
12
- {'Protocol' => 'HTTP', 'LoadBalancerPort' => 80, 'InstancePort' => 80}
11
+ {'Protocol' => 'TCP', 'InstanceProtocol' => 'TCP', 'LoadBalancerPort' => 443, 'InstancePort' => 443, 'SSLCertificateId' => @certificate['Arn']},
12
+ {'Protocol' => 'HTTP', 'InstanceProtocol' => 'HTTP', 'LoadBalancerPort' => 80, 'InstancePort' => 80}
13
13
  ]
14
14
  response = Fog::AWS[:elb].create_load_balancer_listeners(@load_balancer_id, listeners).body
15
15
  response
@@ -7,7 +7,7 @@ Shindo.tests('AWS::ELB | load_balancer_tests', ['aws', 'elb']) do
7
7
 
8
8
  tests("#create_load_balancer").formats(AWS::ELB::Formats::CREATE_LOAD_BALANCER) do
9
9
  zones = ['us-east-1a']
10
- listeners = [{'LoadBalancerPort' => 80, 'InstancePort' => 80, 'Protocol' => 'HTTP'}]
10
+ listeners = [{'LoadBalancerPort' => 80, 'InstancePort' => 80, 'InstanceProtocol' => 'HTTP', 'Protocol' => 'HTTP'}]
11
11
  Fog::AWS[:elb].create_load_balancer(zones, @load_balancer_id, listeners).body
12
12
  end
13
13
 
@@ -0,0 +1,13 @@
1
+ Shindo.tests('AWS::Glacier | glacier archive tests', ['aws']) do
2
+ pending if Fog.mocking?
3
+
4
+ Fog::AWS[:glacier].create_vault('Fog-Test-Vault-upload')
5
+
6
+ tests('single part upload') do
7
+ id = Fog::AWS[:glacier].create_archive('Fog-Test-Vault-upload', 'data body').headers['x-amz-archive-id']
8
+ Fog::AWS[:glacier].delete_archive('Fog-Test-Vault-upload', id)
9
+ end
10
+
11
+ #amazon won't let us delete the vault because it has been written to in the past day
12
+
13
+ end
@@ -0,0 +1,30 @@
1
+ Shindo.tests('AWS::Glacier | glacier archive tests', ['aws']) do
2
+ pending if Fog.mocking?
3
+
4
+ Fog::AWS[:glacier].create_vault('Fog-Test-Vault-upload')
5
+
6
+ tests('initiate and abort') do
7
+ id = Fog::AWS[:glacier].initiate_multipart_upload('Fog-Test-Vault-upload', 1024*1024).headers['x-amz-multipart-upload-id']
8
+ returns(true){ Fog::AWS[:glacier].list_multipart_uploads('Fog-Test-Vault-upload').body['UploadsList'].collect {|item| item['MultipartUploadId']}.include?(id)}
9
+ Fog::AWS[:glacier].abort_multipart_upload('Fog-Test-Vault-upload', id)
10
+ returns(false){ Fog::AWS[:glacier].list_multipart_uploads('Fog-Test-Vault-upload').body['UploadsList'].collect {|item| item['MultipartUploadId']}.include?(id)}
11
+ end
12
+
13
+
14
+ tests('do multipart upload') do
15
+ hash = Fog::AWS::Glacier::TreeHash.new
16
+ id = Fog::AWS[:glacier].initiate_multipart_upload('Fog-Test-Vault-upload', 1024*1024).headers['x-amz-multipart-upload-id']
17
+ part = 't'*1024*1024
18
+ hash_for_part = hash.add_part(part)
19
+ Fog::AWS[:glacier].upload_part('Fog-Test-Vault-upload', id, part, 0, hash_for_part)
20
+
21
+ part_2 = 'u'*1024*1024
22
+ hash_for_part_2 = hash.add_part(part_2)
23
+ Fog::AWS[:glacier].upload_part('Fog-Test-Vault-upload', id, part_2, 1024*1024, hash_for_part_2)
24
+
25
+ archive = Fog::AWS[:glacier].complete_multipart_upload('Fog-Test-Vault-upload', id, 2*1024*1024, hash.hexdigest).headers['x-amz-archive-id']
26
+
27
+ Fog::AWS[:glacier].delete_archive('Fog-Test-Vault-upload', archive)
28
+ #amazon won't let us delete the vault because it has been written to in the past day
29
+ end
30
+ end
@@ -0,0 +1,63 @@
1
+ Shindo.tests('AWS::Glacier | glacier tree hash calcuation', ['aws']) do
2
+
3
+ tests('tree_hash(single part < 1MB)') do
4
+ returns(Digest::SHA256.hexdigest('')) { Fog::AWS::Glacier::TreeHash.digest('')}
5
+ end
6
+
7
+ tests('tree_hash(multibyte characters)') do
8
+ body = ("\xC2\xA1" * 1024*1024)
9
+ body.force_encoding('UTF-8') if body.respond_to? :encoding
10
+
11
+ expected = Digest::SHA256.hexdigest(
12
+ Digest::SHA256.digest("\xC2\xA1" * 1024*512) + Digest::SHA256.digest("\xC2\xA1" * 1024*512)
13
+ )
14
+ returns(expected) { Fog::AWS::Glacier::TreeHash.digest(body)}
15
+ end
16
+
17
+ tests('tree_hash(power of 2 number of parts)') do
18
+ body = ('x' * 1024*1024) + ('y'*1024*1024) + ('z'*1024*1024) + ('t'*1024*1024)
19
+ expected = Digest::SHA256.hexdigest(
20
+ Digest::SHA256.digest(
21
+ Digest::SHA256.digest('x' * 1024*1024) + Digest::SHA256.digest('y' * 1024*1024)
22
+ ) +
23
+ Digest::SHA256.digest(
24
+ Digest::SHA256.digest('z' * 1024*1024) + Digest::SHA256.digest('t' * 1024*1024)
25
+ )
26
+ )
27
+
28
+ returns(expected) { Fog::AWS::Glacier::TreeHash.digest(body)}
29
+ end
30
+
31
+ tests('tree_hash(non power of 2 number of parts)') do
32
+ body = ('x' * 1024*1024) + ('y'*1024*1024) + ('z'*1024*1024)
33
+ expected = Digest::SHA256.hexdigest(
34
+ Digest::SHA256.digest(
35
+ Digest::SHA256.digest('x' * 1024*1024) + Digest::SHA256.digest('y' * 1024*1024)
36
+ ) +
37
+ Digest::SHA256.digest('z' * 1024*1024)
38
+ )
39
+
40
+ returns(expected) { Fog::AWS::Glacier::TreeHash.digest(body)}
41
+ end
42
+
43
+ tests('multipart') do
44
+ tree_hash = Fog::AWS::Glacier::TreeHash.new
45
+ part = ('x' * 1024*1024) + ('y'*1024*1024)
46
+ returns(Fog::AWS::Glacier::TreeHash.digest(part)) { tree_hash.add_part part }
47
+
48
+ tree_hash.add_part('z'* 1024*1024 + 't'*1024*1024)
49
+
50
+ expected = Digest::SHA256.hexdigest(
51
+ Digest::SHA256.digest(
52
+ Digest::SHA256.digest('x' * 1024*1024) + Digest::SHA256.digest('y' * 1024*1024)
53
+ ) +
54
+ Digest::SHA256.digest(
55
+ Digest::SHA256.digest('z' * 1024*1024) + Digest::SHA256.digest('t' * 1024*1024)
56
+ )
57
+ )
58
+ returns(expected) { tree_hash.hexdigest}
59
+
60
+ end
61
+
62
+
63
+ end
@@ -0,0 +1,35 @@
1
+ Shindo.tests('AWS::Glacier | glacier vault requests', ['aws']) do
2
+ pending if Fog.mocking?
3
+
4
+ topic_arn = Fog::AWS[:sns].create_topic( 'fog_test_glacier_topic').body['TopicArn']
5
+ Fog::AWS[:glacier].create_vault('Fog-Test-Vault')
6
+
7
+ tests('list_vaults') do
8
+ returns(true){Fog::AWS[:glacier].list_vaults.body['VaultList'].collect {|data| data['VaultName']}.include?('Fog-Test-Vault')}
9
+ end
10
+
11
+ tests('describe_vault') do
12
+ returns('Fog-Test-Vault'){Fog::AWS[:glacier].describe_vault('Fog-Test-Vault').body['VaultName']}
13
+ end
14
+
15
+ tests('set_vault_notification_configuration') do
16
+ Fog::AWS[:glacier].set_vault_notification_configuration 'Fog-Test-Vault', topic_arn, ['ArchiveRetrievalCompleted']
17
+ end
18
+
19
+ tests('get_vault_notification_configuration') do
20
+ returns('SNSTopic' => topic_arn, 'Events' => ['ArchiveRetrievalCompleted']){ Fog::AWS[:glacier].get_vault_notification_configuration( 'Fog-Test-Vault').body}
21
+ end
22
+
23
+ tests('delete_vault_notification_configuration') do
24
+ Fog::AWS[:glacier].delete_vault_notification_configuration( 'Fog-Test-Vault')
25
+ raises(Excon::Errors::NotFound){Fog::AWS[:glacier].get_vault_notification_configuration( 'Fog-Test-Vault')}
26
+ end
27
+
28
+ tests('delete_vault') do
29
+ Fog::AWS[:glacier].delete_vault( 'Fog-Test-Vault')
30
+ raises(Excon::Errors::NotFound){Fog::AWS[:glacier].describe_vault( 'Fog-Test-Vault')}
31
+ end
32
+
33
+ Fog::AWS[:sns].delete_topic topic_arn
34
+
35
+ end
@@ -96,7 +96,8 @@ class AWS
96
96
  'MasterUsername' => String,
97
97
  'Port' => Integer,
98
98
  'SnapshotCreateTime' => Fog::Nullable::Time,
99
- 'Status' => String
99
+ 'Status' => String,
100
+ 'SnapshotType' => String
100
101
  }
101
102
  INSTANCE = {
102
103
  'AllocatedStorage' => Integer,
@@ -115,6 +116,7 @@ class AWS
115
116
  'Status' => String,
116
117
  'DBSecurityGroupName' => String
117
118
  }],
119
+ 'DBSubnetGroupName' => Fog::Nullable::String,
118
120
  'Endpoint' => {
119
121
  'Address' => Fog::Nullable::String,
120
122
  'Port' => Fog::Nullable::Integer
@@ -137,11 +139,15 @@ class AWS
137
139
  },
138
140
  'PreferredBackupWindow'=> String,
139
141
  'PreferredMaintenanceWindow'=> String,
140
- 'ReadReplicaDBInstanceIdentifiers'=> [String],
141
- 'ReadReplicaDBInstanceIdentifiers'=> [Fog::Nullable::String],
142
- 'ReadReplicaSourceDBInstanceIdentifier'=> Fog::Nullable::String
142
+ 'ReadReplicaDBInstanceIdentifiers'=> [Fog::Nullable::String]
143
143
  }
144
144
 
145
+ REPLICA_INSTANCE = INSTANCE.merge({
146
+ 'BackupRetentionPeriod' => Fog::Nullable::String,
147
+ 'PreferredBackupWindow' => Fog::Nullable::String,
148
+ 'ReadReplicaSourceDBInstanceIdentifier'=> String
149
+ })
150
+
145
151
  CREATE_DB_INSTANCE = BASIC.merge({
146
152
  'CreateDBInstanceResult' => {
147
153
  'DBInstance' => INSTANCE
@@ -175,7 +181,7 @@ class AWS
175
181
 
176
182
  CREATE_READ_REPLICA = BASIC.merge({
177
183
  'CreateDBInstanceReadReplicaResult' => {
178
- 'DBInstance' => INSTANCE
184
+ 'DBInstance' => REPLICA_INSTANCE
179
185
  }
180
186
  })
181
187
 
@@ -70,8 +70,6 @@ Shindo.tests('AWS::RDS | instance requests', ['aws', 'rds']) do
70
70
 
71
71
  server.reload.wait_for { state == 'available' }
72
72
 
73
- pending if Fog.mocking?
74
-
75
73
  tests( "#create read replica").formats(AWS::RDS::Formats::CREATE_READ_REPLICA) do
76
74
  Fog::AWS[:rds].create_db_instance_read_replica(@db_replica_id, @db_instance_id).body
77
75
  end
@@ -1,6 +1,6 @@
1
1
  require 'fog/aws/requests/storage/acl_utils'
2
2
 
3
- Shindo.tests('Fog::Storage::AWS | ACL utils', [:aws]) do
3
+ Shindo.tests('Fog::Storage::AWS | ACL utils', ["aws"]) do
4
4
  tests(".hash_to_acl") do
5
5
  tests(".hash_to_acl({}) at xpath //AccessControlPolicy").returns("", "has an empty AccessControlPolicy") do
6
6
  xml = Fog::Storage::AWS.hash_to_acl({})
@@ -1,4 +1,4 @@
1
- Shindo.tests('Fog::Storage[:aws] | bucket requests', [:aws]) do
1
+ Shindo.tests('Fog::Storage[:aws] | bucket requests', ["aws"]) do
2
2
  @aws_bucket_name = 'fogbuckettests-' + Time.now.to_i.to_s(32)
3
3
 
4
4
  tests('success') do
@@ -1,4 +1,4 @@
1
- Shindo.tests('Fog::Storage[:aws] | multipart upload requests', [:aws]) do
1
+ Shindo.tests('Fog::Storage[:aws] | multipart upload requests', ["aws"]) do
2
2
 
3
3
  @directory = Fog::Storage[:aws].directories.create(:key => 'fogmultipartuploadtests')
4
4
 
@@ -26,6 +26,14 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
26
26
  data
27
27
  end
28
28
 
29
+ tests("#get_object('#{@directory.identity}', 'fog_object', {'Range' => 'bytes=0-20'})").returns(lorem_file.read[0..20]) do
30
+ Fog::Storage[:aws].get_object(@directory.identity, 'fog_object', {'Range' => 'bytes=0-20'}).body
31
+ end
32
+
33
+ tests("#get_object('#{@directory.identity}', 'fog_object', {'Range' => 'bytes=0-0'})").returns(lorem_file.read[0..0]) do
34
+ Fog::Storage[:aws].get_object(@directory.identity, 'fog_object', {'Range' => 'bytes=0-0'}).body
35
+ end
36
+
29
37
  tests("#head_object('#{@directory.identity}', 'fog_object')").succeeds do
30
38
  Fog::Storage[:aws].head_object(@directory.identity, 'fog_object')
31
39
  end
@@ -20,7 +20,7 @@ def delete_bucket
20
20
  Fog::Storage[:aws].delete_bucket(@aws_bucket_name)
21
21
  end
22
22
 
23
- Shindo.tests('Fog::Storage[:aws] | versioning', [:aws]) do
23
+ Shindo.tests('Fog::Storage[:aws] | versioning', ["aws"]) do
24
24
  tests('success') do
25
25
  tests("#put_bucket_versioning") do
26
26
  @aws_bucket_name = 'fogbuckettests-' + Fog::Mock.random_hex(16)
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+
3
+ Shindo.tests('AWS | signaturev4', ['aws']) do
4
+
5
+ # These testcases are from http://docs.amazonwebservices.com/general/latest/gr/signature-v4-test-suite.html
6
+ @signer = Fog::AWS::SignatureV4.new('AKIDEXAMPLE', 'wJalrXUtnFEMI/K7MDENG+bPxRfiCYEXAMPLEKEY', 'us-east-1','host')
7
+
8
+ Fog::Time.now = ::Time.utc(2011,9,9,23,36,0)
9
+
10
+ tests('get-vanilla') do
11
+ returns(@signer.sign({:headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, Fog::Time.now)) do
12
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=b27ccfbfa7df52a200ff74193ca6e32d4b48b8856fab7ebf1c595d0670a7e470'
13
+ end
14
+ end
15
+
16
+ tests('get-vanilla-query-order-key with symbol keys') do
17
+ returns(@signer.sign({:query => {:'a' => 'foo', :'b' => 'foo'}, :headers => {:'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, Fog::Time.now)) do
18
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=0dc122f3b28b831ab48ba65cb47300de53fbe91b577fe113edac383730254a3b'
19
+ end
20
+ end
21
+
22
+ tests('get-vanilla-query-order-key') do
23
+ returns(@signer.sign({:query => {'a' => 'foo', 'b' => 'foo'}, :headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/'}, Fog::Time.now)) do
24
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=0dc122f3b28b831ab48ba65cb47300de53fbe91b577fe113edac383730254a3b'
25
+ end
26
+ end
27
+
28
+ tests('get-unreserved') do
29
+ returns(@signer.sign({:headers => {'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :get, :path => '/-._~0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'}, Fog::Time.now)) do
30
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=date;host, Signature=830cc36d03f0f84e6ee4953fbe701c1c8b71a0372c63af9255aa364dd183281e'
31
+ end
32
+ end
33
+
34
+ tests('post-x-www-form-urlencoded-parameter') do
35
+ returns(@signer.sign({:headers => {'Content-type' => 'application/x-www-form-urlencoded; charset=utf8', 'Host' => 'host.foo.com', 'Date' => 'Mon, 09 Sep 2011 23:36:00 GMT'}, :method => :post, :path => '/',
36
+ :body => 'foo=bar'}, Fog::Time.now)) do
37
+ 'AWS4-HMAC-SHA256 Credential=AKIDEXAMPLE/20110909/us-east-1/host/aws4_request, SignedHeaders=content-type;date;host, Signature=b105eb10c6d318d2294de9d49dd8b031b55e3c3fe139f2e637da70511e9e7b71'
38
+ end
39
+ end
40
+ Fog::Time.now = ::Time.now
41
+ end
@@ -0,0 +1,9 @@
1
+ Shindo.tests('Fog::Compute::Brightbox::Real', ['brightbox']) do
2
+
3
+ @bb = Fog::Compute::Brightbox::Real.new({})
4
+
5
+ tests("#respond_to? :default_image").returns(true) do
6
+ @bb.respond_to?(:default_image)
7
+ end
8
+
9
+ end
@@ -42,13 +42,20 @@ class Brightbox
42
42
  module TestSupport
43
43
  # Find a suitable image for testing with
44
44
  # For speed of server building we're using an empty image
45
+ #
46
+ # Unless the tester has credentials this will fail so we rescue
47
+ # any errors and return nil.
48
+ #
49
+ # This is used in the shared file +tests/compute/helper.rb+ so unfortunately
50
+ # makes all tests reliant on hardcoded values and each other
51
+ #
52
+ # @return [String,NilClass] the most suitable test image's identifier or nil
45
53
  def self.image_id
46
54
  return @image_id unless @image_id.nil?
47
- images = Fog::Compute[:brightbox].list_images
48
- raise "No available images!" if images.empty?
49
- image = images.select {|img| img.size == 0 }.first
50
- image = images.first if image.nil?
55
+ image = select_testing_image_from_api
51
56
  @image_id = image["id"]
57
+ rescue
58
+ @image_id = nil
52
59
  end
53
60
 
54
61
  # Prepare a test server, wait for it to be usable but raise if it fails
@@ -62,6 +69,13 @@ class Brightbox
62
69
  server
63
70
  end
64
71
 
72
+ private
73
+ def self.select_testing_image_from_api
74
+ images = Fog::Compute[:brightbox].list_images
75
+ raise "No available images!" if images.empty?
76
+ images.select {|img| img.size == 0 }.first || images.first
77
+ end
78
+
65
79
  end
66
80
  module Formats
67
81
  module Struct
@@ -189,7 +203,7 @@ class Brightbox
189
203
  "id" => String,
190
204
  "resource_type" => String,
191
205
  "url" => String,
192
- "name" => String,
206
+ "name" => Fog::Nullable::String,
193
207
  "created_at" => String,
194
208
  "default" => Fog::Boolean,
195
209
  "description" => Fog::Nullable::String,
@@ -340,7 +354,7 @@ class Brightbox
340
354
  "id" => String,
341
355
  "resource_type" => String,
342
356
  "url" => String,
343
- "name" => String,
357
+ "name" => Fog::Nullable::String,
344
358
  "description" => Fog::Nullable::String,
345
359
  "default" => Fog::Boolean,
346
360
  "created_at" => String,
@@ -547,6 +561,7 @@ class Brightbox
547
561
  "server_groups" => [Brightbox::Compute::Formats::Nested::SERVER_GROUP],
548
562
  "interfaces" => [Brightbox::Compute::Formats::Nested::INTERFACE],
549
563
  "zone" => Fog::Brightbox::Nullable::Zone,
564
+ "licence_name" => Fog::Nullable::String,
550
565
  "username" => Fog::Nullable::String
551
566
  }
552
567
 
@@ -19,7 +19,7 @@ def volume_tests(connection, params, mocks_implemented = true)
19
19
  end
20
20
  end
21
21
 
22
- Shindo.tests("Fog::Compute[:cloudstack] | volume", :cloudstack) do
22
+ Shindo.tests("Fog::Compute[:cloudstack] | volume", "cloudstack") do
23
23
 
24
24
  config = compute_providers[:cloudstack]
25
25
 
@@ -45,4 +45,4 @@ Shindo.tests('Fog::Compute[:cloudstack] | volume requests', ['cloudstack']) do
45
45
 
46
46
  end
47
47
 
48
- end
48
+ end
@@ -15,7 +15,7 @@ def compute_providers
15
15
  },
16
16
  :brightbox => {
17
17
  :server_attributes => {
18
- :image_id => 'img-wwgbb' # Ubuntu Lucid 10.04 server (i686)
18
+ :image_id => Brightbox::Compute::TestSupport.image_id
19
19
  },
20
20
  :mocked => false
21
21
  },
@@ -33,12 +33,18 @@ def compute_providers
33
33
  },
34
34
  :server_attributes => {}.tap do |hash|
35
35
  [:zone_id, :network_ids, :template_id, :service_offering_id].each do |k|
36
- hash[k]= Fog.credentials["cloudstack_#{k}".to_sym]
36
+ key = "cloudstack_#{k}".to_sym
37
+ if Fog.credentials[key]
38
+ hash[k]= Fog.credentials[key]
39
+ end
37
40
  end
38
41
  end,
39
42
  :volume_attributes => {:name => "somevolume"}.tap do |hash|
40
43
  [:zone_id, :disk_offering_id].each do |k|
41
- hash[k]= Fog.credentials["cloudstack_#{k}".to_sym]
44
+ key = "cloudstack_#{k}".to_sym
45
+ if Fog.credentials[key]
46
+ hash[k]= Fog.credentials[key]
47
+ end
42
48
  end
43
49
  end,
44
50
  :security_group_attributes => {:name => "cloudstack.sg.#{Time.now.to_i}"},
@@ -53,7 +59,7 @@ def compute_providers
53
59
  :glesys => {
54
60
  :server_attributes => {
55
61
  :rootpassword => "secret_password_#{Time.now.to_i}",
56
- :hostname => "fog.example#{Time.now.to_i}.com"
62
+ :hostname => "fog.example#{Time.now.to_i}.com"
57
63
  },
58
64
  :mocked => false
59
65
  },