beaker 1.21.0 → 2.0.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.
Files changed (103) hide show
  1. checksums.yaml +8 -8
  2. data/.gitignore +1 -0
  3. data/.rspec +1 -0
  4. data/CONTRIBUTING.md +1 -0
  5. data/HISTORY.md +17288 -2
  6. data/Rakefile +6 -2
  7. data/beaker.gemspec +15 -19
  8. data/lib/beaker.rb +2 -5
  9. data/lib/beaker/answers.rb +2 -0
  10. data/lib/beaker/answers/version34.rb +37 -1
  11. data/lib/beaker/cli.rb +4 -0
  12. data/lib/beaker/command.rb +16 -84
  13. data/lib/beaker/command_factory.rb +13 -2
  14. data/lib/beaker/dsl/assertions.rb +25 -2
  15. data/lib/beaker/dsl/ezbake_utils.rb +2 -2
  16. data/lib/beaker/dsl/helpers.rb +66 -12
  17. data/lib/beaker/dsl/install_utils.rb +128 -66
  18. data/lib/beaker/dsl/wrappers.rb +41 -3
  19. data/lib/beaker/host.rb +42 -6
  20. data/lib/beaker/host/mac.rb +62 -0
  21. data/lib/beaker/host/mac/group.rb +96 -0
  22. data/lib/beaker/host/mac/user.rb +93 -0
  23. data/lib/beaker/host/unix/exec.rb +1 -1
  24. data/lib/beaker/host/unix/pkg.rb +11 -11
  25. data/lib/beaker/host/windows.rb +4 -4
  26. data/lib/beaker/host_prebuilt_steps.rb +194 -58
  27. data/lib/beaker/hypervisor.rb +16 -9
  28. data/lib/beaker/hypervisor/aws_sdk.rb +61 -17
  29. data/lib/beaker/hypervisor/docker.rb +14 -2
  30. data/lib/beaker/hypervisor/ec2_helper.rb +15 -3
  31. data/lib/beaker/hypervisor/vagrant.rb +22 -10
  32. data/lib/beaker/hypervisor/vagrant_libvirt.rb +11 -0
  33. data/lib/beaker/hypervisor/vagrant_virtualbox.rb +1 -1
  34. data/lib/beaker/hypervisor/vcloud_pooled.rb +8 -39
  35. data/lib/beaker/logger.rb +15 -9
  36. data/lib/beaker/network_manager.rb +2 -2
  37. data/lib/beaker/options/command_line_parser.rb +1 -1
  38. data/lib/beaker/options/parser.rb +1 -8
  39. data/lib/beaker/options/presets.rb +70 -45
  40. data/lib/beaker/perf.rb +3 -4
  41. data/lib/beaker/platform.rb +2 -1
  42. data/lib/beaker/result.rb +3 -9
  43. data/lib/beaker/ssh_connection.rb +2 -0
  44. data/lib/beaker/test_case.rb +2 -21
  45. data/lib/beaker/test_suite.rb +21 -25
  46. data/lib/beaker/version.rb +1 -1
  47. data/spec/beaker/answers_spec.rb +36 -0
  48. data/spec/beaker/cli_spec.rb +45 -45
  49. data/spec/beaker/command_spec.rb +25 -36
  50. data/spec/beaker/dsl/assertions_spec.rb +20 -27
  51. data/spec/beaker/dsl/ezbake_utils_spec.rb +5 -5
  52. data/spec/beaker/dsl/helpers_spec.rb +293 -208
  53. data/spec/beaker/dsl/install_utils_spec.rb +310 -189
  54. data/spec/beaker/dsl/outcomes_spec.rb +6 -6
  55. data/spec/beaker/dsl/roles_spec.rb +27 -18
  56. data/spec/beaker/dsl/structure_spec.rb +11 -11
  57. data/spec/beaker/dsl/wrappers_spec.rb +35 -11
  58. data/spec/beaker/host/mac/group_spec.rb +124 -0
  59. data/spec/beaker/host/mac/user_spec.rb +134 -0
  60. data/spec/beaker/host/unix/pkg_spec.rb +40 -24
  61. data/spec/beaker/host/windows/group_spec.rb +1 -1
  62. data/spec/beaker/host_prebuilt_steps_spec.rb +194 -68
  63. data/spec/beaker/host_spec.rb +145 -67
  64. data/spec/beaker/hypervisor/aixer_spec.rb +6 -6
  65. data/spec/beaker/hypervisor/aws_sdk_spec.rb +22 -7
  66. data/spec/beaker/hypervisor/docker_spec.rb +71 -50
  67. data/spec/beaker/hypervisor/ec2_helper_spec.rb +25 -4
  68. data/spec/beaker/hypervisor/fusion_spec.rb +2 -2
  69. data/spec/beaker/hypervisor/hypervisor_spec.rb +20 -27
  70. data/spec/beaker/hypervisor/hypervisor_spec.rb.orig +80 -0
  71. data/spec/beaker/hypervisor/solaris_spec.rb +8 -8
  72. data/spec/beaker/hypervisor/vagrant_fusion_spec.rb +6 -8
  73. data/spec/beaker/hypervisor/vagrant_libvirt_spec.rb +34 -0
  74. data/spec/beaker/hypervisor/vagrant_spec.rb +34 -33
  75. data/spec/beaker/hypervisor/vagrant_virtualbox_spec.rb +18 -8
  76. data/spec/beaker/hypervisor/vagrant_workstation_spec.rb +6 -8
  77. data/spec/beaker/hypervisor/vcloud_pooled_spec.rb +8 -8
  78. data/spec/beaker/hypervisor/vcloud_spec.rb +10 -10
  79. data/spec/beaker/hypervisor/vsphere_helper_spec.rb +8 -8
  80. data/spec/beaker/hypervisor/vsphere_spec.rb +1 -1
  81. data/spec/beaker/logger_spec.rb +45 -31
  82. data/spec/beaker/options/command_line_parser_spec.rb +10 -2
  83. data/spec/beaker/options/hosts_file_parser_spec.rb +9 -2
  84. data/spec/beaker/options/options_hash_spec.rb +2 -2
  85. data/spec/beaker/options/parser_spec.rb +2 -2
  86. data/spec/beaker/options/pe_version_scaper_spec.rb +6 -1
  87. data/spec/beaker/options/presets_spec.rb +11 -1
  88. data/spec/beaker/shared/error_handler_spec.rb +5 -5
  89. data/spec/beaker/shared/host_manager_spec.rb +3 -2
  90. data/spec/beaker/shared/repetition_spec.rb +18 -18
  91. data/spec/beaker/ssh_connection_spec.rb +33 -4
  92. data/spec/beaker/test_case_spec.rb +9 -9
  93. data/spec/beaker/test_suite_spec.rb +14 -14
  94. data/spec/helpers.rb +4 -4
  95. data/spec/matchers.rb +4 -4
  96. data/spec/mocks.rb +5 -1
  97. data/spec/spec_helper.rb +2 -8
  98. metadata +114 -80
  99. data/lib/beaker/hypervisor/blimper.rb +0 -108
  100. data/spec/beaker/hypervisor/blimper_spec.rb +0 -42
  101. data/spec/beaker/options/data/LATEST +0 -1
  102. data/spec/beaker/puppet_command_spec.rb +0 -161
  103. data/spec/mock_blimpy.rb +0 -48
