simp-beaker-helpers 1.24.1 → 1.24.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf9271df59bd88be59e1555cd5536c0906f7d09dcb2d1096df801302b1ebbd0d
4
- data.tar.gz: 967fb58eb7e5561c35b32899beb972d4b0f70a423239d05e5e12aad20b207658
3
+ metadata.gz: ea59f88fb5dfa33fe812b52e53dfb71ff10e104f9eb720cd4f233974478ba6dc
4
+ data.tar.gz: 39ef7ef09f672407964dfb2e06302131583864a50ed9fd89ec71238ff1f86ee6
5
5
  SHA512:
6
- metadata.gz: 9dfd8dcd9bb759cd995aad0f33f072064537dccd5d96cd9b19e5193b069a8c62b5df860802c8a99f0478bbb596fa882cbd8f482d1d581ff9c72218049c3051f2
7
- data.tar.gz: bd0af0b10d2b743c2f8995821d00c64c4d3bf9d387ebefd3c6af81e4bb738b88ded50671214baf7c74e174fa5e4eb8f884722c5d34c4a06f831e4d79fd098b10
6
+ metadata.gz: bc4ab204f1df2a4a141951d87df4677f449830394d315015079b324c028a7eafe8b32f12a03384b1bc9c01effb8bb5a4cc8e9998349c0bc3f4f9a80c50283d9a
7
+ data.tar.gz: e6a63e7e5175abf091cdb7694be5dd889263a3e2fbfd908657d24367199a79c31faa44a5d9b1eb3964534ffe7a64f50f366dc151cdd250548aec7ebc67c2590a
data/.fixtures.yml CHANGED
@@ -7,6 +7,3 @@ fixtures:
7
7
  disa_stig-el7-baseline:
8
8
  repo: https://github.com/mitre/redhat-enterprise-linux-7-stig-baseline
9
9
  target: spec/fixtures/inspec_deps/inspec_profiles/profiles
10
- disa_stig-el8-baseline:
11
- repo: https://github.com/mitre/redhat-enterprise-linux-8-stig-baseline
12
- target: spec/fixtures/inspec_deps/inspec_profiles/profiles
@@ -1,5 +1,5 @@
1
1
  # Run all tests as GitHub Actions
2
- name: Unit Tests
2
+ name: Acceptance Tests
3
3
  on:
4
4
  push:
5
5
  branches:
@@ -21,7 +21,7 @@
21
21
  #
22
22
  # NOTES:
23
23
  #
24
- # * The CHANGLOG text is altered to remove RPM-style date headers, which don't
24
+ # * The CHANGELOG text is altered to remove RPM-style date headers, which don't
25
25
  # render well as markdown on the GitHub release pages
26
26
  #
27
27
  # * By default, the gem is built and released using the standard rake tasks
@@ -37,12 +37,15 @@
37
37
  # All keys are optional.
38
38
  #
39
39
  ---
40
- name: 'Tag: Release to GitHub & rubygems.org'
40
+ name: 'Tag: Release to GitHub + rubygems.org (no RPMS)'
41
41
 
42
42
  on:
43
43
  push:
44
44
  tags:
45
+ # NOTE: These filter patterns aren't actually regexes:
46
+ # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
45
47
  - '[0-9]+\.[0-9]+\.[0-9]+'
48
+ - '[0-9]+\.[0-9]+\.[0-9]+\-[a-z]+[0-9]+'
46
49
 
47
50
  env:
48
51
  PUPPET_VERSION: '~> 6'
@@ -52,11 +55,7 @@ jobs:
52
55
  releng-checks:
53
56
  name: "RELENG checks"
54
57
  if: github.repository_owner == 'simp'
55
- runs-on: ubuntu-18.04
56
- outputs:
57
- build_command: ${{ steps.commands.outputs.build_command }}
58
- release_command: ${{ steps.commands.outputs.release_command }}
59
- pkg_dir: ${{ steps.commands.outputs.pkg_dir }}
58
+ runs-on: ubuntu-latest
60
59
  steps:
61
60
  - name: "Assert '${{ github.ref }}' is a tag"
