fog 0.0.84 → 0.0.85
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +47 -37
- data/bin/fog +9 -10
- data/fog.gemspec +23 -4
- data/lib/fog.rb +19 -1
- data/lib/fog/aws.rb +23 -0
- data/lib/fog/aws/bin.rb +4 -0
- data/lib/fog/aws/ec2.rb +20 -27
- data/lib/fog/aws/elb.rb +115 -0
- data/lib/fog/aws/models/ec2/server.rb +7 -1
- data/lib/fog/aws/models/s3/directories.rb +4 -4
- data/lib/fog/aws/models/s3/directory.rb +13 -11
- data/lib/fog/aws/parsers/elb/deregister_instances_from_load_balancer.rb +26 -0
- data/lib/fog/aws/parsers/elb/describe_instance_health.rb +30 -0
- data/lib/fog/aws/parsers/elb/describe_load_balancers.rb +101 -0
- data/lib/fog/aws/parsers/elb/disable_availability_zones_for_load_balancer.rb +26 -0
- data/lib/fog/aws/parsers/elb/enable_availability_zones_for_load_balancer.rb +26 -0
- data/lib/fog/aws/parsers/elb/register_instances_with_load_balancer.rb +26 -0
- data/lib/fog/aws/requests/ec2/detach_volume.rb +2 -2
- data/lib/fog/aws/requests/elb/deregister_instances_from_load_balancer.rb +45 -0
- data/lib/fog/aws/requests/elb/describe_instance_health.rb +44 -0
- data/lib/fog/aws/requests/elb/describe_load_balancers.rb +57 -0
- data/lib/fog/aws/requests/elb/disable_availability_zones_for_load_balancer.rb +44 -0
- data/lib/fog/aws/requests/elb/enable_availability_zones_for_load_balancer.rb +44 -0
- data/lib/fog/aws/requests/elb/register_instances_with_load_balancer.rb +45 -0
- data/lib/fog/aws/s3.rb +8 -1
- data/lib/fog/aws/simpledb.rb +9 -18
- data/lib/fog/bin.rb +11 -1
- data/lib/fog/credentials.rb +1 -0
- data/lib/fog/local.rb +72 -0
- data/lib/fog/local/bin.rb +34 -0
- data/lib/fog/local/models/directories.rb +43 -0
- data/lib/fog/local/models/directory.rb +47 -0
- data/lib/fog/local/models/file.rb +58 -0
- data/lib/fog/local/models/files.rb +74 -0
- data/lib/fog/model.rb +2 -8
- data/lib/fog/rackspace/models/files/directories.rb +3 -3
- data/lib/fog/rackspace/models/files/directory.rb +8 -5
- data/lib/fog/rackspace/models/servers/server.rb +7 -3
- data/lib/fog/rackspace/requests/servers/create_server.rb +1 -1
- data/lib/fog/ssh.rb +91 -25
- data/lib/fog/terremark/bin.rb +1 -8
- data/lib/fog/terremark/ecloud.rb +14 -5
- data/lib/fog/terremark/models/shared/server.rb +54 -3
- data/lib/fog/terremark/parsers/shared/vapp.rb +1 -1
- data/lib/fog/terremark/requests/shared/get_network.rb +39 -1
- data/lib/fog/terremark/requests/shared/get_organization.rb +45 -1
- data/lib/fog/terremark/requests/shared/get_organizations.rb +2 -1
- data/lib/fog/terremark/requests/shared/get_public_ips.rb +32 -1
- data/lib/fog/terremark/requests/shared/get_vdc.rb +83 -1
- data/lib/fog/terremark/requests/shared/{reset.rb → power_reset.rb} +1 -1
- data/lib/fog/terremark/requests/shared/power_shutdown.rb +32 -0
- data/lib/fog/terremark/shared.rb +139 -18
- data/lib/fog/terremark/vcloud.rb +14 -5
- data/spec/aws/models/ec2/address_spec.rb +1 -3
- data/spec/aws/models/ec2/snapshot_spec.rb +25 -49
- data/spec/aws/models/ec2/snapshots_spec.rb +25 -31
- data/spec/aws/models/ec2/volume_spec.rb +9 -3
- data/spec/aws/models/s3/directory_spec.rb +14 -14
- data/spec/aws/requests/ec2/associate_address_spec.rb +4 -5
- data/spec/aws/requests/ec2/attach_volume_spec.rb +14 -16
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +2 -3
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +5 -6
- data/spec/aws/requests/ec2/describe_instances_spec.rb +3 -2
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +21 -25
- data/spec/aws/requests/ec2/detach_volume_spec.rb +14 -16
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +3 -4
- data/spec/aws/requests/ec2/get_console_output_spec.rb +1 -0
- data/spec/aws/requests/s3/get_service_spec.rb +5 -6
- data/spec/spec_helper.rb +0 -20
- data/tests/helper.rb +0 -10
- data/tests/rackspace/requests/servers/create_image_tests.rb +2 -2
- data/tests/rackspace/requests/servers/create_server_tests.rb +3 -2
- data/tests/rackspace/requests/servers/delete_image_tests.rb +2 -2
- data/tests/rackspace/requests/servers/delete_server_tests.rb +1 -1
- data/tests/rackspace/requests/servers/get_server_details_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_addresses_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_private_addresses_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_public_addresses_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_servers_detail_tests.rb +1 -1
- data/tests/rackspace/requests/servers/list_servers_tests.rb +1 -1
- data/tests/rackspace/requests/servers/reboot_server_tests.rb +3 -3
- data/tests/rackspace/requests/servers/update_server_tests.rb +1 -1
- data/tests/slicehost/requests/create_slice_tests.rb +1 -1
- data/tests/slicehost/requests/delete_slice_tests.rb +1 -1
- data/tests/slicehost/requests/get_slice_tests.rb +1 -1
- data/tests/slicehost/requests/reboot_slice_tests.rb +2 -2
- metadata +24 -5
- data/lib/fog/terremark/requests/shared/shutdown.rb +0 -43
data/lib/fog/terremark/vcloud.rb
CHANGED
@@ -5,6 +5,13 @@ module Fog
|
|
5
5
|
module Bin
|
6
6
|
end
|
7
7
|
|
8
|
+
module Defaults
|
9
|
+
HOST = 'services.vcloudexpress.terremark.com'
|
10
|
+
PATH = '/api/v0.8'
|
11
|
+
PORT = 443
|
12
|
+
SCHEME = 'https'
|
13
|
+
end
|
14
|
+
|
8
15
|
extend Fog::Terremark::Shared
|
9
16
|
|
10
17
|
def self.new(options={})
|
@@ -31,11 +38,10 @@ module Fog
|
|
31
38
|
def initialize(options={})
|
32
39
|
@terremark_password = options[:terremark_vcloud_password]
|
33
40
|
@terremark_username = options[:terremark_vcloud_username]
|
34
|
-
@host = options[:host] ||
|
35
|
-
@path = options[:path] ||
|
36
|
-
@port = options[:port] ||
|
37
|
-
@scheme = options[:scheme] ||
|
38
|
-
@cookie = get_organizations.headers['Set-Cookie']
|
41
|
+
@host = options[:host] || Fog::Terremark::Vcloud::Defaults::HOST
|
42
|
+
@path = options[:path] || Fog::Terremark::Vcloud::Defaults::PATH
|
43
|
+
@port = options[:port] || Fog::Terremark::Vcloud::Defaults::PORT
|
44
|
+
@scheme = options[:scheme] || Fog::Terremark::Vcloud::Defaults::SCHEME
|
39
45
|
end
|
40
46
|
|
41
47
|
def default_vdc_id
|
@@ -92,6 +98,9 @@ module Fog
|
|
92
98
|
|
93
99
|
def initialize(option = {})
|
94
100
|
super
|
101
|
+
@base_url = Fog::Terremark::Vcloud::Defaults::SCHEME + "://" +
|
102
|
+
Fog::Terremark::Vcloud::Defaults::HOST +
|
103
|
+
Fog::Terremark::Vcloud::Defaults::PATH
|
95
104
|
@data = self.class.data[:terremark_vcloud_username]
|
96
105
|
end
|
97
106
|
end
|
@@ -1,6 +1,22 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../../../spec_helper'
|
2
2
|
|
3
|
-
describe 'Fog::AWS::EC2::
|
3
|
+
describe 'Fog::AWS::EC2::Snapshot' do
|
4
|
+
|
5
|
+
before(:all) do
|
6
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
7
|
+
@volume.wait_for { ready? }
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:all) do
|
11
|
+
@volume.destroy
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:each) do
|
15
|
+
if @snapshot && !@snapshot.new_record?
|
16
|
+
@snapshot.wait_for { ready? }
|
17
|
+
@snapshot.destroy
|
18
|
+
end
|
19
|
+
end
|
4
20
|
|
5
21
|
describe "#initialize" do
|
6
22
|
|
@@ -17,27 +33,13 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
17
33
|
|
18
34
|
end
|
19
35
|
|
20
|
-
describe "#collection" do
|
21
|
-
|
22
|
-
it "should return a Fog::AWS::EC2::Snapshots" do
|
23
|
-
AWS[:ec2].snapshots.new.collection.should be_a(Fog::AWS::EC2::Snapshots)
|
24
|
-
end
|
25
|
-
|
26
|
-
it "should be the snapshots the snapshot is related to" do
|
27
|
-
snapshots = AWS[:ec2].snapshots
|
28
|
-
snapshots.new.collection.should == snapshots
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
|
33
36
|
describe "#destroy" do
|
34
37
|
|
35
38
|
it "should return true if the snapshot is deleted" do
|
36
|
-
|
37
|
-
snapshot
|
38
|
-
snapshot.
|
39
|
-
snapshot
|
40
|
-
volume.destroy
|
39
|
+
@snapshot = @volume.snapshots.create
|
40
|
+
@snapshot.wait_for { ready? }
|
41
|
+
@snapshot.destroy.should be_true
|
42
|
+
@snapshot = nil # avoid the after(:each) block
|
41
43
|
end
|
42
44
|
|
43
45
|
end
|
@@ -45,22 +47,13 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
45
47
|
describe "#reload" do
|
46
48
|
|
47
49
|
before(:each) do
|
48
|
-
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
49
50
|
@snapshot = @volume.snapshots.create
|
50
51
|
@reloaded = @snapshot.reload
|
51
52
|
end
|
52
53
|
|
53
|
-
|
54
|
-
@snapshot.destroy
|
55
|
-
@volume.destroy
|
56
|
-
end
|
57
|
-
|
58
|
-
it "should return a Fog::AWS::EC2::Snapshot" do
|
54
|
+
it "should match the original" do
|
59
55
|
@reloaded.should be_a(Fog::AWS::EC2::Snapshot)
|
60
|
-
|
61
|
-
|
62
|
-
it "should reset attributes to remote state" do
|
63
|
-
@snapshot.attributes.should == @reloaded.attributes
|
56
|
+
@reloaded.attributes.should == @snapshot.attributes
|
64
57
|
end
|
65
58
|
|
66
59
|
end
|
@@ -68,30 +61,13 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
68
61
|
describe "#save" do
|
69
62
|
|
70
63
|
before(:each) do
|
71
|
-
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
72
|
-
@volume.wait_for { ready? }
|
73
64
|
@snapshot = @volume.snapshots.new
|
74
65
|
end
|
75
66
|
|
76
|
-
|
77
|
-
@volume.destroy
|
78
|
-
end
|
79
|
-
|
80
|
-
it "should return true when it succeeds" do
|
81
|
-
@snapshot.save.should be_true
|
82
|
-
@snapshot.wait_for { ready? }
|
83
|
-
@snapshot.destroy
|
84
|
-
end
|
85
|
-
|
86
|
-
it "should not exist in snapshots before save" do
|
67
|
+
it "should persist the snapshot" do
|
87
68
|
AWS[:ec2].snapshots.get(@snapshot.id).should be_nil
|
88
|
-
|
89
|
-
|
90
|
-
it "should exist in snapshots after save" do
|
91
|
-
@snapshot.save
|
69
|
+
@snapshot.save.should be_true
|
92
70
|
AWS[:ec2].snapshots.get(@snapshot.id).should_not be_nil
|
93
|
-
@snapshot.wait_for { ready? }
|
94
|
-
@snapshot.destroy
|
95
71
|
end
|
96
72
|
|
97
73
|
end
|
@@ -2,31 +2,39 @@ require File.dirname(__FILE__) + '/../../../spec_helper'
|
|
2
2
|
|
3
3
|
describe 'Fog::AWS::EC2::Snapshots' do
|
4
4
|
|
5
|
+
before(:all) do
|
6
|
+
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
7
|
+
@volume.wait_for { ready? }
|
8
|
+
end
|
9
|
+
|
10
|
+
after(:all) do
|
11
|
+
@volume.destroy
|
12
|
+
end
|
13
|
+
|
14
|
+
after(:each) do
|
15
|
+
if @snapshot && !@snapshot.new_record?
|
16
|
+
@snapshot.wait_for { ready? }
|
17
|
+
@snapshot.destroy
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
5
21
|
describe "#all" do
|
6
22
|
|
7
|
-
|
8
|
-
|
23
|
+
before(:each) do
|
24
|
+
@snapshot = @volume.snapshots.create
|
9
25
|
end
|
10
26
|
|
11
27
|
it "should include persisted snapshots" do
|
12
|
-
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
13
|
-
eventually { @snapshot = @volume.snapshots.create }
|
14
28
|
AWS[:ec2].snapshots.all.map {|snapshot| snapshot.id}.should include(@snapshot.id)
|
15
|
-
@snapshot.destroy
|
16
|
-
@volume.destroy
|
17
29
|
end
|
18
30
|
|
19
31
|
it "should limit snapshots by volume if present" do
|
20
|
-
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
21
32
|
@other_volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
22
|
-
@volume.wait_for { ready?}
|
23
|
-
@snapshot = @volume.snapshots.create
|
24
|
-
@other_volume.snapshots.all.map {|snapshot| snapshot.id}.should_not include(@snapshot.id)
|
25
33
|
|
26
|
-
@
|
27
|
-
@snapshot.
|
34
|
+
@volume.snapshots.map {|snapshot| snapshot.id}.should include(@snapshot.identity)
|
35
|
+
@other_volume.snapshots.map {|snapshot| snapshot.id}.should_not include(@snapshot.identity)
|
36
|
+
|
28
37
|
@other_volume.destroy
|
29
|
-
@volume.destroy
|
30
38
|
end
|
31
39
|
|
32
40
|
end
|
@@ -34,21 +42,9 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
34
42
|
describe "#create" do
|
35
43
|
|
36
44
|
before(:each) do
|
37
|
-
@volume = AWS[:ec2].volumes.create(:availability_zone => 'us-east-1a', :size => 1, :device => 'dev/sdz1')
|
38
|
-
@volume.wait_for { ready? }
|
39
45
|
@snapshot = @volume.snapshots.create
|
40
46
|
end
|
41
47
|
|
42
|
-
after(:each) do
|
43
|
-
@snapshot.wait_for { ready? }
|
44
|
-
@snapshot.destroy
|
45
|
-
@volume.destroy
|
46
|
-
end
|
47
|
-
|
48
|
-
it "should return a Fog::AWS::EC2::Snapshot" do
|
49
|
-
@snapshot.should be_a(Fog::AWS::EC2::Snapshot)
|
50
|
-
end
|
51
|
-
|
52
48
|
it "should exist on ec2" do
|
53
49
|
AWS[:ec2].snapshots.get(@snapshot.id).should_not be_nil
|
54
50
|
end
|
@@ -58,12 +54,10 @@ describe 'Fog::AWS::EC2::Snapshots' do
|
|
58
54
|
describe "#get" do
|
59
55
|
|
60
56
|
it "should return a Fog::AWS::EC2::Snapshot if a matching snapshot exists" do
|
61
|
-
|
62
|
-
snapshot
|
63
|
-
snapshot.
|
64
|
-
|
65
|
-
snapshot.attributes.should == get.attributes
|
66
|
-
snapshot.destroy
|
57
|
+
@snapshot = @volume.snapshots.create
|
58
|
+
@snapshot.wait_for { ready? }
|
59
|
+
get = AWS[:ec2].snapshots.get(@snapshot.id)
|
60
|
+
@snapshot.attributes.should == get.attributes
|
67
61
|
end
|
68
62
|
|
69
63
|
it "should return nil if no matching address exists" do
|
@@ -46,14 +46,20 @@ describe 'Fog::AWS::EC2::Volume' do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
describe "#server=" do
|
49
|
-
before(:
|
49
|
+
before(:all) do
|
50
50
|
@server = AWS[:ec2].servers.create(:image_id => GENTOO_AMI)
|
51
|
-
@volume = AWS[:ec2].volumes.new(:availability_zone => @server.availability_zone, :size => 1, :device => '/dev/sdz1')
|
52
51
|
@server.wait_for { ready? }
|
53
52
|
end
|
54
53
|
|
55
|
-
after(:
|
54
|
+
after(:all) do
|
56
55
|
@server.destroy
|
56
|
+
end
|
57
|
+
|
58
|
+
before(:each) do
|
59
|
+
@volume = AWS[:ec2].volumes.new(:availability_zone => @server.availability_zone, :size => 1, :device => '/dev/sdz1')
|
60
|
+
end
|
61
|
+
|
62
|
+
after(:each) do
|
57
63
|
if @volume.id
|
58
64
|
@volume.wait_for { state == 'attached' }
|
59
65
|
@volume.server = nil
|
@@ -8,10 +8,10 @@ describe 'Fog::AWS::S3::Directory' do
|
|
8
8
|
now = Time.now
|
9
9
|
directory = Fog::AWS::S3::Directory.new(
|
10
10
|
'CreationDate' => now,
|
11
|
-
'
|
11
|
+
'Key' => 'directorykey'
|
12
12
|
)
|
13
13
|
directory.creation_date.should == now
|
14
|
-
directory.
|
14
|
+
directory.key.should == 'directorykey'
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
@@ -28,12 +28,12 @@ describe 'Fog::AWS::S3::Directory' do
|
|
28
28
|
describe "#destroy" do
|
29
29
|
|
30
30
|
it "should return true if the directory is deleted" do
|
31
|
-
directory = AWS[:s3].directories.create(:
|
31
|
+
directory = AWS[:s3].directories.create(:key => 'fogmodeldirectory')
|
32
32
|
directory.destroy.should be_true
|
33
33
|
end
|
34
34
|
|
35
35
|
it "should return false if the directory does not exist" do
|
36
|
-
directory = AWS[:s3].directories.new(:
|
36
|
+
directory = AWS[:s3].directories.new(:key => 'fogmodeldirectory')
|
37
37
|
directory.destroy.should be_false
|
38
38
|
end
|
39
39
|
|
@@ -42,7 +42,7 @@ describe 'Fog::AWS::S3::Directory' do
|
|
42
42
|
describe "#location" do
|
43
43
|
|
44
44
|
it "should return the location constraint" do
|
45
|
-
directory = AWS[:s3].directories.create(:
|
45
|
+
directory = AWS[:s3].directories.create(:key => 'fogmodeleudirectory', :location => 'EU')
|
46
46
|
directory.location.should == 'EU'
|
47
47
|
AWS[:eu_s3].directories.get('fogmodeleudirectory').destroy
|
48
48
|
end
|
@@ -52,7 +52,7 @@ describe 'Fog::AWS::S3::Directory' do
|
|
52
52
|
describe "#payer" do
|
53
53
|
|
54
54
|
it "should return the request payment value" do
|
55
|
-
directory = AWS[:s3].directories.create(:
|
55
|
+
directory = AWS[:s3].directories.create(:key => 'fogmodeldirectory')
|
56
56
|
directory.payer.should == 'BucketOwner'
|
57
57
|
directory.destroy.should be_true
|
58
58
|
end
|
@@ -62,7 +62,7 @@ describe 'Fog::AWS::S3::Directory' do
|
|
62
62
|
describe "#payer=" do
|
63
63
|
|
64
64
|
it "should set the request payment value" do
|
65
|
-
directory = AWS[:s3].directories.create(:
|
65
|
+
directory = AWS[:s3].directories.create(:key => 'fogmodeldirectory')
|
66
66
|
(directory.payer = 'Requester').should == 'Requester'
|
67
67
|
directory.destroy.should
|
68
68
|
end
|
@@ -72,7 +72,7 @@ describe 'Fog::AWS::S3::Directory' do
|
|
72
72
|
describe "#reload" do
|
73
73
|
|
74
74
|
before(:each) do
|
75
|
-
@directory = AWS[:s3].directories.create(:
|
75
|
+
@directory = AWS[:s3].directories.create(:key => 'fogmodeldirectory')
|
76
76
|
@reloaded = @directory.reload
|
77
77
|
end
|
78
78
|
|
@@ -89,7 +89,11 @@ describe 'Fog::AWS::S3::Directory' do
|
|
89
89
|
describe "#save" do
|
90
90
|
|
91
91
|
before(:each) do
|
92
|
-
@directory = AWS[:s3].directories.new(:
|
92
|
+
@directory = AWS[:s3].directories.new(:key => 'fogmodeldirectory')
|
93
|
+
end
|
94
|
+
|
95
|
+
it "should not exist in directories before save" do
|
96
|
+
AWS[:s3].directories.all.map {|directory| directory.key}.include?(@directory.key).should be_false
|
93
97
|
end
|
94
98
|
|
95
99
|
it "should return true when it succeeds" do
|
@@ -97,13 +101,9 @@ describe 'Fog::AWS::S3::Directory' do
|
|
97
101
|
@directory.destroy
|
98
102
|
end
|
99
103
|
|
100
|
-
it "should not exist in directories before save" do
|
101
|
-
AWS[:s3].directories.all.map {|directory| directory.name}.include?(@directory.name).should be_false
|
102
|
-
end
|
103
|
-
|
104
104
|
it "should exist in directories after save" do
|
105
105
|
@directory.save
|
106
|
-
AWS[:s3].directories.all.map {|directory| directory.
|
106
|
+
AWS[:s3].directories.all.map {|directory| directory.key}.include?(@directory.key).should be_true
|
107
107
|
@directory.destroy
|
108
108
|
end
|
109
109
|
|
@@ -6,6 +6,7 @@ describe 'EC2.associate_address' do
|
|
6
6
|
before(:each) do
|
7
7
|
@instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
|
8
8
|
@public_ip = AWS[:ec2].allocate_address.body['publicIp']
|
9
|
+
AWS[:ec2].servers.get(@instance_id).wait_for { ready? }
|
9
10
|
end
|
10
11
|
|
11
12
|
after(:each) do
|
@@ -14,11 +15,9 @@ describe 'EC2.associate_address' do
|
|
14
15
|
end
|
15
16
|
|
16
17
|
it "should return proper attributes" do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
[false, true].should include(actual.body['return'])
|
21
|
-
end
|
18
|
+
actual = AWS[:ec2].associate_address(@instance_id, @public_ip)
|
19
|
+
actual.body['requestId'].should be_a(String)
|
20
|
+
[false, true].should include(actual.body['return'])
|
22
21
|
end
|
23
22
|
|
24
23
|
end
|
@@ -6,28 +6,26 @@ describe 'EC2.attach_volume' do
|
|
6
6
|
before(:each) do
|
7
7
|
@instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1, {'Placement.AvailabilityZone' => 'us-east-1a'}).body['instancesSet'].first['instanceId']
|
8
8
|
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
9
|
+
AWS[:ec2].servers.get(@instance_id).wait_for { ready? }
|
10
|
+
AWS[:ec2].volumes.get(@volume_id).wait_for { ready? }
|
9
11
|
end
|
10
12
|
|
11
13
|
after(:each) do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
AWS[:ec2].terminate_instances(@instance_id)
|
18
|
-
end
|
14
|
+
AWS[:ec2].volumes.get(@volume_id).wait_for { state == 'attached' }
|
15
|
+
AWS[:ec2].detach_volume(@volume_id)
|
16
|
+
AWS[:ec2].volumes.get(@volume_id).wait_for { ready? }
|
17
|
+
AWS[:ec2].delete_volume(@volume_id)
|
18
|
+
AWS[:ec2].terminate_instances(@instance_id)
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return proper attributes" do
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
actual.body['volumeId'].should be_a(String)
|
30
|
-
end
|
22
|
+
actual = AWS[:ec2].attach_volume(@instance_id, @volume_id, '/dev/sdh')
|
23
|
+
actual.body['attachTime'].should be_a(Time)
|
24
|
+
actual.body['device'].should be_a(String)
|
25
|
+
actual.body['instanceId'].should be_a(String)
|
26
|
+
actual.body['requestId'].should be_a(String)
|
27
|
+
actual.body['status'].should be_a(String)
|
28
|
+
actual.body['volumeId'].should be_a(String)
|
31
29
|
end
|
32
30
|
|
33
31
|
end
|
@@ -9,9 +9,8 @@ describe 'EC2.create_snapshot' do
|
|
9
9
|
|
10
10
|
after(:each) do
|
11
11
|
AWS[:ec2].delete_volume(@volume_id)
|
12
|
-
|
13
|
-
|
14
|
-
end
|
12
|
+
AWS[:ec2].snapshots.get(@snapshot_id).wait_for { ready? }
|
13
|
+
AWS[:ec2].delete_snapshot(@snapshot_id)
|
15
14
|
end
|
16
15
|
|
17
16
|
it "should return proper attributes" do
|
@@ -13,12 +13,11 @@ describe 'EC2.delete_snapshot' do
|
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should return proper attributes" do
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
end
|
16
|
+
AWS[:ec2].snapshots.get(@snapshot_id).wait_for { ready? }
|
17
|
+
actual = AWS[:ec2].delete_snapshot(@snapshot_id)
|
18
|
+
unless actual.body.empty?
|
19
|
+
actual.body['requestId'].should be_a(String)
|
20
|
+
[false, true].should include(actual.body['return'])
|
22
21
|
end
|
23
22
|
end
|
24
23
|
|