@@ -8,7 +8,7 @@ module Beaker
8
8
  @hosts = hosts
9
9
 
10
10
  # increase the http timeouts as provisioning images can be slow
11
- ::Docker.options = { :write_timeout => 300, :read_timeout => 300 }
11
+ ::Docker.options = { :write_timeout => 300, :read_timeout => 300 }.merge(::Docker.options || {})
12
12
  # assert that the docker-api gem can talk to your docker
13
13
  # enpoint. Will raise if there is a version mismatch
14
14
  ::Docker.validate_version!
@@ -111,11 +111,18 @@ module Beaker
111
111
  # add platform-specific actions
112
112
  case host['platform']
113
113
  when /ubuntu/, /debian/
114
+ sshd_options = '-o "PermitRootLogin yes" -o "PasswordAuthentication yes"'
114
115
  dockerfile += <<-EOF
115
116
  RUN apt-get update
116
117
  RUN apt-get install -y openssh-server openssh-client #{Beaker::HostPrebuiltSteps::DEBIAN_PACKAGES.join(' ')}
117
118
  EOF
118
- when /^el-/, /centos/, /fedora/, /redhat/
119
+ when /cumulus/
120
+ sshd_options = '-o "PermitRootLogin yes" -o "PasswordAuthentication yes"'
121
+ dockerfile += <<-EOF
122
+ RUN apt-get update
123
+ RUN apt-get install -y openssh-server openssh-client #{Beaker::HostPrebuiltSteps::CUMULUS_PACKAGES.join(' ')}
124
+ EOF
125
+ when /^el-/, /centos/, /fedora/, /redhat/, /eos/
119
126
  dockerfile += <<-EOF
