beaker-aws 0.1.0
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.
- checksums.yaml +15 -0
- data/.gitignore +25 -0
- data/.simplecov +9 -0
- data/Gemfile +27 -0
- data/LICENSE +202 -0
- data/README.md +37 -0
- data/Rakefile +160 -0
- data/acceptance/config/nodes/hosts.yml +40 -0
- data/aws.md +149 -0
- data/beaker-aws.gemspec +37 -0
- data/bin/beaker-aws +32 -0
- data/config/image_templates/ec2.yaml +5 -0
- data/ec2.md +82 -0
- data/lib/beaker/hypervisor/aws_sdk.rb +1001 -0
- data/lib/beaker/hypervisor/ec2.rb +10 -0
- data/lib/beaker/hypervisor/ec2_helper.rb +42 -0
- data/lib/beaker-aws/version.rb +3 -0
- data/spec/beaker/hypervisor/aws_sdk_spec.rb +1018 -0
- data/spec/beaker/hypervisor/ec2_helper_spec.rb +44 -0
- data/spec/spec_helper.rb +17 -0
- metadata +218 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'beaker/hypervisor/aws_sdk'
|
2
|
+
|
3
|
+
# This parent class is used because beaker accepts 'ec2' as hypervisor argument for AWS hosts
|
4
|
+
# Beaker then will convert 'ec2' to 'Ec2' therefore the classname
|
5
|
+
# Naming it 'Ec2' class will also prevent conflicts with AWS's 'EC2' fs class
|
6
|
+
|
7
|
+
module Beaker
|
8
|
+
class Ec2 < AwsSdk
|
9
|
+
end
|
10
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
module Beaker
|
2
|
+
class EC2Helper
|
3
|
+
# Return a list of open ports for testing based on a hosts role
|
4
|
+
#
|
5
|
+
# @todo horribly hard-coded
|
6
|
+
# @param [Host] host to find ports for
|
7
|
+
# @return [Array<Number>] array of port numbers
|
8
|
+
# @api private
|
9
|
+
def self.amiports(host)
|
10
|
+
ports = [22, 61613, 8139]
|
11
|
+
|
12
|
+
roles = host['roles']
|
13
|
+
|
14
|
+
if roles.include? 'database'
|
15
|
+
ports << 5432
|
16
|
+
ports << 8080
|
17
|
+
ports << 8081
|
18
|
+
end
|
19
|
+
|
20
|
+
if roles.include? 'master'
|
21
|
+
ports << 8140
|
22
|
+
ports << 8142
|
23
|
+
end
|
24
|
+
|
25
|
+
if roles.include? 'dashboard'
|
26
|
+
ports << 443
|
27
|
+
ports << 4433
|
28
|
+
ports << 4435
|
29
|
+
end
|
30
|
+
|
31
|
+
# If they only specified one port in the host config file, YAML will have converted it
|
32
|
+
# into a string, but if it was more than one, an array.
|
33
|
+
user_ports = []
|
34
|
+
if host.has_key?('additional_ports')
|
35
|
+
user_ports = host['additional_ports'].is_a?(Array) ? host['additional_ports'] : [host['additional_ports']]
|
36
|
+
end
|
37
|
+
|
38
|
+
additional_ports = ports + user_ports
|
39
|
+
additional_ports.uniq
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|