simp-beaker-helpers 1.20.1 → 1.23.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -79,7 +79,7 @@ module Simp::BeakerHelpers
79
79
  '7' => {
80
80
  'required_packages' => EL_PACKAGES,
81
81
  'ssg' => {
82
- 'profile_target' => 'rhel7',
82
+ 'profile_target' => 'centos7',
83
83
  'build_target' => 'centos7',
84
84
  'datastream' => 'ssg-centos7-ds.xml'
85
85
  }
@@ -87,7 +87,7 @@ module Simp::BeakerHelpers
87
87
  '8' => {
88
88
  'required_packages' => EL8_PACKAGES,
89
89
  'ssg' => {
90
- 'profile_target' => 'rhel8',
90
+ 'profile_target' => 'centos8',
91
91
  'build_target' => 'centos8',
92
92
  'datastream' => 'ssg-centos8-ds.xml'
93
93
  }
@@ -299,8 +299,26 @@ module Simp::BeakerHelpers
299
299
  result_id = rule_result.attributes['idref'].value.to_s
300
300
  result_value = [
301
301
  'Title: ' + doc.xpath("//Rule[@id='#{result_id}']/title/text()").first.to_s,
302
- ' ID: ' + result_id
303
- ].join("\n")
302
+ ' ID: ' + result_id,
303
+ ]
304
+
305
+ if result.child.content == 'fail'
306
+ references = {}
307
+
308
+ doc.xpath("//Rule[@id='#{result_id}']/reference").each do |ref|
309
+ references[ref['href']] ||= []
310
+ references[ref['href']] << ref.text
311
+ end
312
+
313
+ result_value << ' References:'
314
+ references.each_pair do |src, items|
315
+ result_value << " * #{src}"
316
+ result_value << " * #{items.join(', ')}"
317
+ end
318
+ result_value << ' Description: ' + doc.xpath("//Rule[@id='#{result_id}']/description").text.gsub("\n","\n ")
319
+ end
320
+
321
+ result_value = result_value.join("\n")
304
322
 
305
323
  if result.child.content == 'fail'
306
324
  stats[:failed] << result_value.red
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.20.1'
4
+ VERSION = '1.23.0'
5
5
  end
@@ -196,6 +196,7 @@ module Simp::Rake
196
196
  default_suite = ordered_suites.delete('default')
197
197
  ordered_suites.unshift(default_suite) if default_suite
198
198
 
199
+ suite_start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
199
200
  ordered_suites.each do |ste|
200
201
 
201
202
  next unless (suites[ste]['default_run'] == true)
@@ -255,6 +256,11 @@ module Simp::Rake
255
256
  $stdout.puts("\n\n=== Suite '#{name}' Complete ===\n\n")
256
257
  end
257
258
  end
259
+ suite_end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
260
+
261
+ suite_run_time = ((suite_end_time - suite_start_time)/60).round(2)
262
+
263
+ $stdout.puts("== Total Runtime: #{suite_run_time} minutes ==\n\n")
258
264
 
259
265
  unless failures.keys.empty?
260
266
  $stdout.puts("The following tests had failures:")
@@ -18,10 +18,14 @@ Gem::Specification.new do |s|
18
18
  s.metadata = {
19
19
  'issue_tracker' => 'https://simp-project.atlassian.net'
20
20
  }
21
+
22
+ s.required_ruby_version = '>= 2.3.0'
23
+
21
24
  s.add_runtime_dependency 'beaker' , ['>= 4.17.0', '< 5.0.0']
22
25
  s.add_runtime_dependency 'beaker-rspec' , '~> 6.2'
23
26
  s.add_runtime_dependency 'beaker-puppet' , ['>= 1.18.14', '< 2.0.0']
24
- s.add_runtime_dependency 'beaker-docker' , '~> 0.3'
27
+ s.add_runtime_dependency 'beaker-docker' , ['>= 0.8.3', '< 2.0.0']
28
+ s.add_runtime_dependency 'docker-api' , ['>= 2.1.0', '< 3.0.0']
25
29
  s.add_runtime_dependency 'beaker-vagrant' , ['>= 0.6.4', '< 2.0.0']
26
30
  s.add_runtime_dependency 'beaker-puppet_install_helper', '~> 0.9'
27
31
  s.add_runtime_dependency 'highline' , '~> 2.0'
@@ -0,0 +1,60 @@
1
+ HOSTS:
2
+ el7.test.net:
3
+ roles:
4
+ - el7
5
+ - master
6
+ platform: el-7-x86_64
7
+ hypervisor: docker
8
+ image: simpproject/simp_beaker_el7
9
+ docker_cmd: '["/sbin/init"]'
10
+
11
+ el8.test.net:
12
+ roles:
13
+ - el8
14
+ platform: el-8-x86_64
15
+ hypervisor: docker
16
+ image: simpproject/simp_beaker_el8
17
+ docker_cmd: '["/sbin/init"]'
18
+
19
+ CONFIG:
20
+ log_level: verbose
21
+ type: aio
22
+ <% if ENV['BEAKER_PUPPET_ENVIRONMENT'] -%>
23
+ puppet_environment: <%= ENV['BEAKER_PUPPET_ENVIRONMENT'] %>
24
+ <% end -%>
25
+ # This is necessary for pretty much all containers
26
+ docker_cap_add:
27
+ - AUDIT_WRITE
28
+ <%
29
+ require 'docker-api'
30
+ unless ::Docker.podman?
31
+ -%>
32
+ # All items below this point are required for systemd
33
+ mount_folders:
34
+ cgroup:
35
+ host_path: /sys/fs/cgroup
36
+ container_path: /sys/fs/cgroup
37
+ opts: 'ro'
38
+ dockeropts:
39
+ HostConfig:
40
+ Tmpfs:
41
+ '/run': 'rw,noexec,nosuid,nodev,size=65536k'
42
+ '/run/lock': 'rw,noexec,nosuid,nodev,size=65536k'
43
+ '/tmp': 'rw,exec,nosuid,nodev,size=65536k'
44
+ '/sys/fs/cgroup/systemd': 'rw,size=65536k'
45
+ '/var/log/journal': 'rw,noexec,nodev,nosuid,size=65536k'
46
+ <% end -%>
47
+ ssh:
48
+ password: root
49
+ auth_methods:
50
+ - password
51
+ keepalive: true
52
+ keepalive_interval: 10
53
+ host_key:
54
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
55
+ kex:
56
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
57
+ encryption:
58
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
59
+ hmac:
60
+ - <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
@@ -5,7 +5,7 @@ hosts.each do |host|
5
5
  context "on #{host}" do
6
6
  puppet_collection = host.options[:puppet_collection]
7
7
 
8
- client_puppet_version = on(host, 'puppet --version').output.strip
8
+ client_puppet_version = on(host, 'puppet --version').stdout.strip
9
9
 
10
10
  if puppet_collection =~ /puppet(\d+)/
11
11
  puppet_collection_version = $1
@@ -37,4 +37,10 @@ context 'after copy_fixture_modules_to( hosts )' do
37
37
  expect(pfact_on(master, 'fips_enabled')).to eq expected
38
38
  end
39
39
  end
40
+
41
+ describe "pfact_on returns a hash" do
42
+ it 'should return a Hash' do
43
+ expect(pfact_on(master, 'os')).to be_a(Hash)
44
+ end
45
+ end
40
46
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper_acceptance'
2
2
 
3
3
  hosts.each do |host|
4
- describe '#write_hieradata_to' do
5
- expect_failures = false
6
- if hosts_with_role(hosts, 'el8').include?(host)
7
- expect_failures = true
8
- end
4
+ expect_failures = false
5
+ if hosts_with_role(hosts, 'el8').include?(host)
6
+ expect_failures = true
7
+ end
9
8
 
9
+ describe '#install_simp_repos' do
10
10
  it 'should install yum utils' do
11
11
  host.install_package('yum-utils')
12
12
  end
@@ -21,6 +21,18 @@ hosts.each do |host|
21
21
  end
22
22
  end
23
23
 
24
+ context 'when targeting a release type' do
25
+ it 'adjusts the SIMP release target' do
26
+ set_simp_repo_release(host, 'rolling')
27
+ expect(file_content_on(host, '/etc/yum/vars/simpreleasetype').strip).to eq('rolling')
28
+ end
29
+
30
+ it 'lists the simp rpm' do
31
+ skip "#{host} is not supported yet" if expect_failures
32
+ on(host, 'yum list simp')
33
+ end
34
+ end
35
+
24
36
  context 'when passed a disabled list ' do
25
37
  before(:all) { install_simp_repos(host, ['simp-community-simp'] ) }
26
38
 
@@ -1 +1 @@
1
- ../../nodesets
1
+ spec/acceptance/suites/default/../../nodesets
@@ -18,6 +18,7 @@ new_fixtures = {
18
18
  }
19
19
  }
