fog 0.0.40 → 0.0.41
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/Rakefile +12 -0
- data/VERSION +1 -1
- data/bin/fog +28 -40
- data/fog.gemspec +16 -3
- data/lib/fog.rb +27 -3
- data/lib/fog/aws/ec2.rb +7 -3
- data/lib/fog/aws/models/ec2/security_group.rb +1 -1
- data/lib/fog/aws/models/ec2/server.rb +8 -3
- data/lib/fog/aws/models/ec2/servers.rb +1 -1
- data/lib/fog/aws/parsers/ec2/terminate_instances.rb +10 -10
- data/lib/fog/aws/requests/ec2/run_instances.rb +1 -1
- data/lib/fog/aws/s3.rb +6 -2
- data/lib/fog/rackspace.rb +8 -2
- data/lib/fog/slicehost.rb +3 -1
- data/spec/aws/models/ec2/address_spec.rb +8 -8
- data/spec/aws/models/ec2/addresses_spec.rb +10 -10
- data/spec/aws/models/ec2/key_pair_spec.rb +8 -8
- data/spec/aws/models/ec2/key_pairs_spec.rb +10 -10
- data/spec/aws/models/ec2/security_group_spec.rb +8 -8
- data/spec/aws/models/ec2/security_groups_spec.rb +10 -10
- data/spec/aws/models/ec2/server_spec.rb +1 -4
- data/spec/aws/models/ec2/servers_spec.rb +1 -1
- data/spec/aws/models/ec2/snapshot_spec.rb +12 -10
- data/spec/aws/models/ec2/snapshots_spec.rb +20 -20
- data/spec/aws/models/ec2/volume_spec.rb +10 -10
- data/spec/aws/models/ec2/volumes_spec.rb +10 -10
- data/spec/aws/models/s3/directories_spec.rb +8 -8
- data/spec/aws/models/s3/directory_spec.rb +11 -11
- data/spec/aws/models/s3/file_spec.rb +2 -2
- data/spec/aws/models/s3/files_spec.rb +2 -2
- data/spec/aws/requests/ec2/allocate_address_spec.rb +2 -2
- data/spec/aws/requests/ec2/associate_address_spec.rb +15 -13
- data/spec/aws/requests/ec2/attach_volume_spec.rb +12 -12
- data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +3 -3
- data/spec/aws/requests/ec2/create_key_pair_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_security_group_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/create_volume_spec.rb +2 -2
- data/spec/aws/requests/ec2/delete_key_pair_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_security_group_spec.rb +3 -3
- data/spec/aws/requests/ec2/delete_snapshot_spec.rb +5 -5
- data/spec/aws/requests/ec2/delete_volume_spec.rb +3 -3
- data/spec/aws/requests/ec2/describe_addresses_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_availability_zones_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_images_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_instances_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_regions_spec.rb +2 -2
- data/spec/aws/requests/ec2/describe_security_groups_spec.rb +5 -5
- data/spec/aws/requests/ec2/describe_snapshots_spec.rb +7 -7
- data/spec/aws/requests/ec2/describe_volumes_spec.rb +5 -5
- data/spec/aws/requests/ec2/detach_volume_spec.rb +7 -7
- data/spec/aws/requests/ec2/disassociate_address_spec.rb +9 -7
- data/spec/aws/requests/ec2/get_console_output_spec.rb +4 -4
- data/spec/aws/requests/ec2/reboot_instances_spec.rb +4 -4
- data/spec/aws/requests/ec2/release_address_spec.rb +3 -3
- data/spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb +4 -4
- data/spec/aws/requests/ec2/run_instances_spec.rb +2 -2
- data/spec/aws/requests/ec2/terminate_instances_spec.rb +7 -7
- data/spec/aws/requests/s3/copy_object_spec.rb +11 -11
- data/spec/aws/requests/s3/delete_bucket_spec.rb +8 -8
- data/spec/aws/requests/s3/delete_object_spec.rb +8 -8
- data/spec/aws/requests/s3/get_bucket_location_spec.rb +4 -4
- data/spec/aws/requests/s3/get_bucket_spec.rb +12 -12
- data/spec/aws/requests/s3/get_object_spec.rb +9 -9
- data/spec/aws/requests/s3/get_request_payment_spec.rb +4 -4
- data/spec/aws/requests/s3/get_service_spec.rb +4 -4
- data/spec/aws/requests/s3/head_object_spec.rb +5 -5
- data/spec/aws/requests/s3/put_bucket_spec.rb +3 -3
- data/spec/aws/requests/s3/put_object_spec.rb +11 -11
- data/spec/aws/requests/s3/put_request_payment_spec.rb +4 -4
- data/spec/aws/requests/simpledb/batch_put_attributes_spec.rb +4 -4
- data/spec/aws/requests/simpledb/create_domain_spec.rb +4 -4
- data/spec/aws/requests/simpledb/delete_attributes_spec.rb +8 -8
- data/spec/aws/requests/simpledb/delete_domain_spec.rb +3 -3
- data/spec/aws/requests/simpledb/domain_metadata_spec.rb +6 -6
- data/spec/aws/requests/simpledb/get_attributes_spec.rb +9 -9
- data/spec/aws/requests/simpledb/list_domains_spec.rb +4 -4
- data/spec/aws/requests/simpledb/put_attributes_spec.rb +4 -4
- data/spec/compact_progress_bar_formatter.rb +195 -0
- data/spec/rackspace/models/servers/server_spec.rb +1 -1
- data/spec/rackspace/requests/files/delete_container_spec.rb +3 -3
- data/spec/rackspace/requests/files/delete_object_spec.rb +8 -8
- data/spec/rackspace/requests/files/get_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/get_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/head_container_spec.rb +6 -6
- data/spec/rackspace/requests/files/head_containers_spec.rb +3 -3
- data/spec/rackspace/requests/files/put_container_spec.rb +2 -2
- data/spec/rackspace/requests/files/put_object_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_image_spec.rb +4 -4
- data/spec/rackspace/requests/servers/create_server_spec.rb +2 -2
- data/spec/rackspace/requests/servers/delete_image_spec.rb +5 -5
- data/spec/rackspace/requests/servers/delete_server_spec.rb +3 -3
- data/spec/rackspace/requests/servers/get_flavor_details_spec.rb +1 -1
- data/spec/rackspace/requests/servers/get_server_details_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_flavors_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_flavors_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_detail_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_images_spec.rb +1 -1
- data/spec/rackspace/requests/servers/list_private_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_public_addresses_spec.rb +4 -4
- data/spec/rackspace/requests/servers/list_servers_detail_spec.rb +3 -3
- data/spec/rackspace/requests/servers/list_servers_spec.rb +3 -3
- data/spec/rackspace/requests/servers/reboot_server_spec.rb +4 -4
- data/spec/rackspace/requests/servers/update_server_spec.rb +4 -4
- data/spec/slicehost/requests/create_slice_spec.rb +2 -2
- data/spec/slicehost/requests/delete_slice_spec.rb +2 -2
- data/spec/slicehost/requests/get_backups_spec.rb +1 -1
- data/spec/slicehost/requests/get_flavors_spec.rb +1 -1
- data/spec/slicehost/requests/get_images_spec.rb +1 -1
- data/spec/slicehost/requests/get_slices_spec.rb +1 -1
- data/spec/spec_helper.rb +60 -38
- metadata +16 -3
- data/spec/spec.opts +0 -1
@@ -4,23 +4,23 @@ describe 'EC2.attach_volume' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@instance_id = ec2.run_instances(GENTOO_AMI, 1, 1, {'Placement.AvailabilityZone' => 'us-east-1a'}).body['instancesSet'].first['instanceId']
|
8
|
-
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
7
|
+
@instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1, {'Placement.AvailabilityZone' => 'us-east-1a'}).body['instancesSet'].first['instanceId']
|
8
|
+
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
12
|
eventually do
|
13
|
-
ec2.detach_volume(@volume_id)
|
13
|
+
AWS[:ec2].detach_volume(@volume_id)
|
14
14
|
end
|
15
15
|
eventually do
|
16
|
-
ec2.delete_volume(@volume_id)
|
17
|
-
ec2.terminate_instances(@instance_id)
|
16
|
+
AWS[:ec2].delete_volume(@volume_id)
|
17
|
+
AWS[:ec2].terminate_instances(@instance_id)
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return proper attributes" do
|
22
22
|
eventually(128) do
|
23
|
-
actual = ec2.attach_volume(@instance_id, @volume_id, '/dev/sdh')
|
23
|
+
actual = AWS[:ec2].attach_volume(@instance_id, @volume_id, '/dev/sdh')
|
24
24
|
actual.body['attachTime'].should be_a(Time)
|
25
25
|
actual.body['device'].should be_a(String)
|
26
26
|
actual.body['instanceId'].should be_a(String)
|
@@ -34,19 +34,19 @@ describe 'EC2.attach_volume' do
|
|
34
34
|
describe 'failure' do
|
35
35
|
|
36
36
|
it "should raise a BadRequest error if the instance does not exist" do
|
37
|
-
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
37
|
+
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
38
38
|
lambda {
|
39
|
-
ec2.attach_volume('i-00000000', @volume_id, '/dev/sdh')
|
39
|
+
AWS[:ec2].attach_volume('i-00000000', @volume_id, '/dev/sdh')
|
40
40
|
}.should raise_error(Excon::Errors::BadRequest)
|
41
|
-
ec2.delete_volume(@volume_id)
|
41
|
+
AWS[:ec2].delete_volume(@volume_id)
|
42
42
|
end
|
43
43
|
|
44
44
|
it "should raise a BadRequest error if the address does not exist" do
|
45
|
-
@instance_id = ec2.run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
|
45
|
+
@instance_id = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body['instancesSet'].first['instanceId']
|
46
46
|
lambda {
|
47
|
-
ec2.attach_volume(@instance_id, 'vol-00000000', '/dev/sdh')
|
47
|
+
AWS[:ec2].attach_volume(@instance_id, 'vol-00000000', '/dev/sdh')
|
48
48
|
}.should raise_error(Excon::Errors::BadRequest)
|
49
|
-
ec2.terminate_instances(@instance_id)
|
49
|
+
AWS[:ec2].terminate_instances(@instance_id)
|
50
50
|
end
|
51
51
|
|
52
52
|
end
|
@@ -4,15 +4,15 @@ describe 'EC2.authorize_security_group_ingress' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
ec2.create_security_group('fog_security_group', 'a security group for testing fog')
|
7
|
+
AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
ec2.delete_security_group('fog_security_group')
|
11
|
+
AWS[:ec2].delete_security_group('fog_security_group')
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return proper attributes" do
|
15
|
-
actual = ec2.authorize_security_group_ingress({
|
15
|
+
actual = AWS[:ec2].authorize_security_group_ingress({
|
16
16
|
'FromPort' => 80,
|
17
17
|
'GroupName' => 'fog_security_group',
|
18
18
|
'IpProtocol' => 'tcp',
|
@@ -4,11 +4,11 @@ describe 'EC2.create_key_pair' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
after(:each) do
|
7
|
-
ec2.delete_key_pair('fog_key_pair')
|
7
|
+
AWS[:ec2].delete_key_pair('fog_key_pair')
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
actual = ec2.create_key_pair('fog_key_pair')
|
11
|
+
actual = AWS[:ec2].create_key_pair('fog_key_pair')
|
12
12
|
actual.body['keyFingerprint'].should be_a(String)
|
13
13
|
actual.body['keyMaterial'].should be_a(String)
|
14
14
|
actual.body['keyName'].should be_a(String)
|
@@ -19,16 +19,16 @@ describe 'EC2.create_key_pair' do
|
|
19
19
|
describe 'failure' do
|
20
20
|
|
21
21
|
before(:each) do
|
22
|
-
ec2.create_key_pair('fog_key_pair')
|
22
|
+
AWS[:ec2].create_key_pair('fog_key_pair')
|
23
23
|
end
|
24
24
|
|
25
25
|
after(:each) do
|
26
|
-
ec2.delete_key_pair('fog_key_pair')
|
26
|
+
AWS[:ec2].delete_key_pair('fog_key_pair')
|
27
27
|
end
|
28
28
|
|
29
29
|
it "should raise a BadRequest when the key pair already exists" do
|
30
30
|
lambda {
|
31
|
-
ec2.create_key_pair('fog_key_pair')
|
31
|
+
AWS[:ec2].create_key_pair('fog_key_pair')
|
32
32
|
}.should raise_error(Excon::Errors::BadRequest)
|
33
33
|
end
|
34
34
|
|
@@ -4,11 +4,11 @@ describe 'EC2.create_security_group' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
after(:each) do
|
7
|
-
ec2.delete_security_group('fog_security_group')
|
7
|
+
AWS[:ec2].delete_security_group('fog_security_group')
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
actual = ec2.create_security_group('fog_security_group', 'a security group for testing fog')
|
11
|
+
actual = AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
|
12
12
|
actual.body['requestId'].should be_a(String)
|
13
13
|
[false, true].should include(actual.body['return'])
|
14
14
|
end
|
@@ -17,16 +17,16 @@ describe 'EC2.create_security_group' do
|
|
17
17
|
describe 'failure' do
|
18
18
|
|
19
19
|
before(:each) do
|
20
|
-
ec2.create_security_group('fog_security_group', 'a security group for testing fog')
|
20
|
+
AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
|
21
21
|
end
|
22
22
|
|
23
23
|
after(:each) do
|
24
|
-
ec2.delete_security_group('fog_security_group')
|
24
|
+
AWS[:ec2].delete_security_group('fog_security_group')
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should raise a BadRequest error when the security group already exists" do
|
28
28
|
lambda {
|
29
|
-
ec2.create_security_group('fog_security_group', 'a security group for testing fog')
|
29
|
+
AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
|
30
30
|
}.should raise_error(Excon::Errors::BadRequest)
|
31
31
|
end
|
32
32
|
|
@@ -4,18 +4,18 @@ describe 'EC2.create_snapshot' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
7
|
+
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
ec2.delete_volume(@volume_id)
|
11
|
+
AWS[:ec2].delete_volume(@volume_id)
|
12
12
|
eventually do
|
13
|
-
ec2.delete_snapshot(@snapshot_id)
|
13
|
+
AWS[:ec2].delete_snapshot(@snapshot_id)
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
17
|
it "should return proper attributes" do
|
18
|
-
actual = ec2.create_snapshot(@volume_id)
|
18
|
+
actual = AWS[:ec2].create_snapshot(@volume_id)
|
19
19
|
actual.body['progress'].should be_a(String)
|
20
20
|
@snapshot_id = actual.body['snapshotId']
|
21
21
|
actual.body['snapshotId'].should be_a(String)
|
@@ -29,7 +29,7 @@ describe 'EC2.create_snapshot' do
|
|
29
29
|
|
30
30
|
it "should raise a BadRequest error if the volume does not exist" do
|
31
31
|
lambda {
|
32
|
-
ec2.create_snapshot('vol-00000000')
|
32
|
+
AWS[:ec2].create_snapshot('vol-00000000')
|
33
33
|
}.should raise_error(Excon::Errors::BadRequest)
|
34
34
|
end
|
35
35
|
|
@@ -4,11 +4,11 @@ describe 'EC2.create_volume' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
after(:each) do
|
7
|
-
ec2.delete_volume(@volume_id)
|
7
|
+
AWS[:ec2].delete_volume(@volume_id)
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
actual = ec2.create_volume('us-east-1a', 1)
|
11
|
+
actual = AWS[:ec2].create_volume('us-east-1a', 1)
|
12
12
|
actual.body['availabilityZone'].should be_a(String)
|
13
13
|
actual.body['createTime'].should be_a(Time)
|
14
14
|
actual.body['requestId'].should be_a(String)
|
@@ -4,8 +4,8 @@ describe 'EC2.delete_key_pair' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
ec2.create_key_pair('fog_key_name')
|
8
|
-
@response = ec2.delete_key_pair('fog_key_name')
|
7
|
+
AWS[:ec2].create_key_pair('fog_key_name')
|
8
|
+
@response = AWS[:ec2].delete_key_pair('fog_key_name')
|
9
9
|
end
|
10
10
|
|
11
11
|
it "should return proper attributes" do
|
@@ -14,7 +14,7 @@ describe 'EC2.delete_key_pair' do
|
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should not raise an error if the key pair does not exist" do
|
17
|
-
ec2.delete_key_pair('not_a_key_name')
|
17
|
+
AWS[:ec2].delete_key_pair('not_a_key_name')
|
18
18
|
end
|
19
19
|
|
20
20
|
end
|
@@ -4,11 +4,11 @@ describe 'EC2.delete_security_group' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
ec2.create_security_group('fog_security_group', 'a security group for testing fog')
|
7
|
+
AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
actual = ec2.delete_security_group('fog_security_group')
|
11
|
+
actual = AWS[:ec2].delete_security_group('fog_security_group')
|
12
12
|
actual.body['requestId'].should be_a(String)
|
13
13
|
[false, true].should include(actual.body['return'])
|
14
14
|
end
|
@@ -18,7 +18,7 @@ describe 'EC2.delete_security_group' do
|
|
18
18
|
|
19
19
|
it "should raise a BadRequest error if the security group does not exist" do
|
20
20
|
lambda {
|
21
|
-
ec2.delete_security_group('fog_not_a_security_group')
|
21
|
+
AWS[:ec2].delete_security_group('fog_not_a_security_group')
|
22
22
|
}.should raise_error(Excon::Errors::BadRequest)
|
23
23
|
end
|
24
24
|
|
@@ -4,17 +4,17 @@ describe 'EC2.delete_snapshot' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
8
|
-
@snapshot_id = ec2.create_snapshot(@volume_id).body['snapshotId']
|
7
|
+
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
8
|
+
@snapshot_id = AWS[:ec2].create_snapshot(@volume_id).body['snapshotId']
|
9
9
|
end
|
10
10
|
|
11
11
|
after(:each) do
|
12
|
-
ec2.delete_volume(@volume_id)
|
12
|
+
AWS[:ec2].delete_volume(@volume_id)
|
13
13
|
end
|
14
14
|
|
15
15
|
it "should return proper attributes" do
|
16
16
|
eventually do
|
17
|
-
actual = ec2.delete_snapshot(@snapshot_id)
|
17
|
+
actual = AWS[:ec2].delete_snapshot(@snapshot_id)
|
18
18
|
unless actual.body.empty?
|
19
19
|
actual.body['requestId'].should be_a(String)
|
20
20
|
[false, true].should include(actual.body['return'])
|
@@ -27,7 +27,7 @@ describe 'EC2.delete_snapshot' do
|
|
27
27
|
|
28
28
|
it "should raise a BadRequest error if snapshot does not exist" do
|
29
29
|
lambda {
|
30
|
-
ec2.release_address('snap-00000000')
|
30
|
+
AWS[:ec2].release_address('snap-00000000')
|
31
31
|
}.should raise_error(Excon::Errors::BadRequest)
|
32
32
|
end
|
33
33
|
|
@@ -4,11 +4,11 @@ describe 'EC2.create_volume' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@volume_id = ec2.create_volume('us-east-1a', 1).body['volumeId']
|
7
|
+
@volume_id = AWS[:ec2].create_volume('us-east-1a', 1).body['volumeId']
|
8
8
|
end
|
9
9
|
|
10
10
|
it "should return proper attributes" do
|
11
|
-
actual = ec2.delete_volume(@volume_id)
|
11
|
+
actual = AWS[:ec2].delete_volume(@volume_id)
|
12
12
|
actual.body['requestId'].should be_a(String)
|
13
13
|
actual.body['return'].should == true
|
14
14
|
end
|
@@ -18,7 +18,7 @@ describe 'EC2.create_volume' do
|
|
18
18
|
|
19
19
|
it "should raise a BadRequest error if volume does not exist" do
|
20
20
|
lambda {
|
21
|
-
ec2.delete_volume('vol-00000000')
|
21
|
+
AWS[:ec2].delete_volume('vol-00000000')
|
22
22
|
}.should raise_error(Excon::Errors::BadRequest)
|
23
23
|
end
|
24
24
|
|
@@ -4,22 +4,22 @@ describe 'EC2.describe_addresses' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
@public_ip = ec2.allocate_address.body['publicIp']
|
7
|
+
@public_ip = AWS[:ec2].allocate_address.body['publicIp']
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
ec2.release_address(@public_ip)
|
11
|
+
AWS[:ec2].release_address(@public_ip)
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return proper attributes with no params" do
|
15
|
-
actual = ec2.describe_addresses
|
15
|
+
actual = AWS[:ec2].describe_addresses
|
16
16
|
actual.body['requestId'].should be_a(String)
|
17
17
|
item = actual.body['addressesSet'].select {|address| address['publicIp'] == @public_ip}
|
18
18
|
item.should_not be_nil
|
19
19
|
end
|
20
20
|
|
21
21
|
it "should return proper attributes for specific ip" do
|
22
|
-
actual = ec2.describe_addresses(@public_ip)
|
22
|
+
actual = AWS[:ec2].describe_addresses(@public_ip)
|
23
23
|
actual.body['requestId'].should be_a(String)
|
24
24
|
item = actual.body['addressesSet'].select {|address| address['publicIp'] == @public_ip}
|
25
25
|
item.should_not be_nil
|
@@ -30,7 +30,7 @@ describe 'EC2.describe_addresses' do
|
|
30
30
|
|
31
31
|
it "should raise a BadRequest error if ip does not exist" do
|
32
32
|
lambda {
|
33
|
-
ec2.describe_addresses('127.0.0.1')
|
33
|
+
AWS[:ec2].describe_addresses('127.0.0.1')
|
34
34
|
}.should raise_error(Excon::Errors::BadRequest)
|
35
35
|
end
|
36
36
|
|
@@ -4,7 +4,7 @@ describe 'EC2.describe_availability_zones' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes with no params" do
|
7
|
-
actual = ec2.describe_availability_zones
|
7
|
+
actual = AWS[:ec2].describe_availability_zones
|
8
8
|
zone = actual.body['availabilityZoneInfo'].first
|
9
9
|
zone['regionName'].should be_a(String)
|
10
10
|
zone['zoneName'].should be_a(String)
|
@@ -12,7 +12,7 @@ describe 'EC2.describe_availability_zones' do
|
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return proper attribute with params" do
|
15
|
-
actual = ec2.describe_availability_zones(['us-east-1a'])
|
15
|
+
actual = AWS[:ec2].describe_availability_zones(['us-east-1a'])
|
16
16
|
zone = actual.body['availabilityZoneInfo'].first
|
17
17
|
zone['regionName'].should be_a(String)
|
18
18
|
zone['zoneName'].should be_a(String)
|
@@ -4,7 +4,7 @@ describe 'EC2.describe_images' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes with no params" do
|
7
|
-
actual = ec2.describe_images
|
7
|
+
actual = AWS[:ec2].describe_images
|
8
8
|
actual.body['requestId'].should be_a(String)
|
9
9
|
image = actual.body['imagesSet'].first
|
10
10
|
image['architecture'].should be_a(String)
|
@@ -20,7 +20,7 @@ describe 'EC2.describe_images' do
|
|
20
20
|
end
|
21
21
|
|
22
22
|
it "should return proper attributes with params" do
|
23
|
-
actual = ec2.describe_images('ImageId' => GENTOO_AMI)
|
23
|
+
actual = AWS[:ec2].describe_images('ImageId' => GENTOO_AMI)
|
24
24
|
actual.body['requestId'].should be_a(String)
|
25
25
|
image = actual.body['imagesSet'].first
|
26
26
|
image['architecture'].should be_a(String)
|
@@ -4,17 +4,17 @@ describe 'EC2.describe_instances' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
run_instances = ec2.run_instances(GENTOO_AMI, 1, 1).body
|
7
|
+
run_instances = AWS[:ec2].run_instances(GENTOO_AMI, 1, 1).body
|
8
8
|
@instance_id = run_instances['instancesSet'].first['instanceId']
|
9
9
|
@reservation_id = run_instances['reservationId']
|
10
10
|
end
|
11
11
|
|
12
12
|
after(:each) do
|
13
|
-
ec2.terminate_instances([@instance_id])
|
13
|
+
AWS[:ec2].terminate_instances([@instance_id])
|
14
14
|
end
|
15
15
|
|
16
16
|
it "should return proper attributes with no params" do
|
17
|
-
actual = ec2.describe_instances
|
17
|
+
actual = AWS[:ec2].describe_instances
|
18
18
|
reservation = actual.body['reservationSet'].select {|reservation| reservation['reservationId'] == @reservation_id}.first
|
19
19
|
reservation['groupSet'].should be_an(Array)
|
20
20
|
reservation['groupSet'].first.should be_a(String)
|
@@ -44,7 +44,7 @@ describe 'EC2.describe_instances' do
|
|
44
44
|
end
|
45
45
|
|
46
46
|
it "should return proper attributes with params" do
|
47
|
-
actual = ec2.describe_instances(@instance_id)
|
47
|
+
actual = AWS[:ec2].describe_instances(@instance_id)
|
48
48
|
reservation = actual.body['reservationSet'].select {|reservation| reservation['reservationId'] == @reservation_id}.first
|
49
49
|
reservation['groupSet'].should be_an(Array)
|
50
50
|
reservation['groupSet'].first.should be_a(String)
|
@@ -78,7 +78,7 @@ describe 'EC2.describe_instances' do
|
|
78
78
|
|
79
79
|
it 'should raise a BadRequest error if the instance does not exist' do
|
80
80
|
lambda {
|
81
|
-
ec2.describe_instances('i-00000000')
|
81
|
+
AWS[:ec2].describe_instances('i-00000000')
|
82
82
|
}.should raise_error(Excon::Errors::BadRequest)
|
83
83
|
end
|
84
84
|
|
@@ -4,15 +4,15 @@ describe 'EC2.describe_key_pairs' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
before(:each) do
|
7
|
-
ec2.create_key_pair('fog_key_name')
|
7
|
+
AWS[:ec2].create_key_pair('fog_key_name')
|
8
8
|
end
|
9
9
|
|
10
10
|
after(:each) do
|
11
|
-
ec2.delete_key_pair('fog_key_name')
|
11
|
+
AWS[:ec2].delete_key_pair('fog_key_name')
|
12
12
|
end
|
13
13
|
|
14
14
|
it "should return proper attributes with no params" do
|
15
|
-
actual = ec2.describe_key_pairs
|
15
|
+
actual = AWS[:ec2].describe_key_pairs
|
16
16
|
actual.body['keySet'].should be_an(Array)
|
17
17
|
actual.body['requestId'].should be_a(String)
|
18
18
|
key_pair = actual.body['keySet'].select {|key| key['keyName'] == 'fog_key_name' }.first
|
@@ -21,7 +21,7 @@ describe 'EC2.describe_key_pairs' do
|
|
21
21
|
end
|
22
22
|
|
23
23
|
it "should return proper attributes with params" do
|
24
|
-
actual = ec2.describe_key_pairs('fog_key_name')
|
24
|
+
actual = AWS[:ec2].describe_key_pairs('fog_key_name')
|
25
25
|
actual.body['keySet'].should be_an(Array)
|
26
26
|
actual.body['requestId'].should be_a(String)
|
27
27
|
key_pair = actual.body['keySet'].select {|key| key['keyName'] == 'fog_key_name' }.first
|
@@ -34,7 +34,7 @@ describe 'EC2.describe_key_pairs' do
|
|
34
34
|
|
35
35
|
it "should raise a BadRequest error if the key does not exist" do
|
36
36
|
lambda {
|
37
|
-
ec2.describe_key_pairs('fog_not_a_key_name')
|
37
|
+
AWS[:ec2].describe_key_pairs('fog_not_a_key_name')
|
38
38
|
}.should raise_error(Excon::Errors::BadRequest)
|
39
39
|
end
|
40
40
|
|
@@ -4,14 +4,14 @@ describe 'EC2.describe_availability_zones' do
|
|
4
4
|
describe 'success' do
|
5
5
|
|
6
6
|
it "should return proper attributes with no params" do
|
7
|
-
actual = ec2.describe_regions
|
7
|
+
actual = AWS[:ec2].describe_regions
|
8
8
|
zone = actual.body['regionInfo'].first
|
9
9
|
zone['regionEndpoint'].should be_a(String)
|
10
10
|
zone['regionName'].should be_a(String)
|
11
11
|
end
|
12
12
|
|
13
13
|
it "should return proper attribute with params" do
|
14
|
-
actual = ec2.describe_regions(['us-east-1'])
|
14
|
+
actual = AWS[:ec2].describe_regions(['us-east-1'])
|
15
15
|
zone = actual.body['regionInfo'].first
|
16
16
|
zone['regionEndpoint'].should be_a(String)
|
17
17
|
zone['regionName'].should be_a(String)
|