fog 1.12.1 → 1.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +1 -1
- data/Gemfile +5 -0
- data/Rakefile +14 -4
- data/bin/fog +22 -0
- data/changelog.txt +262 -0
- data/fog.gemspec +8 -4
- data/lib/fog/aws.rb +11 -0
- data/lib/fog/aws/auto_scaling.rb +15 -18
- data/lib/fog/aws/beanstalk.rb +8 -10
- data/lib/fog/aws/cloud_formation.rb +9 -12
- data/lib/fog/aws/compute.rb +8 -10
- data/lib/fog/aws/credential_fetcher.rb +6 -6
- data/lib/fog/aws/elasticache.rb +13 -17
- data/lib/fog/aws/elb.rb +29 -31
- data/lib/fog/aws/iam.rb +10 -13
- data/lib/fog/aws/models/auto_scaling/group.rb +6 -3
- data/lib/fog/aws/models/compute/spot_request.rb +1 -11
- data/lib/fog/aws/models/rds/log_file.rb +26 -0
- data/lib/fog/aws/models/rds/log_files.rb +50 -0
- data/lib/fog/aws/models/rds/server.rb +3 -1
- data/lib/fog/aws/models/rds/snapshot.rb +1 -0
- data/lib/fog/aws/models/rds/snapshots.rb +20 -13
- data/lib/fog/aws/parsers/rds/db_parser.rb +1 -1
- data/lib/fog/aws/parsers/rds/describe_db_log_files.rb +44 -0
- data/lib/fog/aws/parsers/rds/download_db_logfile_portion.rb +26 -0
- data/lib/fog/aws/parsers/ses/verify_domain_identity.rb +26 -0
- data/lib/fog/aws/parsers/storage/complete_multipart_upload.rb +1 -1
- data/lib/fog/aws/parsers/sts/assume_role.rb +30 -0
- data/lib/fog/aws/rds.rb +27 -14
- data/lib/fog/aws/requests/auto_scaling/create_auto_scaling_group.rb +8 -0
- data/lib/fog/aws/requests/auto_scaling/update_auto_scaling_group.rb +8 -1
- data/lib/fog/aws/requests/compute/create_volume.rb +3 -3
- data/lib/fog/aws/requests/rds/create_db_instance.rb +3 -1
- data/lib/fog/aws/requests/rds/describe_db_log_files.rb +67 -0
- data/lib/fog/aws/requests/rds/download_db_logfile_portion.rb +63 -0
- data/lib/fog/aws/requests/ses/send_raw_email.rb +1 -1
- data/lib/fog/aws/requests/ses/verify_domain_identity.rb +30 -0
- data/lib/fog/aws/requests/storage/complete_multipart_upload.rb +6 -2
- data/lib/fog/aws/requests/storage/get_object.rb +1 -1
- data/lib/fog/aws/requests/sts/assume_role.rb +46 -0
- data/lib/fog/aws/ses.rb +26 -9
- data/lib/fog/aws/storage.rb +2 -1
- data/lib/fog/aws/sts.rb +31 -21
- data/lib/fog/bin.rb +0 -1
- data/lib/fog/bin/openstack.rb +5 -0
- data/lib/fog/brightbox/compute.rb +20 -212
- data/lib/fog/brightbox/compute/shared.rb +232 -0
- data/lib/fog/brightbox/models/compute/collaboration.rb +43 -0
- data/lib/fog/brightbox/models/compute/collaborations.rb +23 -0
- data/lib/fog/brightbox/models/compute/user_collaboration.rb +29 -0
- data/lib/fog/brightbox/models/compute/user_collaborations.rb +23 -0
- data/lib/fog/brightbox/requests/compute/accept_user_collaboration.rb +21 -0
- data/lib/fog/brightbox/requests/compute/create_collaboration.rb +23 -0
- data/lib/fog/brightbox/requests/compute/delete_collaboration.rb +28 -0
- data/lib/fog/brightbox/requests/compute/delete_user_collaboration.rb +28 -0
- data/lib/fog/brightbox/requests/compute/destroy_user_collaboration.rb +21 -0
- data/lib/fog/brightbox/requests/compute/get_collaboration.rb +21 -0
- data/lib/fog/brightbox/requests/compute/get_user_collaboration.rb +21 -0
- data/lib/fog/brightbox/requests/compute/list_collaborations.rb +19 -0
- data/lib/fog/brightbox/requests/compute/list_user_collaborations.rb +19 -0
- data/lib/fog/brightbox/requests/compute/reject_user_collaboration.rb +21 -0
- data/lib/fog/brightbox/requests/compute/resend_collaboration.rb +21 -0
- data/lib/fog/cloudsigma/docs/getting_started.md +59 -0
- data/lib/fog/core.rb +7 -2
- data/lib/fog/core/connection.rb +62 -29
- data/lib/fog/core/deprecated/connection.rb +24 -0
- data/lib/fog/core/parser.rb +1 -1
- data/lib/fog/digitalocean/examples/getting_started.md +1 -1
- data/lib/fog/digitalocean/models/compute/server.rb +2 -2
- data/lib/fog/google/compute.rb +31 -7
- data/lib/fog/google/models/compute/disk.rb +80 -0
- data/lib/fog/google/models/compute/disks.rb +28 -0
- data/lib/fog/google/models/compute/image.rb +36 -0
- data/lib/fog/google/models/compute/server.rb +46 -33
- data/lib/fog/google/models/compute/servers.rb +15 -8
- data/lib/fog/google/requests/compute/delete_server.rb +5 -2
- data/lib/fog/google/requests/compute/get_disk.rb +3 -0
- data/lib/fog/google/requests/compute/get_server.rb +7 -1
- data/lib/fog/google/requests/compute/insert_disk.rb +8 -2
- data/lib/fog/google/requests/compute/insert_server.rb +51 -22
- data/lib/fog/google/requests/compute/list_machine_types.rb +3 -2
- data/lib/fog/google/requests/storage/get_object.rb +1 -1
- data/lib/fog/hp/requests/storage/get_object.rb +1 -1
- data/lib/fog/hp/storage.rb +26 -9
- data/lib/fog/ibm/requests/compute/create_instance.rb +20 -15
- data/lib/fog/internet_archive/requests/storage/get_object.rb +1 -1
- data/lib/fog/{core/json.rb → json.rb} +13 -2
- data/lib/fog/metering.rb +25 -0
- data/lib/fog/openstack.rb +1 -0
- data/lib/fog/openstack/metering.rb +215 -0
- data/lib/fog/openstack/models/compute/flavors.rb +2 -2
- data/lib/fog/openstack/models/compute/metadata.rb +1 -1
- data/lib/fog/openstack/models/compute/server.rb +5 -2
- data/lib/fog/openstack/models/image/images.rb +1 -1
- data/lib/fog/openstack/models/metering/meter.rb +0 -0
- data/lib/fog/openstack/models/metering/meters.rb +0 -0
- data/lib/fog/openstack/models/metering/resource.rb +24 -0
- data/lib/fog/openstack/models/metering/resources.rb +25 -0
- data/lib/fog/openstack/models/volume/volume.rb +3 -1
- data/lib/fog/openstack/models/volume/volumes.rb +2 -1
- data/lib/fog/openstack/network.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_flavor.rb +1 -1
- data/lib/fog/openstack/requests/compute/create_server.rb +19 -1
- data/lib/fog/openstack/requests/compute/detach_volume.rb +2 -1
- data/lib/fog/openstack/requests/compute/list_flavors_detail.rb +4 -3
- data/lib/fog/openstack/requests/compute/list_security_groups.rb +1 -1
- data/lib/fog/openstack/requests/identity/create_tenant.rb +2 -2
- data/lib/fog/openstack/requests/metering/get_resource.rb +32 -0
- data/lib/fog/openstack/requests/metering/get_samples.rb +55 -0
- data/lib/fog/openstack/requests/metering/get_statistics.rb +56 -0
- data/lib/fog/openstack/requests/metering/list_meters.rb +50 -0
- data/lib/fog/openstack/requests/metering/list_resources.rb +32 -0
- data/lib/fog/openstack/requests/volume/create_volume.rb +4 -2
- data/lib/fog/rackspace.rb +16 -1
- data/lib/fog/rackspace/block_storage.rb +13 -28
- data/lib/fog/rackspace/cdn.rb +10 -24
- data/lib/fog/rackspace/compute.rb +17 -45
- data/lib/fog/rackspace/compute_v2.rb +13 -33
- data/lib/fog/rackspace/databases.rb +13 -29
- data/lib/fog/rackspace/dns.rb +27 -23
- data/lib/fog/rackspace/identity.rb +10 -26
- data/lib/fog/rackspace/load_balancers.rb +13 -29
- data/lib/fog/rackspace/mock_data.rb +3 -3
- data/lib/fog/rackspace/models/compute/server.rb +1 -1
- data/lib/fog/rackspace/models/dns/zones.rb +34 -21
- data/lib/fog/rackspace/models/identity/users.rb +2 -2
- data/lib/fog/rackspace/models/storage/file.rb +1 -0
- data/lib/fog/rackspace/requests/dns/list_domains.rb +2 -2
- data/lib/fog/rackspace/requests/storage/delete_multiple_objects.rb +75 -0
- data/lib/fog/rackspace/requests/storage/delete_static_large_object.rb +50 -0
- data/lib/fog/rackspace/requests/storage/get_object.rb +3 -1
- data/lib/fog/rackspace/requests/storage/put_dynamic_obj_manifest.rb +44 -0
- data/lib/fog/rackspace/requests/storage/put_object_manifest.rb +3 -30
- data/lib/fog/rackspace/requests/storage/put_static_obj_manifest.rb +60 -0
- data/lib/fog/rackspace/service.rb +43 -1
- data/lib/fog/rackspace/storage.rb +25 -43
- data/lib/fog/riakcs/provisioning.rb +2 -1
- data/lib/fog/riakcs/usage.rb +2 -1
- data/lib/fog/vcloud/requests/compute/configure_vm_cpus.rb +1 -1
- data/lib/fog/vcloud/requests/compute/configure_vm_memory.rb +1 -1
- data/lib/fog/version.rb +1 -1
- data/lib/fog/vsphere/requests/compute/get_folder.rb +1 -1
- data/lib/fog/xenserver/compute.rb +2 -0
- data/lib/fog/xenserver/models/compute/server.rb +9 -7
- data/lib/fog/xenserver/requests/compute/snapshot_revert.rb +22 -0
- data/lib/fog/xenserver/requests/compute/snapshot_server.rb +22 -0
- data/lib/fog/xml.rb +21 -0
- data/lib/fog/xml/sax_parser_connection.rb +43 -0
- data/lib/tasks/changelog_task.rb +1 -0
- data/tests/aws/models/auto_scaling/groups_test.rb +22 -0
- data/tests/aws/requests/compute/volume_tests.rb +3 -3
- data/tests/aws/requests/rds/helper.rb +14 -0
- data/tests/aws/requests/rds/log_file_tests.rb +19 -0
- data/tests/aws/requests/ses/verified_domain_identity_tests.rb +16 -0
- data/tests/aws/requests/sts/assume_role_tests.rb +19 -0
- data/tests/brightbox/requests/compute/collaboration_tests.rb +41 -0
- data/tests/brightbox/requests/compute/helper.rb +46 -2
- data/tests/brightbox/requests/compute/user_collaboration_tests.rb +67 -0
- data/tests/core/connection_tests.rb +26 -0
- data/tests/helper.rb +13 -0
- data/tests/openstack/requests/metering/meter_tests.rb +52 -0
- data/tests/openstack/requests/metering/resource_tests.rb +19 -0
- data/tests/openvz/helper.rb +14 -8
- data/tests/rackspace/block_storage_tests.rb +9 -0
- data/tests/rackspace/compute_tests.rb +9 -0
- data/tests/rackspace/compute_v2_tests.rb +9 -0
- data/tests/rackspace/databases_tests.rb +9 -0
- data/tests/rackspace/dns_tests.rb +20 -0
- data/tests/rackspace/helper.rb +12 -1
- data/tests/rackspace/identity_tests.rb +25 -0
- data/tests/rackspace/load_balancer_tests.rb +10 -0
- data/tests/rackspace/models/block_storage/volume_tests.rb +2 -2
- data/tests/rackspace/models/compute_v2/metadata_tests.rb +2 -2
- data/tests/rackspace/models/compute_v2/server_tests.rb +22 -21
- data/tests/rackspace/models/dns/zones_tests.rb +19 -5
- data/tests/rackspace/models/storage/file_tests.rb +22 -6
- data/tests/rackspace/rackspace_tests.rb +35 -0
- data/tests/rackspace/requests/block_storage/snapshot_tests.rb +2 -3
- data/tests/rackspace/requests/block_storage/volume_type_tests.rb +4 -11
- data/tests/rackspace/requests/compute_v2/address_tests.rb +1 -1
- data/tests/rackspace/requests/compute_v2/attachment_tests.rb +8 -9
- data/tests/rackspace/requests/compute_v2/flavor_tests.rb +1 -1
- data/tests/rackspace/requests/compute_v2/metadata_tests.rb +4 -4
- data/tests/rackspace/requests/databases/database_tests.rb +23 -20
- data/tests/rackspace/requests/databases/user_tests.rb +6 -6
- data/tests/rackspace/requests/identity/user_tests.rb +4 -1
- data/tests/rackspace/requests/load_balancers/usage_tests.rb +4 -2
- data/tests/rackspace/requests/storage/large_object_tests.rb +303 -59
- data/tests/rackspace/requests/storage/object_tests.rb +73 -18
- data/tests/rackspace/service_tests.rb +83 -0
- data/tests/rackspace/storage_tests.rb +9 -0
- data/tests/xenserver/models/compute/server_tests.rb +11 -1
- metadata +89 -19
- data/tests/core/user_agent_tests.rb +0 -6
@@ -0,0 +1,19 @@
|
|
1
|
+
Shindo.tests('Fog::Metering[:openstack] | resource requests', ['openstack']) do
|
2
|
+
|
3
|
+
@resource_format = {
|
4
|
+
'resource_id' => String,
|
5
|
+
'project_id' => String,
|
6
|
+
'user_id' => String,
|
7
|
+
'metadata' => Hash,
|
8
|
+
}
|
9
|
+
|
10
|
+
tests('success') do
|
11
|
+
tests('#list_resource').formats([@resource_format]) do
|
12
|
+
Fog::Metering[:openstack].list_resources.body
|
13
|
+
end
|
14
|
+
|
15
|
+
tests('#get_resource').formats(@resource_format) do
|
16
|
+
Fog::Metering[:openstack].get_resource('test').body
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/tests/openvz/helper.rb
CHANGED
@@ -18,6 +18,9 @@ def openvz_fog_test_server
|
|
18
18
|
# Server bootstrap took more than 120 secs!
|
19
19
|
end
|
20
20
|
end
|
21
|
+
|
22
|
+
openvz_fog_test_cleanup
|
23
|
+
|
21
24
|
server
|
22
25
|
end
|
23
26
|
|
@@ -27,15 +30,18 @@ def openvz_fog_test_server_destroy
|
|
27
30
|
server.destroy if server
|
28
31
|
end
|
29
32
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
server.
|
35
|
-
|
33
|
+
# Prepare a callback to destroy the long lived test server
|
34
|
+
def openvz_fog_test_cleanup
|
35
|
+
at_exit do
|
36
|
+
unless Fog.mocking?
|
37
|
+
server = openvz_service.servers.find { |s| s.name == '104' }
|
38
|
+
if server
|
39
|
+
server.wait_for(120) do
|
40
|
+
reload rescue nil; ready?
|
41
|
+
end
|
36
42
|
end
|
43
|
+
server.stop
|
44
|
+
openvz_fog_test_server_destroy
|
37
45
|
end
|
38
|
-
server.stop
|
39
|
-
openvz_fog_test_server_destroy
|
40
46
|
end
|
41
47
|
end
|
@@ -101,4 +101,13 @@ Shindo.tests('Fog::Rackspace::BlockStorage', ['rackspace']) do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
tests('reauthentication') do
|
105
|
+
pending if Fog.mocking?
|
106
|
+
|
107
|
+
@service = Fog::Rackspace::BlockStorage.new :rackspace_region => :ord
|
108
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
109
|
+
@service.instance_variable_set("@auth_token", "bad-token")
|
110
|
+
returns(200) { @service.list_volumes.status }
|
111
|
+
end
|
112
|
+
|
104
113
|
end
|
@@ -87,4 +87,13 @@ Shindo.tests('Rackspace | Compute', ['rackspace']) do
|
|
87
87
|
returns(true, "uses custom endpoint") { (@service.instance_variable_get("@uri").host =~ /snet-/) != nil }
|
88
88
|
end
|
89
89
|
end
|
90
|
+
|
91
|
+
tests('reauthentication') do
|
92
|
+
pending if Fog.mocking?
|
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) }
|
98
|
+
end
|
90
99
|
end
|
@@ -100,4 +100,13 @@ Shindo.tests('Fog::Compute::RackspaceV2', ['rackspace']) do
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
+
tests('reauthentication') do
|
104
|
+
pending if Fog.mocking?
|
105
|
+
|
106
|
+
@service = Fog::Compute::RackspaceV2.new
|
107
|
+
returns(true, "auth token populated") { !@service.send(:auth_token).nil? }
|
108
|
+
@service.instance_variable_set("@auth_token", "bad_token")
|
109
|
+
returns(true) { [200, 203].include? @service.list_flavors.status }
|
110
|
+
end
|
111
|
+
|
103
112
|
end
|
@@ -102,6 +102,15 @@ Shindo.tests('Fog::Rackspace::Databases', ['rackspace']) do |variable|
|
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
|
+
tests('reauthentication') do
|
106
|
+
pending if Fog.mocking?
|
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 }
|
112
|
+
end
|
113
|
+
|
105
114
|
@service = Fog::Rackspace::Databases.new
|
106
115
|
|
107
116
|
tests('#flavors').succeeds do
|
@@ -82,4 +82,24 @@ Shindo.tests('Fog::DNS::Rackspace', ['rackspace']) do
|
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
85
|
+
tests('reauthentication') do
|
86
|
+
pending if Fog.mocking?
|
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 }
|
92
|
+
end
|
93
|
+
|
94
|
+
tests('array_to_query_string') do
|
95
|
+
pending if Fog.mocking?
|
96
|
+
|
97
|
+
@service = Fog::DNS::Rackspace.new
|
98
|
+
returns("") { @service.send(:array_to_query_string, nil) }
|
99
|
+
returns("param1=1") { @service.send(:array_to_query_string, {:param1 => [1]}) }
|
100
|
+
returns("param1=1") { @service.send(:array_to_query_string, {:param1 => 1}) }
|
101
|
+
returns("param1=1,2") { @service.send(:array_to_query_string, {:param1 => [1,2]}) }
|
102
|
+
returns("param1=1¶m2=2") { @service.send(:array_to_query_string, {:param1 => [1], :param2 => [2]}) }
|
103
|
+
end
|
104
|
+
|
85
105
|
end
|
data/tests/rackspace/helper.rb
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
module Shindo
|
2
2
|
class Tests
|
3
|
-
|
3
|
+
|
4
|
+
unless Fog.mocking?
|
5
|
+
Fog.timeout = 2000
|
6
|
+
Fog::Logger.warning "Setting default fog timeout to #{Fog.timeout} seconds"
|
7
|
+
end
|
8
|
+
|
4
9
|
def given_a_load_balancer_service(&block)
|
5
10
|
@service = Fog::Rackspace::LoadBalancers.new
|
6
11
|
instance_eval(&block)
|
@@ -23,6 +28,12 @@ module Shindo
|
|
23
28
|
end
|
24
29
|
end
|
25
30
|
|
31
|
+
def wait_for_request(description = "waiting", &block)
|
32
|
+
return if Fog.mocking?
|
33
|
+
tests(description) do
|
34
|
+
Fog.wait_for &block
|
35
|
+
end
|
36
|
+
end
|
26
37
|
|
27
38
|
def wait_for_server_deletion(server)
|
28
39
|
return if Fog.mocking?
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Shindo.tests('Fog::Rackspace::Identity', ['rackspace']) do
|
2
|
+
|
3
|
+
tests('current authentication') do
|
4
|
+
pending if Fog.mocking?
|
5
|
+
|
6
|
+
tests('variables populated').returns(200) do
|
7
|
+
@service = Fog::Rackspace::Identity.new :rackspace_auth_url => 'https://identity.api.rackspacecloud.com/v2.0', :connection_options => {:ssl_verify_peer => true}
|
8
|
+
returns(true, "auth token populated") { !@service.auth_token.nil? }
|
9
|
+
returns(false, "path populated") { @service.instance_variable_get("@uri").host.nil? }
|
10
|
+
returns(false, "service catalog populated") { @service.service_catalog.nil? }
|
11
|
+
|
12
|
+
@service.list_tenants.status
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
tests('reauthentication') do
|
17
|
+
pending if Fog.mocking?
|
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 }
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
@@ -101,6 +101,16 @@ Shindo.tests('Fog::Rackspace::LoadBalancers', ['rackspace']) do
|
|
101
101
|
end
|
102
102
|
end
|
103
103
|
|
104
|
+
|
105
|
+
tests('reauthentication') do
|
106
|
+
pending if Fog.mocking?
|
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 }
|
112
|
+
end
|
113
|
+
|
104
114
|
pending if Fog.mocking?
|
105
115
|
|
106
116
|
@service = Fog::Rackspace::LoadBalancers.new
|
@@ -4,7 +4,7 @@ Shindo.tests('Fog::Rackspace::BlockStorage | volume', ['rackspace']) do
|
|
4
4
|
options = { :display_name => "fog_#{Time.now.to_i.to_s}", :size => 100 }
|
5
5
|
|
6
6
|
model_tests(service.volumes, options, true) do
|
7
|
-
@instance.wait_for
|
7
|
+
@instance.wait_for{ ready? }
|
8
8
|
|
9
9
|
tests('double save').raises(Fog::Rackspace::BlockStorage::IdentifierTaken) do
|
10
10
|
@instance.save
|
@@ -18,7 +18,7 @@ Shindo.tests('Fog::Rackspace::BlockStorage | volume', ['rackspace']) do
|
|
18
18
|
tests('#snapshots').succeeds do
|
19
19
|
begin
|
20
20
|
snapshot = @instance.create_snapshot
|
21
|
-
snapshot.wait_for
|
21
|
+
snapshot.wait_for { ready? }
|
22
22
|
|
23
23
|
returns(true) { @instance.snapshots.first.id == snapshot.id }
|
24
24
|
ensure
|
@@ -11,7 +11,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | metadata', ['rackspace']) do
|
|
11
11
|
:flavor_id => rackspace_test_flavor_id(service),
|
12
12
|
:image_id => rackspace_test_image_id(service))
|
13
13
|
|
14
|
-
@server.wait_for
|
14
|
+
@server.wait_for { ready? }
|
15
15
|
|
16
16
|
tests('server') do
|
17
17
|
collection_tests(@server.metadata, {:key => 'my_key', :value => 'my_value'}) do
|
@@ -21,7 +21,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | metadata', ['rackspace']) do
|
|
21
21
|
|
22
22
|
tests('image') do
|
23
23
|
@image = @server.create_image("fog_image_#{test_time}", :metadata => {:my_key => 'my_value'})
|
24
|
-
@image.wait_for
|
24
|
+
@image.wait_for { ready? }
|
25
25
|
tests("#all").succeeds do
|
26
26
|
pending if Fog.mocking? && !mocks_implemented
|
27
27
|
metadata = @image.metadata.all
|
@@ -66,7 +66,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
66
66
|
end
|
67
67
|
|
68
68
|
model_tests(service.servers, options, true) do
|
69
|
-
@instance.wait_for
|
69
|
+
@instance.wait_for { ready? }
|
70
70
|
|
71
71
|
tests('#metadata[\'fog_test\']').returns('true') do
|
72
72
|
@instance.metadata['fog_test']
|
@@ -79,12 +79,12 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
79
79
|
tests('#update').succeeds do
|
80
80
|
@instance.name = "fog_server_update"
|
81
81
|
@instance.access_ipv4_address= "10.10.0.1"
|
82
|
-
@instance.access_ipv6_address= "
|
82
|
+
@instance.access_ipv6_address= "::1"
|
83
83
|
@instance.save
|
84
84
|
sleep 60 unless Fog.mocking?
|
85
85
|
@instance.reload
|
86
86
|
returns("10.10.0.1") { @instance.access_ipv4_address }
|
87
|
-
returns("
|
87
|
+
returns("::1") { @instance.access_ipv6_address }
|
88
88
|
returns("fog_server_update") { @instance.name }
|
89
89
|
end
|
90
90
|
|
@@ -93,13 +93,13 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
93
93
|
returns('REBOOT') { @instance.state }
|
94
94
|
end
|
95
95
|
|
96
|
-
@instance.wait_for
|
96
|
+
@instance.wait_for { ready? }
|
97
97
|
tests('#reboot("HARD")').succeeds do
|
98
98
|
@instance.reboot('HARD')
|
99
99
|
returns('HARD_REBOOT') { @instance.state }
|
100
100
|
end
|
101
101
|
|
102
|
-
@instance.wait_for
|
102
|
+
@instance.wait_for { ready? }
|
103
103
|
@test_image = nil
|
104
104
|
begin
|
105
105
|
tests('#create_image').succeeds do
|
@@ -112,7 +112,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
112
112
|
end
|
113
113
|
|
114
114
|
sleep 30 unless Fog.mocking?
|
115
|
-
@instance.wait_for
|
115
|
+
@instance.wait_for { ready? }
|
116
116
|
sleep 60 unless Fog.mocking?
|
117
117
|
tests('#rebuild').succeeds do
|
118
118
|
@instance.rebuild rackspace_test_image_id(service)
|
@@ -120,7 +120,7 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
120
120
|
end
|
121
121
|
|
122
122
|
sleep 30 unless Fog.mocking?
|
123
|
-
@instance.wait_for
|
123
|
+
@instance.wait_for { ready? }
|
124
124
|
sleep 60 unless Fog.mocking?
|
125
125
|
tests('#resize').succeeds do
|
126
126
|
@instance.resize(3)
|
@@ -128,37 +128,37 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
128
128
|
end
|
129
129
|
|
130
130
|
sleep 30 unless Fog.mocking?
|
131
|
-
@instance.wait_for
|
131
|
+
@instance.wait_for { ready?('VERIFY_RESIZE', ['ACTIVE', 'ERROR']) }
|
132
132
|
sleep 60 unless Fog.mocking?
|
133
133
|
tests('#confirm_resize').succeeds do
|
134
134
|
@instance.confirm_resize
|
135
135
|
end
|
136
136
|
|
137
137
|
sleep 30 unless Fog.mocking?
|
138
|
-
@instance.wait_for
|
138
|
+
@instance.wait_for { ready? }
|
139
139
|
sleep 60 unless Fog.mocking?
|
140
140
|
tests('#resize').succeeds do
|
141
141
|
@instance.resize(2)
|
142
142
|
returns('RESIZE') { @instance.state }
|
143
143
|
end
|
144
144
|
|
145
|
-
@instance.wait_for
|
145
|
+
@instance.wait_for { ready?('VERIFY_RESIZE') }
|
146
146
|
sleep 60 unless Fog.mocking?
|
147
147
|
tests('#revert_resize').succeeds do
|
148
148
|
@instance.revert_resize
|
149
149
|
end
|
150
150
|
|
151
|
-
@instance.wait_for
|
151
|
+
@instance.wait_for { ready? }
|
152
152
|
tests('#rescue').succeeds do
|
153
153
|
@instance.rescue
|
154
154
|
end
|
155
155
|
|
156
|
-
@instance.wait_for
|
156
|
+
@instance.wait_for { ready?('RESCUE') }
|
157
157
|
tests('#unrescue').succeeds do
|
158
158
|
@instance.unrescue
|
159
159
|
end
|
160
160
|
|
161
|
-
@instance.wait_for
|
161
|
+
@instance.wait_for { ready? }
|
162
162
|
tests('#change_admin_password').succeeds do
|
163
163
|
@instance.change_admin_password('somerandompassword')
|
164
164
|
returns('PASSWORD') { @instance.state }
|
@@ -168,28 +168,29 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
168
168
|
tests('attachments') do
|
169
169
|
begin
|
170
170
|
@volume = cbs_service.volumes.create(:size => 100, :display_name => "fog-#{Time.now.to_i.to_s}")
|
171
|
-
@volume.wait_for
|
171
|
+
@volume.wait_for { ready? }
|
172
172
|
tests('#attach_volume').succeeds do
|
173
173
|
@instance.attach_volume(@volume)
|
174
174
|
end
|
175
175
|
tests('#attachments').returns(true) do
|
176
|
-
@instance.wait_for
|
176
|
+
@instance.wait_for do
|
177
177
|
!attachments.empty?
|
178
178
|
end
|
179
179
|
@instance.attachments.any? {|a| a.volume_id == @volume.id }
|
180
180
|
end
|
181
181
|
ensure
|
182
|
-
@volume.wait_for
|
182
|
+
@volume.wait_for { !attachments.empty? }
|
183
183
|
@instance.attachments.each {|a| a.detach }
|
184
|
-
@volume.wait_for
|
184
|
+
@volume.wait_for { ready? && attachments.empty? }
|
185
185
|
@volume.destroy if @volume
|
186
186
|
end
|
187
187
|
end
|
188
188
|
|
189
|
-
@instance.wait_for
|
189
|
+
@instance.wait_for { ready? }
|
190
190
|
end
|
191
191
|
|
192
192
|
wait_for_server_deletion(@instance)
|
193
|
+
sleep 60 unless Fog.mocking?
|
193
194
|
|
194
195
|
tests("delete network #{@network.label}").succeeds do
|
195
196
|
@network.destroy if @network
|
@@ -197,17 +198,17 @@ Shindo.tests('Fog::Compute::RackspaceV2 | server', ['rackspace']) do
|
|
197
198
|
|
198
199
|
#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
|
199
200
|
model_tests(service.servers, options, true) do
|
200
|
-
@instance.wait_for
|
201
|
+
@instance.wait_for { ready? }
|
201
202
|
tests('#resize').succeeds do
|
202
203
|
@instance.resize(4)
|
203
204
|
returns('RESIZE') { @instance.state }
|
204
205
|
end
|
205
206
|
|
206
|
-
@instance.wait_for
|
207
|
+
@instance.wait_for { ready?('VERIFY_RESIZE') }
|
207
208
|
sleep 60 unless Fog.mocking?
|
208
209
|
tests('#revert_resize').succeeds do
|
209
210
|
@instance.revert_resize
|
210
211
|
end
|
211
|
-
@instance.wait_for
|
212
|
+
@instance.wait_for { ready? }
|
212
213
|
end
|
213
214
|
end
|
@@ -1,22 +1,36 @@
|
|
1
1
|
Shindo.tests('Fog::Rackspace::DNS | zones', ['rackspace']) do
|
2
|
-
pending if Fog.mocking?
|
3
2
|
|
4
3
|
provider = Fog::DNS[:rackspace]
|
5
4
|
domain_sld = uniq_id
|
6
5
|
domain_name = domain_sld + '.com'
|
7
6
|
|
8
7
|
begin
|
9
|
-
|
8
|
+
unless Fog.mocking?
|
9
|
+
zone = provider.zones.create({:domain => domain_name, :email => "hostmaster@#{domain_name}"})
|
10
|
+
end
|
10
11
|
|
11
12
|
tests("zones.find(#{domain_sld}) => finds domain_name") do
|
12
|
-
|
13
|
+
pending if Fog.mocking?
|
14
|
+
returns(true) { provider.zones.all.any? {|z| z.domain == domain_name} }
|
13
15
|
end
|
14
16
|
|
15
17
|
random_name = uniq_id
|
16
18
|
tests("zones.find(#{random_name}) => finds nothing") do
|
17
|
-
|
19
|
+
pending if Fog.mocking?
|
20
|
+
returns(false) { provider.zones.all.any? {|z| z.domain == random_name} }
|
18
21
|
end
|
19
22
|
ensure
|
20
|
-
zone.destroy
|
23
|
+
zone.destroy unless Fog.mocking?
|
24
|
+
end
|
25
|
+
|
26
|
+
tests('next_params') do
|
27
|
+
zones = Fog::DNS::Rackspace::Zones.new
|
28
|
+
returns(nil, "no body") { zones.send(:next_params, nil)}
|
29
|
+
returns(nil, "no links") { zones.send(:next_params, {}) }
|
30
|
+
returns(nil, "links are empty") { zones.send(:next_params, {'links' => []}) }
|
31
|
+
returns(nil, "links does not contain next hash") { zones.send(:next_params, {'links' => [ {'rel' => 'previous'} ] }) }
|
32
|
+
returns(nil, "contains a link without parameters") { zones.send(:next_params, {'links' => [ {'rel' => 'next', 'href' => "http://localhost/next"} ] }) }
|
33
|
+
returns({"offset"=>["3"], "limit"=>["3"]}, "contains a link without parameters") { zones.send(:next_params, {'links' => [ {'rel' => 'next', 'href' => "http://localhost/next?offset=3&limit=3"} ] }) }
|
21
34
|
end
|
35
|
+
|
22
36
|
end
|