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,39 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
if Fog.mocking?
|
4
|
+
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
5
|
+
subject { @vcloud }
|
6
|
+
|
7
|
+
it { should respond_to :get_customization_options }
|
8
|
+
|
9
|
+
describe "#get_customization_options" do
|
10
|
+
context "with a valid catalog_item customizations uri" do
|
11
|
+
let(:catalog_item) { @vcloud.get_catalog_item(@vcloud.vdcs.first.catalog.first.href) }
|
12
|
+
|
13
|
+
before { @customization_options = @vcloud.get_customization_options(catalog_item.body[:Link][:href]) }
|
14
|
+
subject { @customization_options }
|
15
|
+
|
16
|
+
it_should_behave_like "all responses"
|
17
|
+
it { should have_headers_denoting_a_content_type_of "application/vnd.tmrk.ecloud.catalogItemCustomizationParameters+xml" }
|
18
|
+
|
19
|
+
describe "#body" do
|
20
|
+
subject { @customization_options.body }
|
21
|
+
|
22
|
+
it { should have(5).items }
|
23
|
+
|
24
|
+
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
|
25
|
+
|
26
|
+
specify { subject[:CustomizeNetwork].should == "true" }
|
27
|
+
specify { subject[:CustomizePassword].should == "false" }
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context "with a catalog uri that doesn't exist" do
|
32
|
+
subject { lambda { @vcloud.get_catalog(URI.parse('https://www.fakey.com/api/v0.8/vdc/999/catalog')) } }
|
33
|
+
|
34
|
+
it_should_behave_like "a request for a resource that doesn't exist"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
else
|
39
|
+
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), '..', '..', '..', 'spec_helper')
|
2
|
+
|
3
|
+
if Fog.mocking?
|
4
|
+
describe "Fog::Vcloud, initialized w/ the TMRK Ecloud module", :type => :mock_tmrk_ecloud_request do
|
5
|
+
subject { @vcloud }
|
6
|
+
|
7
|
+
it { should respond_to :instantiate_vapp_template }
|
8
|
+
|
9
|
+
describe "#instantiate_vapp_template" do
|
10
|
+
let(:vdc) { @vcloud.vdcs.first }
|
11
|
+
let(:catalog_item) { vdc.catalog.first }
|
12
|
+
let(:new_vapp_data) do
|
13
|
+
{
|
14
|
+
:name => "foobar",
|
15
|
+
:network_uri => @mock_network[:href],
|
16
|
+
:row => "test row",
|
17
|
+
:group => "test group",
|
18
|
+
:memory => 1024,
|
19
|
+
:cpus => 2,
|
20
|
+
:vdc_uri => vdc.href
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
context "with a valid data" do
|
25
|
+
let(:template_instantiation) { @vcloud.instantiate_vapp_template(catalog_item.href, new_vapp_data) }
|
26
|
+
subject { template_instantiation }
|
27
|
+
|
28
|
+
it_should_behave_like "all responses"
|
29
|
+
it { should have_headers_denoting_a_content_type_of "application/xml" }
|
30
|
+
|
31
|
+
it "updates the mock data properly" do
|
32
|
+
expect { template_instantiation }.to change { @vcloud.vdc_from_uri(vdc.href)[:vms].count }.by(1)
|
33
|
+
end
|
34
|
+
|
35
|
+
describe "added mock data" do
|
36
|
+
subject { template_instantiation; @vcloud.vdc_from_uri(vdc.href)[:vms].last }
|
37
|
+
|
38
|
+
it { should include :id }
|
39
|
+
it { should include :href }
|
40
|
+
|
41
|
+
specify { subject.values_at(*new_vapp_data.keys).should == new_vapp_data.values }
|
42
|
+
end
|
43
|
+
|
44
|
+
describe "#body" do
|
45
|
+
subject { template_instantiation.body }
|
46
|
+
|
47
|
+
it { should have(9).items }
|
48
|
+
|
49
|
+
it_should_behave_like "it has the standard vcloud v0.8 xmlns attributes" # 3 keys
|
50
|
+
|
51
|
+
its(:href) { should =~ %r{/vapp/\d+$} }
|
52
|
+
its(:type) { should == "application/vnd.vmware.vcloud.vApp+xml" }
|
53
|
+
its(:name) { should == new_vapp_data[:name] }
|
54
|
+
its(:status) { should == "0" }
|
55
|
+
its(:size) { should == "4" }
|
56
|
+
|
57
|
+
it { should include :Link }
|
58
|
+
|
59
|
+
describe "Link" do
|
60
|
+
subject { template_instantiation.body[:Link] }
|
61
|
+
|
62
|
+
it { should have(3).keys }
|
63
|
+
|
64
|
+
its(:rel) { should == "up" }
|
65
|
+
its(:type) { should == "application/vnd.vmware.vcloud.vdc+xml" }
|
66
|
+
its(:href) { should == vdc.href }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
else
|
73
|
+
end
|
@@ -26,8 +26,8 @@ Shindo.tests('AWS::Compute | address requests', ['aws']) do
|
|
26
26
|
AWS[:compute].describe_addresses.body
|
27
27
|
end
|
28
28
|
|
29
|
-
tests("#describe_addresses('#{@public_Ip}')").formats(@addresses_format) do
|
30
|
-
AWS[:compute].describe_addresses(@public_ip).body
|
29
|
+
tests("#describe_addresses('public-ip' => #{@public_Ip}')").formats(@addresses_format) do
|
30
|
+
AWS[:compute].describe_addresses('public-ip' => @public_ip).body
|
31
31
|
end
|
32
32
|
|
33
33
|
tests("#associate_addresses('#{@server.identity}', '#{@public_Ip}')").formats(AWS::Compute::Formats::BASIC) do
|
@@ -47,10 +47,6 @@ Shindo.tests('AWS::Compute | address requests', ['aws']) do
|
|
47
47
|
|
48
48
|
@address = AWS[:compute].addresses.create
|
49
49
|
|
50
|
-
tests("#describe_addresses('127.0.0.1')").raises(Fog::AWS::Compute::NotFound) do
|
51
|
-
AWS[:compute].describe_addresses('127.0.0.1')
|
52
|
-
end
|
53
|
-
|
54
50
|
tests("#associate_addresses('i-00000000', '#{@address.identity}')").raises(Fog::AWS::Compute::NotFound) do
|
55
51
|
AWS[:compute].associate_address('i-00000000', @address.identity)
|
56
52
|
end
|
@@ -2,6 +2,7 @@ Shindo.tests('AWS::Compute | availability zone requests', ['aws']) do
|
|
2
2
|
|
3
3
|
@availability_zones_format = {
|
4
4
|
'availabilityZoneInfo' => [{
|
5
|
+
'messageSet' => [],
|
5
6
|
'regionName' => String,
|
6
7
|
'zoneName' => String,
|
7
8
|
'zoneState' => String
|
@@ -15,16 +16,8 @@ Shindo.tests('AWS::Compute | availability zone requests', ['aws']) do
|
|
15
16
|
AWS[:compute].describe_availability_zones.body
|
16
17
|
end
|
17
18
|
|
18
|
-
tests("#describe_availability_zones('us-east-1a')").formats(@availability_zones_format) do
|
19
|
-
AWS[:compute].describe_availability_zones('us-east-1a').body
|
20
|
-
end
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
tests('failure') do
|
25
|
-
|
26
|
-
tests("#describe_availability_zones('us-east-1e')").raises(Fog::AWS::Compute::Error) do
|
27
|
-
AWS[:compute].describe_availability_zones('us-east-1e')
|
19
|
+
tests("#describe_availability_zones('zone-name' => 'us-east-1a')").formats(@availability_zones_format) do
|
20
|
+
AWS[:compute].describe_availability_zones('zone-name' => 'us-east-1a').body
|
28
21
|
end
|
29
22
|
|
30
23
|
end
|
@@ -13,29 +13,24 @@ Shindo.tests('AWS::Compute | image requests', ['aws']) do
|
|
13
13
|
'kernelId' => String,
|
14
14
|
'productCodes' => [],
|
15
15
|
'ramdiskId' => String,
|
16
|
-
'rootDeviceType' => String
|
16
|
+
'rootDeviceType' => String,
|
17
|
+
'tagSet' => {}
|
17
18
|
}],
|
18
19
|
'requestId' => String,
|
19
20
|
}
|
20
21
|
|
21
22
|
tests('success') do
|
22
23
|
|
23
|
-
# the result for this is HUGE
|
24
|
+
# the result for this is HUGE and relatively uninteresting...
|
24
25
|
# tests("#describe_images").formats(@images_format) do
|
25
26
|
# AWS[:compute].describe_images.body
|
26
27
|
# end
|
27
28
|
|
28
29
|
tests("#describe_images('ImageId' => '#{GENTOO_AMI}')").formats(@images_format) do
|
30
|
+
pending if Fog.mocking?
|
29
31
|
AWS[:compute].describe_images('ImageId' => GENTOO_AMI).body
|
30
32
|
end
|
31
33
|
|
32
34
|
end
|
33
35
|
|
34
|
-
tests('failure') do
|
35
|
-
|
36
|
-
tests("#describe_images('ImageId' => 'ami-00000000')").raises(Fog::AWS::Compute::Error) do
|
37
|
-
AWS[:compute].describe_regions('ImageId' => 'ami-00000000')
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
36
|
end
|
@@ -4,6 +4,7 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|
4
4
|
# 'architecture' => String,
|
5
5
|
'amiLaunchIndex' => Integer,
|
6
6
|
'blockDeviceMapping' => [],
|
7
|
+
'clientToken' => NilClass,
|
7
8
|
'dnsName' => NilClass,
|
8
9
|
'imageId' => String,
|
9
10
|
'instanceId' => String,
|
@@ -21,7 +22,7 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|
21
22
|
'ramdiskId' => String,
|
22
23
|
'reason' => NilClass,
|
23
24
|
# 'rootDeviceName' => String,
|
24
|
-
'rootDeviceType' => String
|
25
|
+
'rootDeviceType' => String,
|
25
26
|
}
|
26
27
|
|
27
28
|
@run_instances_format = {
|
@@ -40,7 +41,9 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|
40
41
|
'dnsName' => String,
|
41
42
|
'ipAddress' => String,
|
42
43
|
'privateDnsName' => String,
|
43
|
-
'privateIpAddress' => String
|
44
|
+
'privateIpAddress' => String,
|
45
|
+
'stateReason' => {},
|
46
|
+
'tagSet' => {}
|
44
47
|
)],
|
45
48
|
'ownerId' => String,
|
46
49
|
'reservationId' => String
|
@@ -81,8 +84,8 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|
81
84
|
# AWS[:compute].describe_instances.body
|
82
85
|
# end
|
83
86
|
|
84
|
-
tests("#describe_instances('#{@instance_id}')").formats(@describe_instances_format) do
|
85
|
-
AWS[:compute].describe_instances(@instance_id).body
|
87
|
+
tests("#describe_instances('instance-id' => '#{@instance_id}')").formats(@describe_instances_format) do
|
88
|
+
AWS[:compute].describe_instances('instance-id' => @instance_id).body
|
86
89
|
end
|
87
90
|
|
88
91
|
tests("#get_console_output('#{@instance_id}')").formats(@get_console_output_format) do
|
@@ -101,10 +104,6 @@ Shindo.tests('AWS::Compute | instance requests', ['aws']) do
|
|
101
104
|
|
102
105
|
tests('failure') do
|
103
106
|
|
104
|
-
tests("#describe_instances('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
105
|
-
AWS[:compute].describe_instances('i-00000000')
|
106
|
-
end
|
107
|
-
|
108
107
|
tests("#get_console_output('i-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
109
108
|
AWS[:compute].get_console_output('i-00000000')
|
110
109
|
end
|
@@ -27,8 +27,8 @@ Shindo.tests('AWS::Compute | key pair requests', ['aws']) do
|
|
27
27
|
AWS[:compute].describe_key_pairs.body
|
28
28
|
end
|
29
29
|
|
30
|
-
tests("#describe_key_pairs(#{@key_pair_name})").formats(@keypairs_format) do
|
31
|
-
AWS[:compute].describe_key_pairs(@key_pair_name).body
|
30
|
+
tests("#describe_key_pairs('key-name' => '#{@key_pair_name}')").formats(@keypairs_format) do
|
31
|
+
AWS[:compute].describe_key_pairs('key-name' => @key_pair_name).body
|
32
32
|
end
|
33
33
|
|
34
34
|
tests("#delete_key_pair('#{@key_pair_name}')").formats(AWS::Compute::Formats::BASIC) do
|
@@ -56,10 +56,6 @@ Shindo.tests('AWS::Compute | key pair requests', ['aws']) do
|
|
56
56
|
AWS[:compute].create_key_pair(@key_pair.name)
|
57
57
|
end
|
58
58
|
|
59
|
-
tests("#describe_key_pair('not_a_key_name')").raises(Fog::AWS::Compute::NotFound) do
|
60
|
-
AWS[:compute].describe_key_pairs('not_a_key_name').body
|
61
|
-
end
|
62
|
-
|
63
59
|
@key_pair.destroy
|
64
60
|
|
65
61
|
end
|
@@ -14,17 +14,10 @@ Shindo.tests('AWS::Compute | region requests', ['aws']) do
|
|
14
14
|
AWS[:compute].describe_regions.body
|
15
15
|
end
|
16
16
|
|
17
|
-
tests("#describe_regions('us-east-1')").formats(@regions_format) do
|
18
|
-
AWS[:compute].describe_regions('us-east-1').body
|
17
|
+
tests("#describe_regions('region-name' => 'us-east-1')").formats(@regions_format) do
|
18
|
+
AWS[:compute].describe_regions('region-name' => 'us-east-1').body
|
19
19
|
end
|
20
20
|
|
21
21
|
end
|
22
22
|
|
23
|
-
tests('failure') do
|
24
|
-
|
25
|
-
tests("#describe_regions('us-east-2')").raises(Fog::AWS::Compute::Error) do
|
26
|
-
AWS[:compute].describe_regions('us-east-2')
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
23
|
end
|
@@ -16,7 +16,7 @@ Shindo.tests('AWS::Compute | security group requests', ['aws']) do
|
|
16
16
|
}]
|
17
17
|
}
|
18
18
|
|
19
|
-
@owner_id = AWS[:compute].describe_security_groups('default').body['securityGroupInfo'].first['ownerId']
|
19
|
+
@owner_id = AWS[:compute].describe_security_groups('group-name' => 'default').body['securityGroupInfo'].first['ownerId']
|
20
20
|
|
21
21
|
tests('success') do
|
22
22
|
|
@@ -45,8 +45,8 @@ Shindo.tests('AWS::Compute | security group requests', ['aws']) do
|
|
45
45
|
AWS[:compute].describe_security_groups.body
|
46
46
|
end
|
47
47
|
|
48
|
-
tests("#describe_security_groups('fog_security_group')").formats(@security_groups_format) do
|
49
|
-
AWS[:compute].describe_security_groups('fog_security_group').body
|
48
|
+
tests("#describe_security_groups('group-name' => 'fog_security_group')").formats(@security_groups_format) do
|
49
|
+
AWS[:compute].describe_security_groups('group-name' => 'fog_security_group').body
|
50
50
|
end
|
51
51
|
|
52
52
|
tests("#revoke_security_group_ingress({'FromPort' => 80, 'GroupName' => 'fog_security_group', 'IpProtocol' => 'tcp', 'toPort' => 80})").formats(AWS::Compute::Formats::BASIC) do
|
@@ -96,10 +96,6 @@ Shindo.tests('AWS::Compute | security group requests', ['aws']) do
|
|
96
96
|
})
|
97
97
|
end
|
98
98
|
|
99
|
-
tests("#describe_security_group('not_a_group_name)").raises(Fog::AWS::Compute::NotFound) do
|
100
|
-
AWS[:compute].describe_security_groups('not_a_group_name')
|
101
|
-
end
|
102
|
-
|
103
99
|
tests("#revoke_security_group_ingress({'FromPort' => 80, 'GroupName' => 'not_a_group_name', 'IpProtocol' => 'tcp', 'toPort' => 80})").raises(Fog::AWS::Compute::NotFound) do
|
104
100
|
AWS[:compute].revoke_security_group_ingress({
|
105
101
|
'FromPort' => 80,
|
@@ -13,7 +13,7 @@ Shindo.tests('AWS::Compute | snapshot requests', ['aws']) do
|
|
13
13
|
|
14
14
|
@snapshots_format = {
|
15
15
|
'requestId' => String,
|
16
|
-
'snapshotSet' => [@snapshot_format]
|
16
|
+
'snapshotSet' => [@snapshot_format.merge('tagSet' => {})]
|
17
17
|
}
|
18
18
|
|
19
19
|
@volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
|
@@ -28,14 +28,15 @@ Shindo.tests('AWS::Compute | snapshot requests', ['aws']) do
|
|
28
28
|
data
|
29
29
|
end
|
30
30
|
|
31
|
+
Fog.wait_for { AWS[:compute].snapshots.get(@snapshot_id) }
|
31
32
|
AWS[:compute].snapshots.get(@snapshot_id).wait_for { ready? }
|
32
33
|
|
33
34
|
tests("#describe_snapshots").formats(@snapshots_format) do
|
34
35
|
AWS[:compute].describe_snapshots.body
|
35
36
|
end
|
36
37
|
|
37
|
-
tests("#describe_snapshots('#{@snapshot_id}')").formats(@snapshots_format) do
|
38
|
-
AWS[:compute].describe_snapshots(@snapshot_id).body
|
38
|
+
tests("#describe_snapshots('snapshot-id' => '#{@snapshot_id}')").formats(@snapshots_format) do
|
39
|
+
AWS[:compute].describe_snapshots('snapshot-id' => @snapshot_id).body
|
39
40
|
end
|
40
41
|
|
41
42
|
tests("#delete_snapshots(#{@snapshot_id})").formats(AWS::Compute::Formats::BASIC) do
|
@@ -45,10 +46,6 @@ Shindo.tests('AWS::Compute | snapshot requests', ['aws']) do
|
|
45
46
|
end
|
46
47
|
tests ('failure') do
|
47
48
|
|
48
|
-
tests("#describe_snapshot('snap-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
49
|
-
AWS[:compute].describe_snapshots('snap-00000000')
|
50
|
-
end
|
51
|
-
|
52
49
|
tests("#delete_snapshot('snap-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
53
50
|
AWS[:compute].delete_snapshot('snap-00000000')
|
54
51
|
end
|
@@ -0,0 +1,49 @@
|
|
1
|
+
Shindo.tests('AWS::Compute | tag requests', ['aws']) do
|
2
|
+
|
3
|
+
@tags_format = {
|
4
|
+
'tagSet' => [{
|
5
|
+
'key' => String,
|
6
|
+
'resourceId' => String,
|
7
|
+
'resourceType' => String,
|
8
|
+
'value' => String
|
9
|
+
}],
|
10
|
+
'requestId' => String
|
11
|
+
}
|
12
|
+
|
13
|
+
@volume = AWS[:compute].volumes.create(:availability_zone => 'us-east-1a', :size => 1)
|
14
|
+
@volume.wait_for { ready? }
|
15
|
+
|
16
|
+
tests('success') do
|
17
|
+
|
18
|
+
tests("#create_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
|
19
|
+
AWS[:compute].create_tags(@volume.identity, 'foo' => 'bar').body
|
20
|
+
end
|
21
|
+
|
22
|
+
tests('#describe_tags').formats(@tags_format) do
|
23
|
+
pending if Fog.mocking?
|
24
|
+
AWS[:compute].describe_tags.body
|
25
|
+
end
|
26
|
+
|
27
|
+
tests("#delete_tags('#{@volume.identity}', 'foo' => 'bar')").formats(AWS::Compute::Formats::BASIC) do
|
28
|
+
pending if Fog.mocking?
|
29
|
+
AWS[:compute].delete_tags(@volume.identity, 'foo' => 'bar').body
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
tests('failure') do
|
35
|
+
|
36
|
+
tests("#create_tags('vol-00000000', 'baz' => 'qux')").raises(Fog::Service::NotFound) do
|
37
|
+
AWS[:compute].create_tags('vol-00000000', 'baz' => 'qux')
|
38
|
+
end
|
39
|
+
|
40
|
+
tests("#delete_tags('vol-00000000', 'baz' => 'qux')").raises(Fog::Service::NotFound) do
|
41
|
+
pending if Fog.mocking?
|
42
|
+
AWS[:compute].delete_tags('vol-00000000', 'baz' => 'qux')
|
43
|
+
end
|
44
|
+
|
45
|
+
end
|
46
|
+
|
47
|
+
@volume.destroy
|
48
|
+
|
49
|
+
end
|
@@ -51,8 +51,8 @@ Shindo.tests('AWS::Compute | volume requests', ['aws']) do
|
|
51
51
|
AWS[:compute].describe_volumes.body
|
52
52
|
end
|
53
53
|
|
54
|
-
tests("#describe_volumes(#{@volume_id})").formats(@volumes_format) do
|
55
|
-
AWS[:compute].describe_volumes.body
|
54
|
+
tests("#describe_volumes('volume-id' => #{@volume_id})").formats(@volumes_format) do
|
55
|
+
AWS[:compute].describe_volumes('volume-id' => @volume_id).body
|
56
56
|
end
|
57
57
|
|
58
58
|
tests("#attach_volume(#{@server.identity}, #{@volume_id}, '/dev/sdh')").formats(@volume_attachment_format) do
|
@@ -76,10 +76,6 @@ Shindo.tests('AWS::Compute | volume requests', ['aws']) do
|
|
76
76
|
|
77
77
|
@volume = AWS[:compute].volumes.create(:availability_zone => @server.availability_zone, :size => 1)
|
78
78
|
|
79
|
-
tests("#describe_volume('vol-00000000')").raises(Fog::AWS::Compute::NotFound) do
|
80
|
-
AWS[:compute].describe_volumes('vol-00000000')
|
81
|
-
end
|
82
|
-
|
83
79
|
tests("#attach_volume('i-00000000', '#{@volume.identity}', '/dev/sdh')").raises(Fog::AWS::Compute::NotFound) do
|
84
80
|
AWS[:compute].attach_volume('i-00000000', @volume.identity, '/dev/sdh')
|
85
81
|
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
Shindo.tests('AWS::Storage | bucket requests', ['aws']) do
|
2
|
+
|
3
|
+
tests('success') do
|
4
|
+
|
5
|
+
@service_format = {
|
6
|
+
'Buckets' => [{
|
7
|
+
'CreationDate' => Time,
|
8
|
+
'Name' => String,
|
9
|
+
}],
|
10
|
+
'Owner' => {
|
11
|
+
'DisplayName' => String,
|
12
|
+
'ID' => String
|
13
|
+
}
|
14
|
+
}
|
15
|
+
|
16
|
+
tests("#put_bucket('fogbuckettests')").succeeds do
|
17
|
+
AWS[:storage].put_bucket('fogbuckettests')
|
18
|
+
end
|
19
|
+
|
20
|
+
tests("#get_service").formats(@service_format) do
|
21
|
+
AWS[:storage].get_service.body
|
22
|
+
end
|
23
|
+
|
24
|
+
tests("#delete_bucket('fogbuckettests')").succeeds do
|
25
|
+
AWS[:storage].delete_bucket('fogbuckettests')
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
tests('failure') do
|
31
|
+
|
32
|
+
tests("#delete_bucket('fognonbucket')").raises(Excon::Errors::NotFound) do
|
33
|
+
AWS[:storage].delete_bucket('fognonbucket')
|
34
|
+
end
|
35
|
+
|
36
|
+
@bucket = AWS[:storage].directories.create(:key => 'fognonempty')
|
37
|
+
@file = @bucket.files.create(:key => 'foo', :body => 'bar')
|
38
|
+
|
39
|
+
tests("#delete_bucket('fognonempty')").raises(Excon::Errors::Conflict) do
|
40
|
+
AWS[:storage].delete_bucket('fognonempty')
|
41
|
+
end
|
42
|
+
|
43
|
+
@file.destroy
|
44
|
+
@bucket.destroy
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
end
|