simp-beaker-helpers 1.34.3 → 1.35.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/pr_acceptance.yml +1 -1
  3. data/.github/workflows/pr_tests.yml +6 -7
  4. data/.rubocop.yml +652 -495
  5. data/CHANGELOG.md +4 -0
  6. data/Gemfile +5 -2
  7. data/lib/simp/beaker_helpers/constants.rb +7 -5
  8. data/lib/simp/beaker_helpers/inspec.rb +52 -55
  9. data/lib/simp/beaker_helpers/snapshot.rb +126 -134
  10. data/lib/simp/beaker_helpers/ssg.rb +33 -34
  11. data/lib/simp/beaker_helpers/version.rb +2 -1
  12. data/lib/simp/beaker_helpers/windows.rb +4 -1
  13. data/lib/simp/beaker_helpers.rb +274 -291
  14. data/lib/simp/rake/beaker.rb +174 -177
  15. data/spec/acceptance/suites/default/check_puppet_version_spec.rb +3 -3
  16. data/spec/acceptance/suites/default/fixture_modules_spec.rb +9 -9
  17. data/spec/acceptance/suites/default/install_simp_deps_repo_spec.rb +7 -13
  18. data/spec/acceptance/suites/default/pki_tests_spec.rb +10 -16
  19. data/spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb +4 -4
  20. data/spec/acceptance/suites/inspec/00_default_spec.rb +22 -22
  21. data/spec/acceptance/suites/offline/00_default_spec.rb +43 -12
  22. data/spec/acceptance/suites/offline/nodesets/default.yml +1 -3
  23. data/spec/acceptance/suites/puppet_collections/00_default_spec.rb +3 -3
  24. data/spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb +27 -7
  25. data/spec/acceptance/suites/snapshot/10_general_usage_spec.rb +3 -3
  26. data/spec/acceptance/suites/ssg/00_default_spec.rb +20 -18
  27. data/spec/acceptance/suites/windows/00_default_spec.rb +47 -49
  28. data/spec/acceptance/suites/windows/nodesets/default.yml +3 -3
  29. data/spec/acceptance/suites/windows/nodesets/win2012.yml +3 -3
  30. data/spec/acceptance/suites/windows/nodesets/win2016.yml +3 -3
  31. data/spec/acceptance/suites/windows/nodesets/win2019.yml +3 -3
  32. data/spec/lib/simp/beaker_helpers_spec.rb +96 -66
  33. data/spec/spec_helper.rb +51 -53
  34. data/spec/spec_helper_acceptance.rb +17 -22
  35. metadata +5 -5
@@ -24,77 +24,108 @@ class MyTestClass
24
24
  end
25
25
 
26
26
  describe 'Simp::BeakerHelpers' do
27
- before :each do
28
- @helper = MyTestClass.new
29
- end
27
+ let(:helper) { MyTestClass.new }
30
28
 
31
- let(:gem_search_results) {
29
+ let(:gem_search_results) do
32
30
  # subset of results, but still exercises code
33
- "puppet (5.5.1 ruby universal-darwin x64-mingw32 x86-mingw32, 5.5.0 ruby universal-darwin x64-mingw32 x86-mingw32, 5.4.0 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.6 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.5 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.4 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.3 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.2 ruby universal-darwin x64-mingw32 x86-mingw32, 5.3.1 ruby universal-darwin x64-mingw32 x86-mingw32, 5.2.0 ruby universal-darwin x64-mingw32 x86-mingw32, 5.1.0 ruby universal-darwin x64-mingw32 x86-mingw32, 5.0.1 ruby universal-darwin x64-mingw32 x86-mingw32, 5.0.0 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.11 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.10 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.9 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.8 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.7 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.6 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.5 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.4 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.1 ruby universal-darwin x64-mingw32 x86-mingw32, 4.10.0 ruby universal-darwin x64-mingw32 x86-mingw32, 4.9.4 ruby universal-darwin x64-mingw32 x86-mingw32, 4.9.3 ruby universal-darwin x64-mingw32 x86-mingw32, 4.9.2 ruby universal-darwin x64-mingw32 x86-mingw32, 4.9.1 ruby universal-darwin x64-mingw32 x86-mingw32, 4.9.0 ruby universal-darwin x64-mingw32 x86-mingw32, 4.8.2 ruby universal-darwin x64-mingw32 x86-mingw32, 4.8.1 ruby universal-darwin x64-mingw32 x86-mingw32, 4.8.0 ruby universal-darwin x64-mingw32 x86-mingw32)\n"
34
- }
31
+ "puppet (#{
32
+ [
33
+ '5.5.1 ruby universal-darwin x64-mingw32 x86-mingw32',
34
+ '5.5.0 ruby universal-darwin x64-mingw32 x86-mingw32',
35
+ '5.4.0 ruby universal-darwin x64-mingw32 x86-mingw32',
36
+ '5.3.6 ruby universal-darwin x64-mingw32 x86-mingw32',
37
+ '5.3.5 ruby universal-darwin x64-mingw32 x86-mingw32',
38
+ '5.3.4 ruby universal-darwin x64-mingw32 x86-mingw32',
39
+ '5.3.3 ruby universal-darwin x64-mingw32 x86-mingw32',
40
+ '5.3.2 ruby universal-darwin x64-mingw32 x86-mingw32',
41
+ '5.3.1 ruby universal-darwin x64-mingw32 x86-mingw32',
42
+ '5.2.0 ruby universal-darwin x64-mingw32 x86-mingw32',
43
+ '5.1.0 ruby universal-darwin x64-mingw32 x86-mingw32',
44
+ '5.0.1 ruby universal-darwin x64-mingw32 x86-mingw32',
45
+ '5.0.0 ruby universal-darwin x64-mingw32 x86-mingw32',
46
+ '4.10.11 ruby universal-darwin x64-mingw32 x86-mingw32',
47
+ '4.10.10 ruby universal-darwin x64-mingw32 x86-mingw32',
48
+ '4.10.9 ruby universal-darwin x64-mingw32 x86-mingw32',
49
+ '4.10.8 ruby universal-darwin x64-mingw32 x86-mingw32',
50
+ '4.10.7 ruby universal-darwin x64-mingw32 x86-mingw32',
51
+ '4.10.6 ruby universal-darwin x64-mingw32 x86-mingw32',
52
+ '4.10.5 ruby universal-darwin x64-mingw32 x86-mingw32',
53
+ '4.10.4 ruby universal-darwin x64-mingw32 x86-mingw32',
54
+ '4.10.1 ruby universal-darwin x64-mingw32 x86-mingw32',
55
+ '4.10.0 ruby universal-darwin x64-mingw32 x86-mingw32',
56
+ '4.9.4 ruby universal-darwin x64-mingw32 x86-mingw32',
57
+ '4.9.3 ruby universal-darwin x64-mingw32 x86-mingw32',
58
+ '4.9.2 ruby universal-darwin x64-mingw32 x86-mingw32',
59
+ '4.9.1 ruby universal-darwin x64-mingw32 x86-mingw32',
60
+ '4.9.0 ruby universal-darwin x64-mingw32 x86-mingw32',
61
+ '4.8.2 ruby universal-darwin x64-mingw32 x86-mingw32',
62
+ '4.8.1 ruby universal-darwin x64-mingw32 x86-mingw32',
63
+ '4.8.0 ruby universal-darwin x64-mingw32 x86-mingw32',
64
+ ].join(', ')})\n"
65
+ end
35
66
 
36
67
  context '#latest_puppet_agent_version_for' do
37
68
  context 'using table' do
38
69
  it 'maps exact Puppet version' do
39
- expect( @helper.latest_puppet_agent_version_for('4.10.4') ).to eq '1.10.4'
70
+ expect(helper.latest_puppet_agent_version_for('4.10.4')).to eq '1.10.4'
40
71
  end
41
72
 
42
73
  # remaining tests are only for a sampling of version specifictions with
43
74
  # operators, because we are really only testing that the version specification
44
75
  # is proper;ly handed off to Gem::Requirement(), not that Gem::Requirement works.
45
76
  it "maps to appropriate Puppet version when '=' operator specified in version" do
46
- expect( @helper.latest_puppet_agent_version_for('= 4.8') ).to eq '1.8.0'
77
+ expect(helper.latest_puppet_agent_version_for('= 4.8')).to eq '1.8.0'
47
78
  end
48
79
 
49
80
  it "maps to appropriate Puppet version when '~>' operator specified in version" do
50
- expect( @helper.latest_puppet_agent_version_for('~> 4.8.0') ).to eq '1.8.3'
81
+ expect(helper.latest_puppet_agent_version_for('~> 4.8.0')).to eq '1.8.3'
51
82
  end
52
83
 
53
84
  it "maps to appropriate Puppet version when '<' operator specified in version" do