20
20
 
21
+ new_fixtures['fixtures']['repositories']['crypto_policy'] = 'https://github.com/simp/pupmod-simp-crypto_policy'
21
22
  new_fixtures['fixtures']['repositories']['fips'] = 'https://github.com/simp/pupmod-simp-fips'
22
23
  new_fixtures['fixtures']['repositories']['augeasproviders_core'] = 'https://github.com/simp/augeasproviders_core'
23
24
  new_fixtures['fixtures']['repositories']['augeasproviders_grub'] = 'https://github.com/simp/augeasproviders_grub'
@@ -1 +1 @@
1
- ../../nodesets
1
+ spec/acceptance/suites/fips_from_fixtures/../../nodesets
@@ -1 +1 @@
1
- ../../nodesets
1
+ spec/acceptance/suites/snapshot/../../nodesets
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.20.1
4
+ version: 1.23.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: 2021-01-10 00:00:00.000000000 Z
12
+ date: 2021-05-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -69,16 +69,42 @@ dependencies:
69
69
  name: beaker-docker
70
70
  requirement: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: 0.8.3
75
+ - - "<"
73
76
  - !ruby/object:Gem::Version
74
- version: '0.3'
77
+ version: 2.0.0
75
78
  type: :runtime
76
79
  prerelease: false