62
61
  run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
@@ -64,7 +63,7 @@ jobs:
64
63
  with:
65
64
  ref: ${{ github.ref }}
66
65
  clean: true
67
- - name: Determing build and release commands
66
+ - name: Determine build and release commands
68
67
  id: commands
69
68
  run: |
70
69
  # By default, these are the standard tasks from "bundler/gem_tasks"
@@ -92,9 +91,7 @@ jobs:
92
91
  ruby-version: 2.5
93
92
  bundler-cache: true
94
93
  - name: Test build the package
95
- env:
96
- GEM_BUILD_COMMAND: ${{ steps.commands.outputs.build_command }}
97
- run: "$GEM_BUILD_COMMAND"
94
+ run: "${{ steps.commands.outputs.build_command }}"
98
95
  - name: "Assert '${{ github.ref }}' matches the package version"
99
96
  run: |
100
97
  tag="${GITHUB_REF/refs\/tags\//}"
@@ -109,7 +106,9 @@ jobs:
109
106
  name: Deploy GitHub Release
110
107
  needs: [ releng-checks ]
111
108
  if: github.repository_owner == 'simp'
112
- runs-on: ubuntu-18.04
109
+ runs-on: ubuntu-latest
110
+ outputs:
111
+ prerelease: ${{ steps.tag-check.outputs.prerelease }}
113
112
  steps:
114
113
  - name: Checkout code
115
114
  uses: actions/checkout@v2
@@ -117,6 +116,7 @@ jobs:
117
116
  ref: ${{ github.ref }}
118
117
  clean: true
119
118
  fetch-depth: 0
119
+
120
120
  - name: Get tag & annotation info (${{github.ref}})
121
121
  id: tag-check
122
122
  run: |
@@ -124,7 +124,19 @@ jobs:
124
124
  annotation="$(git for-each-ref "$GITHUB_REF" --format='%(contents)' --count=1)"
125
125
  annotation_title="$(echo "$annotation" | head -1)"
126
126
 
127
+
128
+ if [[ "$tag" =~ ^(simp-|v)?[0-9]+\.[0-9]+\.[0-9]+(-(rc|alpha|beta|pre|post)?([0-9]+)?)?$ ]]; then
129
+ if [ -n "${BASH_REMATCH[2]}" ]; then
130
+ prerelease=yes
131
+ annotation_title="Pre-release of ${tag}"
132
+ fi
133
+ else
134
+ printf '::error ::Release Tag format is not SemVer, X.Y.Z-R, X.Y.Z-<prerelease>: "%s"\n' "$RELEASE_TAG"
135
+ exit 88
136
+ fi
137
+
127
138
  echo "::set-output name=tag::${tag}"
139
+ echo "::set-output name=prerelease::${prerelease}"
128
140
  echo "::set-output name=annotation_title::${annotation_title}"
129
141
 
130
142
  # Prepare annotation body as a file for the next step
@@ -146,14 +158,14 @@ jobs:
146
158
  tag_name: ${{ github.ref }}
147
159
  release_name: ${{ steps.tag-check.outputs.annotation_title }}
148
160
  body_path: /tmp/annotation.body
161
+ prerelease: ${{ steps.tag-check.outputs.prerelease == 'yes'}}
149
162
  draft: false
150
- prerelease: false
151
163
 
152
164
  deploy-rubygem:
153
165
  name: Deploy RubyGem Release
154
- needs: [ releng-checks ]
155
- if: github.repository_owner == 'simp'
156
- runs-on: ubuntu-18.04
166
+ needs: [ releng-checks, create-github-release ]
167
+ if: (github.repository_owner == 'simp') && (needs.create-github-release.outputs.prerelease != 'yes')
168
+ runs-on: ubuntu-latest
157
169
  env:
158
170
  RUBYGEMS_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
159
171
  BUILD_COMMAND: ${{ needs.releng-checks.outputs.build_command }}
data/.gitlab-ci.yml CHANGED
@@ -209,13 +209,6 @@ variables:
209
209
  # Puppet Versions
210
210
  #-----------------------------------------------------------------------
211
211
 
