poolparty 1.6.6 → 1.6.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/VERSION.yml +2 -3
  2. data/lib/poolparty/chef_solo.rb +0 -1
  3. metadata +12 -69
  4. data/vendor/gems/amazon-ec2/ChangeLog +0 -304
  5. data/vendor/gems/amazon-ec2/LICENSE +0 -66
  6. data/vendor/gems/amazon-ec2/README.rdoc +0 -359
  7. data/vendor/gems/amazon-ec2/README_dev.rdoc +0 -10
  8. data/vendor/gems/amazon-ec2/Rakefile +0 -70
  9. data/vendor/gems/amazon-ec2/VERSION +0 -1
  10. data/vendor/gems/amazon-ec2/amazon-ec2.gemspec +0 -142
  11. data/vendor/gems/amazon-ec2/bin/ec2-gem-example.rb +0 -137
  12. data/vendor/gems/amazon-ec2/bin/ec2-gem-profile.rb +0 -10
  13. data/vendor/gems/amazon-ec2/bin/ec2sh +0 -62
  14. data/vendor/gems/amazon-ec2/bin/setup.rb +0 -29
  15. data/vendor/gems/amazon-ec2/deps.rip +0 -1
  16. data/vendor/gems/amazon-ec2/lib/AWS/Autoscaling/autoscaling.rb +0 -273
  17. data/vendor/gems/amazon-ec2/lib/AWS/Autoscaling.rb +0 -70
  18. data/vendor/gems/amazon-ec2/lib/AWS/Cloudwatch/monitoring.rb +0 -80
  19. data/vendor/gems/amazon-ec2/lib/AWS/Cloudwatch.rb +0 -32
  20. data/vendor/gems/amazon-ec2/lib/AWS/EC2/availability_zones.rb +0 -29
  21. data/vendor/gems/amazon-ec2/lib/AWS/EC2/console.rb +0 -25
  22. data/vendor/gems/amazon-ec2/lib/AWS/EC2/devpay.rb +0 -18
  23. data/vendor/gems/amazon-ec2/lib/AWS/EC2/elastic_ips.rb +0 -86
  24. data/vendor/gems/amazon-ec2/lib/AWS/EC2/image_attributes.rb +0 -133
  25. data/vendor/gems/amazon-ec2/lib/AWS/EC2/images.rb +0 -117
  26. data/vendor/gems/amazon-ec2/lib/AWS/EC2/instances.rb +0 -249
  27. data/vendor/gems/amazon-ec2/lib/AWS/EC2/keypairs.rb +0 -47
  28. data/vendor/gems/amazon-ec2/lib/AWS/EC2/products.rb +0 -21
  29. data/vendor/gems/amazon-ec2/lib/AWS/EC2/security_groups.rb +0 -164
  30. data/vendor/gems/amazon-ec2/lib/AWS/EC2/snapshots.rb +0 -80
  31. data/vendor/gems/amazon-ec2/lib/AWS/EC2/volumes.rb +0 -100
  32. data/vendor/gems/amazon-ec2/lib/AWS/EC2.rb +0 -33
  33. data/vendor/gems/amazon-ec2/lib/AWS/ELB/load_balancers.rb +0 -178
  34. data/vendor/gems/amazon-ec2/lib/AWS/ELB.rb +0 -71
  35. data/vendor/gems/amazon-ec2/lib/AWS/RDS/rds.rb +0 -522
  36. data/vendor/gems/amazon-ec2/lib/AWS/RDS.rb +0 -73
  37. data/vendor/gems/amazon-ec2/lib/AWS/exceptions.rb +0 -200
  38. data/vendor/gems/amazon-ec2/lib/AWS/responses.rb +0 -21
  39. data/vendor/gems/amazon-ec2/lib/AWS.rb +0 -304
  40. data/vendor/gems/amazon-ec2/perftools/ec2prof +0 -0
  41. data/vendor/gems/amazon-ec2/perftools/ec2prof-results.dot +0 -132
  42. data/vendor/gems/amazon-ec2/perftools/ec2prof-results.txt +0 -100
  43. data/vendor/gems/amazon-ec2/perftools/ec2prof.symbols +0 -102
  44. data/vendor/gems/amazon-ec2/test/test_Autoscaling_groups.rb +0 -337
  45. data/vendor/gems/amazon-ec2/test/test_EC2.rb +0 -68
  46. data/vendor/gems/amazon-ec2/test/test_EC2_availability_zones.rb +0 -49
  47. data/vendor/gems/amazon-ec2/test/test_EC2_console.rb +0 -54
  48. data/vendor/gems/amazon-ec2/test/test_EC2_elastic_ips.rb +0 -144
  49. data/vendor/gems/amazon-ec2/test/test_EC2_image_attributes.rb +0 -238
  50. data/vendor/gems/amazon-ec2/test/test_EC2_images.rb +0 -229
  51. data/vendor/gems/amazon-ec2/test/test_EC2_instances.rb +0 -611
  52. data/vendor/gems/amazon-ec2/test/test_EC2_keypairs.rb +0 -123
  53. data/vendor/gems/amazon-ec2/test/test_EC2_products.rb +0 -48
  54. data/vendor/gems/amazon-ec2/test/test_EC2_responses.rb +0 -53
  55. data/vendor/gems/amazon-ec2/test/test_EC2_s3_xmlsimple.rb +0 -80
  56. data/vendor/gems/amazon-ec2/test/test_EC2_security_groups.rb +0 -205
  57. data/vendor/gems/amazon-ec2/test/test_EC2_snapshots.rb +0 -83
  58. data/vendor/gems/amazon-ec2/test/test_EC2_volumes.rb +0 -142
  59. data/vendor/gems/amazon-ec2/test/test_ELB_load_balancers.rb +0 -239
  60. data/vendor/gems/amazon-ec2/test/test_RDS.rb +0 -354
  61. data/vendor/gems/amazon-ec2/test/test_helper.rb +0 -23
  62. data/vendor/gems/amazon-ec2/wsdl/2007-08-29.ec2.wsdl +0 -1269
  63. data/vendor/gems/amazon-ec2/wsdl/2008-02-01.ec2.wsdl +0 -1614
  64. data/vendor/gems/amazon-ec2/wsdl/2008-05-05.ec2.wsdl +0 -2052
  65. data/vendor/gems/amazon-ec2/wsdl/2008-12-01.ec2.wsdl +0 -2354
  66. data/vendor/gems/amazon-ec2/wsdl/2009-10-31.ec2.wsdl +0 -4261
  67. data/vendor/gems/amazon-ec2/wsdl/2009-11-30.ec2.wsdl +0 -4668