77
80
  version_requirements: !ruby/object:Gem::Requirement
78
81
  requirements:
79
- - - "~>"
82
+ - - ">="
83
+ - !ruby/object:Gem::Version
84
+ version: 0.8.3
85
+ - - "<"
86
+ - !ruby/object:Gem::Version
87
+ version: 2.0.0
88
+ - !ruby/object:Gem::Dependency
89
+ name: docker-api
90
+ requirement: !ruby/object:Gem::Requirement
91
+ requirements:
92
+ - - ">="
93
+ - !ruby/object:Gem::Version
94
+ version: 2.1.0
95
+ - - "<"
96
+ - !ruby/object:Gem::Version
97
+ version: 3.0.0
98
+ type: :runtime
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - ">="
103
+ - !ruby/object:Gem::Version
104
+ version: 2.1.0
105
+ - - "<"
80
106
  - !ruby/object:Gem::Version
81
- version: '0.3'
107
+ version: 3.0.0
82
108
  - !ruby/object:Gem::Dependency
83
109
  name: beaker-vagrant
84
110
  requirement: !ruby/object:Gem::Requirement
@@ -163,11 +189,15 @@ extra_rdoc_files: []
163
189
  files:
164
190
  - ".fips_fixtures"
165
191
  - ".fixtures.yml"
192
+ - ".github/workflows.local.json"
193
+ - ".github/workflows/pr_glci.yml"
194
+ - ".github/workflows/pr_glci_cleanup.yml"
195
+ - ".github/workflows/pr_glci_manual.yml"
196
+ - ".github/workflows/tag_deploy_rubygem.yml"
166
197
  - ".gitignore"
167
198
  - ".gitlab-ci.yml"
168
199
  - ".rspec"
169
200
  - ".rubocop.yml"
170
- - ".travis.yml"
171
201
  - CHANGELOG.md
172
202
  - Gemfile
173
203
  - LICENSE
@@ -188,6 +218,7 @@ files:
188
218
  - lib/simp/rake/beaker.rb
189
219
  - simp-beaker-helpers.gemspec
190
220
  - spec/acceptance/nodesets/default.yml
221
+ - spec/acceptance/nodesets/docker.yml
191
222
  - spec/acceptance/nodesets/ubuntu.yml
192
223
  - spec/acceptance/suites/default/check_puppet_version_spec.rb
193
224
  - spec/acceptance/suites/default/enable_fips_spec.rb
@@ -221,7 +252,7 @@ licenses:
221
252
  - Apache-2.0
222
253
  metadata:
223
254
  issue_tracker: https://simp-project.atlassian.net
224
- post_install_message:
255
+ post_install_message:
225
256
  rdoc_options: []
226
257
  require_paths:
227
258
  - lib
@@ -229,44 +260,16 @@ required_ruby_version: !ruby/object:Gem::Requirement
229
260
  requirements:
230
261
  - - ">="
231
262
  - !ruby/object:Gem::Version
232
- version: '0'
263
+ version: 2.3.0
233
264
  required_rubygems_version: !ruby/object:Gem::Requirement
234
265
  requirements:
235
266
  - - ">="
236
267
  - !ruby/object:Gem::Version
237
268
  version: '0'
238
269
  requirements: []
239
- rubygems_version: 3.0.9
240
- signing_key:
270
+ rubyforge_project:
271
+ rubygems_version: 2.7.6.3
272
+ signing_key:
241
273
  specification_version: 4
242
274
  summary: beaker helper methods for SIMP
