fog 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. data/Gemfile +1 -1
  2. data/Gemfile.lock +4 -4
  3. data/benchs/fog_vs.rb +8 -37
  4. data/fog.gemspec +6 -12
  5. data/lib/fog.rb +1 -1
  6. data/lib/fog/aws/requests/ec2/delete_key_pair.rb +4 -3
  7. data/lib/fog/aws/requests/ec2/describe_volumes.rb +2 -2
  8. data/lib/fog/aws/s3.rb +8 -4
  9. data/lib/fog/rackspace/models/servers/image.rb +5 -0
  10. data/tests/aws/helper.rb +33 -0
  11. data/tests/aws/requests/ec2/address_tests.rb +40 -47
  12. data/tests/aws/requests/ec2/availability_zone_tests.rb +23 -0
  13. data/tests/aws/requests/ec2/key_pair_tests.rb +44 -0
  14. data/tests/aws/requests/ec2/region_tests.rb +22 -0
  15. data/tests/aws/requests/ec2/security_group_tests.rb +112 -0
  16. data/tests/aws/requests/ec2/snapshot_tests.rb +14 -21
  17. data/tests/aws/requests/ec2/volume_tests.rb +26 -40
  18. data/tests/helper.rb +50 -35
  19. data/tests/rackspace/helper.rb +2 -0
  20. data/tests/rackspace/requests/servers/create_image_tests.rb +11 -13
  21. data/tests/rackspace/requests/servers/create_server_tests.rb +9 -11
  22. data/tests/rackspace/requests/servers/delete_image_tests.rb +9 -15
  23. data/tests/rackspace/requests/servers/delete_server_tests.rb +6 -10
  24. data/tests/rackspace/requests/servers/get_flavor_details_tests.rb +4 -10
  25. data/tests/rackspace/requests/servers/get_image_details_tests.rb +4 -10
  26. data/tests/rackspace/requests/servers/get_server_details_tests.rb +7 -14
  27. data/tests/rackspace/requests/servers/list_addresses_tests.rb +7 -14
  28. data/tests/rackspace/requests/servers/list_flavors_detail_tests.rb +2 -6
  29. data/tests/rackspace/requests/servers/list_flavors_tests.rb +2 -6
  30. data/tests/rackspace/requests/servers/list_images_detail_tests.rb +2 -6
  31. data/tests/rackspace/requests/servers/list_images_tests.rb +2 -6
  32. data/tests/rackspace/requests/servers/list_private_addresses_tests.rb +7 -14
  33. data/tests/rackspace/requests/servers/list_public_addresses_tests.rb +7 -14
  34. data/tests/rackspace/requests/servers/list_servers_detail_tests.rb +5 -10
  35. data/tests/rackspace/requests/servers/list_servers_tests.rb +5 -10
  36. data/tests/rackspace/requests/servers/reboot_server_tests.rb +11 -19
  37. data/tests/rackspace/requests/servers/update_server_tests.rb +7 -14
  38. data/tests/slicehost/requests/create_slice_tests.rb +6 -11
  39. data/tests/slicehost/requests/delete_slice_tests.rb +4 -9
  40. data/tests/slicehost/requests/get_backups_tests.rb +2 -6
  41. data/tests/slicehost/requests/get_flavor_tests.rb +4 -10
  42. data/tests/slicehost/requests/get_flavors_tests.rb +2 -6
  43. data/tests/slicehost/requests/get_image_tests.rb +4 -10
  44. data/tests/slicehost/requests/get_images_tests.rb +2 -6
  45. data/tests/slicehost/requests/get_slice_tests.rb +7 -15
  46. data/tests/slicehost/requests/get_slices_tests.rb +2 -6
  47. data/tests/slicehost/requests/reboot_slice_tests.rb +8 -16
  48. metadata +7 -13
  49. data/spec/aws/requests/ec2/authorize_security_group_ingress_spec.rb +0 -36
  50. data/spec/aws/requests/ec2/create_key_pair_spec.rb +0 -36
  51. data/spec/aws/requests/ec2/create_security_group_spec.rb +0 -34
  52. data/spec/aws/requests/ec2/delete_key_pair_spec.rb +0 -21
  53. data/spec/aws/requests/ec2/delete_security_group_spec.rb +0 -26
  54. data/spec/aws/requests/ec2/describe_availability_zones_spec.rb +0 -23
  55. data/spec/aws/requests/ec2/describe_key_pairs_spec.rb +0 -42
  56. data/spec/aws/requests/ec2/describe_regions_spec.rb +0 -21
  57. data/spec/aws/requests/ec2/describe_security_groups_spec.rb +0 -51
  58. data/spec/aws/requests/ec2/revoke_security_group_ingress_spec.rb +0 -32
