redaranj-right_aws 1.11.1 → 1.11.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +1 -0
- data/lib/ec2/right_ec2_ebs.rb +451 -0
- data/lib/ec2/right_ec2_images.rb +373 -0
- data/lib/ec2/right_ec2_instances.rb +760 -0
- data/lib/ec2/right_ec2_monitoring.rb +70 -0
- data/lib/ec2/right_ec2_reserved_instances.rb +167 -0
- data/lib/ec2/right_ec2_vpc.rb +571 -0
- data/lib/rds/right_rds_interface.rb +998 -0
- data/test/rds/test_helper.rb +2 -0
- data/test/rds/test_right_rds.rb +120 -0
- metadata +13 -4
@@ -0,0 +1,120 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/test_helper.rb'
|
2
|
+
|
3
|
+
class TestRds < Test::Unit::TestCase
|
4
|
+
|
5
|
+
STDOUT.sync = true
|
6
|
+
|
7
|
+
TEST_SG_NAME = 'RightRdsSGTest0123456789'
|
8
|
+
|
9
|
+
def setup
|
10
|
+
@rds = Rightscale::RdsInterface.new(TestCredentials.aws_access_key_id, TestCredentials.aws_secret_access_key, :logger => Logger.new('/dev/null'))
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_00_instances
|
14
|
+
assert_nothing_raised do
|
15
|
+
items = @rds.describe_db_instances
|
16
|
+
assert items.is_a?(Array)
|
17
|
+
end
|
18
|
+
#
|
19
|
+
assert_nothing_raised do
|
20
|
+
@rds.describe_db_instances do |response|
|
21
|
+
assert response.is_a?(Hash)
|
22
|
+
assert response[:db_instances].is_a?(Array)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def test_10_security_groups
|
28
|
+
assert_nothing_raised do
|
29
|
+
items = @rds.describe_db_security_groups
|
30
|
+
assert items.is_a?(Array)
|
31
|
+
end
|
32
|
+
#
|
33
|
+
assert_nothing_raised do
|
34
|
+
@rds.describe_db_security_groups do |response|
|
35
|
+
assert response.is_a?(Hash)
|
36
|
+
assert response[:db_security_groups].is_a?(Array)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def test_11_remove_security_group
|
42
|
+
@rds.delete_db_security_group rescue nil
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_12_create_security_group
|
46
|
+
sg = nil
|
47
|
+
assert_nothing_raised do
|
48
|
+
sg = @rds.create_db_security_group(TEST_SG_NAME, 'sg-description')
|
49
|
+
end
|
50
|
+
assert sg.is_a?(Hash)
|
51
|
+
end
|
52
|
+
|
53
|
+
def test_13_authorize
|
54
|
+
assert_nothing_raised do
|
55
|
+
sg = @rds.authorize_db_security_group_ingress(TEST_SG_NAME, :cidrip => '131.0.0.1/8')
|
56
|
+
assert sg.is_a?(Hash)
|
57
|
+
assert_equal 1, sg[:ip_ranges].size
|
58
|
+
end
|
59
|
+
assert_nothing_raised do
|
60
|
+
sg = @rds.authorize_db_security_group_ingress(TEST_SG_NAME, :ec2_security_group_owner => '826693181925',
|
61
|
+
:ec2_security_group_name => 'default' )
|
62
|
+
assert sg.is_a?(Hash)
|
63
|
+
assert_equal 1, sg[:ec2_security_groups].size
|
64
|
+
end
|
65
|
+
sleep 30
|
66
|
+
end
|
67
|
+
|
68
|
+
def test_14_revoke
|
69
|
+
assert_nothing_raised do
|
70
|
+
sg = @rds.revoke_db_security_group_ingress(TEST_SG_NAME, :cidrip => '131.0.0.1/8')
|
71
|
+
assert sg.is_a?(Hash)
|
72
|
+
end
|
73
|
+
assert_nothing_raised do
|
74
|
+
sg = @rds.revoke_db_security_group_ingress(TEST_SG_NAME, :ec2_security_group_owner => '826693181925',
|
75
|
+
:ec2_security_group_name => 'default' )
|
76
|
+
assert sg.is_a?(Hash)
|
77
|
+
end
|
78
|
+
sleep 30
|
79
|
+
#
|
80
|
+
sg = @rds.describe_db_security_groups(TEST_SG_NAME).first
|
81
|
+
assert_equal 0, sg[:ip_ranges].size
|
82
|
+
assert_equal 0, sg[:ec2_security_groups].size
|
83
|
+
end
|
84
|
+
|
85
|
+
def test_15_delete_security_group
|
86
|
+
assert_nothing_raised do
|
87
|
+
@rds.delete_db_security_group(TEST_SG_NAME)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
|
92
|
+
def test_20_db_snapshots
|
93
|
+
assert_nothing_raised do
|
94
|
+
items = @rds.describe_db_snapshots
|
95
|
+
assert items.is_a?(Array)
|
96
|
+
end
|
97
|
+
#
|
98
|
+
assert_nothing_raised do
|
99
|
+
@rds.describe_db_snapshots do |response|
|
100
|
+
assert response.is_a?(Hash)
|
101
|
+
assert response[:db_snapshots].is_a?(Array)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
|
106
|
+
def test_30_events
|
107
|
+
assert_nothing_raised do
|
108
|
+
items = @rds.describe_events
|
109
|
+
assert items.is_a?(Array)
|
110
|
+
end
|
111
|
+
#
|
112
|
+
assert_nothing_raised do
|
113
|
+
@rds.describe_events do |response|
|
114
|
+
assert response.is_a?(Hash)
|
115
|
+
assert response[:events].is_a?(Array)
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redaranj-right_aws
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.11.
|
4
|
+
version: 1.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- RightScale, Inc.
|
@@ -42,8 +42,17 @@ files:
|
|
42
42
|
- lib/awsbase/right_awsbase.rb
|
43
43
|
- lib/awsbase/support.rb
|
44
44
|
- lib/ec2/right_ec2.rb
|
45
|
+
- lib/ec2/right_ec2_images.rb
|
46
|
+
- lib/ec2/right_ec2_instances.rb
|
47
|
+
- lib/ec2/right_ec2_ebs.rb
|
48
|
+
- lib/ec2/right_ec2_reserved_instances.rb
|
49
|
+
- lib/ec2/right_ec2_vpc.rb
|
50
|
+
- lib/ec2/right_ec2_monitoring.rb
|
45
51
|
- lib/right_aws.rb
|
46
52
|
- lib/s3/right_s3.rb
|
53
|
+
- lib/acw/right_acw_interface.rb
|
54
|
+
- lib/elb/right_elb_interface.rb
|
55
|
+
- lib/as/right_as_interface.rb
|
47
56
|
- lib/s3/right_s3_interface.rb
|
48
57
|
- lib/sdb/active_sdb.rb
|
49
58
|
- lib/sdb/right_sdb_interface.rb
|
@@ -52,9 +61,7 @@ files:
|
|
52
61
|
- lib/sqs/right_sqs_gen2_interface.rb
|
53
62
|
- lib/sqs/right_sqs_interface.rb
|
54
63
|
- lib/acf/right_acf_interface.rb
|
55
|
-
- lib/
|
56
|
-
- lib/as/right_as_interface.rb
|
57
|
-
- lib/acw/right_acw_interface.rb
|
64
|
+
- lib/rds/right_rds_interface.rb
|
58
65
|
- test/ec2/test_helper.rb
|
59
66
|
- test/ec2/test_right_ec2.rb
|
60
67
|
- test/http_connection.rb
|
@@ -71,6 +78,8 @@ files:
|
|
71
78
|
- test/ts_right_aws.rb
|
72
79
|
- test/acf/test_helper.rb
|
73
80
|
- test/acf/test_right_acf.rb
|
81
|
+
- test/rds/test_helper.rb
|
82
|
+
- test/rds/test_right_rds.rb
|
74
83
|
has_rdoc: true
|
75
84
|
homepage:
|
76
85
|
licenses: []
|