54
- expect( @helper.latest_puppet_agent_version_for('< 4.9') ).to match /1.8.3/
85
+ expect(helper.latest_puppet_agent_version_for('< 4.9')).to match(%r{1.8.3})
55
86
  end
56
87
 
57
- it "maps to appropriate Puppet version when comma-separated operators specified in version" do
58
- expect( @helper.latest_puppet_agent_version_for('>= 4.7, < 4.9') ).to match /1.8.3/
88
+ it 'maps to appropriate Puppet version when comma-separated operators specified in version' do
89
+ expect(helper.latest_puppet_agent_version_for('>= 4.7, < 4.9')).to match(%r{1.8.3})
59
90
  end
60
91
  end
61
92
 
62
93
  context 'using gem lookup' do
63
94
  it 'maps exact Puppet version' do
64
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
65
- expect( @helper.latest_puppet_agent_version_for('5.3.1') ).to eq '5.3.1'
95
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
96
+ expect(helper.latest_puppet_agent_version_for('5.3.1')).to eq '5.3.1'
66
97
  end
67
98
 
68
99
  # remaining tests are only for a sampling of version specifictions with
69
100
  # operators, because we are really only testing that the version specification
70
101
  # is proper;ly handed off to Gem::Requirement(), not that Gem::Requirement works.
71
102
  it "maps to appropriate Puppet version when '=' operator specified in version" do
72
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
73
- expect( @helper.latest_puppet_agent_version_for('= 5.5') ).to eq '5.5.0'
103
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
104
+ expect(helper.latest_puppet_agent_version_for('= 5.5')).to eq '5.5.0'
74
105
  end
75
106
 
76
107
  it "maps to appropriate Puppet version when '~>' operator specified in version" do
77
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
78
- expect( @helper.latest_puppet_agent_version_for('~> 5.3.0') ).to eq '5.3.6'
108
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
109
+ expect(helper.latest_puppet_agent_version_for('~> 5.3.0')).to eq '5.3.6'
79
110
  end
80
111
 
81
112
  # this logic won't work properly without code changes that just aren't worth it because
82
113
  # Puppet 4 is MD soon....
83
114
  # it "maps to appropriate Puppet version when '<' operator specified in version" do
84
115
  # pending 'fails because matches 4.x table'
85
- # allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
86
- # expect( @helper.latest_puppet_agent_version_for('< 5.5') ).to match /5.4.0/
116
+ # allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
117
+ # expect( helper.latest_puppet_agent_version_for('< 5.5') ).to match /5.4.0/
87
118
  # end
88
119
 
89
- it "maps to appropriate Puppet version when comma-separated operators specified in version" do
90
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
91
- expect( @helper.latest_puppet_agent_version_for('>= 5, < 5.5') ).to match /5.4.0/
120
+ it 'maps to appropriate Puppet version when comma-separated operators specified in version' do
121
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
122
+ expect(helper.latest_puppet_agent_version_for('>= 5, < 5.5')).to match(%r{5.4.0})
92
123
  end
93
124
  end
94
125
  end
95
126
 
96
127
  context '#get_puppet_install_info' do
97
- after (:each) do
128
+ after(:each) do
98
129
  ENV['BEAKER_PUPPET_AGENT_VERSION'] = nil
99
130
  ENV['PUPPET_INSTALL_VERSION'] = nil
100
131
  ENV['PUPPET_VERSION'] = nil
@@ -103,9 +134,8 @@ describe 'Simp::BeakerHelpers' do
103
134
  end
104
135
 
105
136
  it 'uses defaults when no environment variables are set' do
106
-
107
137
  # Prevent namespace pollution
108
- pipe_out,pipe_in = IO.pipe
138
+ pipe_out, pipe_in = IO.pipe
109
139
  fork do
110
140
  pipe_out.close
111
141
  require 'puppet'
@@ -115,81 +145,81 @@ describe 'Simp::BeakerHelpers' do
115
145
 
116
146
  expected_major_version = pipe_out.gets.split('.').first
117
147
 
118
- expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq("puppet#{expected_major_version}")
119
- expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('agent')
148
+ expect(helper.get_puppet_install_info[:puppet_collection]).to eq("puppet#{expected_major_version}")
149
+ expect(helper.get_puppet_install_info[:puppet_install_type]).to eq('agent')
120
150
  end
121
151
 
122
152
  it 'extracts info from PUPPET_INSTALL_VERSION for Puppet 5' do