@@ -1,23 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
2
-
3
- describe 'EC2.describe_availability_zones' do
4
- describe 'success' do
5
-
6
- it "should return proper attributes with no params" do
7
- actual = AWS[:ec2].describe_availability_zones
8
- zone = actual.body['availabilityZoneInfo'].first
9
- zone['regionName'].should be_a(String)
10
- zone['zoneName'].should be_a(String)
11
- zone['zoneState'].should be_a(String)
12
- end
13
-
14
- it "should return proper attribute with params" do
15
- actual = AWS[:ec2].describe_availability_zones(['us-east-1a'])
16
- zone = actual.body['availabilityZoneInfo'].first
17
- zone['regionName'].should be_a(String)
18
- zone['zoneName'].should be_a(String)
19
- zone['zoneState'].should be_a(String)
20
- end
21
-
22
- end
23
- end
@@ -1,42 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
2
-
3
- describe 'EC2.describe_key_pairs' do
4
- describe 'success' do
5
-
6
- before(:each) do
7
- AWS[:ec2].create_key_pair('fog_key_name')
8
- end
9
-
10
- after(:each) do
11
- AWS[:ec2].delete_key_pair('fog_key_name')
12
- end
13
-
14
- it "should return proper attributes with no params" do
15
- actual = AWS[:ec2].describe_key_pairs
16
- actual.body['keySet'].should be_an(Array)
17
- actual.body['requestId'].should be_a(String)
18
- key_pair = actual.body['keySet'].select {|key| key['keyName'] == 'fog_key_name' }.first
19
- key_pair['keyFingerprint'].should be_a(String)
20
- key_pair['keyName'].should be_a(String)
21
- end
22
-
23
- it "should return proper attributes with params" do
24
- actual = AWS[:ec2].describe_key_pairs('fog_key_name')
25
- actual.body['keySet'].should be_an(Array)
26
- actual.body['requestId'].should be_a(String)
27
- key_pair = actual.body['keySet'].select {|key| key['keyName'] == 'fog_key_name' }.first
28
- key_pair['keyFingerprint'].should be_a(String)
29
- key_pair['keyName'].should be_a(String)
30
- end
31
-
32
- end
33
- describe 'failure' do
34
-
35
- it "should raise a BadRequest error if the key does not exist" do
36
- lambda {
37
- AWS[:ec2].describe_key_pairs('fog_not_a_key_name')
38
- }.should raise_error(Excon::Errors::BadRequest)
39
- end
40
-
41
- end
42
- end
@@ -1,21 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
2
-
3
- describe 'EC2.describe_availability_zones' do
4
- describe 'success' do
5
-
6
- it "should return proper attributes with no params" do
7
- actual = AWS[:ec2].describe_regions
8
- zone = actual.body['regionInfo'].first
9
- zone['regionEndpoint'].should be_a(String)
10
- zone['regionName'].should be_a(String)
11
- end
12
-
13
- it "should return proper attribute with params" do
14
- actual = AWS[:ec2].describe_regions(['us-east-1'])
15
- zone = actual.body['regionInfo'].first
16
- zone['regionEndpoint'].should be_a(String)
17
- zone['regionName'].should be_a(String)
18
- end
19
-
20
- end
21
- end
@@ -1,51 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
2
-
3
- describe 'EC2.describe_security_groups' do
4
- describe 'success' do
5
-
6
- before(:each) do
7
- AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
8
- end
9
-
10
- after(:each) do
11
- AWS[:ec2].delete_security_group('fog_security_group')
12
- end
13
-
14
- it "should return proper attributes with no params" do
15
- actual = AWS[:ec2].describe_security_groups
16
- actual.body['requestId'].should be_a(String)
17
- actual.body['securityGroupInfo'].should be_an(Array)
18
- security_group = actual.body['securityGroupInfo'].select do |security_group|
19
- security_group['groupName'] == 'fog_security_group'
20
- end.first
21
- security_group['groupDescription'].should be_a(String)
22
- security_group['groupName'].should be_a(String)
23
- security_group['ownerId'].should be_a(String)
24
- security_group['ipPermissions'].should be_an(Array)
25
-
26
- end
27
-
28
- it "should return proper attributes with params" do
29
- actual = AWS[:ec2].describe_security_groups('fog_security_group')
30
- actual.body['requestId'].should be_a(String)
31
- actual.body['securityGroupInfo'].should be_an(Array)
32
- security_group = actual.body['securityGroupInfo'].select do |security_group|
33
- security_group['groupName'] == 'fog_security_group'
34
- end.first
35
- security_group['groupDescription'].should be_a(String)
36
- security_group['groupName'].should be_a(String)
37
- security_group['ownerId'].should be_a(String)
38
- security_group['ipPermissions'].should be_an(Array)
39
- end
40
-
41
- end
42
- describe 'failure' do
43
-
44
- it "should raise a BadRequest error if the security group does not exist" do
45
- lambda {
46
- AWS[:ec2].describe_security_groups('not_a_security_group')
47
- }.should raise_error(Excon::Errors::BadRequest)
48
- end
49
-
50
- end
51
- end
@@ -1,32 +0,0 @@
1
- require File.dirname(__FILE__) + '/../../../spec_helper'
2
-
3
- describe 'EC2.revoke_security_group_ingress' do
4
- describe 'success' do
5
-
6
- before(:each) do
7
- AWS[:ec2].create_security_group('fog_security_group', 'a security group for testing fog')
8
- AWS[:ec2].authorize_security_group_ingress({
9
- 'FromPort' => 80,
10
- 'GroupName' => 'fog_security_group',
11
- 'IpProtocol' => 'tcp',
12
- 'ToPort' => 80
13
- })
14
- end
15
-
16
- after(:each) do
17
- AWS[:ec2].delete_security_group('fog_security_group')
18
- end
19
-
20
- it "should return proper attributes" do
21
- actual = AWS[:ec2].revoke_security_group_ingress({
22
- 'FromPort' => 80,
23
- 'GroupName' => 'fog_security_group',
24
- 'IpProtocol' => 'tcp',
25
- 'ToPort' => 80
26
- })
27
- actual.body['requestId'].should be_a(String)
28
- [false, true].should include(actual.body['return'])
29
- end
30
-
31
- end
32
- end