beaker-puppet 1.27.0 → 1.29.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68502ef5f5e7277b97ce2192ef1d51f571d084e705e98d69f1f4a53e303fcac0
4
- data.tar.gz: 3c3c471c33bf0481e6a3d8e44fdaabae4f5efec04377f56a66135d905995c043
3
+ metadata.gz: 1d22580f573383c2d14f8c340936f3011cd4aa22a3f68c7d3d7e212ee000b5a4
4
+ data.tar.gz: 43ca75a56533ea39da64b84808c1559ce392b9e9b5cd7ba7bbb019b809a9a875
5
5
  SHA512:
6
- metadata.gz: 036c6489dd3157d13fb07123dfc27dba5bf7ef1e6ac488f8230942072057a01fd9f32a36922747fc8e656562ffc88f967e0c54f7b4ca15dab9ba4ae6c2ce88dc
7
- data.tar.gz: bca6b6878ed42eb9126af029381df3144c5c7e540ffafc07031c14d478e34212256ccf56dd4b9972852ef0f894616b7c1ed95e8b2c7a3f31587a223abbad03e5
6
+ metadata.gz: c272d6d40f9050bbef35f36db0972e6e6becc53af61b0870b2b8b53756ad83a68e9e4a761dc91835056c7ac3a3e46348aad35fb7aab06db4cbaea4a2314ca7ff
7
+ data.tar.gz: 189fd8c32eb885429d14cfa146687619610ef40460e6f6e7fb4f5553d1673574ba0bc9c53fa06cb77cbc9209b1e03ab9d9ca9bbbf29061efa8474f6fa7d671c3
data/CHANGELOG.md CHANGED
@@ -2,6 +2,30 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.29.0](https://github.com/voxpupuli/beaker-puppet/tree/1.29.0) (2022-11-02)
6
+
7
+ [Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.28.0...1.29.0)
8
+
9
+ **Implemented enhancements:**
10
+
11
+ - Introduce BEAKER\_PUPPET\_DEBUG env var [\#197](https://github.com/voxpupuli/beaker-puppet/pull/197) ([ekohl](https://github.com/ekohl))
12
+
13
+ **Fixed bugs:**
14
+
15
+ - \(maint\) Fix DigiCert root cert to match fully patched Solaris 11.4 [\#202](https://github.com/voxpupuli/beaker-puppet/pull/202) ([yachub](https://github.com/yachub))
16
+
17
+ **Merged pull requests:**
18
+
19
+ - \(maint\) Uses RFC 5737 IP space in example [\#200](https://github.com/voxpupuli/beaker-puppet/pull/200) ([mhashizume](https://github.com/mhashizume))
20
+
21
+ ## [1.28.0](https://github.com/voxpupuli/beaker-puppet/tree/1.28.0) (2022-09-08)
22
+
23
+ [Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.27.0...1.28.0)
24
+
25
+ **Implemented enhancements:**
26
+
27
+ - \(PA-4552\) Create ci:test:setup step for iterative workflow [\#194](https://github.com/voxpupuli/beaker-puppet/pull/194) ([joshcooper](https://github.com/joshcooper))
28
+
5
29
  ## [1.27.0](https://github.com/voxpupuli/beaker-puppet/tree/1.27.0) (2022-08-31)
6
30
 
7
31
  [Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.26.3...1.27.0)
@@ -14,6 +38,10 @@ All notable changes to this project will be documented in this file.
14
38
 
15
39
  - \(PA-4566\) Retry beaker exec if presuite completes [\#195](https://github.com/voxpupuli/beaker-puppet/pull/195) ([joshcooper](https://github.com/joshcooper))
16
40
 
41
+ **Merged pull requests:**
42
+
43
+ - Release 1.27.0 [\#199](https://github.com/voxpupuli/beaker-puppet/pull/199) ([mhashizume](https://github.com/mhashizume))
44
+
17
45
  ## [1.26.3](https://github.com/voxpupuli/beaker-puppet/tree/1.26.3) (2022-08-09)
18
46
 
19
47
  [Full Changelog](https://github.com/voxpupuli/beaker-puppet/compare/1.26.2...1.26.3)
data/README.md CHANGED
@@ -41,6 +41,23 @@ require 'beaker-puppet'
41
41
  Doing this will include (automatically) the beaker-puppet DSL methods in the
42
42
  beaker DSL. Then you can call beaker-puppet methods, exactly as you did before.
43
43
 
44
+ ## Running Puppet in debug mode
45
+
46
+ When using `apply_manifest` to run Puppet, it is common that you need debug
47
+ output. To achieve this, the debug option can be passed.
48
+
49
+ ```ruby
50
+ apply_manifest_on(host, manifest, { debug: true })
51
+ ```
52
+
53
+ This has the downside that Puppet always runs in debug mode, which is very
54
+ verbose. Of course you can modify the spec, but that's tedious. An easier
55
+ alternative is to use the environment variable `BEAKER_PUPPET_DEBUG`.
56
+
57
+ ```sh
58
+ BEAKER_PUPPET_DEBUG=1 rspec spec/acceptance/my_spec.rb
59
+ ```
60
+
44
61
  # How Do I Test This?
45
62
 
46
63
  ### Unit / Spec Testing
@@ -459,7 +459,7 @@ module Beaker
459
459
  on_options[:acceptable_exit_codes] = Array(opts[:acceptable_exit_codes])
460
460
 
461
461
  puppet_apply_opts = {}
462
- if opts[:debug]
462
+ if opts[:debug] || ENV['BEAKER_PUPPET_DEBUG']
463
463
  puppet_apply_opts[:debug] = nil
464
464
  else
465
465
  puppet_apply_opts[:verbose] = nil
@@ -1,3 +1,3 @@
1
1
  module BeakerPuppet
2
- VERSION = '1.27.0'
2
+ VERSION = '1.29.0'
3
3
  end
@@ -72,10 +72,10 @@ EOM
72
72
 
73
73
  hosts.each do |host|
74
74
  next unless host.platform =~ /solaris-11(\.2)?-(i386|sparc)/
75
- create_remote_file(host, "DigiCertTrustedRootG4.crt.pem", DigiCert)
76
- on(host, 'chmod a+r /root/DigiCertTrustedRootG4.crt.pem')
77
- on(host, 'cp -p /root/DigiCertTrustedRootG4.crt.pem /etc/certs/CA/')
78
- on(host, 'rm /root/DigiCertTrustedRootG4.crt.pem')
75
+ create_remote_file(host, "DigiCert_Trusted_Root_G4.pem", DigiCert)
76
+ on(host, 'chmod a+r /root/DigiCert_Trusted_Root_G4.pem')
77
+ on(host, 'cp -p /root/DigiCert_Trusted_Root_G4.pem /etc/certs/CA/')
78
+ on(host, 'rm /root/DigiCert_Trusted_Root_G4.pem')
79
79
 
80
80
  if host.platform=~ /solaris-11-sparc/
81
81
  create_remote_file(host, "USERTrust_RSA_Certification_Authority.pem", USERTrust)
data/tasks/ci.rake CHANGED
@@ -25,6 +25,7 @@ Usage: bundle exec rake <target> [arguments]
25
25
 
26
26
  where <target> is one of:
27
27
 
28
+ ci:test:setup
28
29
  ci:test:git
29
30
  ci:test:aio
30
31
  ci:test:gem
@@ -109,8 +110,8 @@ SERVER:
109
110
 
110
111
  $project_SERVER:
111
112
  Similar to SERVER, but project specific. If you have only one project (i.e., hiera) that you
112
- want to pull from a different server then all the others, you could set HIERA_SERVER=179.0.0.1,
113
- and you would get back 'https://179.0.0.1/puppetlabs-hiera.git'.
113
+ want to pull from a different server then all the others, you could set HIERA_SERVER=192.0.2.1,
114
+ and you would get back 'https://192.0.2.1/puppetlabs-hiera.git'.
114
115
 
115
116
  RUNTIME_BRANCH:
116
117
  Currently only used with git-based testing. This must correspond to a branch in the
@@ -126,11 +127,22 @@ namespace :ci do
126
127
  end
127
128
 
128
129
  task :check_env do
129
- if ENV['SHA'].nil?
130
+ sha = ENV['SHA']
131
+ case sha
132
+ when /^\d+\.\d+\.\d+$/
133
+ # tags are ok
134
+ when /^[0-9a-f]{40}$/
135
+ # full SHAs are ok
136
+ when nil
130
137
  puts "Error: A SHA must be specified"
131
138
  puts "\n"
132
139
  puts USAGE
133
140
  exit 1
141
+ else
142
+ puts "Error: Expected SHA to be a tag or 40 digit SHA, not '#{sha}'"
143
+ puts "\n"
144
+ puts USAGE
145
+ exit 1
134
146
  end
135
147
 
136
148
  if ENV['TESTS'].nil?
@@ -205,6 +217,35 @@ EOS
205
217
  end
206
218
  end
207
219
 
220
+ desc <<-EOS
221
+ Setup acceptance tests using puppet-agent (AIO) packages.
222
+
223
+ $ SHA=<tag or full sha> HOSTS=<hosts> bundle exec rake ci:test:setup
224
+
225
+ SHA should be the tag or full SHA for the puppet-agent package.
226
+
227
+ HOSTS can be a beaker-hostgenerator string or existing file.
228
+ EOS
229
+ task :setup => ['ci:check_env'] do |t, args|
230
+ unless ENV['HOSTS']
231
+ case File.basename(Dir.pwd.sub(/\/acceptance$/, ''))
232
+ when 'pxp-agent', 'puppet'
233
+ ENV['HOSTS'] ||= 'redhat7-64m-redhat7-64a'
234
+ else
235
+ ENV['HOSTS'] ||= 'redhat7-64a'
236
+ end
237
+ end
238
+
239
+ Rake::Task[:'ci:gen_hosts'].invoke('abs')
240
+ beaker_setup(:aio)
241
+ puts "\nSetup completed on:"
242
+ YAML.load_file('.beaker/subcommand_options.yaml').fetch('HOSTS', {}).each_pair do |hostname, data|
243
+ roles = data.fetch('roles', []).join(', ')
244
+ puts "- #{hostname} (#{roles})"
245
+ end
246
+ puts "\nRun 'bundle exec beaker exec <path>' where <path> is a directory or comma-separated list of tests."
247
+ end
248
+
208
249
  desc <<-EOS
209
250
  Run the acceptance tests against puppet gem on various platforms, performing a
210
251
  basic smoke test.
@@ -265,6 +306,13 @@ def beaker(command, *argv)
265
306
  sh('beaker', command.to_s, *argv)
266
307
  end
267
308
 
309
+ def beaker_setup(type)
310
+ beaker(:init, '--hosts', ENV['HOSTS'], '--preserve-hosts', 'always', '--options-file', "config/#{String(type)}/options.rb")
311
+ beaker(:provision)
312
+ beaker(:exec, 'pre-suite', '--preserve-state', '--pre-suite', pre_suites(type))
313
+ beaker(:exec, 'pre-suite', '--preserve-state')
314
+ end
315
+
268
316
  def beaker_suite(type)
269
317
  beaker(:init, '--hosts', ENV['HOSTS'], '--options-file', "config/#{String(type)}/options.rb")
270
318
  beaker(:provision)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.29.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vox Pupuli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-31 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec