simp-beaker-helpers 1.23.1 → 1.23.2

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: 662fa0921ca0879ff169a372722db43cab01b6084d7fb8bd0c22b9727499d44d
4
- data.tar.gz: 7fdcc1bb9a1e7384fe8e7edcb6336f3b30e5045719ac2250c67666efddffe0ad
3
+ metadata.gz: cfd8d6cfc126259b0d2062a8c63765eb67e1645a46d8fd5bdc4605455d4e10bb
4
+ data.tar.gz: 006e29f01522f454f0ccc84caa3f9ae22405f6034bfaf074080ceb1bec6a9008
5
5
  SHA512:
6
- metadata.gz: 046ed4502f9257b59afa940d925f40f80ad3d5d4e9bb600904625382e4e437493313230a6109d105f4e1471f77537f8fbcfb176297fa71ca1d6bf979d0ccf565
7
- data.tar.gz: f0d190e6abf5474bca2b4764658cfeb3af61298b13c4ad3b1cd8649417d4ecb67814eb88e6f266ee261fcbd35b77e47ee71b0ee1c7a72a59f4428e9fc5b73920
6
+ metadata.gz: c094cfa4b6d883bbf83a463a646d2a03b9b543f7fcccca64d9afe72d35a9f7c22112500071f96a150eead084f1ffc0dda7a6cd3be78f2da7ddcf04dc1565ccab
7
+ data.tar.gz: d22878a97daf38ed771e4d2a023ef4edcdf69edaaee8e0ce9d282cd944010f78e27a90ae5dffdf524a98ccf2a359e8356c6bbfbaa81c99e33cfc0b7b740a7222
@@ -5,7 +5,7 @@ on:
5
5
  branches:
6
6
  # A test branch for seeing if your tests will pass in your personal fork
7
7
  - test_me_github
8
- pull_request_target:
8
+ pull_request:
9
9
  types: [opened, reopened, synchronize]
10
10
 
11
11
  jobs:
@@ -18,8 +18,10 @@ jobs:
18
18
  - 2.6
19
19
  fail-fast: false
20
20
  steps:
21
- - uses: actions/checkout@v2
22
- - uses: ruby/setup-ruby@v1
21
+ - name: checkout repo
22
+ uses: actions/checkout@v2
23
+ - name: setup ruby
24
+ uses: ruby/setup-ruby@v1
23
25
  with:
24
26
  ruby-version: ${{ matrix.ruby }}
25
27
  - name: ensure entropy
@@ -27,45 +29,27 @@ jobs:
27
29
  sudo apt-get update -y
28
30
  sudo apt-get install -y rng-tools
29
31
  sudo systemctl start rng-tools
30
- - name: install podman
32
+ - name: install docker
31
33
  run: |
32
34
  set -x
33
- sudo apt-get remove -y podman docker-ce docker docker-engine docker.io containerd runc ||:
34
- curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$( lsb_release -rs )/Release.key | sudo apt-key add -
35
- echo "deb https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_$( lsb_release -rs )/ /" | sudo tee /etc/apt/sources.list.d/podman.list /dev/null
35
+ sudo apt-get remove -y podman ||:
36
+ sudo apt-get install -y docker-ce docker docker-engine docker.io containerd runc ||:
36
37
  sudo apt-get update
37
- sudo apt-get install -y podman
38
38
  sudo apt autoremove -y
39
- sudo systemctl start podman
39
+ sudo systemctl start docker
40
40
  - name: install bundler
41
41
  run: |
42
42
  gem install bundler
43
43
  bundle update
44
- - name: beaker default
45
- env:
46
- DOCKER_HOST: unix:///var/run/podman/podman.sock
47
- CONTAINER_HOST: unix:///var/run/podman/podman.sock
44
+ - name: beaker
48
45
  run: |
49
- sudo chmod -R ugo+rwX /var/run/podman
50
46
  bundle exec rake beaker:suites[default,docker]
51
47
  - name: beaker puppet_collections
52
- env:
53
- DOCKER_HOST: unix:///var/run/podman/podman.sock
54
- CONTAINER_HOST: unix:///var/run/podman/podman.sock
55
48
  run: |
56
- sudo chmod -R ugo+rwX /var/run/podman
57
49
  bundle exec rake beaker:suites[puppet_collections,docker]
58
50
  - name: beaker ssg
59
- env:
60
- DOCKER_HOST: unix:///var/run/podman/podman.sock
61
- CONTAINER_HOST: unix:///var/run/podman/podman.sock
62
51
  run: |
63
- sudo chmod -R ugo+rwX /var/run/podman
64
52
  bundle exec rake beaker:suites[ssg,docker]
65
53
  - name: beaker inspec
66
- env:
67
- DOCKER_HOST: unix:///var/run/podman/podman.sock
68
- CONTAINER_HOST: unix:///var/run/podman/podman.sock
69
54
  run: |
70
- sudo chmod -R ugo+rwX /var/run/podman
71
55
  bundle exec rake beaker:suites[inspec,docker]
@@ -0,0 +1,90 @@
1
+ # Run Puppet checks and test matrix on Pull Requests
2
+ # ------------------------------------------------------------------------------
3
+ # NOTICE: **This file is maintained with puppetsync**
4
+ #
5
+ # This file is updated automatically as part of a puppet module baseline.
6
+ #
7
+ # The next baseline sync will overwrite any local changes to this file!
8
+ #
9
+ # ==============================================================================
10
+ #
11
+ # The testing matrix considers ruby/puppet versions supported by SIMP and PE:
12
+ # ------------------------------------------------------------------------------
13
+ # Release Puppet Ruby EOL
14
+ # SIMP 6.4 5.5 2.40 TBD
15
+ # PE 2018.1 5.5 2.40 2021-01 (LTS overlap)
16
+ # PE 2019.8 6.18 2.5 2022-12 (LTS)
17
+ #
18
+ # https://puppet.com/docs/pe/2018.1/component_versions_in_recent_pe_releases.html
19
+ # https://puppet.com/misc/puppet-enterprise-lifecycle
20
+ # https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
21
+ # ==============================================================================
22
+ #
23
+ # https://docs.github.com/en/actions/reference/events-that-trigger-workflows
24
+ #
25
+
26
+ name: PR Tests
27
+ on:
28
+ push:
29
+ branches:
30
+ # A test branch for seeing if your tests will pass in your personal fork
31
+ - test_me_github
32
+ pull_request:
33
+ types: [opened, reopened, synchronize]
34
+
35
+ env:
36
+ PUPPET_VERSION: '~> 6'
37
+
38
+ jobs:
39
+ ruby-style:
40
+ if: false # TODO Modules will need: rubocop in Gemfile, .rubocop.yml
41
+ name: 'Ruby Style (experimental)'
42
+ runs-on: ubuntu-18.04
43
+ continue-on-error: true
44
+ steps:
45
+ - uses: actions/checkout@v2
46
+ - name: "Install Ruby ${{matrix.puppet.ruby_version}}"
47
+ uses: ruby/setup-ruby@v1
48
+ with:
49
+ ruby-version: 2.5
50
+ bundler-cache: true
51
+ - run: |
52
+ bundle show
53
+ bundle exec rake rubocop
54
+
55
+ spec-tests:
56
+ name: 'Spec'
57
+ runs-on: ubuntu-18.04
58
+ strategy:
59
+ matrix:
60
+ puppet:
61
+ - label: 'Puppet 6.18 [SIMP 6.5/PE 2019.8]'
62
+ puppet_version: '~> 6.18.0'
63
+ ruby_version: '2.5'
64
+ - label: 'Puppet 5.5 [SIMP 6.4/PE 2018.1]'
65
+ puppet_version: '~> 5.5.22'
66
+ ruby_version: '2.4'
67
+ - label: 'Puppet 7.x'
68
+ puppet_version: '~> 7.0'
69
+ ruby_version: '2.7'
70
+ env:
71
+ PUPPET_VERSION: '${{matrix.puppet.puppet_version}}'
72
+ steps:
73
+ - uses: actions/checkout@v2
74
+ - name: 'Install Ruby ${{matrix.puppet.ruby_version}}'
75
+ uses: ruby/setup-ruby@v1
76
+ with:
77
+ ruby-version: ${{matrix.puppet.ruby_version}}
78
+ bundler-cache: true
79
+ - run: 'command -v rpm || if command -v apt-get; then sudo apt-get update; sudo apt-get install -y rpm; fi ||:'
80
+ - run: 'bundle exec rake spec'
81
+
82
+ # dump_contexts:
83
+ # name: 'Examine Context contents'
84
+ # runs-on: ubuntu-16.04
85
+ # steps:
86
+ # - name: Dump contexts
87
+ # env:
88
+ # GITHUB_CONTEXT: ${{ toJson(github) }}
89
+ # run: echo "$GITHUB_CONTEXT"
90
+ #
data/.gitlab-ci.yml CHANGED
@@ -312,6 +312,18 @@ pup7.x-pkg:
312
312
 
313
313
  #=======================================================================
314
314
  # Acceptance tests
315
+
316
+ # Verify a suite fails when an explicitly-specified nodeset does not exist.
317
+ # It is significantly quicker to test here (where rvm is already installed
318
+ # and the bundle is configured with this version of simp-beaker-helpers)
319
+ # than in an acceptance test with a build user.
320
+ default-bad-nodeset:
321
+ <<: *pup_6_x
322
+ <<: *acceptance_base
323
+ script:
324
+ - 'RESULT=`bundle exec rake beaker:suites[default,oops] 1>/dev/null; echo $?`; (test $RESULT == "1")'
325
+ - echo 'beaker:suites correctly failed with unknown nodeset'
326
+
315
327
  default:
316
328
  <<: *pup_6_x
317
329
  <<: *acceptance_base
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 1.23.2 / 2021-05-29
2
+ * Fixed:
3
+ * Fail an acceptance test when an explicitly-specified nodeset for an
4
+ acceptance test suite does not exist and the suite is configured
5
+ to fail fast (default behavior).
6
+ * The usual way of registering RHEL systems had to be changed to activate
7
+ immediately when called to function properly.
8
+
1
9
  ### 1.23.1 / 2021-05-19
2
10
  * Fixed:
3
11
  * The SSG default branch is now the latest numeric tag instead of the one
@@ -672,6 +672,9 @@ module Simp::BeakerHelpers
672
672
  def linux_errata( suts )
673
673
  parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
674
674
  block_on(suts, :run_in_parallel => parallel) do |sut|
675
+ # Set the locale if not set
676
+ sut.set_env_var('LANG', 'en_US.UTF-8') unless sut.get_env_var('LANG')
677
+
675
678
  # We need to be able to flip between server and client without issue
676
679
  on sut, 'puppet resource group puppet gid=52'
677
680
  on sut, 'puppet resource user puppet comment="Puppet" gid="52" uid="52" home="/var/lib/puppet" managehome=true'
@@ -747,11 +750,9 @@ module Simp::BeakerHelpers
747
750
  if os_info['family'] == 'RedHat'
748
751
  # OS-specific items
749
752
  if os_info['name'] == 'RedHat'
750
- RSpec.configure do |c|
751
- c.before(:all) do
752
- rhel_rhsm_subscribe(sut)
753
- end
753
+ rhel_rhsm_subscribe(sut)
754
754
 
755
+ RSpec.configure do |c|
755
756
  c.after(:all) do
756
757
  rhel_rhsm_unsubscribe(sut)
757
758
  end
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.23.1'
4
+ VERSION = '1.23.2'
5
5
  end
@@ -226,8 +226,14 @@ module Simp::Rake
226
226
 
227
227
  nodesets.each do |nodeset_yml|
228
228
  unless File.file?(nodeset_yml)
229
- $stdout.puts("=== Suite #{name} Nodeset '#{File.basename(nodeset_yml, '.yml')}' Not Found, Skipping ===")
230
- next
229
+ # Get here if user has specified a non-existent nodeset or the
230
+ # implied `default` nodeset does not exist.
231
+ if suite_config['fail_fast']
232
+ fail("*** Suite #{name} Nodeset '#{File.basename(nodeset_yml, '.yml')}' Not Found ***")
233
+ else
234
+ $stdout.puts("=== Suite #{name} Nodeset '#{File.basename(nodeset_yml, '.yml')}' Not Found, Skipping ===")
235
+ next
236
+ end
231
237
  end
232
238
 
233
239
  ENV['BEAKER_setfile'] = nodeset_yml
@@ -9,13 +9,15 @@ hosts.each do |host|
9
9
  end
10
10
 
11
11
  it 'has fips enabled' do
12
- stdout = on(host, 'cat /proc/sys/crypto/fips_enabled').stdout.strip
13
- expect(stdout).to eq('1')
12
+ if host[:hypervisor] == 'docker'
13
+ skip('Not supported on docker')
14
+ else
15
+ expect(fips_enabled(host)).to be true
16
+ end
14
17
  end
15
18
  else
16
19
  it 'has fips disabled' do
17
- stdout = on(host, 'cat /proc/sys/crypto/fips_enabled').stdout.strip
18
- expect(stdout).to eq('0')
20
+ expect(fips_enabled(host)).to be false
19
21
  end
20
22
  end
21
23
  end
@@ -66,8 +66,7 @@ describe 'FIPS pre-installed' do
66
66
  if host[:hypervisor] == 'docker'
67
67
  skip('Not supported on docker')
68
68
  else
69
- stdout = on(host, 'cat /proc/sys/crypto/fips_enabled').stdout.strip
70
- expect(stdout).to eq('1')
69
+ expect(fips_enabled(host)).to be true
71
70
  end
72
71
  end
73
72
  end
@@ -13,7 +13,7 @@ end
13
13
  hosts.each do |host|
14
14
  describe 'make sure puppet version is valid' do
15
15
  context "on #{host}" do
16
- client_puppet_version = on(host, 'puppet --version').output.strip
16
+ client_puppet_version = on(host, 'puppet --version').output.lines.last.strip
17
17
 
18
18
  it "should be running puppet version #{target_version}" do
19
19
  expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(target_version)
@@ -113,10 +113,8 @@ describe 'Simp::BeakerHelpers' do
113
113
  end
114
114
  pipe_in.close
115
115
 
116
- expected_version = pipe_out.gets
117
- expected_major_version = expected_version.split('.').first
116
+ expected_major_version = pipe_out.gets.split('.').first
118
117
 
119
- expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(expected_version)
120
118
  expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq("puppet#{expected_major_version}")
121
119
  expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('agent')
122
120
  end
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.23.1
4
+ version: 1.23.2
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: 2021-05-25 00:00:00.000000000 Z
12
+ date: 2021-06-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -194,6 +194,7 @@ files:
194
194
  - ".github/workflows/pr_glci.yml"
195
195
  - ".github/workflows/pr_glci_cleanup.yml"
196
196
  - ".github/workflows/pr_glci_manual.yml"
197
+ - ".github/workflows/pr_tests.yml"
197
198
  - ".github/workflows/tag_deploy_rubygem.yml"
198
199
  - ".gitignore"
199
200
  - ".gitlab-ci.yml"