Skip to content

Commit

Permalink
Fix derivatives hack (#168)
Browse files Browse the repository at this point in the history
 Fix derivatives hack

Update the derivatives workaround to insert an inert line instead of
commenting out the previous line to allow for logic updates

* Removed EL8 inspec material - unsure what happened to the upstream repo
* Corrected test title
* Addressed a bug where passing an empty exceptions array would produce
  an invalid xpath query
* Ensure that the new SIMP community RPMs are used

Closes #166
Closes #167

Co-authored-by: Chris Tessmer <[email protected]>
  • Loading branch information
trevor-vaughan and op-ct authored Mar 10, 2022
1 parent 55af4b1 commit a4ed105
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 73 deletions.
3 changes: 0 additions & 3 deletions .fixtures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,3 @@ fixtures:
disa_stig-el7-baseline:
repo: https://github.com/mitre/redhat-enterprise-linux-7-stig-baseline
target: spec/fixtures/inspec_deps/inspec_profiles/profiles
disa_stig-el8-baseline:
repo: https://github.com/mitre/redhat-enterprise-linux-8-stig-baseline
target: spec/fixtures/inspec_deps/inspec_profiles/profiles
2 changes: 1 addition & 1 deletion .github/workflows/pr_acceptance.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Run all tests as GitHub Actions
name: Unit Tests
name: Acceptance Tests
on:
push:
branches:
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### 1.24.2 / 2022-02-20
* Fixed:
* Update the derivatives workaround to insert an inert line instead of
commenting out the previous line to allow for logic updates
* Addressed a bug where passing an empty exceptions array would produce an
invalid xpath query
* Ensure that the new SIMP community RPMs are used

### 1.24.1 / 2021-10-27
* Fixed:
* Worked around a bug in 'puppet lookup' - PUP-11402
Expand Down
4 changes: 3 additions & 1 deletion lib/simp/beaker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1498,10 +1498,12 @@ def install_simp_repos(suts, disable = [])
block_on(suts, :run_in_parallel => parallel) do |sut|
install_package_unless_present_on(sut, 'yum-utils')

release = fact_on(sut, 'os.release.major')

install_package_unless_present_on(
sut,
'simp-release-community',
"https://download.simp-project.com/simp-release-community.rpm",
"https://download.simp-project.com/simp-release-community.el#{release}.rpm"
)

to_disable = disable.dup
Expand Down
4 changes: 1 addition & 3 deletions lib/simp/beaker_helpers/inspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ def self.enable_repo_on(suts)
# The name of the profile against which to run
#
def initialize(sut, profile)
# The 4.41 release is currently broken
# @inspec_version = ENV['BEAKER_inspec_version'] || 'latest'
@inspec_version = ENV['BEAKER_inspec_version'] || '4.39.0'
@inspec_version = ENV['BEAKER_inspec_version'] || 'latest'

@sut = sut

Expand Down
7 changes: 3 additions & 4 deletions lib/simp/beaker_helpers/ssg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,8 @@ def self.process_ssg_results(result_file, filter=nil, exclusions=nil)

xpath_query << ')' if filter.size > 1

if exclusions
exclusions = Array(exclusions)

exclusions = Array(exclusions)
unless exclusions.empty?
xpath_query << 'and not('

xpath_query << exclusions.map do |exl|
Expand Down Expand Up @@ -419,7 +418,7 @@ def get_ssg_datastream
#
# This isn't 100% correct but it's "good enough" for an automated CI
# environment to tell us if something is critically out of alignment.
on(@sut, %(cd scap-content/build-scripts; sed -ci 's/ssg.build_derivatives.profile_handling/#ssg.build_derivatives.profile_handling/g' enable_derivatives.py))
on(@sut, %(cd scap-content/build-scripts; sed -ci 's/ssg.build_derivatives.profile_handling/__simp_dontcare__ = None #ssg.build_derivatives.profile_handling/g' enable_derivatives.py))

on(@sut, %(cd scap-content/build; cmake ../; make -j4 #{OS_INFO[@os][@os_rel]['ssg']['build_target']}-content && cp *ds.xml #{@scap_working_dir}))
end
Expand Down
2 changes: 1 addition & 1 deletion lib/simp/beaker_helpers/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Simp; end

module Simp::BeakerHelpers
VERSION = '1.24.1'
VERSION = '1.24.2'
end
1 change: 0 additions & 1 deletion spec/fixtures/inspec_profiles/CentOS-8-disa_stig

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions spec/fixtures/inspec_profiles/RedHat-8-disa_stig/inspec.yml

This file was deleted.

0 comments on commit a4ed105

Please sign in to comment.