212
- .pup_5_x: &pup_5_x
213
- image: 'ruby:2.4'
214
- variables:
215
- PUPPET_VERSION: '~> 5.0'
216
- BEAKER_PUPPET_COLLECTION: 'puppet5'
217
- MATRIX_RUBY_VERSION: '2.4'
218
-
219
212
  .pup_6_x: &pup_6_x
220
213
  image: 'ruby:2.5'
221
214
  variables:
@@ -332,12 +325,6 @@ fips_from_fixtures:
332
325
  script:
333
326
  - bundle exec rake beaker:suites[fips_from_fixtures]
334
327
 
335
- puppet5_collections:
336
- <<: *pup_5_x
337
- <<: *acceptance_base
338
- script:
339
- - bundle exec rake beaker:suites[puppet_collections]
340
-
341
328
  puppet6_collections:
342
329
  <<: *pup_6_x
343
330
  <<: *acceptance_base
data/CHANGELOG.md CHANGED
@@ -1,3 +1,24 @@
1
+ ### 1.24.4 / 2022-04-28
2
+ * Fixed:
3
+ * Workaround for [MODULES-11315] in `puppet-agent-versions.yaml`
4
+ * Removed:
5
+ * Dropped acceptance tests for Puppet 5.5
6
+
7
+ [MODULES-11315]: https://tickets.puppetlabs.com/browse/MODULES-11315
8
+
9
+ ### 1.24.3 / 2022-04-10
10
+ * Fixed:
11
+ * Added python-setuptools to the list of required packages
12
+
13
+ ### 1.24.2 / 2022-03-09
14
+ * Fixed:
15
+ * Prevent `spec/` directory symlink recursion in `copy_fixture_modules_to`
16
+ * Update the derivatives workaround to insert an inert line instead of
17
+ commenting out the previous line to allow for logic updates
18
+ * Addressed a bug where passing an empty exceptions array would produce an
19
+ invalid xpath query
20
+ * Ensure that the new SIMP community RPMs are used
21
+
1
22
  ### 1.24.1 / 2021-10-27
2
23
  * Fixed:
3
24
  * Worked around a bug in 'puppet lookup' - PUP-11402
@@ -44,3 +44,4 @@ version_mappings:
44
44
  '4.2.0': '1.2.1'
45
45
  '4.1.0': '1.1.1'
46
46
  '4.0.0': '1.0.1'
47
+ '6.27.0': '6.27.1' # latest gem is 6.7.0, only RPM is 6.7.1
@@ -34,9 +34,7 @@ module Simp::BeakerHelpers
34
34
  # The name of the profile against which to run
35
35
  #
36
36
  def initialize(sut, profile)
37
- # The 4.41 release is currently broken
38
- # @inspec_version = ENV['BEAKER_inspec_version'] || 'latest'
39
- @inspec_version = ENV['BEAKER_inspec_version'] || '4.39.0'
37
+ @inspec_version = ENV['BEAKER_inspec_version'] || 'latest'
40
38
 
41
39
  @sut = sut
42
40
 
@@ -23,11 +23,12 @@ module Simp::BeakerHelpers
23
23
  'PyYAML',
24
24
  'cmake',
25
25
  'git',
26
- 'openscap-scanner',
27
26
  'openscap-python',
27
+ 'openscap-scanner',
28
28
  'openscap-utils',
29
29
  'python-jinja2',
30
- 'python-lxml'
30
+ 'python-lxml',
31
+ 'python-setuptools'
31
32
  ]
32
33
 
33
34
  EL8_PACKAGES = [
@@ -41,6 +42,7 @@ module Simp::BeakerHelpers
41
42
  'python3-jinja2',
42
43
  'python3-lxml',
43
44
  'python3-pyyaml',
45
+ 'python3-setuptools',
44
46
  'libarchive'
45
47
  ]
46
48
 
@@ -278,9 +280,8 @@ module Simp::BeakerHelpers
278
280
 
279
281
  xpath_query << ')' if filter.size > 1
280
282
 
