beaker 2.29.1 → 2.30.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NDZlMGU2MGNjMGIzZmQxNzkyZjlhZjRhYmE1ODgwZDVlYTQ3ZTE3Yw==
4
+ M2FjYzE1ZjkzNDBiNTMwOTdjZTFlOTg5OTMzOTgzNDBkMzJlMzRmMA==
5
5
  data.tar.gz: !binary |-
6
- OGY0NDVlMDJiNTk4Mjg0Mzk4MjVjOTdjN2JlOGI4YmNhNTAwYjRlNQ==
6
+ OTA5NTY5ZTQ5YWE0OWU2NjVlNDVhMDBjYThiZmEwYTg2ODFiMTM3OA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NTYzNjJjODNkNDE1ZGU1MTYxNTQyMjZhZjM0MTQzZDc5MzQ4ZGM1Nzc4M2Y3
10
- YWRkNWRhYjQwMGQyZWU2Y2I3Y2FiN2QxMTI5YTk2NDAzMTUxZDU4NTU3MmQ0
11
- NGU0MWJiNzQ2N2JjMTYzMTMxYjQwNzA4NjdjN2ExNGRhOWJiZjY=
9
+ YmE0NjFmMmU2ZmU5OWMxMTY2YmI2YWUxOGE3MGVjZmNlYzMzNTgxYjg2Zjc5
10
+ ZTMwZGQ3OWQ5Y2Q5ZTc0NzgzY2M3NGJlZWE0ZTU4NjQxODA0MjdhNGQyNjE5
11
+ NDY3YTljMzcwYjJlNTgxOGNiMTAwZDc4NjM2MDVmOGY1NzgyODA=
12
12
  data.tar.gz: !binary |-
13
- ZjFiZmE3NzNiODg0ODgyZTAwMzNjMjhiMmY4YzA5MWU5NWQ1ZjlmZDI5YTY5
14
- MWVkY2U4NzZlMGEwNDY2YjU2MmM2NzRhOTEzYzRhOGVmNWMzYjk0N2FhODMx
15
- ZWQ0MzQ1MWRlYjFiNGIxMzQ5ZDM5MjllNzMzYzhlY2JjNDk0YjA=
13
+ ZWJlZmY0NzBlY2Q1ZjYyNDQxMDNmYzg0ZjE0OWE0N2NmMjBjZTVjMmE5OTNh
14
+ ODhjN2E5ZmYxOTg5ODYyMzQ3NjA5NTkwZDU0MmYxMTMyNTliM2YyNjNiMzUx
15
+ NzZiOGQ2ZDgyYjYyMWQ2MTc1NDQzOTk2ZTJlNzQ2NGQwZTk4YmM=
data/.gitignore CHANGED
@@ -8,6 +8,7 @@ Gemfile.lock
8
8
  options.rb
9
9
  test.cfg
10
10
  .yardoc
11
+ yard_docs
11
12
  coverage
12
13
  .bundle
13
14
  .vendor
data/HISTORY.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # default - History
2
2
  ## Tags