@@ -1,123 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Glenn Rempe (mailto:glenn@rempe.us)
6
- # Copyright:: Copyright (c) 2007-2008 Glenn Rempe
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- context "EC2 keypairs " do
14
-
15
- before do
16
- @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
17
-
18
- @create_keypair_response_body = <<-RESPONSE
19
- <CreateKeyPairResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
20
- <keyName>example-key-name</keyName>
21
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
22
- <keyMaterial>-----BEGIN RSA PRIVATE KEY-----
23
- MIIEoQIBAAKCAQBuLFg5ujHrtm1jnutSuoO8Xe56LlT+HM8v/xkaa39EstM3/aFxTHgElQiJLChp
24
- HungXQ29VTc8rc1bW0lkdi23OH5eqkMHGhvEwqa0HWASUMll4o3o/IX+0f2UcPoKCOVUR+jx71Sg
25
- 5AU52EQfanIn3ZQ8lFW7Edp5a3q4DhjGlUKToHVbicL5E+g45zfB95wIyywWZfeW/UUF3LpGZyq/
26
- ebIUlq1qTbHkLbCC2r7RTn8vpQWp47BGVYGtGSBMpTRP5hnbzzuqj3itkiLHjU39S2sJCJ0TrJx5
27
- i8BygR4s3mHKBj8l+ePQxG1kGbF6R4yg6sECmXn17MRQVXODNHZbAgMBAAECggEAY1tsiUsIwDl5
28
- 91CXirkYGuVfLyLflXenxfI50mDFms/mumTqloHO7tr0oriHDR5K7wMcY/YY5YkcXNo7mvUVD1pM
29
- ZNUJs7rw9gZRTrf7LylaJ58kOcyajw8TsC4e4LPbFaHwS1d6K8rXh64o6WgW4SrsB6ICmr1kGQI7
30
- 3wcfgt5ecIu4TZf0OE9IHjn+2eRlsrjBdeORi7KiUNC/pAG23I6MdDOFEQRcCSigCj+4/mciFUSA
31
- SWS4dMbrpb9FNSIcf9dcLxVM7/6KxgJNfZc9XWzUw77Jg8x92Zd0fVhHOux5IZC+UvSKWB4dyfcI
32
- tE8C3p9bbU9VGyY5vLCAiIb4qQKBgQDLiO24GXrIkswF32YtBBMuVgLGCwU9h9HlO9mKAc2m8Cm1
33
- jUE5IpzRjTedc9I2qiIMUTwtgnw42auSCzbUeYMURPtDqyQ7p6AjMujp9EPemcSVOK9vXYL0Ptco
34
- xW9MC0dtV6iPkCN7gOqiZXPRKaFbWADp16p8UAIvS/a5XXk5jwKBgQCKkpHi2EISh1uRkhxljyWC
35
- iDCiK6JBRsMvpLbc0v5dKwP5alo1fmdR5PJaV2qvZSj5CYNpMAy1/EDNTY5OSIJU+0KFmQbyhsbm
36
- rdLNLDL4+TcnT7c62/aH01ohYaf/VCbRhtLlBfqGoQc7+sAc8vmKkesnF7CqCEKDyF/dhrxYdQKB
37
- gC0iZzzNAapayz1+JcVTwwEid6j9JqNXbBc+Z2YwMi+T0Fv/P/hwkX/ypeOXnIUcw0Ih/YtGBVAC
38
- DQbsz7LcY1HqXiHKYNWNvXgwwO+oiChjxvEkSdsTTIfnK4VSCvU9BxDbQHjdiNDJbL6oar92UN7V
39
- rBYvChJZF7LvUH4YmVpHAoGAbZ2X7XvoeEO+uZ58/BGKOIGHByHBDiXtzMhdJr15HTYjxK7OgTZm
40
- gK+8zp4L9IbvLGDMJO8vft32XPEWuvI8twCzFH+CsWLQADZMZKSsBasOZ/h1FwhdMgCMcY+Qlzd4
41
- JZKjTSu3i7vhvx6RzdSedXEMNTZWN4qlIx3kR5aHcukCgYA9T+Zrvm1F0seQPbLknn7EqhXIjBaT
42
- P8TTvW/6bdPi23ExzxZn7KOdrfclYRph1LHMpAONv/x2xALIf91UB+v5ohy1oDoasL0gij1houRe
43
- 2ERKKdwz0ZL9SWq6VTdhr/5G994CK72fy5WhyERbDjUIdHaK3M849JJuf8cSrvSb4g==
44
- -----END RSA PRIVATE KEY-----</keyMaterial>
45
- </CreateKeyPairResponse>
46
- RESPONSE
47
-
48
- @describe_keypairs_response_body = <<-RESPONSE
49
- <DescribeKeyPairsResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
50
- <keySet>
51
- <item>
52
- <keyName>example-key-name</keyName>
53
- <keyFingerprint>1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f</keyFingerprint>
54
- </item>
55
- </keySet>
56
- </DescribeKeyPairsResponse>
57
- RESPONSE
58
-
59
- @delete_keypair_body = <<-RESPONSE
60
- <DeleteKeyPair xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
61
- <return>true</return>
62
- </DeleteKeyPair>
63
- RESPONSE
64
-
65
- end
66
-
67
-
68
- specify "should be able to be created" do
69
- @ec2.stubs(:make_request).with('CreateKeyPair', {"KeyName"=>"example-key-name"}).
70
- returns stub(:body => @create_keypair_response_body, :is_a? => true)
71
-
72
- @ec2.create_keypair( :key_name => "example-key-name" ).should.be.an.instance_of Hash
73
-
74
- response = @ec2.create_keypair( :key_name => "example-key-name" )
75
- response.keyName.should.equal "example-key-name"
76
- response.keyFingerprint.should.equal "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f"
77
- response.keyMaterial.should.not.equal ""
78
- response.keyMaterial.should.not.be.nil
79
- end
80
-
81
-
82
- specify "method create_keypair should reject bad arguments" do
83
- @ec2.stubs(:make_request).with('CreateKeyPair', {"KeyName"=>"example-key-name"}).
84
- returns stub(:body => @create_keypair_response_body, :is_a? => true)
85
-
86
- lambda { @ec2.create_keypair( :key_name => "example-key-name" ) }.should.not.raise(AWS::ArgumentError)
87
- lambda { @ec2.create_keypair() }.should.raise(AWS::ArgumentError)
88
- lambda { @ec2.create_keypair( :key_name => nil ) }.should.raise(AWS::ArgumentError)
89
- lambda { @ec2.create_keypair( :key_name => "" ) }.should.raise(AWS::ArgumentError)
90
- end
91
-
92
-
93
- specify "should be able to be described with describe_keypairs" do
94
- @ec2.stubs(:make_request).with('DescribeKeyPairs', {"KeyName.1"=>"example-key-name"}).
95
- returns stub(:body => @describe_keypairs_response_body, :is_a? => true)
96
- @ec2.describe_keypairs( :key_name => "example-key-name" ).should.be.an.instance_of Hash
97
- response = @ec2.describe_keypairs( :key_name => "example-key-name" )
98
- response.keySet.item[0].keyName.should.equal "example-key-name"
99
- response.keySet.item[0].keyFingerprint.should.equal "1f:51:ae:28:bf:89:e9:d8:1f:25:5d:37:2d:7d:b8:ca:9f:f5:f1:6f"
100
- end
101
-
102
-
103
- specify "should be able to be deleted with delete_keypairs" do
104
- @ec2.stubs(:make_request).with('DeleteKeyPair', {"KeyName"=>"example-key-name"}).
105
- returns stub(:body => @delete_keypair_body, :is_a? => true)
106
- @ec2.delete_keypair( :key_name => "example-key-name" ).should.be.an.instance_of Hash
107
- response = @ec2.delete_keypair( :key_name => "example-key-name" )
108
- response.return.should.equal "true"
109
- end
110
-
111
-
112
- specify "method delete_keypair should reject bad argument" do
113
- @ec2.stubs(:make_request).with('DeleteKeyPair', {"KeyName"=>"example-key-name"}).
114
- returns stub(:body => @delete_keypair_body, :is_a? => true)
115
-
116
- lambda { @ec2.delete_keypair( :key_name => "example-key-name" ) }.should.not.raise(AWS::ArgumentError)
117
- lambda { @ec2.delete_keypair() }.should.raise(AWS::ArgumentError)
118
- lambda { @ec2.delete_keypair( :key_name => nil ) }.should.raise(AWS::ArgumentError)
119
- lambda { @ec2.delete_keypair( :key_name => "" ) }.should.raise(AWS::ArgumentError)
120
- end
121
-
122
-
123
- end
@@ -1,48 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Glenn Rempe (mailto:glenn@rempe.us)
6
- # Copyright:: Copyright (c) 2007-2008 Glenn Rempe
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- context "An EC2 instance " do
14
-
15
- before do
16
- @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
17
-
18
- @confirm_product_instance_response_body = <<-RESPONSE
19
- <ConfirmProductInstanceResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
20
- <result>true</result>
21
- <ownerId>254933287430</ownerId>
22
- </ConfirmProductInstanceResponse>
23
- RESPONSE
24
-
25
- end
26
-
27
-
28
- specify "should indicate whether a product code is attached to an instance" do
29
- @ec2.stubs(:make_request).with('ConfirmProductInstance', {"ProductCode"=>"774F4FF8", "InstanceId"=>"i-10a64379"}).
30
- returns stub(:body => @confirm_product_instance_response_body, :is_a? => true)
31
-
32
- @ec2.confirm_product_instance( :product_code => "774F4FF8", :instance_id => "i-10a64379" ).should.be.an.instance_of Hash
33
- response = @ec2.confirm_product_instance( :product_code => "774F4FF8", :instance_id => "i-10a64379" )
34
- response.ownerId.should.equal "254933287430"
35
- response.result.should.equal "true"
36
- end
37
-
38
-
39
- specify "method get_console_output should raise an exception when called without nil/empty string arguments" do
40
- lambda { @ec2.confirm_product_instance() }.should.raise(AWS::ArgumentError)
41
- lambda { @ec2.confirm_product_instance(:product_code => "774F4FF8", :instance_id => nil) }.should.raise(AWS::ArgumentError)
42
- lambda { @ec2.confirm_product_instance(:product_code => "774F4FF8", :instance_id => "") }.should.raise(AWS::ArgumentError)
43
- lambda { @ec2.confirm_product_instance(:product_code => nil, :instance_id => "i-10a64379") }.should.raise(AWS::ArgumentError)
44
- lambda { @ec2.confirm_product_instance(:product_code => "", :instance_id => "i-10a64379") }.should.raise(AWS::ArgumentError)
45
- end
46
-
47
-
48
- end
@@ -1,53 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Glenn Rempe (mailto:glenn@rempe.us)
6
- # Copyright:: Copyright (c) 2007-2008 Glenn Rempe
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- context "The Response classes " do
14
-
15
-
16
- before do
17
- @http_xml = <<-RESPONSE
18
- <RebootInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
19
- <return>true</return>
20
- </RebootInstancesResponse>
21
- RESPONSE
22
-
23
- @response = AWS::Response.parse(:xml => @http_xml)
24
- end
25
-
26
-
27
- specify "should show the response as a formatted string when calling #inspect" do
28
- # sorting the response hash first since ruby 1.8.6 and ruby 1.9.1 sort the hash differently before the inspect
29
- @response.sort.inspect.should.equal %{[[\"return\", \"true\"], [\"xmlns\", \"http://ec2.amazonaws.com/doc/2007-03-01\"]]}
30
- end
31
-
32
-
33
- specify "should be a Hash" do
34
- @response.kind_of?(Hash).should.equal true
35
- end
36
-
37
-
38
- specify "should return its members" do
39
- @response.keys.length.should.equal 2
40
- test_array = ["return", "xmlns"].sort
41
- @response.keys.sort.should.equal test_array
42
- end
43
-
44
-
45
- # Note: since we are now returning a hash of the xml, there should be no need for anyone to re-parse the xml.
46
- # Therefore storing the xml on the object is a waste of memory, and is not done.
47
- #
48
- # specify "should return the original amazon XML response in the 'xml' attribute of the response object." do
49
- # @response.xml.should.equal @http_xml
50
- # end
51
-
52
-
53
- end
@@ -1,80 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Glenn Rempe (mailto:glenn@rempe.us)
6
- # Copyright:: Copyright (c) 2007-2008 Glenn Rempe
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- # NOTE : These tests exercise amazon-ec2 when used with the aws/s3 gem
14
- # which was demonstrating some breaking behavior. The fix was to
15
- # add the XmlSimple option "'keeproot' => false" in responses.rb
16
-
17
- context "EC2 aws-s3 compat test" do
18
-
19
- before do
20
- @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
21
-
22
- @describe_instances_response_body = <<-RESPONSE
23
- <DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2007-08-29">
24
- <reservationSet>
25
- <item>
26
- <reservationId>r-44a5402d</reservationId>
27
- <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
28
- <groupSet>
29
- <item>
30
- <groupId>default</groupId>
31
- </item>
32
- </groupSet>
33
- <instancesSet>
34
- <item>
35
- <instanceId>i-28a64341</instanceId>
36
- <imageId>ami-6ea54007</imageId>
37
- <instanceState>
38
- <code>0</code>
39
- <name>running</name>
40
- </instanceState>
41
- <privateDnsName>domU-12-31-35-00-1E-01.z-2.compute-1.internal</privateDnsName>
42
- <dnsName>ec2-72-44-33-4.z-2.compute-1.amazonaws.com</dnsName>
43
- <keyName>example-key-name</keyName>
44
- <productCodesSet>
45
- <item><productCode>774F4FF8</productCode></item>
46
- </productCodesSet>
47
- <instanceType>m1.small</instanceType>
48
- <launchTime>2007-08-07T11:54:42.000Z</launchTime>
49
- </item>
50
- </instancesSet>
51
- </item>
52
- </reservationSet>
53
- </DescribeInstancesResponse>
54
- RESPONSE
55
-
56
- end
57
-
58
- specify "should be able to be described and return the correct Ruby response class" do
59
- @ec2.stubs(:make_request).with('DescribeInstances', {}).
60
- returns stub(:body => @describe_instances_response_body, :is_a? => true)
61
- @ec2.describe_instances.should.be.an.instance_of Hash
62
- response = @ec2.describe_instances
63
- response.reservationSet.item[0].reservationId.should.equal "r-44a5402d"
64
- end
65
-
66
- specify "should be able to be described and return the correct Ruby response class when the aws/s3 lib is required" do
67
- begin
68
- require 'aws/s3s'
69
- @ec2.stubs(:make_request).with('DescribeInstances', {}).
70
- returns stub(:body => @describe_instances_response_body, :is_a? => true)
71
- @ec2.describe_instances.should.be.an.instance_of Hash
72
- response = @ec2.describe_instances
73
- response.reservationSet.item[0].reservationId.should.equal "r-44a5402d"
74
- rescue LoadError
75
- # do nothing. no aws/s3 gem installed to test against
76
- end
77
- end
78
-
79
- end
80
-
@@ -1,205 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Glenn Rempe (mailto:glenn@rempe.us)
6
- # Copyright:: Copyright (c) 2007-2008 Glenn Rempe
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- context "EC2 security groups " do
14
-
15
- before do
16
- @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
17
-
18
- @create_security_group_response_body = <<-RESPONSE
19
- <CreateSecurityGroupResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
20
- <return>true</return>
21
- </CreateSecurityGroupResponse>
22
- RESPONSE
23
-
24
- @delete_security_group_response_body = <<-RESPONSE
25
- <DeleteSecurityGroupResponse xmlns="http://ec2.amazonaws.com/doc/2007-03-01">
26
- <return>true</return>
27
- </DeleteSecurityGroupResponse>
28
- RESPONSE
29
-
30
- @describe_security_groups_response_body = <<-RESPONSE
31
- <DescribeSecurityGroupsResponse xm-lns="http://ec2.amazonaws.com/doc/2007-03-01">
32
- <securityGroupInfo>
33
- <item>
34
- <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
35
- <groupName>WebServers</groupName>
36
- <groupDescription>Web</groupDescription>
37
- <ipPermissions>
38
- <item>
39
- <ipProtocol>tcp</ipProtocol>
40
- <fromPort>80</fromPort>
41
- <toPort>80</toPort>
42
- <groups/>
43
- <ipRanges>
44
- <item>
45
- <cidrIp>0.0.0.0/0</cidrIp>
46
- </item>
47
- </ipRanges>
48
- </item>
49
- </ipPermissions>
50
- </item>
51
- <item>
52
- <ownerId>UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM</ownerId>
53
- <groupName>RangedPortsBySource</groupName>
54
- <groupDescription>A</groupDescription>
55
- <ipPermissions>
56
- <item>
57
- <ipProtocol>tcp</ipProtocol>
58
- <fromPort>6000</fromPort>
59
- <toPort>7000</toPort>
60
- <groups/>
61
- <ipRanges/>
62
- </item>
63
- </ipPermissions>
64
- </item>
65
- </securityGroupInfo>
66
- </DescribeSecurityGroupsResponse>
67
- RESPONSE
68
-
69
- @authorize_security_group_ingress_response_body = <<-RESPONSE
70
- <AuthorizeSecurityGroupIngressResponse xm-lns="http://ec2.amazonaws.com/doc/2007-03-01">
71
- <return>true</return>
72
- </AuthorizeSecurityGroupIngressResponse>
73
- RESPONSE
74
-
75
- @revoke_security_group_ingress_response_body = <<-RESPONSE
76
- <RevokeSecurityGroupIngressResponse xm-lns="http://ec2.amazonaws.com/doc/2007-03-01">
77
- <return>true</return>
78
- </RevokeSecurityGroupIngressResponse>
79
- RESPONSE
80
-
81
- end
82
-
83
-
84
- specify "should be able to be created" do
85
- @ec2.stubs(:make_request).with('CreateSecurityGroup', {"GroupName"=>"WebServers", "GroupDescription"=>"Web"}).
86
- returns stub(:body => @create_security_group_response_body, :is_a? => true)
87
- @ec2.create_security_group( :group_name => "WebServers", :group_description => "Web" ).should.be.an.instance_of Hash
88
- end
89
-
90
-
91
- specify "method create_security_group should reject bad arguments" do
92
- @ec2.stubs(:make_request).with('CreateSecurityGroup', {"GroupName"=>"WebServers", "GroupDescription"=>"Web"}).
93
- returns stub(:body => @create_security_group_response_body, :is_a? => true)
94
-
95
- lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "Web" ) }.should.not.raise(AWS::ArgumentError)
96
- lambda { @ec2.create_security_group() }.should.raise(AWS::ArgumentError)
97
-
98
- # :group_name can't be nil or empty
99
- lambda { @ec2.create_security_group( :group_name => "", :group_description => "Web" ) }.should.raise(AWS::ArgumentError)
100
- lambda { @ec2.create_security_group( :group_name => nil, :group_description => "Web" ) }.should.raise(AWS::ArgumentError)
101
-
102
- # :group_description can't be nil or empty
103
- lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => "" ) }.should.raise(AWS::ArgumentError)
104
- lambda { @ec2.create_security_group( :group_name => "WebServers", :group_description => nil ) }.should.raise(AWS::ArgumentError)
105
- end
106
-
107
-
108
- specify "should be able to be deleted" do
109
- @ec2.stubs(:make_request).with('DeleteSecurityGroup', {"GroupName"=>"WebServers"}).
110
- returns stub(:body => @delete_security_group_response_body, :is_a? => true)
111
- @ec2.delete_security_group( :group_name => "WebServers" ).should.be.an.instance_of Hash
112
- end
113
-
114
-
115
- specify "method delete_security_group should reject bad arguments" do
116
- @ec2.stubs(:make_request).with('DeleteSecurityGroup', {"GroupName"=>"WebServers"}).
117
- returns stub(:body => @delete_security_group_response_body, :is_a? => true)
118
-
119
- lambda { @ec2.delete_security_group( :group_name => "WebServers" ) }.should.not.raise(AWS::ArgumentError)
120
- lambda { @ec2.delete_security_group() }.should.raise(AWS::ArgumentError)
121
-
122
- # :group_name can't be nil or empty
123
- lambda { @ec2.delete_security_group( :group_name => "" ) }.should.raise(AWS::ArgumentError)
124
- lambda { @ec2.delete_security_group( :group_name => nil ) }.should.raise(AWS::ArgumentError)
125
- end
126
-
127
-
128
- specify "should be able to be described with describe_security_groups" do
129
- @ec2.stubs(:make_request).with('DescribeSecurityGroups', { "GroupName.1" => "WebServers", "GroupName.2" => "RangedPortsBySource" }).
130
- returns stub(:body => @describe_security_groups_response_body, :is_a? => true)
131
- @ec2.describe_security_groups( :group_name => ["WebServers", "RangedPortsBySource"] ).should.be.an.instance_of Hash
132
-
133
- response = @ec2.describe_security_groups( :group_name => ["WebServers", "RangedPortsBySource"] )
134
-
135
- response.securityGroupInfo.item[0].ownerId.should.equal "UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM"
136
- response.securityGroupInfo.item[0].groupName.should.equal "WebServers"
137
- response.securityGroupInfo.item[0].groupDescription.should.equal "Web"
138
- response.securityGroupInfo.item[0].ipPermissions.item[0].ipProtocol.should.equal "tcp"
139
- response.securityGroupInfo.item[0].ipPermissions.item[0].fromPort.should.equal "80"
140
- response.securityGroupInfo.item[0].ipPermissions.item[0].toPort.should.equal "80"
141
- response.securityGroupInfo.item[0].ipPermissions.item[0].groups.should.be.nil
142
- response.securityGroupInfo.item[0].ipPermissions.item[0].ipRanges.item[0].cidrIp.should.equal "0.0.0.0/0"
143
-
144
- response.securityGroupInfo.item[1].ownerId.should.equal "UYY3TLBUXIEON5NQVUUX6OMPWBZIQNFM"
145
- response.securityGroupInfo.item[1].groupName.should.equal "RangedPortsBySource"
146
- response.securityGroupInfo.item[1].groupDescription.should.equal "A"
147
- response.securityGroupInfo.item[1].ipPermissions.item[0].ipProtocol.should.equal "tcp"
148
- response.securityGroupInfo.item[1].ipPermissions.item[0].fromPort.should.equal "6000"
149
- response.securityGroupInfo.item[1].ipPermissions.item[0].toPort.should.equal "7000"
150
- response.securityGroupInfo.item[1].ipPermissions.item[0].groups.should.be.nil
151
- response.securityGroupInfo.item[1].ipPermissions.item[0].ipRanges.should.be.nil
152
- end
153
-
154
-
155
- specify "method describe_security_groups should reject bad arguments" do
156
- @ec2.stubs(:make_request).with('DescribeSecurityGroups', {"GroupName.1"=>"WebServers"}).
157
- returns stub(:body => @describe_security_groups_response_body, :is_a? => true)
158
-
159
- lambda { @ec2.describe_security_groups( :group_name => "WebServers" ) }.should.not.raise(AWS::ArgumentError)
160
-
161
- end
162
-
163
-
164
- specify "permissions should be able to be added to a security group with authorize_security_group_ingress." do
165
- @ec2.stubs(:make_request).with('AuthorizeSecurityGroupIngress', { "GroupName"=>"WebServers",
166
- "IpProtocol"=>"tcp",
167
- "FromPort"=>"8000",
168
- "ToPort"=>"80",
169
- "CidrIp"=>"0.0.0.0/24",
170
- "SourceSecurityGroupName"=>"Source SG Name",
171
- "SourceSecurityGroupOwnerId"=>"123"}).
172
- returns stub(:body => @authorize_security_group_ingress_response_body, :is_a? => true)
173
-
174
- @ec2.authorize_security_group_ingress( :group_name => "WebServers",
175
- :ip_protocol => "tcp",
176
- :from_port => "8000",
177
- :to_port => "80",
178
- :cidr_ip => "0.0.0.0/24",
179
- :source_security_group_name => "Source SG Name",
180
- :source_security_group_owner_id => "123"
181
- ).should.be.an.instance_of Hash
182
- end
183
-
184
-
185
- specify "permissions should be able to be revoked from a security group with revoke_security_group_ingress." do
186
- @ec2.stubs(:make_request).with('RevokeSecurityGroupIngress', { "GroupName"=>"WebServers",
187
- "IpProtocol"=>"tcp",
188
- "FromPort"=>"8000",
189
- "ToPort"=>"80",
190
- "CidrIp"=>"0.0.0.0/24",
191
- "SourceSecurityGroupName"=>"Source SG Name",
192
- "SourceSecurityGroupOwnerId"=>"123"}).
193
- returns stub(:body => @revoke_security_group_ingress_response_body, :is_a? => true)
194
-
195
- @ec2.revoke_security_group_ingress( :group_name => "WebServers",
196
- :ip_protocol => "tcp",
197
- :from_port => "8000",
198
- :to_port => "80",
199
- :cidr_ip => "0.0.0.0/24",
200
- :source_security_group_name => "Source SG Name",
201
- :source_security_group_owner_id => "123"
202
- ).should.be.an.instance_of Hash
203
- end
204
-
205
- end
@@ -1,83 +0,0 @@
1
- #--
2
- # Amazon Web Services EC2 Query API Ruby library, EBS snapshots support
3
- #
4
- # Ruby Gem Name:: amazon-ec2
5
- # Author:: Yann Klis (mailto:yann.klis@novelys.com)
6
- # Copyright:: Copyright (c) 2008 Yann Klis
7
- # License:: Distributes under the same terms as Ruby
8
- # Home:: http://github.com/grempe/amazon-ec2/tree/master
9
- #++
10
-
11
- require File.dirname(__FILE__) + '/test_helper.rb'
12
-
13
- context "EC2 snaphots " do
14
-
15
- before do
16
- @ec2 = AWS::EC2::Base.new( :access_key_id => "not a key", :secret_access_key => "not a secret" )
17
-
18
- @describe_snapshots_response_body = <<-RESPONSE
19
- <DescribeSnapshotsResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
20
- <snapshotId>snap-78a54011</snapshotId>
21
- <volumeId>vol-4d826724</volumeId>
22
- <status>pending</status>
23
- <startTime>2008-05-07T12:51:50.000Z</startTime>
24
- <progress>80%</progress>
25
- </DescribeSnapshotsResponse>
26
- RESPONSE
27
-
28
- @create_snapshot_response_body = <<-RESPONSE
29
- <CreateSnapshotResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
30
- <snapshotId>snap-78a54011</snapshotId>
31
- <volumeId>vol-4d826724</volumeId>
32
- <status>pending</status>
33
- <startTime>2008-05-07T12:51:50.000Z</startTime>
34
- <progress></progress>
35
- </CreateSnapshotResponse>
36
- RESPONSE
37
-
38
- @delete_snapshot_response_body = <<-RESPONSE
39
- <DeleteSnapshotResponse xmlns="http://ec2.amazonaws.com/doc/2008-05-05">
40
- <return>true</return>
41
- </DeleteSnapshotResponse>
42
- RESPONSE
43
-
44
- end
45
-
46
-
47
- specify "should be able to be described with describe_snapshots" do
48
- @ec2.stubs(:make_request).with('DescribeSnapshots', {'SnapshotId.1' => 'snap-78a54011'}).
49
- returns stub(:body => @describe_snapshots_response_body, :is_a? => true)
50
-
51
- @ec2.describe_snapshots( :snapshot_id => "snap-78a54011" ).should.be.an.instance_of Hash
52
-
53
- response = @ec2.describe_snapshots( :snapshot_id => "snap-78a54011" )
54
- response.snapshotId.should.equal "snap-78a54011"
55
- response.volumeId.should.equal "vol-4d826724"
56
- response.status.should.equal "pending"
57
- response.progress.should.equal "80%"
58
- end
59
-
60
- specify "should be able to be created with a volume_id" do
61
- @ec2.stubs(:make_request).with('CreateSnapshot', {"VolumeId" => "vol-4d826724"}).
62
- returns stub(:body => @create_snapshot_response_body, :is_a? => true)
63
-
64
- @ec2.create_snapshot( :volume_id => "vol-4d826724" ).should.be.an.instance_of Hash
65
-
66
- response = @ec2.create_snapshot( :volume_id => "vol-4d826724" )
67
- response.snapshotId.should.equal "snap-78a54011"
68
- response.volumeId.should.equal "vol-4d826724"
69
- response.status.should.equal "pending"
70
- response.progress.should.equal nil
71
- end
72
-
73
- specify "should be able to be deleted with a snapsot_id" do
74
- @ec2.stubs(:make_request).with('DeleteSnapshot', {"SnapshotId" => "snap-78a54011"}).
75
- returns stub(:body => @delete_snapshot_response_body, :is_a? => true)
76
-
77
- @ec2.delete_snapshot( :snapshot_id => "snap-78a54011" ).should.be.an.instance_of Hash
78
-
79
- response = @ec2.delete_snapshot( :snapshot_id => "snap-78a54011" )
80
- response.return.should.equal "true"
81
- end
82
-
83
- end