120
127
  RUN yum clean all
121
128
  RUN yum install -y sudo openssh-server openssh-clients #{Beaker::HostPrebuiltSteps::UNIX_PACKAGES.join(' ')}
@@ -145,6 +152,11 @@ module Beaker
145
152
  "RUN #{command}\n"
146
153
  }.join('')
147
154
 
155
+ # Override image entrypoint
156
+ if host['docker_image_entrypoint']
157
+ dockerfile += "ENTRYPOINT #{host['docker_image_entrypoint']}\n"
158
+ end
159
+
148
160
  # How to start a sshd on port 22. May be an init for more supervision
149
161
  cmd = host['docker_cmd'] || "/usr/sbin/sshd -D #{sshd_options}"
150
162
  dockerfile += <<-EOF
@@ -3,13 +3,16 @@ module Beaker
3
3
  # Return a list of open ports for testing based on a hosts role
4
4
  #
5
5
  # @todo horribly hard-coded
6
- # @param [Array<String>] roles An array of roles
6
+ # @param [Host] host to find ports for
7
7
  # @return [Array<Number>] array of port numbers
8
8
  # @api private
9
- def self.amiports(roles)
9
+ def self.amiports(host)
10
10
  ports = [22, 61613, 8139]
11
11
 
12
+ roles = host['roles']
13
+
12
14
  if roles.include? 'database'
15
+ ports << 5432
13
16
  ports << 8080
14
17
  ports << 8081
15
18
  end
@@ -20,10 +23,19 @@ module Beaker
20
23
 
21
24
  if roles.include? 'dashboard'
22
25
  ports << 443
26
+ ports << 4433
23
27
  ports << 4435
24
28
  end
25
29
 
26
- ports
30
+ # If they only specified one port in the host config file, YAML will have converted it
31
+ # into a string, but if it was more than one, an array.
32
+ user_ports = []
33
+ if host.has_key?('additional_ports')
34
+ user_ports = host['additional_ports'].is_a?(Array) ? host['additional_ports'] : [host['additional_ports']]
35
+ end
36
+
37
+ additional_ports = ports + user_ports
38
+ additional_ports.uniq
27
39
  end
28
40
  end
29
41
  end
@@ -58,14 +58,17 @@ module Beaker
58
58
  def set_ssh_config host, user
59
59
  f = Tempfile.new("#{host.name}")
60
60
  ssh_config = Dir.chdir(@vagrant_path) do
61
- result = `vagrant ssh-config #{host.name}`
62
- if $?.to_i != 0
63
- raise "Failed to vagrant ssh-config for #{host.name}"
61
+ stdin, stdout, stderr, wait_thr = Open3.popen3('vagrant', 'ssh-config', host.name)
62
+ if not wait_thr.value.success?
63
+ raise "Failed to 'vagrant ssh-config' for #{host.name}"
64
64
  end
65
- result
65
+ stdout.read
66
66
  end