123
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
124
- ENV['PUPPET_INSTALL_VERSION']= '5.5.0'
153
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
154
+ ENV['PUPPET_INSTALL_VERSION'] = '5.5.0'
125
155
  expected = {
126
- :puppet_install_version => '5.5.0',
127
- :puppet_collection => 'puppet5',
128
- :puppet_install_type => 'agent'
156
+ puppet_install_version: '5.5.0',
157
+ puppet_collection: 'puppet5',
158
+ puppet_install_type: 'agent'
129
159
  }
130
- expect( @helper.get_puppet_install_info ).to eq expected
160
+ expect(helper.get_puppet_install_info).to eq expected
131
161
  end
132
162
 
133
163
  it 'extracts info from PUPPET_INSTALL_VERSION even when BEAKER_PUPPET_COLLECTION is set' do
134
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
135
- ENV['PUPPET_INSTALL_VERSION']= '5.5.0'
136
- ENV['BEAKER_PUPPET_COLLECTION']= 'puppet6'
164
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
165
+ ENV['PUPPET_INSTALL_VERSION'] = '5.5.0'
166
+ ENV['BEAKER_PUPPET_COLLECTION'] = 'puppet6'
137
167
  expected = {
138
- :puppet_install_version => '5.5.0',
139
- :puppet_collection => 'puppet5',
140
- :puppet_install_type => 'agent'
168
+ puppet_install_version: '5.5.0',
169
+ puppet_collection: 'puppet5',
170
+ puppet_install_type: 'agent'
141
171
  }
142
- expect( @helper.get_puppet_install_info ).to eq expected
172
+ expect(helper.get_puppet_install_info).to eq expected
143
173
  end
144
174
 
145
175
  it 'extracts info from PUPPET_INSTALL_VERSION even when host puppet_collection option is set' do
146
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
147
- ENV['PUPPET_INSTALL_VERSION']= '5.5.0'
148
- @helper.host.options = {'puppet_collection' => 'puppet6'}
176
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
177
+ ENV['PUPPET_INSTALL_VERSION'] = '5.5.0'
178
+ helper.host.options = { 'puppet_collection' => 'puppet6' }
149
179
  expected = {
150
- :puppet_install_version => '5.5.0',
151
- :puppet_collection => 'puppet5',
152
- :puppet_install_type => 'agent'
180
+ puppet_install_version: '5.5.0',
181
+ puppet_collection: 'puppet5',
182
+ puppet_install_type: 'agent'
153
183
  }
154
- expect( @helper.get_puppet_install_info ).to eq expected
184
+ expect(helper.get_puppet_install_info).to eq expected
155
185
  end
156
186
 
157
- it 'extracts info from BEAKER_PUPPET_COLLECTION' do
158
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
159
- ENV['BEAKER_PUPPET_COLLECTION']= 'puppet5'
187
+ it 'extracts info from BEAKER_PUPPET_COLLECTION env var' do
188
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
189
+ ENV['BEAKER_PUPPET_COLLECTION'] = 'puppet5'
160
190
  expected = {
161
- :puppet_install_version => '5.5.1',
162
- :puppet_collection => 'puppet5',
163
- :puppet_install_type => 'agent'
191
+ puppet_install_version: '5.5.1',
192
+ puppet_collection: 'puppet5',
193
+ puppet_install_type: 'agent'
164
194
  }
165
- expect( @helper.get_puppet_install_info ).to eq expected
195
+ expect(helper.get_puppet_install_info).to eq expected
166
196
  end
167
197
 
