simp-beaker-helpers 3.1.2 → 3.2.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: 7487245f845a8b08a99fb9ff13bc22527ed5438c3ba59d9fcae3f98a7e48851c
4
- data.tar.gz: 8870dc7e054399cb22974c5858791389d6a0678985e9a2d332be8ff8f73bb8ae
3
+ metadata.gz: 715fefc3d0f97c9acd754714500ad5b7449bab8ff8cf37143d5c67ffaf23769a
4
+ data.tar.gz: f91cc5e9a932e037889ec0db8380dab0c3a146bb3a00c7724afa086dbab235ca
5
5
  SHA512:
6
- metadata.gz: 5254345501682c0657fe99d79616258ddd1126beb2b74cab969f31e4ce31b9f8f670c8981be75246492b60981304519ae8bd29480c7e939ed100f546f2b431f3
7
- data.tar.gz: b2e96e3bdd29439ae26ce70916b4a2ddfc34840ff8d9a3ba163c26a33cc3a75a29d0480be786a6890f5c0de92f600c686130e11fb30f31a532bed7af0e0637b8
6
+ metadata.gz: 8802f41a286e3ce1e504fe6753a0767575caf74d326d0a33f679c714f9026aa92b9b92ce2146f22547c9ba3fb41033d960eec3c20d0d58ad208df492695b1d17
7
+ data.tar.gz: 4dca280a068b3f74ad4993556215f6131ed3d68ca86ed6f8e36487f62f0872742d7dc371da63d88c8db80a8328a389d963d2dedb8a5bd6e6cbbab99891509770
data/.fixtures.yml CHANGED
@@ -4,6 +4,3 @@ fixtures:
4
4
  stdlib: https://github.com/simp/puppetlabs-stdlib
5
5
  simplib: https://github.com/simp/pupmod-simp-simplib
6
6
  compliance_markup: https://github.com/simp/pupmod-simp-compliance_markup
7
- disa_stig-el7-baseline:
8
- repo: https://github.com/mitre/redhat-enterprise-linux-7-stig-baseline
9
- target: spec/fixtures/inspec_deps/inspec_profiles/profiles
@@ -36,7 +36,7 @@ jobs:
36
36
  - name: "Install Ruby 3.2"
37
37
  uses: ruby/setup-ruby@v1
38
38
  with:
39
- ruby-version: 4.0.7
39
+ ruby-version: 4.0.9
40
40
  bundler-cache: true
41
41
  - run: |
42
42
  bundle show
@@ -52,10 +52,8 @@ jobs:
52
52
  puppet_version: '~> 8.0'
53
53
  ruby_version: '3.2'
54
54
  experimental: false
55
- # OpenVox 9 is unreleased; preview the future Ruby 4.0 / OpenVox 9
56
- # combo by running the OpenVox 8 gem on Ruby 4.0.
57
- - label: 'OpenVox 9.x preview (Ruby 4.0, OpenVox 8 gem)'
58
- puppet_version: '~> 8.0'
55
+ - label: 'OpenVox 9.x (Ruby 4.0)'
56
+ puppet_version: '~> 9.0'
59
57
  ruby_version: '4.0'
60
58
  experimental: false
61
59
  env:
@@ -71,6 +69,80 @@ jobs:
71
69
  - run: 'bundle exec rake spec'
72
70
  continue-on-error: ${{matrix.puppet.experimental}}
73
71
 
72
+ acceptance:
73
+ name: '${{matrix.beaker.suite}}, ${{matrix.puppet.label}}'
74
+ runs-on:
75
+ - ubuntu-latest
76
+ strategy:
77
+ matrix:
78
+ puppet:
79
+ - label: 'OpenVox 8.x'
80
+ puppet_version: '~> 8.0'
81
+ ruby_version: '3.2'
82
+ collection: 'openvox8'
83
+ experimental: false
84
+ beaker:
85
+ - label: beaker
86
+ suite: default
87
+ allowed_to_fail: false
88
+ - label: beaker puppet_collections
89
+ suite: puppet_collections
90
+ allowed_to_fail: false
91
+ fail-fast: false
92
+ env:
93
+ PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
94
+ steps:
95
+ - name: checkout repo
96
+ uses: actions/checkout@v7
97
+ - name: setup ruby
98
+ uses: ruby/setup-ruby@v1
99
+ with:
100
+ ruby-version: ${{ matrix.puppet.ruby_version }}
101
+ - name: ensure entropy
102
+ run: |
103
+ sudo apt-get update -y
104
+ sudo apt-get install -y rng-tools
105
+ sudo systemctl start rng-tools
106
+ - name: install docker
107
+ run: |
108
+ set -x
109
+ sudo apt-get remove -y podman ||:
110
+ sudo apt-get install -y docker-ce docker docker-engine docker.io containerd runc ||:
111
+ sudo apt-get update
112
+ sudo apt autoremove -y
113
+ sudo systemctl start docker
114
+ - name: install bundle
115
+ run: |
116
+ bundle config path vendor
117
+ bundle install -j $(nproc)
118
+ - name: set BEAKER_PUPPET_COLLECTION
119
+ if: ${{matrix.puppet.collection}}
120
+ run: echo "BEAKER_PUPPET_COLLECTION=${{matrix.puppet.collection}}" >> $GITHUB_ENV
121
+ - name: 'run beaker:suite "${{matrix.beaker.label}}"'
122
+ continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}}
123
+ env:
124
+ BEAKER_SUITE: ${{matrix.beaker.suite}}
125
+ run: bundle exec rake beaker:suites[$BEAKER_SUITE,docker]
126
+
127
+ # The one check for branch protection to require: GitHub only blocks a
128
+ # merge on checks listed by name, and this job fails unless every job it
129
+ # needs succeeded. Add any new job in this workflow to `needs:`.
130
+ all-checks:
131
+ name: 'All checks'
132
+ if: always()
133
+ needs:
134
+ - ruby-style
135
+ - spec-tests
136
+ - acceptance
137
+ runs-on: ubuntu-latest
138
+ steps:
139
+ - name: 'Fail unless every needed job succeeded'
140
+ env:
141
+ NEEDS: ${{ toJSON(needs) }}
142
+ run: |
143
+ jq -r 'to_entries[] | "\(.key): \(.value.result)"' <<< "$NEEDS"
144
+ jq -e 'all(.[]; .result == "success")' <<< "$NEEDS" > /dev/null
145
+
74
146
  # dump_contexts:
75
147
  # name: 'Examine Context contents'
76
148
  # runs-on: ubuntu-latest
@@ -92,7 +92,7 @@ jobs:
92
92
  echo "release_command=$GEM_RELEASE_COMMAND" | tee -a "$GITHUB_OUTPUT"
93
93
  - uses: ruby/setup-ruby@v1
94
94
  with:
95
- ruby-version: 4.0.7
95
+ ruby-version: 4.0.9
96
96
  bundler-cache: true
97
97
  - name: Test build the package
98
98
  run: "${{ steps.commands.outputs.build_command }}"
@@ -184,7 +184,7 @@ jobs:
184
184
  clean: true
185
185
  - uses: ruby/setup-ruby@v1
186
186
  with:
187
- ruby-version: 4.0.7
187
+ ruby-version: 4.0.9
188
188
  bundler-cache: true
189
189
  - name: Build RubyGem
190
190
  run: |
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 3.2.0 / 2026-11-13
2
+ * Added:
3
+ * Tested with OpenVox 9 (the gem itself does not constrain the openvox
4
+ version)
5
+ * Deprecated:
6
+ * `Simp::BeakerHelpers::Inspec` now warns when used and will be removed in
7
+ the next major release
8
+
1
9
  ### 3.1.2 / 2026-09-29
2
10
  * Fixed:
3
11
  * Minor changes for rubocop 1.91
data/Gemfile CHANGED
@@ -41,13 +41,13 @@ group :system_tests do
41
41
  gem 'ed25519'
42
42
  gem 'net-ssh'
43
43
  # renovate: datasource=rubygems versioning=ruby
44
- gem 'openvox', ENV.fetch('OPENVOX_VERSION', ENV.fetch('PUPPET_VERSION', ['>= 8.0.0', '< 9.0.0']))
44
+ gem 'openvox', ENV.fetch('OPENVOX_VERSION', ENV.fetch('PUPPET_VERSION', ['>= 8.0.0', '< 10.0.0']))
45
45
  gem 'pry-byebug', '~> 3.12.0'
46
46
  gem 'syslog' # Required for Ruby >= 3.4
47
47
  end
48
48
 
49
49
  group :tests do
50
- gem 'rubocop', '~> 1.91.0'
50
+ gem 'rubocop', '~> 1.92.0'
51
51
  gem 'rubocop-performance', '~> 1.27.0'
52
52
  gem 'rubocop-rake', '~> 0.7.0'
53
53
  gem 'rubocop-rspec', '~> 3.10.0'
data/README.md CHANGED
@@ -262,8 +262,8 @@ copy_fixture_modules_to( suts = hosts, opts = {} )
262
262
  - **`opts`** = _(Hash)_ Options passed on to `copy_module_to()` for each SUT
263
263
 
264
264
  By default, this will copy modules to the first path listed in each SUT's
265
- `modulepath` and simulate a pluginsync so the Beaker DSL's `facter_on` will
266
- still work.
265
+ `modulepath` and simulate a pluginsync, which copies the modules' plugins (such
266
+ as custom facts) into each SUT's `libdir`.
267
267
 
268
268
  If you need to use a non-default module path:
269
269
  ```ruby
@@ -275,7 +275,7 @@ copy_fixture_modules_to( hosts, {
275
275
 
276
276
  If you want to disable pluginsync:
277
277
  ```ruby
278
- # WARNING: `fact_on` will not see custom facts
278
+ # `fact_on` and `pfact_on` still see the copied modules' facts
279
279
  copy_fixture_modules_to( hosts, {
280
280
  :pluginsync => false
281
281
  })
@@ -462,10 +462,11 @@ might try to install packages before subscription manager is configured.
462
462
 
463
463
  #### BEAKER_inspec_version
464
464
 
465
- The version of InSpec to use when running inspec tests. Currently hard-coded to
466
- `4.16.14` due to a bug introduced in `4.16.15`.
465
+ **Deprecated:** `Simp::BeakerHelpers::Inspec` will be removed in the next
466
+ major release.
467
467
 
468
- Set to 'latest' to use the latest available in the upstream repos.
468
+ The version of InSpec that `Simp::BeakerHelpers::Inspec` installs. Defaults to
469
+ `latest`, the newest version in the upstream repos.
469
470
 
470
471
  #### BEAKER_RHSM_UNSUBSCRIBE
471
472
 
@@ -3,14 +3,26 @@ module Simp::BeakerHelpers
3
3
  require 'simp/beaker_helpers/constants'
4
4
 
5
5
  # Helpers for working with Inspec
6
+ #
7
+ # @deprecated Will be removed in the next major release.
6
8
  class Inspec
7
9
  require 'json'
8
10
 
11
+ # Warn once per process that this helper is deprecated
12
+ def self.deprecation_warning
13
+ return if @deprecation_warned
14
+
15
+ warn('DEPRECATION: Simp::BeakerHelpers::Inspec is deprecated and will be removed in the next major release of simp-beaker-helpers')
16
+ @deprecation_warned = true
17
+ end
18
+
9
19
  attr_reader :profile
10
20
  attr_reader :profile_dir
11
21
  attr_reader :deps_root
12
22
 
13
23
  def self.enable_repo_on(suts)
24
+ deprecation_warning
25
+
14
26
  parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