67
67
  #replace hostname with ip
68
68
  ssh_config = ssh_config.gsub(/#{host.name}/, host['ip']) unless not host['ip']
69
+ if host['platform'] =~ /windows/
70
+ ssh_config = ssh_config.gsub(/127\.0\.0\.1/, host['ip']) unless not host['ip']
71
+ end
69
72
  #set the user
70
73
  ssh_config = ssh_config.gsub(/User vagrant/, "User #{user}")
71
74
  f.write(ssh_config)
@@ -128,7 +131,10 @@ module Beaker
128
131
 
129
132
  set_ssh_config host, 'vagrant'
130
133
 
134
+ #copy vagrant's keys to roots home dir, to allow for login as root
131
135
  copy_ssh_to_root host, @options
136
+ #ensure that root login is enabled for this host
137
+ enable_root_login host, @options
132
138
  #shut down connection, will reconnect on next exec
133
139
  host.close
134
140
 
@@ -151,12 +157,18 @@ module Beaker
151
157
 
152
158
  def vagrant_cmd(args)
153
159
  Dir.chdir(@vagrant_path) do
154
- result = `vagrant #{args} 2>&1`
155
- result.each_line do |line|
156
- @logger.debug(line)
157
- end
158
- if $?.to_i != 0
159
- raise "Failed to exec 'vagrant #{args}'"
160
+ exit_status = 1
161
+ Open3.popen3("vagrant #{args}") {|stdin, stdout, stderr, wait_thr|
162
+ while line = stdout.gets
163
+ @logger.info(line)
164
+ end
165
+ if not wait_thr.value.success?
166
+ raise "Failed to exec 'vagrant #{args}'"
167
+ end
168
+ exit_status = wait_thr.value
169
+ }
170
+ if exit_status != 0
171
+ raise "Failed to execute vagrant_cmd ( #{args} )"
160
172
  end
161
173
  end
162
174
  end
@@ -0,0 +1,11 @@
1
+ require 'beaker/hypervisor/vagrant'
2
+
3
+ class Beaker::VagrantLibvirt < Beaker::Vagrant
4
+ def provision(provider = 'libvirt')
5
+ super
6
+ end
7
+
8
+ def self.provider_vfile_section(host, options)
9
+ " v.vm.provider :libvirt"
10
+ end
11
+ end
@@ -9,6 +9,7 @@ class Beaker::VagrantVirtualbox < Beaker::Vagrant
9
9
  provider_section = ""
10
10
  provider_section << " v.vm.provider :virtualbox do |vb|\n"
11
11
  provider_section << " vb.customize ['modifyvm', :id, '--memory', '#{options['vagrant_memsize'] ||= '1024'}']\n"
12
+ provider_section << " vb.vbguest.auto_update = false" if options[:vbguest_plugin] == 'disable'
12
13
  if host['disk_path']
13
14
  unless File.exist?(host['disk_path'])
14
15
  host['disk_path'] = File.join(host['disk_path'], "#{host.name}.vmdk")
@@ -17,7 +18,6 @@ class Beaker::VagrantVirtualbox < Beaker::Vagrant
17
18
  provider_section << " vb.customize ['storageattach', :id, '--storagectl', 'SATA Controller', '--port', 1, '--device', 0, '--type', 'hdd', '--medium','#{host['disk_path']}']\n"
18
19
  provider_section << " vb.customize [\"modifyvm\", :id, \"--natdnshostresolver1\", \"#{host['natdns']}\"]\n" unless host['natdns'].nil?
19
20
  provider_section << " vb.customize [\"modifyvm\", :id, \"--natdnsproxy1\", \"#{host['natdns']}\"]\n" unless host['natdns'].nil?
20
- provider_section << " end\n"
21
21
  end
22
22
  provider_section << " end\n"
23
23
 
@@ -19,37 +19,12 @@ module Beaker
19
19
  @options = options
20
20
  @logger = options[:logger]
21
21
  @hosts = vcloud_hosts
22
- @credentials = load_credentials(@options[:dot_fog])
23
22
 
24
23
  raise 'You must specify a datastore for vCloud instances!' unless @options['datastore']
25
24
  raise 'You must specify a resource pool for vCloud instances!' unless @options['resourcepool']
26
25
  raise 'You must specify a folder for vCloud instances!' unless @options['folder']
27
26
  end
28
27
 
29
- def load_credentials(dot_fog = '.fog')
30
- creds = {}
31
-
32
- if fog = read_fog_file(dot_fog)
33
- if fog[:default] && fog[:default][:vmpooler_token]
34
- creds[:vmpooler_token] = fog[:default][:vmpooler_token]
35
- else
36
- @logger.warn "Credentials file (#{dot_fog}) is missing a :default section with a :vmpooler_token value; proceeding without authentication"
37
- end
38
- else
39
- @logger.warn "Credentials file (#{dot_fog}) is empty; proceeding without authentication"
40
- end
41
-
42
- creds
43
-
44
- rescue Errno::ENOENT
45
- @logger.warn "Credentials file (#{dot_fog}) not found; proceeding without authentication"
46
- creds
47
- end
48
-
49
- def read_fog_file(dot_fog = '.fog')
50
- YAML.load_file(dot_fog)
51
- end
52
-
53
28
  def check_url url
54
29
  begin
55
30
  URI.parse(url)
@@ -77,7 +52,6 @@ module Beaker
77
52
 
78
53
  def provision
79
54
  start = Time.now
80
- try = 1
81
55
  @hosts.each_with_index do |h, i|
82
56
  if not h['template']
83
57
  raise ArgumentError, "You must specify a template name for #{h}"
@@ -89,22 +63,19 @@ module Beaker
89
63
 
90
64
  @logger.notify "Requesting '#{h['template']}' VM from vCloud host pool"
91
65
 
66
+ last_wait, wait = 0, 1
67
+ waited = 0 #the amount of time we've spent waiting for this host to provision
92
68
  begin
93
69
  uri = URI.parse(get_template_url(@options['pooling_api'], h['template']))
94
70
 
95
71
  http = Net::HTTP.new( uri.host, uri.port )
96
72
  request = Net::HTTP::Post.new(uri.request_uri)
97
73
 
98
- if @credentials[:vmpooler_token]
99
- request['X-AUTH-TOKEN'] = @credentials[:vmpooler_token]
100
- end
101
-
102
74
  request.set_form_data({'pool' => @options['resourcepool'], 'folder' => 'foo'})
103
75
 
104
- attempts = @options[:timeout].to_i / 5
105
76
  response = http.request(request)
106
77
  parsed_response = JSON.parse(response.body)
107
- if parsed_response[h['template']] && parsed_response['ok'] && parsed_response[h['template']]['hostname']
78
+ if parsed_response[h['template']] && parsed_response[h['template']]['ok'] && parsed_response[h['template']]['hostname']
108
79
  hostname = parsed_response[h['template']]['hostname']
109
80
  domain = parsed_response['domain']
110
81
  h['vmhostname'] = domain ? "#{hostname}.#{domain}" : hostname
@@ -112,9 +83,11 @@ module Beaker
112
83
  raise "VcloudPooled.provision - no vCloud host free for #{h.name} in pool"
113
84
  end
114
85
  rescue JSON::ParserError, RuntimeError, *SSH_EXCEPTIONS => e
115
- if try <= attempts
116
- sleep 5
117
- try += 1
86
+ if waited <= @options[:timeout].to_i
87
+ @logger.debug("Retrying provision for vCloud host #{h.name} after waiting #{wait} second(s) (failed with #{e.class})")
88
+ sleep wait
89
+ waited += wait
90
+ last_wait, wait = wait, last_wait + wait
118
91
  retry
119
92
  end
120
93
  report_and_raise(@logger, e, 'vCloudPooled.provision')
@@ -141,10 +114,6 @@ module Beaker
141
114
  http = Net::HTTP.new( uri.host, uri.port )
142
115
  request = Net::HTTP::Delete.new(uri.request_uri)
143
116
 
144
- if @credentials[:vmpooler_token]
145
- request['X-AUTH-TOKEN'] = @credentials[:vmpooler_token]
146
- end
147
-
148
117
  begin
149
118
  response = http.request(request)
150
119
  rescue *SSH_EXCEPTIONS => e
@@ -169,15 +169,9 @@ module Beaker
169
169
  convert s
170
170
  end
171
171
  else
172
- if string.respond_to?( :force_encoding )
173
- # We're running in >= 1.9 and we'll need to convert
174
- # Remove invalid and undefined UTF-8 character encodings
175
- string.force_encoding('UTF-8')
176
- return string.chars.select{|i| i.valid_encoding?}.join
177
- else
178
- # We're running 1.8, do nothing
179
- string
180
- end
172
+ # Remove invalid and undefined UTF-8 character encodings
173
+ string.force_encoding('UTF-8')
174
+ return string.chars.select{|i| i.valid_encoding?}.join
181
175
  end
182
176
  end
183
177
 
@@ -306,6 +300,18 @@ module Beaker
306
300
  @sublog.read
307
301
  end
308
302
 
303
+ # Utility method to centralize dated log folder generation
304
+ #
305
+ # @param [String] base_dir path of the directory for the dated log folder to live in
306
+ # @param [Time] timestamp the timestamp that should be used to generate the dated log folder
307
+ #
308
+ # @return [String] the path of the dated log folder generated
309
+ def Logger.generate_dated_log_folder(base_dir, timestamp)
310
+ log_dir = File.join(base_dir, timestamp.strftime("%F_%H_%M_%S"))
311
+ FileUtils.mkdir_p(log_dir) unless File.directory?(log_dir)
312
+ log_dir
313
+ end
314
+
309
315
  private
310
316
  # Expand each symlink found to its full path
311
317
  # Lines are assumed to be in the format "String : Integer"
@@ -75,10 +75,10 @@ module Beaker
75
75
 
76
76
  # configure proxy on all provioned machines
77
77
  #@raise [Exception] Raise an exception if virtual machines fail to be configured
78
- def package_proxy
78
+ def proxy_package_manager
79
79
  if @hypervisors
80
80
  @hypervisors.each_key do |type|
81
- @hypervisors[type].package_proxy
81
+ @hypervisors[type].proxy_package_manager
82
82
  end
83
83
  end
84
84
  end
@@ -155,7 +155,7 @@ module Beaker
155
155
  end
156
156
 
157
157
  opts.on '--repo-proxy',
158
- 'Proxy packaging repositories on ubuntu, debian and solaris-11',
158
+ 'Proxy packaging repositories on ubuntu, debian, cumulus and solaris-11',
159
159
  '(default: false)' do
160
160
  @cmd_options[:repo_proxy] = true
161
161
  end
@@ -11,7 +11,7 @@ module Beaker
11
11
  #These options expand out into an array of .rb files
12
12
  RB_FILE_OPTS = [:tests, :pre_suite, :post_suite]
13
13
 
14
- PARSE_ERROR = if RUBY_VERSION > '1.8.7'; then Psych::SyntaxError; else ArgumentError; end
14
+ PARSE_ERROR = Psych::SyntaxError
15
15
 
16
16
  #The OptionsHash of all parsed options
17
17
  attr_accessor :options
@@ -240,7 +240,6 @@ module Beaker
240
240
  # - --fail-mode is one of 'fast', 'stop' or nil
241
241
  # - if using blimpy hypervisor an EC2 YAML file exists
242
242
  # - if using the aix, solaris, or vcloud hypervisors a .fog file exists
243
- # - if using docker hypervisor are using RUBY 1.9+
244
243
  # - that one and only one master is defined per set of hosts
245
244
  # - that solaris/windows/aix hosts are agent only for PE tests OR
246
245
  # - that windows/aix host are agent only if type is not 'pe'
@@ -307,12 +306,6 @@ module Beaker
307
306
  check_yaml_file(@options[:dot_fog], "required by #{visor}")
308
307
  end
309
308
  end
310
- #if using docker need ruby 1.9+
311
- if hypervisors.include?('docker')
312
- if RUBY_VERSION < '1.9'
313
- parser_error "Cannot use the 'docker' hypervisor on Ruby < 1.9 (using #{RUBY_VERSION})"
314
- end
315
- end
316
309
 
317
310
  #check that roles of hosts make sense
318
311
  # - must be one and only one master
@@ -26,6 +26,7 @@ module Beaker
26
26
  :release_apt_repo_url => ['BEAKER_RELEASE_APT_REPO', 'RELEASE_APT_REPO'],
27
27
  :release_yum_repo_url => ['BEAKER_RELEASE_YUM_REPO', 'RELEASE_YUM_REPO'],
28
28
  :dev_builds_url => ['BEAKER_DEV_BUILDS_URL', 'DEV_BUILDS_URL'],
29
+ :vbguest_plugin => ['BEAKER_VB_GUEST_PLUGIN', 'BEAKER_vb_guest_plugin'],
29
30
  }
