fog 0.3.7 → 0.3.8
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +6 -6
- data/README.rdoc +7 -1
- data/bin/fog +4 -3
- data/fog.gemspec +39 -24
- data/lib/fog.rb +4 -12
- data/lib/fog/aws.rb +14 -5
- data/lib/fog/aws/compute.rb +26 -9
- data/lib/fog/aws/elb.rb +3 -2
- data/lib/fog/aws/models/compute/address.rb +2 -1
- data/lib/fog/aws/models/compute/addresses.rb +11 -9
- data/lib/fog/aws/models/compute/flavor.rb +1 -1
- data/lib/fog/aws/models/compute/flavors.rb +13 -11
- data/lib/fog/aws/models/compute/image.rb +2 -1
- data/lib/fog/aws/models/compute/images.rb +7 -9
- data/lib/fog/aws/models/compute/key_pair.rb +1 -1
- data/lib/fog/aws/models/compute/key_pairs.rb +10 -8
- data/lib/fog/aws/models/compute/security_group.rb +1 -1
- data/lib/fog/aws/models/compute/security_groups.rb +11 -9
- data/lib/fog/aws/models/compute/server.rb +10 -3
- data/lib/fog/aws/models/compute/servers.rb +14 -8
- data/lib/fog/aws/models/compute/snapshot.rb +3 -2
- data/lib/fog/aws/models/compute/snapshots.rb +11 -16
- data/lib/fog/aws/models/compute/tag.rb +36 -0
- data/lib/fog/aws/models/compute/tags.rb +34 -0
- data/lib/fog/aws/models/compute/volume.rb +11 -10
- data/lib/fog/aws/models/compute/volumes.rb +11 -9
- data/lib/fog/aws/models/storage/directories.rb +1 -1
- data/lib/fog/aws/models/storage/directory.rb +1 -1
- data/lib/fog/aws/models/storage/file.rb +3 -2
- data/lib/fog/aws/models/storage/files.rb +1 -7
- data/lib/fog/aws/parsers/compute/describe_availability_zones.rb +4 -2
- data/lib/fog/aws/parsers/compute/describe_images.rb +23 -13
- data/lib/fog/aws/parsers/compute/describe_instances.rb +34 -8
- data/lib/fog/aws/parsers/compute/describe_security_groups.rb +4 -3
- data/lib/fog/aws/parsers/compute/describe_snapshots.rb +33 -13
- data/lib/fog/aws/parsers/compute/describe_tags.rb +30 -0
- data/lib/fog/aws/parsers/compute/describe_volumes.rb +17 -3
- data/lib/fog/aws/parsers/compute/run_instances.rb +4 -4
- data/lib/fog/aws/parsers/storage/get_bucket.rb +1 -1
- data/lib/fog/aws/parsers/storage/get_bucket_logging.rb +1 -1
- data/lib/fog/aws/parsers/storage/get_bucket_object_versions.rb +3 -3
- data/lib/fog/aws/requests/compute/create_snapshot.rb +1 -0
- data/lib/fog/aws/requests/compute/create_tags.rb +78 -0
- data/lib/fog/aws/requests/compute/delete_tags.rb +45 -0
- data/lib/fog/aws/requests/compute/describe_addresses.rb +27 -19
- data/lib/fog/aws/requests/compute/describe_availability_zones.rb +31 -25
- data/lib/fog/aws/requests/compute/describe_images.rb +11 -18
- data/lib/fog/aws/requests/compute/describe_instances.rb +125 -53
- data/lib/fog/aws/requests/compute/describe_key_pairs.rb +29 -21
- data/lib/fog/aws/requests/compute/describe_regions.rb +28 -23
- data/lib/fog/aws/requests/compute/describe_reserved_instances.rb +8 -4
- data/lib/fog/aws/requests/compute/describe_security_groups.rb +48 -19
- data/lib/fog/aws/requests/compute/describe_snapshots.rb +72 -35
- data/lib/fog/aws/requests/compute/describe_tags.rb +42 -0
- data/lib/fog/aws/requests/compute/describe_volumes.rb +67 -36
- data/lib/fog/aws/requests/compute/run_instances.rb +10 -3
- data/lib/fog/aws/simpledb.rb +3 -1
- data/lib/fog/aws/storage.rb +17 -8
- data/lib/fog/bluebox/models/compute/flavor.rb +1 -1
- data/lib/fog/bluebox/models/compute/flavors.rb +1 -1
- data/lib/fog/bluebox/models/compute/image.rb +1 -1
- data/lib/fog/bluebox/models/compute/images.rb +1 -1
- data/lib/fog/bluebox/models/compute/server.rb +8 -6
- data/lib/fog/bluebox/models/compute/servers.rb +1 -1
- data/lib/fog/bluebox/requests/compute/get_blocks.rb +1 -1
- data/lib/fog/core.rb +11 -0
- data/lib/fog/{attributes.rb → core/attributes.rb} +0 -0
- data/lib/fog/{bin.rb → core/bin.rb} +1 -1
- data/lib/fog/{collection.rb → core/collection.rb} +4 -0
- data/lib/fog/{connection.rb → core/connection.rb} +0 -0
- data/lib/fog/{credentials.rb → core/credentials.rb} +2 -0
- data/lib/fog/{deprecation.rb → core/deprecation.rb} +0 -0
- data/lib/fog/{errors.rb → core/errors.rb} +0 -0
- data/lib/fog/{hmac.rb → core/hmac.rb} +0 -0
- data/lib/fog/{model.rb → core/model.rb} +0 -0
- data/lib/fog/{parser.rb → core/parser.rb} +0 -0
- data/lib/fog/{provider.rb → core/provider.rb} +0 -0
- data/lib/fog/{service.rb → core/service.rb} +1 -0
- data/lib/fog/{ssh.rb → core/ssh.rb} +7 -7
- data/lib/fog/go_grid.rb +1 -1
- data/lib/fog/go_grid/compute.rb +6 -1
- data/lib/fog/go_grid/models/compute/image.rb +60 -0
- data/lib/fog/go_grid/models/compute/images.rb +33 -0
- data/lib/fog/go_grid/models/compute/server.rb +56 -0
- data/lib/fog/go_grid/models/compute/servers.rb +35 -0
- data/lib/fog/go_grid/requests/compute/grid_image_get.rb +41 -0
- data/lib/fog/go_grid/requests/compute/grid_image_list.rb +6 -1
- data/lib/fog/go_grid/requests/compute/grid_server_power.rb +2 -2
- data/lib/fog/google/models/storage/directories.rb +1 -1
- data/lib/fog/google/models/storage/directory.rb +1 -1
- data/lib/fog/google/models/storage/file.rb +3 -2
- data/lib/fog/google/models/storage/files.rb +1 -7
- data/lib/fog/google/parsers/storage/get_bucket.rb +1 -1
- data/lib/fog/linode/requests/compute/avail_linodeplans.rb +2 -2
- data/lib/fog/local/models/storage/directories.rb +1 -1
- data/lib/fog/local/models/storage/directory.rb +1 -1
- data/lib/fog/local/models/storage/file.rb +2 -2
- data/lib/fog/local/models/storage/files.rb +2 -5
- data/lib/fog/local/storage.rb +1 -1
- data/lib/fog/new_servers/compute.rb +1 -1
- data/lib/fog/rackspace/models/compute/flavor.rb +1 -3
- data/lib/fog/rackspace/models/compute/flavors.rb +1 -1
- data/lib/fog/rackspace/models/compute/image.rb +2 -1
- data/lib/fog/rackspace/models/compute/images.rb +1 -1
- data/lib/fog/rackspace/models/compute/server.rb +12 -11
- data/lib/fog/rackspace/models/compute/servers.rb +1 -1
- data/lib/fog/rackspace/models/storage/directories.rb +1 -1
- data/lib/fog/rackspace/models/storage/directory.rb +1 -1
- data/lib/fog/rackspace/models/storage/file.rb +4 -4
- data/lib/fog/rackspace/models/storage/files.rb +1 -1
- data/lib/fog/rackspace/requests/compute/create_image.rb +2 -2
- data/lib/fog/rackspace/requests/compute/delete_image.rb +1 -1
- data/lib/fog/rackspace/requests/compute/delete_server.rb +1 -1
- data/lib/fog/rackspace/requests/compute/get_server_details.rb +1 -1
- data/lib/fog/rackspace/requests/compute/list_addresses.rb +1 -1
- data/lib/fog/rackspace/requests/compute/list_images_detail.rb +2 -2
- data/lib/fog/rackspace/requests/compute/list_private_addresses.rb +1 -1
- data/lib/fog/rackspace/requests/compute/list_public_addresses.rb +1 -1
- data/lib/fog/rackspace/requests/compute/update_server.rb +1 -1
- data/lib/fog/rackspace/requests/storage/put_object.rb +4 -3
- data/lib/fog/slicehost/models/compute/flavor.rb +1 -1
- data/lib/fog/slicehost/models/compute/flavors.rb +1 -1
- data/lib/fog/slicehost/models/compute/image.rb +1 -1
- data/lib/fog/slicehost/models/compute/images.rb +1 -1
- data/lib/fog/slicehost/models/compute/server.rb +3 -1
- data/lib/fog/slicehost/models/compute/servers.rb +1 -1
- data/lib/fog/terremark/ecloud.rb +34 -33
- data/lib/fog/terremark/models/shared/address.rb +1 -1
- data/lib/fog/terremark/models/shared/network.rb +1 -1
- data/lib/fog/terremark/models/shared/server.rb +1 -1
- data/lib/fog/terremark/models/shared/servers.rb +1 -1
- data/lib/fog/terremark/models/shared/task.rb +1 -1
- data/lib/fog/terremark/models/shared/tasks.rb +1 -1
- data/lib/fog/terremark/models/shared/vdc.rb +1 -1
- data/lib/fog/terremark/parser.rb +1 -0
- data/lib/fog/terremark/vcloud.rb +4 -4
- data/lib/fog/vcloud.rb +15 -7
- data/lib/fog/vcloud/terremark/ecloud.rb +15 -3
- data/lib/fog/vcloud/terremark/ecloud/models/firewall_acls.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/internet_services.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/ips.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/networks.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/nodes.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/public_ips.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/servers.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/tasks.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/models/vdcs.rb +1 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/add_internet_service.rb +55 -49
- data/lib/fog/vcloud/terremark/ecloud/requests/add_node.rb +19 -15
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_internet_service.rb +8 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/configure_node.rb +17 -12
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog.rb +29 -1
- data/lib/fog/vcloud/terremark/ecloud/requests/get_catalog_item.rb +38 -2
- data/lib/fog/vcloud/terremark/ecloud/requests/get_customization_options.rb +8 -2
- data/lib/fog/vcloud/terremark/ecloud/requests/instantiate_vapp_template.rb +46 -4
- data/spec/aws/models/compute/server_spec.rb +2 -0
- data/spec/aws/requests/simpledb/select_spec.rb +1 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/vcloud/spec_helper.rb +1 -1
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_item_spec.rb +62 -0
- data/spec/vcloud/terremark/ecloud/requests/get_catalog_spec.rb +44 -0
- data/spec/vcloud/terremark/ecloud/requests/get_customization_options_spec.rb +39 -0
- data/spec/vcloud/terremark/ecloud/requests/instantiate_vapp_template_spec.rb +73 -0
- data/tests/aws/requests/compute/address_tests.rb +2 -6
- data/tests/aws/requests/compute/availability_zone_tests.rb +3 -10
- data/tests/aws/requests/compute/image_tests.rb +4 -9
- data/tests/aws/requests/compute/instance_tests.rb +7 -8
- data/tests/aws/requests/compute/key_pair_tests.rb +2 -6
- data/tests/aws/requests/compute/region_tests.rb +2 -9
- data/tests/aws/requests/compute/security_group_tests.rb +3 -7
- data/tests/aws/requests/compute/snapshot_tests.rb +4 -7
- data/tests/aws/requests/compute/tag_tests.rb +49 -0
- data/tests/aws/requests/compute/volume_tests.rb +2 -6
- data/tests/aws/requests/storage/bucket_tests.rb +48 -0
- data/tests/aws/requests/storage/object_tests.rb +63 -0
- data/tests/bluebox/requests/compute/block_tests.rb +24 -11
- data/tests/bluebox/requests/compute/product_tests.rb +3 -0
- data/tests/bluebox/requests/compute/template_tests.rb +3 -0
- data/tests/go_grid/helper.rb +0 -0
- data/tests/go_grid/requests/compute/image_tests.rb +0 -0
- data/tests/helper.rb +5 -1
- data/tests/linode/requests/compute/datacenter_tests.rb +1 -0
- data/tests/linode/requests/compute/distribution_tests.rb +2 -0
- data/tests/linode/requests/compute/linode_tests.rb +6 -0
- data/tests/linode/requests/compute/linodeplans_tests.rb +2 -0
- data/tests/lorem.txt +1 -0
- data/tests/rackspace/requests/compute/flavor_tests.rb +4 -0
- data/tests/rackspace/requests/compute/image_tests.rb +12 -4
- data/tests/rackspace/requests/compute/server_tests.rb +9 -0
- data/tests/slicehost/requests/compute/backup_tests.rb +1 -0
- data/tests/slicehost/requests/compute/flavor_tests.rb +3 -0
- data/tests/slicehost/requests/compute/image_tests.rb +3 -0
- data/tests/slicehost/requests/compute/slice_tests.rb +14 -2
- metadata +42 -27
- data/spec/aws/requests/storage/delete_bucket_spec.rb +0 -35
- data/spec/aws/requests/storage/delete_object_spec.rb +0 -36
- data/spec/aws/requests/storage/get_object_spec.rb +0 -58
- data/spec/aws/requests/storage/get_service_spec.rb +0 -32
- data/spec/aws/requests/storage/head_object_spec.rb +0 -26
- data/spec/aws/requests/storage/put_bucket_spec.rb +0 -19
- data/spec/aws/requests/storage/put_object_spec.rb +0 -43
@@ -0,0 +1,63 @@
|
|
1
|
+
Shindo.tests('AWS::Storage | object requests', ['aws']) do
|
2
|
+
|
3
|
+
@directory = AWS[:storage].directories.create(:key => 'fogobjecttests')
|
4
|
+
|
5
|
+
tests('success') do
|
6
|
+
|
7
|
+
tests("#put_object('#{@directory.identity}', 'fog_object', lorem_file)").succeeds do
|
8
|
+
AWS[:storage].put_object(@directory.identity, 'fog_object', lorem_file)
|
9
|
+
end
|
10
|
+
|
11
|
+
tests("#get_object('#{@directory.identity}', 'fog_object')").returns(lorem_file.read) do
|
12
|
+
AWS[:storage].get_object(@directory.identity, 'fog_object').body
|
13
|
+
end
|
14
|
+
|
15
|
+
tests("#get_object('#{@directory.identity}', 'fog_object', &block)").returns(lorem_file.read) do
|
16
|
+
data = ''
|
17
|
+
AWS[:storage].get_object(@directory.identity, 'fog_object') do |chunk|
|
18
|
+
data << chunk
|
19
|
+
end
|
20
|
+
data
|
21
|
+
end
|
22
|
+
|
23
|
+
tests("#head_object('#{@directory.identity}', 'fog_object')").succeeds do
|
24
|
+
AWS[:storage].head_object(@directory.identity, 'fog_object')
|
25
|
+
end
|
26
|
+
|
27
|
+
tests("#delete_object('#{@directory.identity}', 'fog_object')").succeeds do
|
28
|
+
AWS[:storage].delete_object(@directory.identity, 'fog_object')
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
tests('failure') do
|
34
|
+
|
35
|
+
tests("#put_object('fognonbucket', 'fog_non_object', lorem_file)").raises(Excon::Errors::NotFound) do
|
36
|
+
AWS[:storage].put_object('fognonbucket', 'fog_non_object', lorem_file)
|
37
|
+
end
|
38
|
+
|
39
|
+
tests("#get_object('fognonbucket', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
40
|
+
AWS[:storage].get_object('fognonbucket', 'fog_non_object')
|
41
|
+
end
|
42
|
+
|
43
|
+
tests("#get_object('#{@directory.identity}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
44
|
+
AWS[:storage].get_object(@directory.identity, 'fog_non_object')
|
45
|
+
end
|
46
|
+
|
47
|
+
tests("#head_object('fognonbucket', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
48
|
+
AWS[:storage].head_object('fognonbucket', 'fog_non_object')
|
49
|
+
end
|
50
|
+
|
51
|
+
tests("#head_object('#{@directory.identity}', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
52
|
+
AWS[:storage].head_object(@directory.identity, 'fog_non_object')
|
53
|
+
end
|
54
|
+
|
55
|
+
tests("#delete_object('fognonbucket', 'fog_non_object')").raises(Excon::Errors::NotFound) do
|
56
|
+
AWS[:storage].delete_object('fognonbucket', 'fog_non_object')
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
|
61
|
+
@directory.destroy
|
62
|
+
|
63
|
+
end
|
@@ -1,15 +1,16 @@
|
|
1
1
|
Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
2
2
|
|
3
3
|
@block_format = {
|
4
|
-
'cpu'
|
5
|
-
'
|
6
|
-
'
|
7
|
-
'
|
8
|
-
'
|
9
|
-
'
|
10
|
-
'
|
11
|
-
'
|
12
|
-
'
|
4
|
+
'cpu' => Float,
|
5
|
+
'description' => String,
|
6
|
+
'hostname' => String,
|
7
|
+
'id' => String,
|
8
|
+
'ips' => [{'address' => String}],
|
9
|
+
'memory' => Integer,
|
10
|
+
'product' => Bluebox::Compute::Formats::PRODUCT,
|
11
|
+
'status' => String,
|
12
|
+
'storage' => Integer,
|
13
|
+
'template' => String
|
13
14
|
}
|
14
15
|
|
15
16
|
tests('success') do
|
@@ -21,28 +22,37 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
|
21
22
|
@block_id = nil
|
22
23
|
|
23
24
|
tests("create_block('#{@product_id}', '#{@template_id}', 'password' => '#{@password}')").formats(@block_format) do
|
25
|
+
pending if Fog.mocking?
|
24
26
|
data = Bluebox[:compute].create_block(@product_id, @template_id, 'password' => @password).body
|
25
27
|
@block_id = data['id']
|
26
28
|
data
|
27
29
|
end
|
28
30
|
|
29
|
-
|
31
|
+
unless Fog.mocking?
|
32
|
+
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
33
|
+
end
|
30
34
|
|
31
35
|
tests("get_block('#{@block_id}')").formats(@block_format) do
|
36
|
+
pending if Fog.mocking?
|
32
37
|
Bluebox[:compute].get_block(@block_id).body
|
33
38
|
end
|
34
39
|
|
35
40
|
tests("get_blocks").formats([@block_format.reject {|key,value| ['product', 'template'].include?(key)}]) do
|
41
|
+
pending if Fog.mocking?
|
36
42
|
Bluebox[:compute].get_blocks.body
|
37
43
|
end
|
38
44
|
|
39
45
|
tests("reboot_block('#{@block_id}')").formats({'status' => String, 'text' => String}) do
|
46
|
+
pending if Fog.mocking?
|
40
47
|
Bluebox[:compute].reboot_block(@block_id).body
|
41
48
|
end
|
42
49
|
|
43
|
-
|
50
|
+
unless Fog.mocking?
|
51
|
+
Bluebox[:compute].servers.get(@block_id).wait_for { ready? }
|
52
|
+
end
|
44
53
|
|
45
54
|
tests("destroy_block('#{@block_id})'").formats({'text' => String}) do
|
55
|
+
pending if Fog.mocking?
|
46
56
|
Bluebox[:compute].destroy_block(@block_id).body
|
47
57
|
end
|
48
58
|
|
@@ -51,14 +61,17 @@ Shindo.tests('Bluebox::Compute | block requests', ['bluebox']) do
|
|
51
61
|
tests('failure') do
|
52
62
|
|
53
63
|
tests("get_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
64
|
+
pending if Fog.mocking?
|
54
65
|
Bluebox[:compute].get_block('00000000-0000-0000-0000-000000000000')
|
55
66
|
end
|
56
67
|
|
57
68
|
tests("reboot_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
69
|
+
pending if Fog.mocking?
|
58
70
|
Bluebox[:compute].reboot_block('00000000-0000-0000-0000-000000000000')
|
59
71
|
end
|
60
72
|
|
61
73
|
tests("destroy_block('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
74
|
+
pending if Fog.mocking?
|
62
75
|
Bluebox[:compute].destroy_block('00000000-0000-0000-0000-000000000000')
|
63
76
|
end
|
64
77
|
|
@@ -5,10 +5,12 @@ Shindo.tests('Bluebox::Compute | product requests', ['bluebox']) do
|
|
5
5
|
@product_id = '94fd37a7-2606-47f7-84d5-9000deda52ae' # 1 GB
|
6
6
|
|
7
7
|
tests("get_product('#{@product_id}')").formats(Bluebox::Compute::Formats::PRODUCT) do
|
8
|
+
pending if Fog.mocking?
|
8
9
|
Bluebox[:compute].get_product(@product_id).body
|
9
10
|
end
|
10
11
|
|
11
12
|
tests("get_products").formats([Bluebox::Compute::Formats::PRODUCT]) do
|
13
|
+
pending if Fog.mocking?
|
12
14
|
Bluebox[:compute].get_products.body
|
13
15
|
end
|
14
16
|
|
@@ -17,6 +19,7 @@ Shindo.tests('Bluebox::Compute | product requests', ['bluebox']) do
|
|
17
19
|
tests('failure') do
|
18
20
|
|
19
21
|
tests("get_product('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
22
|
+
pending if Fog.mocking?
|
20
23
|
Bluebox[:compute].get_product('00000000-0000-0000-0000-000000000000')
|
21
24
|
end
|
22
25
|
|
@@ -12,10 +12,12 @@ Shindo.tests('Bluebox::Compute | template requests', ['bluebox']) do
|
|
12
12
|
@template_id = 'a00baa8f-b5d0-4815-8238-b471c4c4bf72' # Ubuntu 9.10 64bit
|
13
13
|
|
14
14
|
tests("get_template('#{@template_id}')").formats(@template_format) do
|
15
|
+
pending if Fog.mocking?
|
15
16
|
Bluebox[:compute].get_template(@template_id).body
|
16
17
|
end
|
17
18
|
|
18
19
|
tests("get_templates").formats([@template_format]) do
|
20
|
+
pending if Fog.mocking?
|
19
21
|
Bluebox[:compute].get_templates.body
|
20
22
|
end
|
21
23
|
|
@@ -24,6 +26,7 @@ Shindo.tests('Bluebox::Compute | template requests', ['bluebox']) do
|
|
24
26
|
tests('failure') do
|
25
27
|
|
26
28
|
tests("get_template('00000000-0000-0000-0000-000000000000')").raises(Fog::Bluebox::Compute::NotFound) do
|
29
|
+
pending if Fog.mocking?
|
27
30
|
Bluebox[:compute].get_template('00000000-0000-0000-0000-000000000000')
|
28
31
|
end
|
29
32
|
|
File without changes
|
File without changes
|
data/tests/helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'fog'
|
2
|
-
require 'fog/bin'
|
2
|
+
require 'fog/core/bin'
|
3
3
|
Fog.bin = true
|
4
4
|
|
5
5
|
require File.expand_path(File.join(File.dirname(__FILE__), 'helpers', 'model_helper'))
|
@@ -16,6 +16,10 @@ end
|
|
16
16
|
FalseClass.send(:include, Fog::Boolean)
|
17
17
|
TrueClass.send(:include, Fog::Boolean)
|
18
18
|
|
19
|
+
def lorem_file
|
20
|
+
File.open(File.dirname(__FILE__) + '/lorem.txt', 'r')
|
21
|
+
end
|
22
|
+
|
19
23
|
module Shindo
|
20
24
|
class Tests
|
21
25
|
|
@@ -16,12 +16,14 @@ Shindo.tests('Linode::Compute | distribution requests', ['linode']) do
|
|
16
16
|
@distribution_id = nil
|
17
17
|
|
18
18
|
tests('#avail_distributions').formats(@distributions_format) do
|
19
|
+
pending if Fog.mocking?
|
19
20
|
data = Linode[:compute].avail_distributions.body
|
20
21
|
@distribution_id = data['DATA'].first['DISTRIBUTIONID']
|
21
22
|
data
|
22
23
|
end
|
23
24
|
|
24
25
|
tests("@avail_distributions(#{@distribution_id})").formats(@distributions_format) do
|
26
|
+
pending if Fog.mocking?
|
25
27
|
Linode[:compute].avail_distributions(@distribution_id).body
|
26
28
|
end
|
27
29
|
|
@@ -41,16 +41,19 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|
41
41
|
|
42
42
|
# (2 => Dallas, TX, USA), (1 => 1 month), (1 => Linode 512)
|
43
43
|
tests('#linode_create(2, 1, 1)').formats(@linode_format) do
|
44
|
+
pending if Fog.mocking?
|
44
45
|
data = Linode[:compute].linode_create(2, 1, 1).body
|
45
46
|
@linode_id = data['DATA']['LinodeID']
|
46
47
|
data
|
47
48
|
end
|
48
49
|
|
49
50
|
tests("#linode_list(#{@linode_id})").formats(@linodes_format) do
|
51
|
+
pending if Fog.mocking?
|
50
52
|
Linode[:compute].linode_list(@linode_id).body
|
51
53
|
end
|
52
54
|
|
53
55
|
tests('#linode_list').formats(@linodes_format) do
|
56
|
+
pending if Fog.mocking?
|
54
57
|
Linode[:compute].linode_list.body
|
55
58
|
end
|
56
59
|
|
@@ -59,6 +62,7 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|
59
62
|
# end
|
60
63
|
|
61
64
|
tests('#linode_delete(#{@linode_id})').succeeds do
|
65
|
+
pending if Fog.mocking?
|
62
66
|
Linode[:compute].linode_delete(@linode_id)
|
63
67
|
end
|
64
68
|
|
@@ -67,10 +71,12 @@ Shindo.tests('Linode::Compute | linode requests', ['linode']) do
|
|
67
71
|
tests('failure') do
|
68
72
|
|
69
73
|
tests('#linode_reboot(0)').raises(Fog::Linode::Compute::NotFound) do
|
74
|
+
pending if Fog.mocking?
|
70
75
|
Linode[:compute].linode_reboot(0)
|
71
76
|
end
|
72
77
|
|
73
78
|
tests('#linode_delete(0)').raises(Fog::Linode::Compute::NotFound) do
|
79
|
+
pending if Fog.mocking?
|
74
80
|
Linode[:compute].linode_delete(0)
|
75
81
|
end
|
76
82
|
|
@@ -23,12 +23,14 @@ Shindo.tests('Linode::Compute | linodeplans requests', ['linode']) do
|
|
23
23
|
@linodeplan_id = nil
|
24
24
|
|
25
25
|
tests('#avail_linodeplans').formats(@linodeplans_format) do
|
26
|
+
pending if Fog.mocking?
|
26
27
|
data = Linode[:compute].avail_linodeplans.body
|
27
28
|
@linodeplan_id = data['DATA'].first['PLANID']
|
28
29
|
data
|
29
30
|
end
|
30
31
|
|
31
32
|
tests("#avail_linodeplans(#{@linodeplan_id})").formats(@linodeplans_format) do
|
33
|
+
pending if Fog.mocking?
|
32
34
|
Linode[:compute].avail_linodeplans(@linodeplan_id).body
|
33
35
|
end
|
34
36
|
|
data/tests/lorem.txt
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
|
@@ -10,14 +10,17 @@ Shindo.tests('Rackspace::Compute | flavor requests', ['rackspace']) do
|
|
10
10
|
tests('success') do
|
11
11
|
|
12
12
|
tests('#get_flavor_details(1)').formats(@flavor_format) do
|
13
|
+
pending if Fog.mocking?
|
13
14
|
Rackspace[:compute].get_flavor_details(1).body['flavor']
|
14
15
|
end
|
15
16
|
|
16
17
|
tests('#list_flavors').formats({'flavors' => [Rackspace::Compute::Formats::SUMMARY]}) do
|
18
|
+
pending if Fog.mocking?
|
17
19
|
Rackspace[:compute].list_flavors.body
|
18
20
|
end
|
19
21
|
|
20
22
|
tests('#list_flavors_detail').formats({'flavors' => [@flavor_format]}) do
|
23
|
+
pending if Fog.mocking?
|
21
24
|
Rackspace[:compute].list_flavors_detail.body
|
22
25
|
end
|
23
26
|
|
@@ -26,6 +29,7 @@ Shindo.tests('Rackspace::Compute | flavor requests', ['rackspace']) do
|
|
26
29
|
tests('failure') do
|
27
30
|
|
28
31
|
tests('#get_flavor_details(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
32
|
+
pending if Fog.mocking?
|
29
33
|
Rackspace[:compute].get_flavor_details(0)
|
30
34
|
end
|
31
35
|
|
@@ -4,13 +4,12 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|
4
4
|
'id' => Integer,
|
5
5
|
'name' => String,
|
6
6
|
'status' => String,
|
7
|
-
'updated' => String
|
7
|
+
'updated' => String,
|
8
8
|
}
|
9
9
|
|
10
10
|
@image_format = @images_format.merge({
|
11
11
|
'created' => String,
|
12
12
|
'progress' => Integer,
|
13
|
-
'serverId' => Integer,
|
14
13
|
})
|
15
14
|
|
16
15
|
tests('success') do
|
@@ -19,15 +18,18 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|
19
18
|
@server.wait_for { ready? }
|
20
19
|
@image_id = nil
|
21
20
|
|
22
|
-
tests("#create_image(#{@server.id})").formats(@images_format) do
|
21
|
+
tests("#create_image(#{@server.id})").formats(@images_format.merge('serverId' => Integer)) do
|
23
22
|
data = Rackspace[:compute].create_image(@server.id).body['image']
|
24
23
|
@image_id = data['id']
|
25
24
|
data
|
26
25
|
end
|
27
26
|
|
28
|
-
|
27
|
+
unless Fog.mocking?
|
28
|
+
Rackspace[:compute].images.get(@image_id).wait_for { ready? }
|
29
|
+
end
|
29
30
|
|
30
31
|
tests("#get_image_details(#{@image_id})").formats(@image_format) do
|
32
|
+
pending if Fog.mocking?
|
31
33
|
Rackspace[:compute].get_image_details(@image_id).body['image']
|
32
34
|
end
|
33
35
|
|
@@ -39,7 +41,12 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|
39
41
|
Rackspace[:compute].list_images_detail.body
|
40
42
|
end
|
41
43
|
|
44
|
+
unless Fog.mocking?
|
45
|
+
Rackspace[:compute].images.get(@image_id).wait_for { ready? }
|
46
|
+
end
|
47
|
+
|
42
48
|
tests("#delete_image(#{@image_id})").succeeds do
|
49
|
+
pending if Fog.mocking? # because it will fail without the wait just above here, which won't work
|
43
50
|
Rackspace[:compute].delete_image(@image_id)
|
44
51
|
end
|
45
52
|
|
@@ -54,6 +61,7 @@ Shindo.tests('Rackspace::Compute | image requests', ['rackspace']) do
|
|
54
61
|
end
|
55
62
|
|
56
63
|
tests('#get_image_details(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
64
|
+
pending if Fog.mocking?
|
57
65
|
Rackspace[:compute].get_image_details(0)
|
58
66
|
end
|
59
67
|
|
@@ -40,15 +40,23 @@ Shindo.tests('Rackspace::Compute | server requests', ['rackspace']) do
|
|
40
40
|
Rackspace[:compute].list_servers_detail.body
|
41
41
|
end
|
42
42
|
|
43
|
+
Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
|
44
|
+
|
43
45
|
tests("#update_server(#{@server_id}, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')").succeeds do
|
44
46
|
Rackspace[:compute].update_server(@server_id, :name => 'fogupdatedserver', :adminPass => 'fogupdatedserver')
|
45
47
|
end
|
46
48
|
|
49
|
+
Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
|
50
|
+
|
47
51
|
tests("#reboot_server(#{@server_id}, 'HARD')").succeeds do
|
52
|
+
pending if Fog.mocking?
|
48
53
|
Rackspace[:compute].reboot_server(@server_id, 'HARD')
|
49
54
|
end
|
50
55
|
|
56
|
+
Rackspace[:compute].servers.get(@server_id).wait_for { ready? }
|
57
|
+
|
51
58
|
tests("#reboot_server(#{@server_id}, 'SOFT')").succeeds do
|
59
|
+
pending if Fog.mocking?
|
52
60
|
Rackspace[:compute].reboot_server(@server_id, 'SOFT')
|
53
61
|
end
|
54
62
|
|
@@ -75,6 +83,7 @@ Shindo.tests('Rackspace::Compute | server requests', ['rackspace']) do
|
|
75
83
|
end
|
76
84
|
|
77
85
|
tests('#reboot_server(0)').raises(Fog::Rackspace::Compute::NotFound) do
|
86
|
+
pending if Fog.mocking?
|
78
87
|
Rackspace[:compute].reboot_server(0)
|
79
88
|
end
|
80
89
|
|
@@ -10,10 +10,12 @@ Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
|
|
10
10
|
tests('success') do
|
11
11
|
|
12
12
|
tests('#get_flavor(1)').formats(@flavor_format) do
|
13
|
+
pending if Fog.mocking?
|
13
14
|
Slicehost[:compute].get_flavor(1).body
|
14
15
|
end
|
15
16
|
|
16
17
|
tests('#get_flavors').formats({ 'flavors' => [@flavor_format] }) do
|
18
|
+
pending if Fog.mocking?
|
17
19
|
Slicehost[:compute].get_flavors.body
|
18
20
|
end
|
19
21
|
|
@@ -22,6 +24,7 @@ Shindo.tests('Slicehost::Compute | flavor requests', ['slicehost']) do
|
|
22
24
|
tests('failure') do
|
23
25
|
|
24
26
|
tests('#get_flavor(0)').raises(Excon::Errors::Forbidden) do
|
27
|
+
pending if Fog.mocking?
|
25
28
|
Slicehost[:compute].get_flavor(0)
|
26
29
|
end
|
27
30
|
|
@@ -8,10 +8,12 @@ Shindo.tests('Slicehost::Compute | image requests', ['slicehost']) do
|
|
8
8
|
tests('success') do
|
9
9
|
|
10
10
|
tests('#get_image(19)').formats(@image_format) do
|
11
|
+
pending if Fog.mocking?
|
11
12
|
Slicehost[:compute].get_image(19).body
|
12
13
|
end
|
13
14
|
|
14
15
|
tests('#get_images').formats({ 'images' => [@image_format] }) do
|
16
|
+
pending if Fog.mocking?
|
15
17
|
Slicehost[:compute].get_images.body
|
16
18
|
end
|
17
19
|
|
@@ -20,6 +22,7 @@ Shindo.tests('Slicehost::Compute | image requests', ['slicehost']) do
|
|
20
22
|
tests('failure') do
|
21
23
|
|
22
24
|
tests('#get_image(0)').raises(Excon::Errors::Forbidden) do
|
25
|
+
pending if Fog.mocking?
|
23
26
|
Slicehost[:compute].get_image(0)
|
24
27
|
end
|
25
28
|
|