15
27
  block_on(suts, run_in_parallel: parallel) do |sut|
16
28
  repo_manifest = create_yum_resource(
@@ -34,6 +46,8 @@ module Simp::BeakerHelpers
34
46
  # The name of the profile against which to run
35
47
  #
36
48
  def initialize(sut, profile)
49
+ self.class.deprecation_warning
50
+
37
51
  @inspec_version = ENV['BEAKER_inspec_version'] || 'latest'
38
52
 
39
53
  @sut = sut
@@ -240,12 +254,10 @@ module Simp::BeakerHelpers
240
254
 
241
255
  if control['results'] && !control['results'].empty?
242
256
  status = :passed
243
- color = 'green'
244
257
 
245
258
  control['results'].each do |_result|
246
259
  if %r{^fail}.match?(results['status'])
247
260
  status = :failed
248
- color = 'red'
249
261
  end
250
262
  end
251
263
 
@@ -4,5 +4,5 @@
4
4
  module Simp; end
5
5
 
6
6
  module Simp::BeakerHelpers # rubocop:disable Style/OneClassPerFile
7
- VERSION = '3.1.2'
7
+ VERSION = '3.2.0'
8
8
  end
@@ -6,13 +6,6 @@ context 'after copy_fixture_modules_to( hosts )' do
6
6
  copy_fixture_modules_to(hosts)
7
7
  end
8
8
 
9
- describe "fact_on(default,'root_home')" do
10
- # fact_on in beaker_puppet_helpers is equivalent to pfact_on
11
- xit 'does not return value of `root_home`' do
12
- expect(fact_on(default, 'root_home').to_s).to eq ''
13
- end
14
- end
15
-
16
9
  describe "pfact_on(default,'root_home')" do
17
10
  it 'returns value of `root_home`' do
18
11
  expect(pfact_on(default, 'root_home')).to eq '/root'
@@ -145,16 +145,9 @@ describe 'Simp::BeakerHelpers' do
145
145
  end
146
146
 
147
147
  it 'uses defaults when no environment variables are set' do
148
- # Prevent namespace pollution
149
- pipe_out, pipe_in = IO.pipe
150
- fork do
151
- pipe_out.close
152
- require 'puppet'
153
- pipe_in.write(Puppet.version)
154
- end
155
- pipe_in.close
156
-
157
- expected_major_version = pipe_out.gets.split('.').first
148
+ # The default collection follows DEFAULT_PUPPET_AGENT_VERSION, not the
149
+ # openvox gem the test suite happens to be running under
150
+ expected_major_version = Simp::BeakerHelpers::DEFAULT_PUPPET_AGENT_VERSION[%r{\d+}]
158
151
 
159
152
  expect(helper.get_puppet_install_info[:puppet_collection]).to eq("puppet#{expected_major_version}")
160
153
  expect(helper.get_puppet_install_info[:puppet_install_type]).to eq('agent')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
8
8
  - Trevor Vaughan
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-09-30 00:00:00.000000000 Z
11
+ date: 2026-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: beaker
@@ -196,7 +196,6 @@ files:
196
196
  - ".fixtures.yml"
197
197
  - ".github/workflows.local.json"
198
198
  - ".github/workflows/add_new_issue_to_triage_project.yml"
199
- - ".github/workflows/pr_acceptance.yml"
200
199
  - ".github/workflows/pr_tests.yml"
201
200
  - ".github/workflows/tag_deploy_rubygem.yml"
202
201
  - ".gitignore"
@@ -237,9 +236,6 @@ files:
237
236
  - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
238
237
  - spec/acceptance/suites/fips_from_fixtures/metadata.yml
239
238
  - spec/acceptance/suites/fips_from_fixtures/nodesets
240
- - spec/acceptance/suites/inspec/00_default_spec.rb
241
- - spec/acceptance/suites/inspec/metadata.yml
242
- - spec/acceptance/suites/inspec/nodesets
243
239
  - spec/acceptance/suites/offline/00_default_spec.rb
244
240
  - spec/acceptance/suites/offline/README
245
241
  - spec/acceptance/suites/offline/nodesets/default.yml
@@ -254,9 +250,6 @@ files:
254
250
  - spec/acceptance/suites/windows/nodesets/win2012.yml
255
251
  - spec/acceptance/suites/windows/nodesets/win2016.yml
256
252
  - spec/acceptance/suites/windows/nodesets/win2019.yml
257
- - spec/fixtures/inspec_profiles/CentOS-7-disa_stig
258
- - spec/fixtures/inspec_profiles/RedHat-7-disa_stig/controls/00_Control_Selector.rb
259
- - spec/fixtures/inspec_profiles/RedHat-7-disa_stig/inspec.yml
260
253
  - spec/lib/simp/beaker_helpers_spec.rb
261
254
  - spec/spec_helper.rb
262
255
  - spec/spec_helper_acceptance.rb
@@ -1,72 +0,0 @@
1
- # Run all tests as GitHub Actions
2
- ---
3
- name: Acceptance Tests
4
- 'on':
5
- push:
6
- branches:
7
- # A test branch for seeing if your tests will pass in your personal fork
8
- - test_me_github
9
- pull_request:
10
- types: [opened, reopened, synchronize]
11
-
12
- jobs:
13
- acceptance:
14
- name: '${{matrix.beaker.suite}}, ${{matrix.puppet.label}}'
15
- runs-on:
16
- - ubuntu-latest
17
- strategy:
18
- matrix:
19
- puppet:
20
- - label: 'OpenVox 8.x'
21
- puppet_version: '~> 8.0'
22
- ruby_version: '3.2'
23
- collection: 'openvox8'
24
- experimental: false
25
- beaker:
26
- - label: beaker
27
- suite: default
28
- allowed_to_fail: false
29
- - label: beaker puppet_collections
30
- suite: puppet_collections
31
- allowed_to_fail: false
32
- # The inspec suite fails for unclear reasons during an scp.
33
- # Sicura tests compliance at the framework level, so troubleshooting
34
- # inspec acceptance tests is not a priority at present.
35
- - label: beaker inspec
36
- suite: inspec
37
- allowed_to_fail: true
38
- fail-fast: false
39
- env:
40
- PUPPET_VERSION: ${{matrix.puppet.puppet_version}}
41
- steps:
42
- - name: checkout repo
43
- uses: actions/checkout@v7
44
- - name: setup ruby
45
- uses: ruby/setup-ruby@v1
46
- with:
47
- ruby-version: ${{ matrix.puppet.ruby_version }}
48
- - name: ensure entropy
49
- run: |
50
- sudo apt-get update -y
51
- sudo apt-get install -y rng-tools
52
- sudo systemctl start rng-tools
53
- - name: install docker
54
- run: |
55
- set -x
56
- sudo apt-get remove -y podman ||:
57
- sudo apt-get install -y docker-ce docker docker-engine docker.io containerd runc ||:
58
- sudo apt-get update
59
- sudo apt autoremove -y
60
- sudo systemctl start docker
61
- - name: install bundle
62
- run: |
63
- bundle config path vendor
64
- bundle install -j $(nproc)
65
- - name: set BEAKER_PUPPET_COLLECTION
66
- if: ${{matrix.puppet.collection}}
67
- run: echo "BEAKER_PUPPET_COLLECTION=${{matrix.puppet.collection}}" >> $GITHUB_ENV
68
- - name: 'run beaker:suite "${{matrix.beaker.label}}"'
69
- continue-on-error: ${{matrix.puppet.experimental || matrix.beaker.allowed_to_fail}}
70
- env:
71
- BEAKER_SUITE: ${{matrix.beaker.suite}}
72
- run: bundle exec rake beaker:suites[$BEAKER_SUITE,docker]
@@ -1,52 +0,0 @@
1
- require 'spec_helper_acceptance'
2
- require 'json'
3
-
4
- test_name 'Inspec STIG Profile'
5
-
6
- describe 'Inspec STIG Profile' do
7
- profiles_to_validate = ['disa_stig']
8
-
9
- hosts.each do |host|
10
- profiles_to_validate.each do |profile|
11
- context "for profile #{profile}" do
12
- context "on #{host}" do
13
- profile_path = File.join(
14
- fixtures_path,
15
- 'inspec_profiles',
16
- "#{fact_on(host, 'os.name')}-#{fact_on(host, 'os.release.major')}-#{profile}",
17
- )
18
-
19
- if File.exist?(profile_path)
20
- let(:inspec) do
21
- Simp::BeakerHelpers::Inspec.enable_repo_on(hosts)
22
- Simp::BeakerHelpers::Inspec.new(host, profile)
23
- end
24
-
25
- let(:inspec_report_data) { inspec.process_inspec_results }
26
-
27
- # rubocop:disable-next RSpec/RepeatedDescription
28
- it 'runs inspec' do
29
- inspec.run
30
- end
31
-
32
- it 'has an inspec report' do
33
- expect(inspec_report_data).not_to be_nil
34
-
35
- inspec.write_report(inspec_report_data)
36
- end
37
-
38
- it 'has a report' do
39
- expect(inspec_report_data[:report]).not_to be_nil
40
- puts inspec_report_data[:report] # rubocop:disable RSpec/Output
41
- end
42
- else
43
- # rubocop:disable-next RSpec/RepeatedDescription
44
- it 'runs inspec' do
45
- skip("No matching profile available at #{profile_path}")
46
- end
47
- end
48
- end
49
- end
50
- end
51
- end
52
- end
@@ -1,2 +0,0 @@
1
- ---
2
- 'default_run': true
@@ -1 +0,0 @@
1
- ../../nodesets
@@ -1 +0,0 @@
1
- RedHat-7-disa_stig
@@ -1,45 +0,0 @@
1
- skips = {
2
- 'V-72209' => 'Cannot guarantee a remote syslog server during test'
3
- }
4
- overrides = [ 'V-72091' ]
5
- subsystems = []
6
-
7
- require_controls 'disa_stig-el7-baseline' do
8
- skips.each_pair do |ctrl, reason|
9
- control ctrl do
10
- describe "Skip #{ctrl}" do
11
- skip "Reason: #{skips[ctrl]}" do
12
- end
13
- end
14
- end
15
- end
16
-
17
- @conf['profile'].info[:controls].each do |ctrl|
18
- next if (overrides + skips.keys).include?(ctrl[:id])
19
-
20
- if subsystems.empty?
21
- control ctrl[:id]
22
- else
23
- tags = ctrl[:tags]
24
- if tags && tags[:subsystems]
25
- subsystems.each do |subsystem|
26
- if tags[:subsystems].include?(subsystem)
27
- control ctrl[:id]
28
- end
29
- end
30
- end
31
- end
32
- end
33
-
34
- ## Overrides ##
35
-
36
- # There's no email server to send anything to by default so syslog is a safer
37
- # default for processing.
38
- control 'V-72091' do
39
- overrides << self.to_s
40
-
41
- describe auditd_conf do
42
- its('space_left_action.downcase') { should cmp 'syslog' }
43
- end
44
- end
45
- end
@@ -1,14 +0,0 @@
1
- name: EL7 STIG
2
- title: STIG for EL 7
3
- supports:
4
- - os-family: redhat
5
- maintainer: SIMP Team
6
- copyright: Onyx Point, Inc.
7
- copyright_email: simp@onyxpoint.com
8
- license: Apache-2.0
9
- summary: |
10
- A collection of InSpec tests
11
- version: 0.0.1
12
- depends:
13
- - name: disa_stig-el7-baseline
14
- path: ../../inspec_deps/inspec_profiles/profiles/disa_stig-el7-baseline