30
31
 
31
32
  # Select all environment variables whose name matches provided regex
@@ -64,7 +65,19 @@ module Beaker
64
65
  # @return [Hash] Environment config values formatted appropriately
65
66
  def format_found_env_vars( found_env_vars )
66
67
  found_env_vars[:consoleport] &&= found_env_vars[:consoleport].to_i
67
- found_env_vars[:type] = found_env_vars[:is_pe] == 'true' || found_env_vars[:is_pe] == 'yes' ? 'pe' : nil
68
+
69
+ if found_env_vars[:is_pe]
70
+ is_pe_val = found_env_vars[:is_pe]
71
+ type = case is_pe_val
72
+ when /yes|true/ then 'pe'
73
+ when /no|false/ then 'foss'
74
+ else
75
+ raise "Invalid value for one of #{ENVIRONMENT_SPEC[:is_pe].join(' ,')}: #{is_pe_val}"
76
+ end
77
+
78
+ found_env_vars[:type] = type
79
+ end
80
+
68
81
  found_env_vars[:pe_version_file_win] = found_env_vars[:pe_version_file]
69
82
  found_env_vars
70
83
  end
@@ -96,45 +109,48 @@ module Beaker
96
109
  def presets
97
110
  h = Beaker::Options::OptionsHash.new