3
- * [LATEST - 23 Nov, 2015 (5781838d)](#LATEST)
3
+ * [LATEST - 2 Dec, 2015 (bc912e78)](#LATEST)
4
+ * [2.29.1 - 23 Nov, 2015 (5d824690)](#2.29.1)
4
5
  * [2.29.0 - 18 Nov, 2015 (33fd2399)](#2.29.0)
5
6
  * [2.28.0 - 4 Nov, 2015 (89829551)](#2.28.0)
6
7
  * [2.27.0 - 21 Oct, 2015 (0378d13a)](#2.27.0)
@@ -102,7 +103,272 @@
102
103
  * [pe1.2 - 6 Sep, 2011 (ba3dadd2)](#pe1.2)
103
104
 
104
105
  ## Details
105
- ### <a name = "LATEST">LATEST - 23 Nov, 2015 (5781838d)
106
+ ### <a name = "LATEST">LATEST - 2 Dec, 2015 (bc912e78)
107
+
108
+ * (GEM) update beaker version to 2.30.0 (bc912e78)
109
+
110
+ * Merge pull request #1013 from puppetlabs/bkr-623/test-runner-reorganization (6c613051)
111
+
112
+
113
+ ```
114
+ Merge pull request #1013 from puppetlabs/bkr-623/test-runner-reorganization
115
+
116
+ [BKR-623] Reorganize Beaker test runner classes for introduction of minitest runner
117
+ ```
118
+ * Merge pull request #1021 from kevpl/yard_gen_fix (5fcdb777)
119
+
120
+
121
+ ```
122
+ Merge pull request #1021 from kevpl/yard_gen_fix
123
+
124
+ (MAINT) updated yard doc location
125
+ ```
126
+ * Merge pull request #1016 from hunner/add_solaris (1245f155)
127
+
128
+
129
+ ```
130
+ Merge pull request #1016 from hunner/add_solaris
131
+
132
+ (BKR-472) (BKR-475) Fix solaris for install_pe_on with 2015.2
133
+ ```
134
+ * Merge pull request #1017 from adrienthebo/ruby-193-p194-platform-yaml-deserialize (d4854de2)
135
+
136
+
137
+ ```
138
+ Merge pull request #1017 from adrienthebo/ruby-193-p194-platform-yaml-deserialize
139
+
140
+ (BKR-634) Fix YAML deserialization for Beaker::Platform
141
+ ```
142
+ * Merge pull request #1008 from developerinlondon/master (6bdb61bc)
143
+
144
+
145
+ ```
146
+ Merge pull request #1008 from developerinlondon/master
147
+
148
+ (BKR-622) Fix Regular Expression to give correct Host IP Address
149
+ ```
150
+ * Merge pull request #1022 from bleach/fix_module_howto (125fd861)
151
+
152
+
153
+ ```
154
+ Merge pull request #1022 from bleach/fix_module_howto
155
+
156
+ (BKR-636) Fix module howto
157
+ ```
158
+ * (BKR-623) Make native runner name consistent (fdd904eb)
159
+
160
+
161
+ ```
162
+ (BKR-623) Make native runner name consistent
163
+
164
+ Prior to this we ended up in a state where the beaker native runner
165
+ was in the Beaker::Runner::Native module namespace, but textual and
166
+ --runner references to the runner used the name 'beaker'. This makes
167
+ them consistently 'native'.
168
+ ```
169
+ * (BKR-623) Stop advertising minitest runner in --help (1164b15c)
170
+
171
+
172
+ ```
173
+ (BKR-623) Stop advertising minitest runner in --help
174
+
175
+ We will wait until this is ready for prime time to mention it.
176
+ ```
177
+ * Merge pull request #1012 from kevpl/bkr609_pever_empty (bff4d847)
178
+
179
+
180
+ ```
181
+ Merge pull request #1012 from kevpl/bkr609_pever_empty
182
+
183
+ (BKR-609) added checks to make aio_version? more robust
184
+ ```
185
+ * (BKR-636) Specify module directory in spec helper (3635726c)
186
+
187
+
188
+ ```
189
+ (BKR-636) Specify module directory in spec helper
190
+
191
+ Unless this is specified, the module seems to be installed in
192
+ /etc/puppetlabs/puppet/modules, where it is not found by puppet.
193
+ ```
194
+ * (BKR-636) Tell the user to install pry (151d72fe)
195
+
196
+
197
+ ```
198
+ (BKR-636) Tell the user to install pry
199
+
200
+ The sample spec_helper requires pry, so we now tell the user to install it.
201
+ ```
202
+ * Merge pull request #1014 from heathseals/extraConfig (1317b33b)
203
+
204
+
205
+ ```
206
+ Merge pull request #1014 from heathseals/extraConfig
207
+
208
+ (BKR-635) Add VM hostname to VMX data during cloning operations
209
+ ```
210
+ * (MAINT) updated yard doc location (1c51fdee)
211
+
212
+
213
+ ```
214
+ (MAINT) updated yard doc location
215
+
216
+ Since moving the wiki docs into the repo itself, there's been
217
+ an issue where if you ran the yard rake tasks, you'd blow away
218
+ the in-repo docs, because the default yard doc location is the
219
+ same as the in-repo docs location: . This change makes
220
+ yard create the folder, and use it for local doc
221
+ generation
222
+ ```
223
+ * (BKR-634) Fix YAML deserialization for Beaker::Platform (2ddd8881)
224
+
225
+
226
+ ```
227
+ (BKR-634) Fix YAML deserialization for Beaker::Platform
228
+
229
+ The version of Psych shipped with Ruby 1.9.3-p194 did not support
230
+ subclasses of String that added additional ivars to the String class.
231
+ The Beaker::Platform class does just that - subclassing String and
232
+ additional ivars - which meant that round tripping a Beaker::Platform
233
+ object would create an object with improperly initialized instance
234
+ variables. Psych commit e2fcf9af9e95535401f816bc893839b9ad743a9e
235
+ resolved that issue but we still use platforms that have the old version
236
+ of psych.
237
+
238
+ To resolve this issue, this commit implements a custom #init_with method
239
+ that explicitly sets all instance variables on the Beaker object that
240
+ were defined inside of the YAML map instance, and then reconstructs the
241
+ string value based on those fields.
242
+ ```
243
+ * (BKR-472) (BKR-475) Fix solaris for install_pe_on with 2015.2 (e27613e1)
244
+
245
+
246
+ ```
247
+ (BKR-472) (BKR-475) Fix solaris for install_pe_on with 2015.2
248
+
249
+ When trying to install puppet-agent collection packages through
250
+ `install_pe_on`, eventually `install_puppet_agent_pe_promoted_repo_on`
251
+ gets called but has no entry for where the solaris packages are kept.
252
+ This commit adds the ability for solaris to install PC puppet-agent
253
+ packages.
254
+ ```
255
+ * (BKR-623) Remove inheritance from Beaker::TestSuite (c8610167)
256
+
257
+ * (BKR-623) migrate TestCase tests into native runner (afc9546a)
258
+
259
+ * (BKR-632) Include 'minitest' in --runner options list (e84a4059)
260
+
261
+ * (BKR-623) Add barebones minitest test suite class (a33c5ec5)
262
+
263
+ * (BKR-623) Migrate TestSuite tests to the native runner (43c7ac77)
264
+
265
+ * (BKR-635) Add VM hostname to VMX data during cloning operations (55fb8447)
266
+
267
+
268
+ ```
269
+ (BKR-635) Add VM hostname to VMX data during cloning operations
270
+
271
+ This commit adds a custom guestinfo keyword and hostname variable
272
+ that allows the VMware Tools to query the hostname.
273
+ ```
274
+ * (BKR-623) Rename runner/beaker to runner/native, ... (7d13665e)
275
+
276
+
277
+ ```
278
+ (BKR-623) Rename runner/beaker to runner/native, ...
279
+
280
+ ... and bring `Beaker::TestCase` into the fold.
281
+
282
+ Prior to this, `Beaker::TestCase` was still global. In moving it to a nested
283
+ `Beaker::Runner::Beaker::TestCase` I found that a few tests were starting to
284
+ fail. Further investigation showed that references to `Beaker::*` classes
285
+ inside tests were being resolved as `Beaker::Runner::Beaker::*`, and throwing
286
+ constant missing exceptions. Moving `Beaker::Runner::Beaker` to
287
+ `Beaker::Runner::Native` allows ruby's nested class resolution algorithm
288
+ to find `::Beaker` instead of a nested `Beaker` module constant.
289
+ ```
290
+ * (BKR-623) Use --runner to choose test suite (f1aace6b)
291
+
292
+ * (BKR-623) Adjust const_set hack names (06469668)
293
+
294
+
295
+ ```
296
+ (BKR-623) Adjust const_set hack names
297
+
298
+ Prior to this, old tests which relied on Beaker::Log being set to
299
+ @logger, would break under our refactorings. For example:
300
+ https://github.com/puppetlabs/puppet/blob/3.8.3/acceptance/tests/security/cve-2013-1653_puppet_kick.rb#L66
301
+
302
+ This should continue the duct-taping of constant names, kicking the can that much further
303
+ down the road.
304
+ ```
305
+ * (BKR-623) Add `--runner` option, defaulting to "beaker" (f392f2a3)
306
+
307
+
308
+ ```
309
+ (BKR-623) Add `--runner` option, defaulting to "beaker"
310
+
311
+ Note, we are generally not testing our command-line behavior, our presets, etc.
312
+ This adds a spec that shows how to easily test these sorts of things.
313
+ ```
314
+ * (BKR-623) Specialize Beaker::TestSuite (1bf1ed77)
315
+
316
+
317
+ ```
318
+ (BKR-623) Specialize Beaker::TestSuite
319
+
320
+ This creates a `lib/beaker/runnner` path, a `Beaker::Runner` module namespace,
321
+ and moves the `Beaker::TestSuite` there, leaving a wrapper subclass behind.
322
+
323
+ This allows us to treat the current Beaker test runner as a special case, making
324
+ space to add support for other test runners. Everything should continue working
325
+ as before, allowing us to move on to next steps.
326
+ ```
327
+ * (BKR-609) added checks to make aio_version? more robust (54f79440)
328
+
329
+ * {BKR-622} Fix Regular Expression to give correct Host IP Address (5c3331b4)
330
+
331
+
332
+ ```
333
+ {BKR-622} Fix Regular Expression to give correct Host IP Address
334
+
335
+ Without this patch applied the hostname can sometimes be incorrectly picked up and this
336
+ creates problem with all the hostnames getting the same IP addresses on a multi-node setup.
337
+
338
+ Example Nodeset that can cause this problem:
339
+ HOSTS:
340
+ staging:
341
+ roles:
342
+ - sta
343
+ - master
344
+ platform: el-6-x86_64
345
+ box: puppetlabs/centos-6.6-64-puppet
346
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-6.6-64-puppet
347
+ hypervisor: vagrant
348
+ shared_folder: abc
349
+ NetworkSettings:
350
+ IPAddress: 10.255.50.100
351
+ etl:
352
+ roles:
353
+ - etl
354
+ platform: el-6-x86_64
355
+ box: puppetlabs/centos-6.6-64-puppet
356
+ box_url: https://vagrantcloud.com/puppetlabs/boxes/centos-6.6-64-puppet
357
+ hypervisor: vagrant
358
+ NetworkSettings:
359
+ IPAddress: 10.255.50.120
360
+ CONFIG:
361
+ type: git
362
+ destroy: no
363
+
364
+ In the above scenario, the hostname 'etl' is also available when you search 'puppetlabs'.
365
+
366
+ The patch fixes this by changing the regular expression to look for the string 'etl' (including
367
+ the quote marks).
368
+ ```
369
+ ### <a name = "2.29.1">2.29.1 - 23 Nov, 2015 (5d824690)
370
+
371
+ * (HISTORY) update beaker history for gem release 2.29.1 (5d824690)
106
372
 
107
373
  * (GEM) update beaker version to 2.29.1 (5781838d)
108
374
 
data/Rakefile CHANGED
@@ -75,8 +75,9 @@ end
75
75
  # Documentation Tasks
76
76
  #
77
77
  ###########################################################
78
- DOCS_DAEMON = "yard server --reload --daemon --server thin"
79
- FOREGROUND_SERVER = 'bundle exec yard server --reload --verbose --server thin lib/beaker'
78
+ DOCS_DIR = 'yard_docs'
79
+ DOCS_DAEMON = "yard server --reload --daemon --server thin --docroot #{DOCS_DIR}"
80
+ FOREGROUND_SERVER = "bundle exec yard server --reload --verbose --server thin lib/beaker --docroot #{DOCS_DIR}"
80
81
 
81
82
  def running?( cmdline )
82
83
  ps = `ps -ef`
@@ -107,7 +108,7 @@ namespace :docs do
107
108
  task :clear do
108
109
  original_dir = Dir.pwd
109
110
  Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
110
- sh 'rm -rf docs'
111
+ sh "rm -rf #{DOCS_DIR}"
111
112
  Dir.chdir( original_dir )
112
113
  end
113
114
 
@@ -115,7 +116,7 @@ namespace :docs do
115
116
  task :gen => 'docs:clear' do
116
117
  original_dir = Dir.pwd
117
118
  Dir.chdir( File.expand_path(File.dirname(__FILE__)) )
118
- output = `bundle exec yard doc`
119
+ output = `bundle exec yard doc -o #{DOCS_DIR}`
119
120
  puts output
120
121
  if output =~ /\[warn\]|\[error\]/
121
122
  fail "Errors/Warnings during yard documentation generation"
@@ -66,7 +66,8 @@ RSpec.configure do |c|
66
66
  # Configure all nodes in nodeset
67
67
  c.before :suite do
68
68
  # Install module
69
- puppet_module_install(:source => module_root, :module_name => 'mysql')
69
+ puppet_module_install(:source => module_root, :module_name => 'mysql',
70
+ :target_module_path => '/etc/puppet/modules')
70
71
  hosts.each do |host|
71
72
  on host, puppet('module','install','puppetlabs-stdlib'), { :acceptable_exit_codes => [0,1] }
72
73
  end
@@ -79,13 +80,19 @@ Update spec_helper_acceptance.rb to reflect the module under test. You will nee
79
80
  ###Install beaker-rspec
80
81
  ####From Gem (preferred)
81
82
 
82
- gem install beaker-rspec
83
+ gem install beaker-rspec pry
83
84
 
84
85
  ###Update the module's Gemfile
85
86
 
86
- In module's top level directory edit Gemfile.
87
+ In module's top level directory edit the Gemfile. If there is a section that
88
+ begins `group :development, :test do`, then add it there.
87
89
 
88
- Add `gem 'beaker-rspec', :require => false` under `group :development, :test do`.
90
+ ```ruby
91
+ gem 'beaker-rspec', :require => false
92
+ gem 'pry', :require => false
93
+ ```
94
+
95
+ Then run
89
96
 
90
97
  bundle install
91
98
 
data/lib/beaker/cli.rb CHANGED
@@ -154,7 +154,13 @@ module Beaker
154
154
  @logger.notify("No tests to run for suite '#{suite_name.to_s}'")
155
155
  return
156
156
  end
157
- Beaker::TestSuite.new(
157
+
158
+ unless runner_class = Beaker::TestSuite.runner(@options[:runner])
159
+ @logger.error "Test runner #{@options[:runner]} is unknown."
160
+ exit 1
161
+ end
162
+
163
+ runner_class.new(
158
164
  suite_name, @hosts, @options, @timestamp, failure_strategy
159
165
  ).run_and_raise_on_failure
160
166
  end
@@ -1338,6 +1338,12 @@ NOASK
1338
1338
  when /^osx$/
1339
1339
  release_file = "/repos/apple/#{opts[:puppet_collection]}/puppet-agent-*"
1340
1340
  download_file = "puppet-agent-#{variant}-#{version}.tar.gz"
1341
+ when /^solaris$/
1342
+ if arch == 'x86_64'
1343
+ arch = 'i386'
1344
+ end
1345
+ release_file = "/repos/solaris/#{version}/#{opts[:puppet_collection]}/puppet-agent-*#{arch}.pkg.gz"
1346
+ download_file = "puppet-agent-#{varant}-#{version}-#{arch}.tar.gz"
1341
1347
  else
1342
1348
  raise "No pe-promoted installation step for #{variant} yet..."
1343
1349
  end
@@ -119,25 +119,28 @@ module Beaker
119
119
  host['roles'].length == 1 && host['roles'].include?('agent')
120
120
  end
121
121
 
122
- # Determine whether a host has an AIO version or not. If a host :pe_ver or :version
123
- # is not specified, then it is open-ended, and as such, can be an AIO
124
- # version depending on the context.
122
+ # Determine whether a host has an AIO version or not. If a host :pe_ver or
123
+ # :version is not specified, then either the 'aio' role or type will be
124
+ # needed for a host to be the AIO version.
125
125
  #
126
- # True when any of the following cases are true
127
- # * has PE version (:pe_ver) >= 4.0
128
- # * has FOSS version (:version) >= 4.0
129
- # * host has role 'aio'
130
- # * host as the type 'aio'
126
+ # True if host has
127
+ # * PE version (:pe_ver) >= 4.0
128
+ # * FOSS version (:version) >= 4.0
129
+ # * the role 'aio'
130
+ # * the type 'aio'
131
131
  #
132
132
  # @note aio version is just a base-line condition. If you want to check
133
133
  # that a host is an aio agent, refer to {#aio_agent?}.
134
134
  #
135
135
  # @return [Boolean] whether or not a host is AIO-capable
136
136
  def aio_version?(host)
137
- return (( host[:pe_ver] && !version_is_less(host[:pe_ver], '4.0') ) ||
138
- ( host[:version] && !version_is_less(host[:version], '4.0') ) ||
139
- ( host[:roles] && host[:roles].include?('aio')) ||
140
- ( host[:type] && !!(host[:type] =~ /(\A|-)aio(\Z|-)/ ))) == true
137
+ [:pe_ver, :version].each do |key|
138
+ version = host[key]
139
+ return !version_is_less(version, '4.0') if version && !version.empty?
140
+ end
141
+ return true if host[:roles] && host[:roles].include?('aio')
142
+ return true if host[:type] && !!(host[:type] =~ /(\A|-)aio(\Z|-)/ )
143
+ false
141
144
  end
142
145
 
143
146
  # Determine if the host is an AIO agent