168
- it 'extracts info from BEAKER_PUPPET_COLLECTION' do
169
- allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
170
- @helper.host.options = {'puppet_collection' => 'puppet5'}
198
+ it 'extracts info from host puppet_collection option' do
199
+ allow(helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
200
+ helper.host.options = { 'puppet_collection' => 'puppet5' }
171
201
  expected = {
172
- :puppet_install_version => '5.5.1',
173
- :puppet_collection => 'puppet5',
174
- :puppet_install_type => 'agent'
202
+ puppet_install_version: '5.5.1',
203
+ puppet_collection: 'puppet5',
204
+ puppet_install_type: 'agent'
175
205
  }
176
- expect( @helper.get_puppet_install_info ).to eq expected
206
+ expect(helper.get_puppet_install_info).to eq expected
177
207
  end
178
208
 
179
209
  it 'extracts info from PUPPET_INSTALL_TYPE' do
180
210
  ENV['PUPPET_INSTALL_TYPE'] = 'pe'
181
211
 
182
- expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('pe')
212
+ expect(helper.get_puppet_install_info[:puppet_install_type]).to eq('pe')
183
213
  end
184
214
 
185
215
  it 'fails when BEAKER_PUPPET_COLLECTION is invalid' do
186
216
  ENV['BEAKER_PUPPET_COLLECTION'] = 'PUPPET5'
187
- expect{ @helper.get_puppet_install_info }.to raise_error(/Error: Puppet Collection 'PUPPET5' must match/)
217
+ expect { helper.get_puppet_install_info }.to raise_error(%r{Error: Puppet Collection 'PUPPET5' must match})
188
218
  end
189
219
 
190
220
  it 'fails when host options puppet_collection is invalid' do
191
- @helper.host.options = {'puppet_collection' => 'PUPPET5'}
192
- expect{ @helper.get_puppet_install_info }.to raise_error(/Error: Puppet Collection 'PUPPET5' must match/)
221
+ helper.host.options = { 'puppet_collection' => 'PUPPET5' }
222
+ expect { helper.get_puppet_install_info }.to raise_error(%r{Error: Puppet Collection 'PUPPET5' must match})
193
223
  end
194
224
  end
195
225
  end
data/spec/spec_helper.rb CHANGED
@@ -44,57 +44,55 @@ RSpec.configure do |config|
44
44
  # triggering implicit auto-inclusion in groups with matching metadata.
45
45
  config.shared_context_metadata_behavior = :apply_to_host_groups
46
46
 
47
- # The settings below are suggested to provide a good initial experience
48
- # with RSpec, but feel free to customize to your heart's content.
49
- =begin
50
- # This allows you to limit a spec run to individual examples or groups
51
- # you care about by tagging them with `:focus` metadata. When nothing
52
- # is tagged with `:focus`, all examples get run. RSpec also provides
53
- # aliases for `it`, `describe`, and `context` that include `:focus`
54
- # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
55
- config.filter_run_when_matching :focus
56
-
57
- # Allows RSpec to persist some state between runs in order to support
58
- # the `--only-failures` and `--next-failure` CLI options. We recommend
59
- # you configure your source control system to ignore this file.
60
- config.example_status_persistence_file_path = "spec/examples.txt"
61
-
62
- # Limits the available syntax to the non-monkey patched syntax that is
63
- # recommended. For more details, see:
64
- # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
65
- # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
66
- # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
67
- config.disable_monkey_patching!
68
-
69
- # This setting enables warnings. It's recommended, but in some cases may
70
- # be too noisy due to issues in dependencies.
71
- config.warnings = true
72
-
73
- # Many RSpec users commonly either run the entire suite or an individual
74
- # file, and it's useful to allow more verbose output when running an
75
- # individual spec file.
76
- if config.files_to_run.one?
77
- # Use the documentation formatter for detailed output,
78
- # unless a formatter has already been configured
79
- # (e.g. via a command-line flag).
80
- config.default_formatter = "doc"
81
- end
82
-
83
- # Print the 10 slowest examples and example groups at the
84
- # end of the spec run, to help surface which specs are running
85
- # particularly slow.
86
- config.profile_examples = 10
87
-
88
- # Run specs in random order to surface order dependencies. If you find an
89
- # order dependency and want to debug it, you can fix the order by providing
90
- # the seed, which is printed after each run.
91
- # --seed 1234
92
- config.order = :random
93
-
94
- # Seed global randomization in this process using the `--seed` CLI option.
95
- # Setting this allows you to use `--seed` to deterministically reproduce
96
- # test failures related to randomization by passing the same `--seed` value
97
- # as the one that triggered the failure.
98
- Kernel.srand config.seed
99
- =end
47
+ # The settings below are suggested to provide a good initial experience
48
+ # with RSpec, but feel free to customize to your heart's content.
49
+ # # This allows you to limit a spec run to individual examples or groups
50
+ # # you care about by tagging them with `:focus` metadata. When nothing
51
+ # # is tagged with `:focus`, all examples get run. RSpec also provides
52
+ # # aliases for `it`, `describe`, and `context` that include `:focus`
53
+ # # metadata: `fit`, `fdescribe` and `fcontext`, respectively.
54
+ # config.filter_run_when_matching :focus
55
+ #
56
+ # # Allows RSpec to persist some state between runs in order to support
57
+ # # the `--only-failures` and `--next-failure` CLI options. We recommend
58
+ # # you configure your source control system to ignore this file.
59
+ # config.example_status_persistence_file_path = "spec/examples.txt"
60
+ #
61
+ # # Limits the available syntax to the non-monkey patched syntax that is
62
+ # # recommended. For more details, see:
63
+ # # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/
64
+ # # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/
65
+ # # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode
66
+ # config.disable_monkey_patching!
67
+ #
68
+ # # This setting enables warnings. It's recommended, but in some cases may
69
+ # # be too noisy due to issues in dependencies.
70
+ # config.warnings = true
71
+ #
72
+ # # Many RSpec users commonly either run the entire suite or an individual
73
+ # # file, and it's useful to allow more verbose output when running an
74
+ # # individual spec file.
75
+ # if config.files_to_run.one?
76
+ # # Use the documentation formatter for detailed output,
77
+ # # unless a formatter has already been configured
78
+ # # (e.g. via a command-line flag).
79
+ # config.default_formatter = "doc"
80
+ # end
81
+ #
82
+ # # Print the 10 slowest examples and example groups at the
83
+ # # end of the spec run, to help surface which specs are running
84
+ # # particularly slow.
85
+ # config.profile_examples = 10
86
+ #
87
+ # # Run specs in random order to surface order dependencies. If you find an
88
+ # # order dependency and want to debug it, you can fix the order by providing
89
+ # # the seed, which is printed after each run.
90
+ # # --seed 1234
91
+ # config.order = :random
92
+ #
93
+ # # Seed global randomization in this process using the `--seed` CLI option.
94
+ # # Setting this allows you to use `--seed` to deterministically reproduce
95
+ # # test failures related to randomization by passing the same `--seed` value
96
+ # # as the one that triggered the failure.
97
+ # Kernel.srand config.seed
100
98
  end
@@ -15,7 +15,6 @@ unless ENV['BEAKER_provision'] == 'no'
15
15
  end
16
16
  end
17
17
 
18
-
19
18
  RSpec.configure do |c|
20
19
  # ensure that environment OS is ready on each host
21
20
  fix_errata_on hosts
@@ -29,29 +28,25 @@ RSpec.configure do |c|
29
28
 
30
29
  # Configure all nodes in nodeset
31
30
  c.before :suite do
31
+ # Install modules and dependencies from spec/fixtures/modules
32
+ copy_fixture_modules_to(hosts)
32
33
  begin
33
- # Install modules and dependencies from spec/fixtures/modules
34
- copy_fixture_modules_to( hosts )
35
- begin
36
- server = only_host_with_role(hosts, 'server')
37
- rescue ArgumentError =>e
38
- server = only_host_with_role(hosts, 'default')
39
- end
40
-
41
- # Generate and install PKI certificates on each SUT
42
- Dir.mktmpdir do |cert_dir|
43
- run_fake_pki_ca_on(server, hosts, cert_dir )
44
- hosts.each{ |sut| copy_pki_to( sut, cert_dir, '/etc/pki/simp-testing' )}
45
- end
34
+ server = only_host_with_role(hosts, 'server')
35
+ rescue ArgumentError => e
36
+ server = only_host_with_role(hosts, 'default')
37
+ end
46
38
 
47
- # add PKI keys
48
- copy_keydist_to(server)
49
- rescue StandardError, ScriptError => e
50
- if ENV['PRY']
51
- require 'pry'; binding.pry
52
- else
53
- raise e
54
- end
39
+ # Generate and install PKI certificates on each SUT
40
+ Dir.mktmpdir do |cert_dir|
41
+ run_fake_pki_ca_on(server, hosts, cert_dir)
42
+ hosts.each { |sut| copy_pki_to(sut, cert_dir, '/etc/pki/simp-testing') }
55
43
  end
44
+
45
+ # add PKI keys
46
+ copy_keydist_to(server)
47
+ rescue StandardError, ScriptError => e
48
+ raise e unless ENV['PRY']
49
+ require 'pry'
50
+ binding.pry # rubocop:disable Lint/Debugger
56
51
  end
57
52
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.34.3
4
+ version: 1.35.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-12-23 00:00:00.000000000 Z
12
+ date: 2025-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -244,7 +244,7 @@ licenses:
244
244
  - Apache-2.0
245
245
  metadata:
246
246
  issue_tracker: https://github.com/simp/rubygem-simp-beaker-helpers/issues
247
- post_install_message:
247
+ post_install_message:
248
248
  rdoc_options: []
249
249
  require_paths:
250
250
  - lib
@@ -260,7 +260,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
260
  version: '0'
261
261
  requirements: []
262
262
  rubygems_version: 3.1.6
263
- signing_key:
263
+ signing_key:
264
264
  specification_version: 4
265
265
  summary: beaker helper methods for SIMP
266
266
  test_files: []