aws 2.1.10 → 2.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,6 +18,10 @@ http://groups.google.com/group/ruby-aws
18
18
 
19
19
  http://appoxy.lighthouseapp.com/projects/38441-aws/overview
20
20
 
21
+ ## Documentation
22
+
23
+ http://rdoc.info/projects/appoxy/aws
24
+
21
25
  ## Appoxy Amazon Web Services Ruby Gems
22
26
 
23
27
  Published by Appoxy LLC, under the MIT License. Special thanks to RightScale from which this project is forked.
@@ -306,8 +306,11 @@ module Aws
306
306
  end
307
307
 
308
308
  def tagstart(name, attributes)
309
- puts 'tagstart ' + name + ' -- ' + @xmlpath
310
- if (name == 'member' && @xmlpath == 'RegisterInstancesWithLoadBalancerResponse/RegisterInstancesWithLoadBalancerResult/Instances/member')
309
+ # puts 'tagstart ' + name + ' -- ' + @xmlpath
310
+ if (name == 'member' &&
311
+ (@xmlpath == 'RegisterInstancesWithLoadBalancerResponse/RegisterInstancesWithLoadBalancerResult/Instances' ||
312
+ @xmlpath == 'DeregisterInstancesFromLoadBalancerResponse/DeregisterInstancesFromLoadBalancerResult/Instances')
313
+ )
311
314
  @member = { }
312
315
  end
313
316
 
@@ -331,7 +334,7 @@ module Aws
331
334
  end
332
335
 
333
336
  def tagstart(name, attributes)
334
- puts 'tagstart ' + name + ' -- ' + @xmlpath
337
+ # puts 'tagstart ' + name + ' -- ' + @xmlpath
335
338
  if (name == 'member' && @xmlpath == 'DescribeInstanceHealthResponse/DescribeInstanceHealthResult/InstanceStates')
336
339
  @member = { }
337
340
  end
@@ -2,50 +2,67 @@ require File.dirname(__FILE__) + '/test_helper.rb'
2
2
  require 'pp'
3
3
  require File.dirname(__FILE__) + '/../test_credentials.rb'
4
4
 
5
- class TestEc2 < Test::Unit::TestCase
5
+ class TestElb < Test::Unit::TestCase
6
6
 
7
7
  # Some of RightEc2 instance methods concerning instance launching and image registration
8
8
  # are not tested here due to their potentially risk.
9
9
 
10
- def setup
11
- TestCredentials.get_credentials
12
- @ec2 = Aws::Elb.new(TestCredentials.aws_access_key_id,
13
- TestCredentials.aws_secret_access_key)
14
- @key = 'right_ec2_awesome_test_key'
15
- @group = 'right_ec2_awesome_test_security_group'
16
- end
17
-
18
- def test_01_create_elb
19
-
20
- end
21
-
22
- def test_02_register_instances
23
- assert @ec2.create_security_group(@group,'My awesone test group'), 'Create_security_group fail'
24
- group = @ec2.describe_security_groups([@group])[0]
25
- assert_equal @group, group[:aws_group_name], 'Group must be created but does not exist'
26
- end
27
-
28
- def test_03_deregister_instances
29
- assert @ec2.authorize_security_group_named_ingress(@group, TestCredentials.account_number, 'default')
30
- assert @ec2.authorize_security_group_IP_ingress(@group, 80,80,'udp','192.168.1.0/8')
31
- end
32
-
33
- def test_04_describe_instance_health
34
- assert_equal 2, @ec2.describe_security_groups([@group])[0][:aws_perms].size
35
- end
36
-
37
- def test_05_describe_elb
38
- assert @ec2.revoke_security_group_IP_ingress(@group, 80,80,'udp','192.168.1.0/8')
39
- assert @ec2.revoke_security_group_named_ingress(@group,
40
- TestCredentials.account_number, 'default')
41
- end
42
-
43
- def test_06_delete_elb
44
- images = @ec2.describe_images
45
- assert images.size>0, 'Amazon must have at least some public images'
46
- # unknown image
47
- assert_raise(Aws::AwsError){ @ec2.describe_images(['ami-ABCDEFGH'])}
48
- end
10
+ def setup
11
+ TestCredentials.get_credentials
12
+
13
+ @ec2 = Aws::Ec2.new(TestCredentials.aws_access_key_id,
14
+ TestCredentials.aws_secret_access_key)
15
+
16
+ @elb = Aws::Elb.new(TestCredentials.aws_access_key_id,
17
+ TestCredentials.aws_secret_access_key)
18
+ @key = 'right_ec2_awesome_test_key'
19
+ @group = 'right_ec2_awesome_test_security_group'
20
+ end
21
+
22
+ def test_01_create_elb
23
+
24
+ # Create elb
25
+
26
+ # Launch instance and add to elb
27
+ new_key = @ec2.create_key_pair(@key)
28
+ assert @ec2.create_security_group(@group, 'My awesone test group'), 'Create_security_group fail'
29
+ # LAUNCH HERE
30
+
31
+ # SHUTDOWN HERE
32
+
33
+ # Remove artifacts
34
+ assert @ec2.delete_security_group(@group), 'Delete_security_group fail'
35
+ assert @ec2.delete_key_pair(@key), 'Delete_key_pair fail'
36
+
37
+ end
38
+
39
+ def test_02_register_instances
40
+ assert @ec2.create_security_group(@group, 'My awesone test group'), 'Create_security_group fail'
41
+ group = @ec2.describe_security_groups([@group])[0]
42
+ assert_equal @group, group[:aws_group_name], 'Group must be created but does not exist'
43
+ end
44
+
45
+ def test_03_deregister_instances
46
+ assert @ec2.authorize_security_group_named_ingress(@group, TestCredentials.account_number, 'default')
47
+ assert @ec2.authorize_security_group_IP_ingress(@group, 80, 80, 'udp', '192.168.1.0/8')
48
+ end
49
+
50
+ def test_04_describe_instance_health
51
+ assert_equal 2, @ec2.describe_security_groups([@group])[0][:aws_perms].size
52
+ end
53
+
54
+ def test_05_describe_elb
55
+ assert @ec2.revoke_security_group_IP_ingress(@group, 80, 80, 'udp', '192.168.1.0/8')
56
+ assert @ec2.revoke_security_group_named_ingress(@group,
57
+ TestCredentials.account_number, 'default')
58
+ end
59
+
60
+ def test_06_delete_elb
61
+ images = @ec2.describe_images
62
+ assert images.size>0, 'Amazon must have at least some public images'
63
+ # unknown image
64
+ assert_raise(Aws::AwsError){ @ec2.describe_images(['ami-ABCDEFGH'])}
65
+ end
49
66
 
50
67
 
51
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10
4
+ version: 2.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Travis Reeder
@@ -11,7 +11,7 @@ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
13
 
14
- date: 2009-12-03 00:00:00 -08:00
14
+ date: 2009-12-04 00:00:00 -08:00
15
15
  default_executable:
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency