fog 1.10.1 → 1.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.travis.yml +1 -0
- data/Gemfile +2 -0
- data/README.md +4 -3
- data/changelog.txt +207 -0
- data/fog.gemspec +4 -3
- data/lib/fog/aws.rb +0 -2
- data/lib/fog/aws/dynamodb.rb +1 -1
- data/lib/fog/aws/elasticache.rb +0 -2
- data/lib/fog/aws/iam.rb +1 -0
- data/lib/fog/aws/models/compute/volume.rb +1 -0
- data/lib/fog/aws/models/iam/user.rb +1 -0
- data/lib/fog/aws/models/storage/directories.rb +1 -1
- data/lib/fog/aws/models/storage/directory.rb +20 -17
- data/lib/fog/aws/models/storage/file.rb +4 -5
- data/lib/fog/aws/parsers/iam/get_user.rb +2 -0
- data/lib/fog/aws/parsers/iam/list_users.rb +2 -0
- data/lib/fog/aws/requests/cdn/delete_streaming_distribution.rb +2 -2
- data/lib/fog/aws/requests/cdn/put_distribution_config.rb +3 -3
- data/lib/fog/aws/requests/cloud_formation/update_stack.rb +3 -3
- data/lib/fog/aws/requests/cloud_formation/validate_template.rb +5 -5
- data/lib/fog/aws/requests/iam/create_user.rb +5 -4
- data/lib/fog/aws/requests/iam/get_user.rb +5 -4
- data/lib/fog/aws/requests/iam/list_users.rb +5 -4
- data/lib/fog/aws/requests/rds/create_db_instance.rb +25 -25
- data/lib/fog/aws/requests/storage/abort_multipart_upload.rb +3 -3
- data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +2 -2
- data/lib/fog/aws/requests/storage/copy_object.rb +2 -2
- data/lib/fog/aws/requests/storage/delete_bucket.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_bucket_cors.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_bucket_lifecycle.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_bucket_policy.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_bucket_website.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_multiple_objects.rb +1 -1
- data/lib/fog/aws/requests/storage/delete_object.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_acl.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_cors.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_lifecycle.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_location.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_logging.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_object_versions.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_policy.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_versioning.rb +1 -1
- data/lib/fog/aws/requests/storage/get_bucket_website.rb +1 -1
- data/lib/fog/aws/requests/storage/get_object.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_acl.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_http_url.rb +1 -19
- data/lib/fog/aws/requests/storage/get_object_torrent.rb +2 -2
- data/lib/fog/aws/requests/storage/get_object_url.rb +5 -14
- data/lib/fog/aws/requests/storage/get_request_payment.rb +1 -1
- data/lib/fog/aws/requests/storage/head_object.rb +2 -2
- data/lib/fog/aws/requests/storage/initiate_multipart_upload.rb +2 -2
- data/lib/fog/aws/requests/storage/list_multipart_uploads.rb +7 -8
- data/lib/fog/aws/requests/storage/list_parts.rb +2 -2
- data/lib/fog/aws/requests/storage/put_bucket.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_acl.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_cors.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_lifecycle.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_logging.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_policy.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_versioning.rb +1 -1
- data/lib/fog/aws/requests/storage/put_bucket_website.rb +1 -1
- data/lib/fog/aws/requests/storage/put_object.rb +2 -2
- data/lib/fog/aws/requests/storage/put_object_acl.rb +8 -8
- data/lib/fog/aws/requests/storage/put_object_url.rb +5 -7
- data/lib/fog/aws/requests/storage/put_request_payment.rb +1 -1
- data/lib/fog/aws/requests/storage/upload_part.rb +2 -2
- data/lib/fog/aws/storage.rb +201 -97
- data/lib/fog/bin/google.rb +47 -1
- data/lib/fog/bluebox/models/compute/server.rb +3 -1
- data/lib/fog/brightbox/compute.rb +11 -26
- data/lib/fog/brightbox/compute/image_selector.rb +45 -0
- data/lib/fog/cloudstack/compute.rb +70 -2
- data/lib/fog/cloudstack/models/compute/disk_offering.rb +46 -0
- data/lib/fog/cloudstack/models/compute/disk_offerings.rb +27 -0
- data/lib/fog/cloudstack/models/compute/image.rb +1 -1
- data/lib/fog/cloudstack/models/compute/servers.rb +3 -2
- data/lib/fog/cloudstack/requests/compute/create_disk_offering.rb +51 -0
- data/lib/fog/cloudstack/requests/compute/delete_disk_offering.rb +31 -0
- data/lib/fog/cloudstack/requests/compute/delete_snapshot.rb +44 -2
- data/lib/fog/cloudstack/requests/compute/list_disk_offerings.rb +9 -0
- data/lib/fog/cloudstack/requests/compute/list_os_types.rb +9 -0
- data/lib/fog/cloudstack/requests/compute/list_snapshots.rb +21 -0
- data/lib/fog/core/errors.rb +3 -0
- data/lib/fog/core/json.rb +48 -7
- data/lib/fog/core/model.rb +11 -10
- data/lib/fog/core/service.rb +1 -1
- data/lib/fog/digitalocean/CHANGELOG.md +1 -1
- data/lib/fog/dreamhost/dns.rb +1 -3
- data/lib/fog/google.rb +1 -0
- data/lib/fog/google/compute.rb +131 -0
- data/lib/fog/google/models/compute/flavor.rb +24 -0
- data/lib/fog/google/models/compute/flavors.rb +28 -0
- data/lib/fog/google/models/compute/image.rb +19 -0
- data/lib/fog/google/models/compute/images.rb +28 -0
- data/lib/fog/google/models/compute/server.rb +80 -0
- data/lib/fog/google/models/compute/servers.rb +61 -0
- data/lib/fog/google/requests/compute/delete_disk.rb +31 -0
- data/lib/fog/google/requests/compute/delete_firewall.rb +30 -0
- data/lib/fog/google/requests/compute/delete_image.rb +30 -0
- data/lib/fog/google/requests/compute/delete_network.rb +30 -0
- data/lib/fog/google/requests/compute/delete_operation.rb +30 -0
- data/lib/fog/google/requests/compute/delete_server.rb +40 -0
- data/lib/fog/google/requests/compute/get_disk.rb +31 -0
- data/lib/fog/google/requests/compute/get_firewall.rb +30 -0
- data/lib/fog/google/requests/compute/get_image.rb +30 -0
- data/lib/fog/google/requests/compute/get_machine_type.rb +30 -0
- data/lib/fog/google/requests/compute/get_network.rb +30 -0
- data/lib/fog/google/requests/compute/get_server.rb +31 -0
- data/lib/fog/google/requests/compute/get_zone.rb +30 -0
- data/lib/fog/google/requests/compute/insert_disk.rb +35 -0
- data/lib/fog/google/requests/compute/insert_firewall.rb +37 -0
- data/lib/fog/google/requests/compute/insert_image.rb +38 -0
- data/lib/fog/google/requests/compute/insert_network.rb +34 -0
- data/lib/fog/google/requests/compute/insert_server.rb +49 -0
- data/lib/fog/google/requests/compute/list_disks.rb +30 -0
- data/lib/fog/google/requests/compute/list_firewalls.rb +29 -0
- data/lib/fog/google/requests/compute/list_global_operations.rb +28 -0
- data/lib/fog/google/requests/compute/list_images.rb +29 -0
- data/lib/fog/google/requests/compute/list_machine_types.rb +29 -0
- data/lib/fog/google/requests/compute/list_networks.rb +29 -0
- data/lib/fog/google/requests/compute/list_servers.rb +30 -0
- data/lib/fog/google/requests/compute/list_zone_operations.rb +28 -0
- data/lib/fog/google/requests/compute/list_zones.rb +29 -0
- data/lib/fog/google/requests/compute/set_metadata.rb +36 -0
- data/lib/fog/hp.rb +1 -1
- data/lib/fog/hp/storage.rb +1 -1
- data/lib/fog/internet_archive/models/storage/ia_attributes.rb +1 -1
- data/lib/fog/internet_archive/requests/storage/head_object.rb +1 -2
- data/lib/fog/internet_archive/requests/storage/list_multipart_uploads.rb +5 -6
- data/lib/fog/openstack.rb +29 -1
- data/lib/fog/openstack/CHANGELOG.md +1 -1
- data/lib/fog/openstack/compute.rb +3 -2
- data/lib/fog/openstack/identity.rb +1 -5
- data/lib/fog/openstack/image.rb +8 -9
- data/lib/fog/openstack/models/compute/server.rb +24 -0
- data/lib/fog/openstack/network.rb +7 -28
- data/lib/fog/openstack/requests/compute/allocate_address.rb +1 -1
- data/lib/fog/openstack/requests/compute/attach_volume.rb +11 -6
- data/lib/fog/openstack/requests/compute/boot_from_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_key_pair.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_security_group_rule.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_volume.rb +15 -14
- data/lib/fog/openstack/requests/compute/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/compute/delete_volume.rb +9 -2
- data/lib/fog/openstack/requests/compute/detach_volume.rb +7 -2
- data/lib/fog/openstack/requests/compute/get_server_volumes.rb +10 -0
- data/lib/fog/openstack/requests/compute/get_volume_details.rb +7 -16
- data/lib/fog/openstack/requests/compute/list_tenants.rb +1 -1
- data/lib/fog/openstack/requests/compute/list_volumes.rb +4 -26
- data/lib/fog/openstack/requests/compute/revert_resize_server.rb +2 -2
- data/lib/fog/openstack/requests/compute/update_quota.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_ec2_credential.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_role.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_user.rb +1 -1
- data/lib/fog/openstack/requests/identity/update_user.rb +1 -1
- data/lib/fog/openstack/requests/image/update_image_members.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume.rb +1 -1
- data/lib/fog/openstack/requests/volume/create_volume_snapshot.rb +1 -1
- data/lib/fog/openstack/requests/volume/get_quota.rb +31 -0
- data/lib/fog/openstack/requests/volume/get_quota_defaults.rb +31 -0
- data/lib/fog/openstack/requests/volume/update_quota.rb +32 -0
- data/lib/fog/openstack/volume.rb +11 -7
- data/lib/fog/rackspace.rb +11 -5
- data/lib/fog/rackspace/block_storage.rb +2 -1
- data/lib/fog/rackspace/cdn.rb +15 -15
- data/lib/fog/rackspace/compute.rb +2 -2
- data/lib/fog/rackspace/compute_v2.rb +8 -5
- data/lib/fog/rackspace/databases.rb +2 -1
- data/lib/fog/rackspace/dns.rb +2 -1
- data/lib/fog/rackspace/errors.rb +27 -0
- data/lib/fog/rackspace/load_balancers.rb +2 -1
- data/lib/fog/rackspace/mock_data.rb +5 -6
- data/lib/fog/rackspace/models/block_storage/snapshot.rb +8 -8
- data/lib/fog/rackspace/models/block_storage/snapshots.rb +8 -8
- data/lib/fog/rackspace/models/block_storage/volume.rb +16 -16
- data/lib/fog/rackspace/models/block_storage/volume_types.rb +8 -8
- data/lib/fog/rackspace/models/block_storage/volumes.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/attachment.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/attachments.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/flavors.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/image.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/images.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/metadata.rb +12 -12
- data/lib/fog/rackspace/models/compute_v2/metadatum.rb +8 -8
- data/lib/fog/rackspace/models/compute_v2/server.rb +94 -55
- data/lib/fog/rackspace/models/compute_v2/servers.rb +12 -12
- data/lib/fog/rackspace/models/dns/records.rb +1 -1
- data/lib/fog/rackspace/models/dns/zones.rb +1 -1
- data/lib/fog/rackspace/models/storage/account.rb +8 -8
- data/lib/fog/rackspace/models/storage/directories.rb +8 -8
- data/lib/fog/rackspace/models/storage/directory.rb +32 -32
- data/lib/fog/rackspace/models/storage/file.rb +36 -36
- data/lib/fog/rackspace/models/storage/files.rb +20 -20
- data/lib/fog/rackspace/requests/block_storage/create_snapshot.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/create_volume.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/delete_snapshot.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/delete_volume.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/get_snapshot.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/get_volume.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/get_volume_type.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/list_snapshots.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/list_volume_types.rb +4 -4
- data/lib/fog/rackspace/requests/block_storage/list_volumes.rb +4 -4
- data/lib/fog/rackspace/requests/cdn/delete_object.rb +4 -4
- data/lib/fog/rackspace/requests/cdn/get_containers.rb +4 -4
- data/lib/fog/rackspace/requests/cdn/head_container.rb +4 -4
- data/lib/fog/rackspace/requests/cdn/post_container.rb +4 -4
- data/lib/fog/rackspace/requests/cdn/put_container.rb +4 -4
- data/lib/fog/rackspace/requests/compute/delete_image.rb +1 -1
- data/lib/fog/rackspace/requests/compute_v2/attach_volume.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/change_server_password.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/confirm_resize_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/create_image.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/create_server.rb +11 -5
- data/lib/fog/rackspace/requests/compute_v2/delete_attachment.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/delete_image.rb +5 -4
- data/lib/fog/rackspace/requests/compute_v2/delete_metadata_item.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/delete_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/get_attachment.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/get_flavor.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/get_image.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/get_metadata_item.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/get_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_addresses.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_addresses_by_network.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_attachments.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_flavors.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_images.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_metadata.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/list_servers.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/reboot_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/rebuild_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/rescue_server.rb +43 -0
- data/lib/fog/rackspace/requests/compute_v2/resize_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/revert_resize_server.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/set_metadata.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/set_metadata_item.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/unrescue_server.rb +40 -0
- data/lib/fog/rackspace/requests/compute_v2/update_metadata.rb +4 -4
- data/lib/fog/rackspace/requests/compute_v2/update_server.rb +4 -4
- data/lib/fog/rackspace/requests/storage/copy_object.rb +4 -4
- data/lib/fog/rackspace/requests/storage/delete_container.rb +4 -4
- data/lib/fog/rackspace/requests/storage/delete_object.rb +4 -4
- data/lib/fog/rackspace/requests/storage/get_container.rb +4 -4
- data/lib/fog/rackspace/requests/storage/get_containers.rb +4 -4
- data/lib/fog/rackspace/requests/storage/get_object.rb +4 -4
- data/lib/fog/rackspace/requests/storage/get_object_https_url.rb +4 -4
- data/lib/fog/rackspace/requests/storage/head_container.rb +4 -4
- data/lib/fog/rackspace/requests/storage/head_containers.rb +4 -4
- data/lib/fog/rackspace/requests/storage/head_object.rb +4 -4
- data/lib/fog/rackspace/requests/storage/post_set_meta_temp_url_key.rb +4 -4
- data/lib/fog/rackspace/requests/storage/put_container.rb +4 -4
- data/lib/fog/rackspace/requests/storage/put_object.rb +4 -4
- data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +4 -4
- data/lib/fog/rackspace/service.rb +1 -1
- data/lib/fog/rackspace/storage.rb +12 -6
- data/lib/fog/riakcs.rb +3 -3
- data/lib/fog/riakcs/provisioning.rb +1 -3
- data/lib/fog/riakcs/requests/provisioning/create_user.rb +2 -2
- data/lib/fog/riakcs/requests/provisioning/get_user.rb +1 -1
- data/lib/fog/riakcs/requests/provisioning/list_users.rb +1 -1
- data/lib/fog/riakcs/requests/usage/get_usage.rb +1 -1
- data/lib/fog/riakcs/usage.rb +0 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/compute.rb +21 -14
- data/lib/fog/vsphere/models/compute/networks.rb +2 -2
- data/lib/fog/vsphere/models/compute/server.rb +10 -0
- data/lib/fog/vsphere/requests/compute/get_resource_pool.rb +1 -1
- data/lib/fog/vsphere/requests/compute/get_template.rb +16 -0
- data/lib/fog/vsphere/requests/compute/list_datacenters.rb +1 -1
- data/lib/fog/vsphere/requests/compute/list_templates.rb +49 -0
- data/lib/fog/vsphere/requests/compute/list_virtual_machines.rb +9 -6
- data/lib/fog/vsphere/requests/compute/vm_clone.rb +41 -27
- data/lib/fog/xenserver/CHANGELOG.md +1 -1
- data/lib/fog/xenserver/models/compute/network.rb +2 -2
- data/lib/tasks/changelog_task.rb +2 -1
- data/tests/aws/models/storage/directory_tests.rb +41 -5
- data/tests/aws/models/storage/file_tests.rb +1 -2
- data/tests/aws/models/storage/files_tests.rb +6 -4
- data/tests/aws/models/storage/url_tests.rb +7 -5
- data/tests/aws/models/storage/version_tests.rb +2 -2
- data/tests/aws/models/storage/versions_tests.rb +5 -5
- data/tests/aws/requests/iam/user_tests.rb +10 -8
- data/tests/aws/requests/storage/multipart_upload_tests.rb +1 -1
- data/tests/aws/requests/storage/object_tests.rb +15 -13
- data/tests/brightbox/compute/image_selector_tests.rb +103 -0
- data/tests/cloudstack/compute/models/disk_offering_tests.rb +5 -0
- data/tests/cloudstack/compute/models/snapshot_tests.rb +5 -20
- data/tests/cloudstack/requests/disk_offering_tests.rb +3 -3
- data/tests/cloudstack/requests/os_type_tests.rb +2 -3
- data/tests/compute/helper.rb +9 -0
- data/tests/core/json_tests.rb +62 -0
- data/tests/dynect/requests/dns/dns_tests.rb +0 -3
- data/tests/google/models/compute/server_tests.rb +24 -0
- data/tests/google/requests/compute/disk_tests.rb +88 -0
- data/tests/google/requests/compute/firewall_tests.rb +85 -0
- data/tests/google/requests/compute/image_tests.rb +80 -0
- data/tests/google/requests/compute/network_tests.rb +74 -0
- data/tests/google/requests/compute/operation_tests.rb +19 -0
- data/tests/google/requests/compute/server_tests.rb +84 -0
- data/tests/google/requests/compute/zone_tests.rb +46 -0
- data/tests/helpers/mock_helper.rb +4 -0
- data/tests/openstack/models/compute/server_tests.rb +91 -1
- data/tests/openstack/requests/compute/volume_tests.rb +11 -9
- data/tests/openstack/requests/volume/quota_tests.rb +51 -0
- data/tests/openstack/version_tests.rb +55 -0
- data/tests/rackspace/helper.rb +10 -0
- data/tests/rackspace/models/compute_v2/server_tests.rb +26 -1
- data/tests/rackspace/requests/compute/image_tests.rb +1 -1
- data/tests/rackspace/requests/compute_v2/image_tests.rb +2 -2
- data/tests/rackspace/requests/compute_v2/server_tests.rb +13 -0
- data/tests/rackspace/requests/dns/dns_tests.rb +1 -1
- data/tests/rackspace/requests/dns/records_tests.rb +3 -3
- data/tests/vsphere/requests/compute/vm_clone_tests.rb +10 -0
- metadata +109 -747
@@ -1,6 +1,6 @@
|
|
1
1
|
Shindo.tests('Fog::Storage[:aws] | multipart upload requests', ["aws"]) do
|
2
2
|
|
3
|
-
@directory = Fog::Storage[:aws].directories.create(:key => 'fogmultipartuploadtests')
|
3
|
+
@directory = Fog::Storage[:aws].directories.create(:key => uniq_id('fogmultipartuploadtests'))
|
4
4
|
|
5
5
|
tests('success') do
|
6
6
|
|
@@ -111,14 +111,16 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
|
|
111
111
|
|
112
112
|
end
|
113
113
|
|
114
|
+
fognonbucket = uniq_id('fognonbucket')
|
115
|
+
|
114
116
|
tests('failure') do
|
115
117
|
|
116
|
-
tests("#put_object('fognonbucket', 'fog_non_object', lorem_file)").raises(Excon::Errors::NotFound) do
|
117
|
-
Fog::Storage[:aws].put_object(
|
118
|
+
tests("#put_object('#{fognonbucket}', 'fog_non_object', lorem_file)").raises(Excon::Errors::NotFound) do
|
119
|
+
Fog::Storage[:aws].put_object(fognonbucket, 'fog_non_object', lorem_file)
|
118
120
|
end
|
119
121
|
|
120
|
-
tests("#copy_object('fognonbucket', 'fog_object', '#{@directory.identity}', 'fog_other_object')").raises(Excon::Errors::NotFound) do
|
121
|
-
Fog::Storage[:aws].copy_object(
|
122
|
+
tests("#copy_object('#{fognonbucket}', 'fog_object', '#{@directory.identity}', 'fog_other_object')").raises(Excon::Errors::NotFound) do
|
123
|
+
Fog::Storage[:aws].copy_object(fognonbucket, 'fog_object', @directory.identity, 'fog_other_object')
|
122
124
|
end
|
123
125
|
|
124
126
|
tests("#copy_object('#{@directory.identity}', 'fog_non_object', '#{@directory.identity}', 'fog_other_object')").raises(Excon::Errors::NotFound) do
|
@@ -126,32 +128,32 @@ Shindo.tests('AWS::Storage | object requests', ['aws']) do
|
|
126
128
|
end
|
127
129
|
|
128
130
|
tests("#copy_object('#{@directory.identity}', 'fog_object', 'fognonbucket', 'fog_other_object')").raises(Excon::Errors::NotFound) do
|
129
|
-
Fog::Storage[:aws].copy_object(@directory.identity, 'fog_object',
|
131
|
+
Fog::Storage[:aws].copy_object(@directory.identity, 'fog_object', fognonbucket, 'fog_other_object')
|
130
132
|
end
|
131
133
|
|
132
|
-
tests("#get_object('fognonbucket', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
133
|
-
Fog::Storage[:aws].get_object(
|
134
|
+
tests("#get_object('#{fognonbucket}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
135
|
+
Fog::Storage[:aws].get_object(fognonbucket, 'fog_non_object')
|
134
136
|
end
|
135
137
|
|
136
138
|
tests("#get_object('#{@directory.identity}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
137
139
|
Fog::Storage[:aws].get_object(@directory.identity, 'fog_non_object')
|
138
140
|
end
|
139
141
|
|
140
|
-
tests("#head_object(
|
141
|
-
Fog::Storage[:aws].head_object(
|
142
|
+
tests("#head_object(fognonbucket, 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
143
|
+
Fog::Storage[:aws].head_object(fognonbucket, 'fog_non_object')
|
142
144
|
end
|
143
145
|
|
144
146
|
tests("#head_object('#{@directory.identity}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
145
147
|
Fog::Storage[:aws].head_object(@directory.identity, 'fog_non_object')
|
146
148
|
end
|
147
149
|
|
148
|
-
tests("#delete_object('fognonbucket', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
149
|
-
Fog::Storage[:aws].delete_object(
|
150
|
+
tests("#delete_object('#{fognonbucket}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
151
|
+
Fog::Storage[:aws].delete_object(fognonbucket, 'fog_non_object')
|
150
152
|
end
|
151
153
|
|
152
|
-
tests("#delete_multiple_objects('fognonbucket', ['fog_non_object'])").raises(Excon::Errors::NotFound) do
|
154
|
+
tests("#delete_multiple_objects('#{fognonbucket}', ['fog_non_object'])").raises(Excon::Errors::NotFound) do
|
153
155
|
pending if Fog.mocking?
|
154
|
-
Fog::Storage[:aws].delete_multiple_objects(
|
156
|
+
Fog::Storage[:aws].delete_multiple_objects(fognonbucket, ['fog_non_object'])
|
155
157
|
end
|
156
158
|
|
157
159
|
tests("#put_object_acl('#{@directory.identity}', 'fog_object', 'invalid')").raises(Excon::Errors::BadRequest) do
|
@@ -0,0 +1,103 @@
|
|
1
|
+
Shindo.tests("Fog::Brightbox::Compute::ImageSelector.new", ["brightbox"]) do
|
2
|
+
|
3
|
+
sample_images = [
|
4
|
+
{
|
5
|
+
"id" => "img-00000",
|
6
|
+
"name" => "Ubuntu Lucid 10.04 LTS",
|
7
|
+
"official" => true,
|
8
|
+
"arch" => "i686",
|
9
|
+
"created_at" => "2013-04-30T12:34:56"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"id" => "img-11111",
|
13
|
+
"name" => "ubuntu-precise-12.04-amd64-server",
|
14
|
+
"official" => false,
|
15
|
+
"arch" => "i686",
|
16
|
+
"created_at" => "2013-05-01T12:34:56"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"id" => "img-22222",
|
20
|
+
"name" => "ubuntu-quantal-12.10-i386-server",
|
21
|
+
"official" => true,
|
22
|
+
"arch" => "i686",
|
23
|
+
"created_at" => "2013-05-01T12:34:56"
|
24
|
+
},
|
25
|
+
{
|
26
|
+
"id" => "img-33333",
|
27
|
+
"name" => "ubuntu-raring-13.04-amd64-server",
|
28
|
+
"official" => true,
|
29
|
+
"arch" => "amd64",
|
30
|
+
"created_at" => "2013-05-01T12:34:56"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"id" => "img-44444",
|
34
|
+
"name" => "Fedora 17 server",
|
35
|
+
"official" => true,
|
36
|
+
"arch" => "i686",
|
37
|
+
"created_at" => "2013-05-01T12:34:56"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"id" => "img-ubuntu",
|
41
|
+
"name" => "ubuntu-raring-13.04-i386-server",
|
42
|
+
"official" => true,
|
43
|
+
"arch" => "i686",
|
44
|
+
"created_at" => "2013-05-01T12:34:56"
|
45
|
+
},
|
46
|
+
]
|
47
|
+
|
48
|
+
@image_selector = Fog::Brightbox::Compute::ImageSelector.new(sample_images)
|
49
|
+
|
50
|
+
test("#respond_to?(:latest_ubuntu)") do
|
51
|
+
@image_selector.respond_to?(:latest_ubuntu)
|
52
|
+
end
|
53
|
+
|
54
|
+
tests("when there are sample of images") do
|
55
|
+
tests("#latest_ubuntu").returns("img-ubuntu") do
|
56
|
+
@image_selector.latest_ubuntu
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
tests("when only old format names are present") do
|
61
|
+
tests("#latest_ubuntu").returns("img-ubuntu") do
|
62
|
+
sample_images = [
|
63
|
+
{
|
64
|
+
"id" => "img-11111",
|
65
|
+
"name" => "Ubuntu Lucid 10.04 LTS server",
|
66
|
+
"official" => true,
|
67
|
+
"arch" => "i686",
|
68
|
+
"created_at" => "2013-05-01T12:34:56"
|
69
|
+
},
|
70
|
+
{
|
71
|
+
"id" => "img-22222",
|
72
|
+
"name" => "Ubuntu Quantal 12.10 server",
|
73
|
+
"official" => false,
|
74
|
+
"arch" => "x86_64",
|
75
|
+
"created_at" => "2013-05-01T12:34:56"
|
76
|
+
},
|
77
|
+
{
|
78
|
+
"id" => "img-ubuntu",
|
79
|
+
"name" => "Ubuntu Quantal 12.10 server",
|
80
|
+
"official" => true,
|
81
|
+
"arch" => "i686",
|
82
|
+
"created_at" => "2013-05-01T12:34:56"
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"id" => "img-33333",
|
86
|
+
"name" => "Blank disk image",
|
87
|
+
"official" => true,
|
88
|
+
"arch" => "i686",
|
89
|
+
"created_at" => "2013-05-01T12:34:56"
|
90
|
+
}
|
91
|
+
]
|
92
|
+
@image_selector = Fog::Brightbox::Compute::ImageSelector.new(sample_images)
|
93
|
+
@image_selector.latest_ubuntu
|
94
|
+
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
tests("when ") do
|
99
|
+
tests("#latest_ubuntu").returns(nil) do
|
100
|
+
Fog::Brightbox::Compute::ImageSelector.new([]).latest_ubuntu
|
101
|
+
end
|
102
|
+
end
|
103
|
+
end
|
@@ -3,19 +3,6 @@ def snapshot_tests(connection, params, mocks_implemented = true)
|
|
3
3
|
if !Fog.mocking? || mocks_implemented
|
4
4
|
@instance.wait_for { ready? }
|
5
5
|
end
|
6
|
-
|
7
|
-
@volume = @instance.connection.volumes.create(params[:volumes_attributes])
|
8
|
-
@volume.wait_for { ready? }
|
9
|
-
|
10
|
-
tests('create').succeeds do
|
11
|
-
@instance.create :volume_id => @volume.id
|
12
|
-
end
|
13
|
-
|
14
|
-
tests('destroy').succeeds do
|
15
|
-
@instance.destroy
|
16
|
-
end
|
17
|
-
|
18
|
-
@volume.destroy
|
19
6
|
end
|
20
7
|
end
|
21
8
|
|
@@ -23,12 +10,10 @@ Shindo.tests("Fog::Compute[:cloudstack] | snapshot", "cloudstack") do
|
|
23
10
|
|
24
11
|
config = compute_providers[:cloudstack]
|
25
12
|
|
26
|
-
snapshot_tests(Fog::Compute[:cloudstack], config, config[:mocked])
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
responds_to(:ready?)
|
31
|
-
responds_to(:volume)
|
32
|
-
end
|
13
|
+
snapshot_tests(Fog::Compute[:cloudstack], config, config[:mocked])
|
14
|
+
|
15
|
+
tests('has volume relation') do
|
16
|
+
responds_to(:volume)
|
33
17
|
end
|
18
|
+
|
34
19
|
end
|
@@ -4,14 +4,15 @@ Shindo.tests('Fog::Compute[:cloudstack] | disk offering requests', ['cloudstack'
|
|
4
4
|
'listdiskofferingsresponse' => {
|
5
5
|
'count' => Integer,
|
6
6
|
'diskoffering' => [
|
7
|
-
'id' =>
|
7
|
+
'id' => String,
|
8
8
|
'created' => String,
|
9
9
|
'disksize' => Integer,
|
10
10
|
'displaytext' => String,
|
11
11
|
'domain' => Fog::Nullable::String,
|
12
|
-
'domainid' => Fog::Nullable::
|
12
|
+
'domainid' => Fog::Nullable::String,
|
13
13
|
'iscustomized' => Fog::Boolean,
|
14
14
|
'name' => String,
|
15
|
+
'storagetype' => String,
|
15
16
|
'tags' => Fog::Nullable::String
|
16
17
|
]
|
17
18
|
}
|
@@ -20,7 +21,6 @@ Shindo.tests('Fog::Compute[:cloudstack] | disk offering requests', ['cloudstack'
|
|
20
21
|
tests('success') do
|
21
22
|
|
22
23
|
tests('#list_disk_offerings').formats(@disk_offerings_format) do
|
23
|
-
pending if Fog.mocking?
|
24
24
|
Fog::Compute[:cloudstack].list_disk_offerings
|
25
25
|
end
|
26
26
|
|
@@ -4,9 +4,9 @@ Shindo.tests('Fog::Compute[:cloudstack] | os type requests', ['cloudstack']) do
|
|
4
4
|
'listostypesresponse' => {
|
5
5
|
'count' => Integer,
|
6
6
|
'ostype' => [
|
7
|
-
'id' =>
|
7
|
+
'id' => String,
|
8
8
|
'description' => String,
|
9
|
-
'oscategoryid' =>
|
9
|
+
'oscategoryid' => String
|
10
10
|
]
|
11
11
|
}
|
12
12
|
}
|
@@ -24,7 +24,6 @@ Shindo.tests('Fog::Compute[:cloudstack] | os type requests', ['cloudstack']) do
|
|
24
24
|
tests('success') do
|
25
25
|
|
26
26
|
tests('#list_os_types').formats(@os_types_format) do
|
27
|
-
pending if Fog.mocking?
|
28
27
|
Fog::Compute[:cloudstack].list_os_types
|
29
28
|
end
|
30
29
|
|
data/tests/compute/helper.rb
CHANGED
@@ -60,6 +60,14 @@ def compute_providers
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end,
|
63
|
+
:snapshot_attributes => {:volume_id => "89198f7c-0245-aa1d-136a-c5f479ef9db7"}.tap do |hash|
|
64
|
+
[:volume_id, :domain_id, :policy_id].each do |k|
|
65
|
+
key = "cloudstack_#{k}".to_sym
|
66
|
+
if Fog.credentials[key]
|
67
|
+
hash[k]= Fog.credentials[key]
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end,
|
63
71
|
:security_group_attributes => {:name => "cloudstack.sg.#{Time.now.to_i}"},
|
64
72
|
:security_group_rule_attributes => {
|
65
73
|
:cidr => '0.0.0.0/0',
|
@@ -67,6 +75,7 @@ def compute_providers
|
|
67
75
|
:end_port => 456,
|
68
76
|
:protocol => 'tcp'
|
69
77
|
},
|
78
|
+
:disk_offering_attributes => { :name => "new disk offering", :display_text => 'New Disk Offering' },
|
70
79
|
:mocked => true
|
71
80
|
},
|
72
81
|
:glesys => {
|
@@ -0,0 +1,62 @@
|
|
1
|
+
Shindo.tests('Fog#JSON', 'core') do
|
2
|
+
|
3
|
+
TEST_HASH = {'quantity' => 4}
|
4
|
+
VALID_JSON = "{\"quantity\":4}"
|
5
|
+
|
6
|
+
tests('LegacyJSON') do
|
7
|
+
|
8
|
+
begin
|
9
|
+
require 'json'
|
10
|
+
rescue => e
|
11
|
+
returns('Failed to load JSON library', true) { false }
|
12
|
+
end
|
13
|
+
|
14
|
+
pending? unless defined? ::JSON
|
15
|
+
|
16
|
+
class LegacyJSONTester
|
17
|
+
include Fog::JSON::LegacyJSON
|
18
|
+
end
|
19
|
+
|
20
|
+
@tester = LegacyJSONTester.new
|
21
|
+
tests('encode').returns(VALID_JSON) do
|
22
|
+
@tester.encode(TEST_HASH)
|
23
|
+
end
|
24
|
+
|
25
|
+
tests('decode').returns(TEST_HASH) do
|
26
|
+
@tester.decode(VALID_JSON)
|
27
|
+
end
|
28
|
+
|
29
|
+
tests('invalid decode').raises(Fog::JSON::LoadError) do
|
30
|
+
@tester.decode("I am not json")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
tests('NewJSON') do
|
35
|
+
|
36
|
+
begin
|
37
|
+
require 'multi_json'
|
38
|
+
rescue => e
|
39
|
+
returns('Failed to load multi_json library', true) { false }
|
40
|
+
end
|
41
|
+
|
42
|
+
pending unless defined? ::MultiJson
|
43
|
+
|
44
|
+
class NewJSONTester
|
45
|
+
include Fog::JSON::NewJSON
|
46
|
+
end
|
47
|
+
|
48
|
+
@tester = NewJSONTester.new
|
49
|
+
tests('encode').returns(VALID_JSON) do
|
50
|
+
@tester.encode(TEST_HASH)
|
51
|
+
end
|
52
|
+
|
53
|
+
tests('decode').returns(TEST_HASH) do
|
54
|
+
@tester.decode(VALID_JSON)
|
55
|
+
end
|
56
|
+
|
57
|
+
tests('invalid decode').raises(Fog::JSON::LoadError) do
|
58
|
+
@tester.decode("I am not json")
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
Shindo.tests("Fog::Compute[:google] | server model", ['google']) do
|
2
|
+
|
3
|
+
tests('servers') do
|
4
|
+
@instance = nil
|
5
|
+
test('#bootstrap') do
|
6
|
+
@instance = Fog::Compute[:google].servers.bootstrap
|
7
|
+
@instance.ready?
|
8
|
+
end
|
9
|
+
|
10
|
+
test('#sshable?') do
|
11
|
+
@instance.wait_for { sshable? }
|
12
|
+
@instance.sshable?
|
13
|
+
end
|
14
|
+
|
15
|
+
test('#ssh') do
|
16
|
+
@instance.ssh("uname") == "Linux"
|
17
|
+
end
|
18
|
+
|
19
|
+
test('#destroy') do
|
20
|
+
response = @instance.destroy
|
21
|
+
response.body['operationType'] == 'delete'
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -0,0 +1,88 @@
|
|
1
|
+
Shindo.tests('Fog::Compute[:google] | disk requests', ['google']) do
|
2
|
+
|
3
|
+
@google = Fog::Compute[:google]
|
4
|
+
|
5
|
+
@insert_disk_format = {
|
6
|
+
'kind' => String,
|
7
|
+
'id' => String,
|
8
|
+
'selfLink' => String,
|
9
|
+
'name' => String,
|
10
|
+
'targetLink' => String,
|
11
|
+
'status' => String,
|
12
|
+
'user' => String,
|
13
|
+
'progress' => Integer,
|
14
|
+
'zone' => String,
|
15
|
+
'insertTime' => String,
|
16
|
+
'startTime' => String,
|
17
|
+
'operationType' => String
|
18
|
+
}
|
19
|
+
|
20
|
+
@get_disk_format = {
|
21
|
+
'kind' => String,
|
22
|
+
'id' => String,
|
23
|
+
'selfLink' => String,
|
24
|
+
'creationTimestamp' => String,
|
25
|
+
'name' => String,
|
26
|
+
'zone' => String,
|
27
|
+
'status' => String,
|
28
|
+
'sizeGb' => String
|
29
|
+
}
|
30
|
+
|
31
|
+
@delete_disk_format = {
|
32
|
+
'kind' => String,
|
33
|
+
'id' => String,
|
34
|
+
'selfLink' => String,
|
35
|
+
'name' => String,
|
36
|
+
'targetLink' => String,
|
37
|
+
'targetId' => String,
|
38
|
+
'status' => String,
|
39
|
+
'user' => String,
|
40
|
+
'progress' => Integer,
|
41
|
+
'insertTime' => String,
|
42
|
+
'zone' => String,
|
43
|
+
'startTime' => String,
|
44
|
+
'operationType' => String
|
45
|
+
}
|
46
|
+
|
47
|
+
@list_disks_format = {
|
48
|
+
'kind' => String,
|
49
|
+
'id' => String,
|
50
|
+
'selfLink' => String,
|
51
|
+
'items' => [{
|
52
|
+
'kind'=> String,
|
53
|
+
'id'=> String,
|
54
|
+
'creationTimestamp'=>String,
|
55
|
+
'selfLink'=>String,
|
56
|
+
'name'=> String,
|
57
|
+
'sizeGb'=> String,
|
58
|
+
'zone'=> String,
|
59
|
+
'status'=>String,
|
60
|
+
}]
|
61
|
+
}
|
62
|
+
|
63
|
+
tests('success') do
|
64
|
+
|
65
|
+
disk_name = 'new-disk-test'
|
66
|
+
disk_size = '2'
|
67
|
+
zone_name = 'us-central1-a'
|
68
|
+
|
69
|
+
# These will all fail if errors happen on insert
|
70
|
+
tests("#insert_disk").formats(@insert_disk_format) do
|
71
|
+
@google.insert_disk(disk_name, disk_size, zone_name).body
|
72
|
+
end
|
73
|
+
|
74
|
+
tests("#get_disk").formats(@get_disk_format) do
|
75
|
+
@google.get_disk(disk_name, zone_name).body
|
76
|
+
end
|
77
|
+
|
78
|
+
tests("#list_disks").formats(@list_disks_format) do
|
79
|
+
@google.list_disks(zone_name).body
|
80
|
+
end
|
81
|
+
|
82
|
+
tests("#delete_disk").formats(@delete_disk_format) do
|
83
|
+
@google.delete_disk(disk_name, zone_name).body
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|