281
- if exclusions
282
- exclusions = Array(exclusions)
283
-
283
+ exclusions = Array(exclusions)
284
+ unless exclusions.empty?
284
285
  xpath_query << 'and not('
285
286
 
286
287
  xpath_query << exclusions.map do |exl|
@@ -419,7 +420,7 @@ module Simp::BeakerHelpers
419
420
  #
420
421
  # This isn't 100% correct but it's "good enough" for an automated CI
421
422
  # environment to tell us if something is critically out of alignment.
422
- on(@sut, %(cd scap-content/build-scripts; sed -ci 's/ssg.build_derivatives.profile_handling/#ssg.build_derivatives.profile_handling/g' enable_derivatives.py))
423
+ 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))
423
424
 
424
425
  on(@sut, %(cd scap-content/build; cmake ../; make -j4 #{OS_INFO[@os][@os_rel]['ssg']['build_target']}-content && cp *ds.xml #{@scap_working_dir}))
425
426
  end
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.24.1'
4
+ VERSION = '1.24.4'
5
5
  end
@@ -411,7 +411,7 @@ module Simp::BeakerHelpers
411
411
  begin
412
412
  tarfile = "#{Simp::BeakerHelpers.tmpname}.tar"
413
413
 
414
- excludes = PUPPET_MODULE_INSTALL_IGNORE.map do |x|
414
+ excludes = (PUPPET_MODULE_INSTALL_IGNORE + ['spec']).map do |x|
415
415
  x = "--exclude '*/#{x}'"
416
416
  end.join(' ')
417
417
 
@@ -1498,10 +1498,12 @@ module Simp::BeakerHelpers
1498
1498
  block_on(suts, :run_in_parallel => parallel) do |sut|
1499
1499
  install_package_unless_present_on(sut, 'yum-utils')
1500
1500
 
1501
+ release = fact_on(sut, 'os.release.major')
1502
+
1501
1503
  install_package_unless_present_on(
1502
1504
  sut,
1503
1505
  'simp-release-community',
1504
- "https://download.simp-project.com/simp-release-community.rpm",
1506
+ "https://download.simp-project.com/simp-release-community.el#{release}.rpm"
1505
1507
  )
1506
1508
 
1507
1509
  to_disable = disable.dup
@@ -21,14 +21,6 @@ HOSTS:
21
21
  box: generic/centos8
22
22
  hypervisor: <%= hypervisor %>
23
23
 
24
- el8-0:
25
- roles:
26
- - el8
27
- platform: el-8-x86_64
28
- box: centos/8
29
- box_version: "1905.1"
30
- hypervisor: <%= hypervisor %>
31
-
32
24
  CONFIG:
33
25
  log_level: verbose
34
26
  type: aio
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simp-beaker-helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.24.1
4
+ version: 1.24.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-01-11 00:00:00.000000000 Z
12
+ date: 2022-04-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -254,11 +254,8 @@ files:
254
254
  - spec/acceptance/suites/windows/nodesets/win2016.yml
255
255
  - spec/acceptance/suites/windows/nodesets/win2019.yml
256
256
  - spec/fixtures/inspec_profiles/CentOS-7-disa_stig
257
- - spec/fixtures/inspec_profiles/CentOS-8-disa_stig
258
257
  - spec/fixtures/inspec_profiles/RedHat-7-disa_stig/controls/00_Control_Selector.rb
259
258
  - spec/fixtures/inspec_profiles/RedHat-7-disa_stig/inspec.yml
260
- - spec/fixtures/inspec_profiles/RedHat-8-disa_stig/controls/00_Control_Selector.rb
261
- - spec/fixtures/inspec_profiles/RedHat-8-disa_stig/inspec.yml
262
259
  - spec/lib/simp/beaker_helpers_spec.rb
263
260
  - spec/spec_helper.rb
264
261
  - spec/spec_helper_acceptance.rb
@@ -1 +0,0 @@
1
- spec/fixtures/inspec_profiles/RedHat-8-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-el8-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: EL8 STIG
2
- title: STIG for EL 8
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-el8-baseline
14
- path: ../../inspec_deps/inspec_profiles/profiles/disa_stig-el8-baseline