243
- test_files:
244
- - spec/acceptance/nodesets/default.yml
245
- - spec/acceptance/nodesets/ubuntu.yml
246
- - spec/acceptance/suites/default/check_puppet_version_spec.rb
247
- - spec/acceptance/suites/default/enable_fips_spec.rb
248
- - spec/acceptance/suites/default/fixture_modules_spec.rb
249
- - spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
250
- - spec/acceptance/suites/default/nodesets
251
- - spec/acceptance/suites/default/pki_tests_spec.rb
252
- - spec/acceptance/suites/default/set_hieradata_on_spec.rb
253
- - spec/acceptance/suites/default/write_hieradata_to_spec.rb
254
- - spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
255
- - spec/acceptance/suites/fips_from_fixtures/metadata.yml
256
- - spec/acceptance/suites/fips_from_fixtures/nodesets
257
- - spec/acceptance/suites/offline/00_default_spec.rb
258
- - spec/acceptance/suites/offline/README
259
- - spec/acceptance/suites/offline/nodesets/default.yml
260
- - spec/acceptance/suites/puppet_collections/00_default_spec.rb
261
- - spec/acceptance/suites/puppet_collections/metadata.yml
262
- - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
263
- - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
264
- - spec/acceptance/suites/snapshot/nodesets
265
- - spec/acceptance/suites/windows/00_default_spec.rb
266
- - spec/acceptance/suites/windows/metadata.yml
267
- - spec/acceptance/suites/windows/nodesets/default.yml
268
- - spec/acceptance/suites/windows/nodesets/win2016.yml
269
- - spec/acceptance/suites/windows/nodesets/win2019.yml
270
- - spec/lib/simp/beaker_helpers_spec.rb
271
- - spec/spec_helper.rb
272
- - spec/spec_helper_acceptance.rb
275
+ test_files: []
data/.travis.yml DELETED
@@ -1,42 +0,0 @@
1
- ---
2
- language: shell
3
- notifications:
4
- email: false
5
- stages:
6
- - name: deploy
7
- if: 'tag IS present'
8
-
9
- ### Testing on Travis CI is indefinitely disabled
10
- ###
11
- ### See:
12
- ### * https://blog.travis-ci.com/2020-11-02-travis-ci-new-billing
13
- ### * https://simp-project.atlassian.net/browse/SIMP-8703
14
- jobs:
15
- include:
16
- - stage: deploy
17
- script: skip
18
- cache: bundler
19
- before_install:
20
- - rm Gemfile.lock || true
21
- bundler_args: "--without development --path .vendor"
22
- language: ruby
23
- rvm: 2.4.5
24
- before_deploy:
25
- - bundle exec rake clobber
26
- - "export GEM_VERSION=`ruby -r ./lib/simp/beaker_helpers/version.rb -e 'puts Simp::BeakerHelpers::VERSION'`"
27
- - '[[ $TRAVIS_TAG =~ ^${GEM_VERSION}$ ]]'
28
- deploy:
29
- - provider: rubygems
30
- gemspec: simp-beaker-helpers.gemspec
31
- gem: simp-beaker-helpers
32
- token:
33
- secure: "AlnBx0dBSxn+S97n0h14ltKUOA+6v0bc7QZPIcwGJV9nnf1hKH3pf9La1TVknEx7XgpAcM9jusQJ7hBlqvSq8z8SFF0bZk1EgSRIKc1cuYPLiGyUM2O7+AFHyCy3iCnPvKeoQmE/BJb5O1dGnbmSbf4A0fqLxA7jiHG1j7z+cnmJB1i67wovDfl13TsOXyBfbespWBMMc0BKAw56FPs9XggAk2cNusS3hd5tqW1AZPT2/xwt+d8ngkmO96u8QcichYRFQ+w+XW4H0w935wNg/dWiskJlt7TIYVAh4Ko5s2DZKf52Tne8TugALSn0LhRatpp7sw1FTTpteCW8UqK8uwGC2hM4pZViAOv4P1YObz2IPOZPriBl+cCayJdMKnotkUJliAMnw5TLiSWKLou+S0Pdj2h3fJZWdOEwRPMzIVoJtsOHG3GdNcPL6f7iU0vP/wr6FeR3uWa+fA7NHRi2Du955O8JpogjdrW08ahcAEwhtI3A4mrA08wN09axsrwr093uDRm/5h4FHyAhExJ0YiA/6kcPpUvILcLStyHe0RQDICQMdsQo2DSbnL65w3QjFa2fML2Shf9cRwX06+ia2BxozWzFD/6p3RiRtPxphnbFiUdjYSGWcwCcUgbJx9SW04lSSxOhpyItuXgxZqiybkzstXd6riu5zwg1R8TWk34="
34
- on:
35
- tags: true
36
- condition: "($SKIP_PUBLISH != true)"
37
- - provider: releases
38
- token:
39
- secure: "I41p4aqjkrNDHJhZ5gWC4gzn7BVwEYRm5Q3PAxQRSIUDB/QTVgNqZx8YptkuIvSGpw8kIywyZg3NKdzGUO8aJJ0NlXapL7e9qQIigkYhdaCZjZFG5zIxdOFs4sVoz/6vnQT9JIcGWy7uS5xiNOulGvfEWU78+e+I9yPdT74RApve5VAVT/km5lV5ldRnwwehLnTx+volUlnOD8rwfizoVLqFTrfRfr4cVMF605UYyaiVxHF50hywFRZoAdVcMEhlLQnQXfz/ZsLMJLJm9eCpjQ989N0oX6theSLCcv7QtHcWMXydjWMcpuTfBZSFrwUVbC23uMOKTJVEWq5LMG3m2L6hP3//2gvUzGhOVLvoGuC+erboB7QoXdcoOgXY+dTZPMcPBxpArdDLWVQSLTvPs05QzpaUdRLVMC/kD1d1EudlEicgkNgNDBhBn3089nVmvKndbKLvj+23a5AQVVbs+8C0x+SJvTc9N2N+bmuH7jIJPrEvWK4xwcQa+g2M/EBv05jaEdSErlVa6B6UKCH0Lea9rpy1se9vn5OzpaaMCCJIpcpQqHDjo0PMAQXBSbqjKcBei6lR5fIFl5UO9gWP1v8PGPuCzGTBivQ92XlgV1TWXmdbJHwIuSbJx3Ali7Wp19RR4E4uHC+TPFssvgkh9ZLkORnWWS35wzzU1LkwWx0="
40
- on:
41
- tags: true
42
- condition: "($SKIP_PUBLISH != true)"