98
111
  h.merge({
99
- :project => 'Beaker',
100
- :department => ENV['USER'] || ENV['USERNAME'] || 'unknown',
101
- :validate => true,
102
- :jenkins_build_url => nil,
103
- :log_level => 'verbose',
104
- :trace_limit => 10,
105
- :"master-start-curl-retries" => 120,
106
- :options_file => nil,
107
- :type => 'pe',
108
- :provision => true,
109
- :preserve_hosts => 'never',
110
- :root_keys => false,
111
- :quiet => false,
112
- :project_root => File.expand_path(File.join(File.dirname(__FILE__), "../")),
113
- :xml_dir => 'junit',
114
- :xml_file => 'beaker_junit.xml',
115
- :xml_stylesheet => 'junit.xsl',
116
- :log_dir => 'log',
117
- :color => true,
118
- :dry_run => false,
119
- :timeout => 300,
120
- :fail_mode => 'slow',
121
- :timesync => false,
122
- :disable_iptables => false,
123
- :repo_proxy => false,
124
- :package_proxy => false,
125
- :add_el_extras => false,
126
- :release_apt_repo_url => "http://apt.puppetlabs.com",
127
- :release_yum_repo_url => "http://yum.puppetlabs.com",
128
- :dev_builds_url => "http://builds.delivery.puppetlabs.net",
129
- :epel_url => "http://mirrors.kernel.org/fedora-epel",
130
- :epel_arch => "i386",
131
- :epel_6_pkg => "epel-release-6-8.noarch.rpm",
132
- :epel_5_pkg => "epel-release-5-4.noarch.rpm",
133
- :consoleport => 443,
134
- :pe_dir => '/opt/enterprise/dists',
135
- :pe_version_file => 'LATEST',
136
- :pe_version_file_win => 'LATEST-win',
137
- :answers => {
112
+ :project => 'Beaker',
113
+ :department => ENV['USER'] || ENV['USERNAME'] || 'unknown',
114
+ :validate => true,
115
+ :jenkins_build_url => nil,
116
+ :log_level => 'info',
117
+ :trace_limit => 10,
118
+ :"master-start-curl-retries" => 120,
119
+ :options_file => nil,
120
+ :type => 'pe',
121
+ :provision => true,
122
+ :preserve_hosts => 'never',
123
+ :root_keys => false,
124
+ :quiet => false,
125
+ :project_root => File.expand_path(File.join(File.dirname(__FILE__), "../")),
126
+ :xml_dir => 'junit',
127
+ :xml_file => 'beaker_junit.xml',
128
+ :xml_stylesheet => 'junit.xsl',
129
+ :log_dir => 'log',
130
+ :color => true,
131
+ :dry_run => false,
132
+ :timeout => 300,
133
+ :fail_mode => 'slow',
134
+ :accept_all_exit_codes => false,
135
+ :timesync => false,
136
+ :disable_iptables => false,
137
+ :repo_proxy => false,
138
+ :package_proxy => false,
139
+ :add_el_extras => false,
140
+ :release_apt_repo_url => "http://apt.puppetlabs.com",
141
+ :release_yum_repo_url => "http://yum.puppetlabs.com",
142
+ :dev_builds_url => "http://builds.delivery.puppetlabs.net",
143
+ :epel_url => "http://mirrors.kernel.org/fedora-epel",
144
+ :epel_arch => "i386",
145
+ :epel_6_pkg => "epel-release-6-8.noarch.rpm",
146
+ :epel_5_pkg => "epel-release-5-4.noarch.rpm",
147
+ :consoleport => 443,
148
+ :pe_dir => '/opt/enterprise/dists',
149
+ :pe_version_file => 'LATEST',
150
+ :pe_version_file_win => 'LATEST-win',
151
+ :host_env => {},
152
+ :ssh_env_file => '~/.ssh/environment',
153
+ :answers => {
138
154
  :q_puppet_enterpriseconsole_auth_user_email => 'admin@example.com',
139
155
  :q_puppet_enterpriseconsole_auth_password => '~!@#$%^*-/ aZ',
140
156
  :q_puppet_enterpriseconsole_smtp_port => 25,
@@ -153,12 +169,21 @@ module Beaker
153
169
  :q_puppetdb_database_user => 'mYpdBu3r',
154
170
  :q_database_port => 5432,
155
171
  :q_puppetdb_port => 8081,
172
+ :q_classifier_database_user => 'DFGhjlkj',
173
+ :q_database_name => 'pe-classifier',
174
+ :q_classifier_database_password => '~!@#$%^*-/ aZ',
175
+ :q_activity_database_user => 'adsfglkj',
176
+ :q_activity_database_name => 'pe-activity',
177
+ :q_activity_database_password => '~!@#$%^*-/ aZ',
178
+ :q_rbac_database_user => 'RbhNBklm',
179
+ :q_rbac_database_name => 'pe-rbac',
180
+ :q_rbac_database_password => '~!@#$%^*-/ aZ',
156
181
  },
157
- :dot_fog => File.join(ENV['HOME'], '.fog'),
158
- :ec2_yaml => 'config/image_templates/ec2.yaml',
159
- :help => false,
160
- :collect_perf_data => false,
161
- :ssh => {
182
+ :dot_fog => File.join(ENV['HOME'], '.fog'),
183
+ :ec2_yaml => 'config/image_templates/ec2.yaml',
184
+ :help => false,
185
+ :collect_perf_data => false,
186
+ :ssh => {
162
187
  :config => false,
163
188
  :paranoid => false,
164
189
  :timeout => 300,