simp-beaker-helpers 1.24.4 → 1.25.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/tag_deploy_rubygem.yml +7 -3
- data/.gitignore +19 -4
- data/.gitlab-ci.yml +6 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +2 -2
- data/files/pki/make.sh +2 -1
- data/lib/simp/beaker_helpers/ssg.rb +5 -1
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/lib/simp/beaker_helpers.rb +63 -48
- data/lib/simp/rake/beaker.rb +2 -1
- data/simp-beaker-helpers.gemspec +1 -6
- data/spec/acceptance/nodesets/amzn2.yml +23 -0
- data/spec/acceptance/nodesets/default.yml +1 -2
- data/spec/acceptance/nodesets/oel.yml +0 -1
- data/spec/acceptance/nodesets/ubuntu.yml +0 -1
- data/spec/acceptance/suites/windows/00_default_spec.rb +0 -2
- data/spec/acceptance/suites/windows/nodesets/default.yml +0 -1
- data/spec/acceptance/suites/windows/nodesets/win2016.yml +0 -1
- data/spec/acceptance/suites/windows/nodesets/win2019.yml +0 -1
- data/spec/spec_helper_acceptance.rb +33 -1
- metadata +5 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bce7304da1a7425de25af167725291b8889ca26e1bbbed5559b0583fb900a1b4
|
4
|
+
data.tar.gz: 359b9c5c9eda2855e7eab95f1afc7837f3fbc108ccef4aaf2eb6d2b0d9f7858f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ea99cff5b4a6e7e0f7fe1720efe7e439215ea14cbc0f278fe7a0f314470a3026fe64717d55559e1c80945ac4cb28289f25344b5e5e7a978516d11029b1f1add
|
7
|
+
data.tar.gz: 336a178662a391759629d6d539aaf78b3ecb7d7fc93804e49e63bf03057cb87a6d9f996298c8a203a31e4aec4ee299df8dd49ba68e950df216769553edf4d2f7
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# Create GitHub release, build & publish .gem to rubygems.org on SemVer tag push
|
2
2
|
#
|
3
3
|
# This workflow's jobs are only triggered in repos under the `simp` organization
|
4
4
|
# ------------------------------------------------------------------------------
|
@@ -56,6 +56,10 @@ jobs:
|
|
56
56
|
name: "RELENG checks"
|
57
57
|
if: github.repository_owner == 'simp'
|
58
58
|
runs-on: ubuntu-latest
|
59
|
+
outputs:
|
60
|
+
build_command: ${{ steps.commands.outputs.build_command }}
|
61
|
+
release_command: ${{ steps.commands.outputs.release_command }}
|
62
|
+
pkg_dir: ${{ steps.commands.outputs.pkg_dir }}
|
59
63
|
steps:
|
60
64
|
- name: "Assert '${{ github.ref }}' is a tag"
|
61
65
|
run: '[[ "$GITHUB_REF" =~ ^refs/tags/ ]] || { echo "::error ::GITHUB_REF is not a tag: ${GITHUB_REF}"; exit 1 ; }'
|
@@ -66,8 +70,8 @@ jobs:
|
|
66
70
|
- name: Determine build and release commands
|
67
71
|
id: commands
|
68
72
|
run: |
|
69
|
-
# By default,
|
70
|
-
# To override
|
73
|
+
# By default, this is the standard task from "bundler/gem_tasks"
|
74
|
+
# To override it, add the new command to LOCAL_WORKFLOW_CONFIG_FILE
|
71
75
|
GEM_BUILD_COMMAND='bundle exec rake build'
|
72
76
|
GEM_RELEASE_COMMAND='bundle exec rake build release:rubygem_push'
|
73
77
|
GEM_PKG_DIR='pkg'
|
data/.gitignore
CHANGED
@@ -1,9 +1,24 @@
|
|
1
|
+
.*.sw?
|
2
|
+
.yardoc
|
3
|
+
.idea/
|
1
4
|
.fips_fixtures.yml
|
2
5
|
*.gem
|
3
|
-
*.swp
|
4
|
-
Gemfile.lock
|
5
|
-
.bundle/
|
6
6
|
*.old
|
7
7
|
.vagrant
|
8
|
+
dist
|
9
|
+
/pkg
|
10
|
+
# Read everything in fixtures
|
11
|
+
/spec/fixtures/*
|
12
|
+
# Un-ignore hieradata
|
13
|
+
!/spec/fixtures/hieradata/*
|
14
|
+
# Except this one, which is auto-generated
|
15
|
+
/spec/fixtures/hieradata/hiera.yaml
|
16
|
+
/spec/rp_env
|
17
|
+
/.rspec_system
|
18
|
+
/.vagrant
|
19
|
+
/.bundle
|
20
|
+
/.vendor
|
21
|
+
/vendor
|
22
|
+
/junit
|
8
23
|
/log
|
9
|
-
/
|
24
|
+
/doc
|
data/.gitlab-ci.yml
CHANGED
@@ -313,6 +313,12 @@ default:
|
|
313
313
|
script:
|
314
314
|
- bundle exec rake beaker:suites[default]
|
315
315
|
|
316
|
+
default-amzn2:
|
317
|
+
<<: *pup_6_x
|
318
|
+
<<: *acceptance_base
|
319
|
+
script:
|
320
|
+
- bundle exec rake beaker:suites[default,amzn2]
|
321
|
+
|
316
322
|
default-fips:
|
317
323
|
<<: *pup_6_x
|
318
324
|
<<: *acceptance_base
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
### 1.25.0 / 2022-06-11
|
2
|
+
* Fixed:
|
3
|
+
* Replaced calls to `sed -c` with something POSIX compliant that should work
|
4
|
+
on non-RHEL systems
|
5
|
+
* Added:
|
6
|
+
* Updated all dependencies to their latest versions where possible and removed
|
7
|
+
depdendencies on deprecated libraries.
|
8
|
+
|
9
|
+
### 1.24.5 / 2022-05-06
|
10
|
+
* Fixed:
|
11
|
+
* Added a workaround for Amazon Linux 2 testing
|
12
|
+
|
1
13
|
### 1.24.4 / 2022-04-28
|
2
14
|
* Fixed:
|
3
15
|
* Workaround for [MODULES-11315] in `puppet-agent-versions.yaml`
|
data/Gemfile
CHANGED
@@ -44,8 +44,8 @@ group :system_tests do
|
|
44
44
|
gem 'beaker-rspec'
|
45
45
|
gem 'beaker-windows'
|
46
46
|
gem 'net-ssh'
|
47
|
-
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~>
|
48
|
-
gem 'puppetlabs_spec_helper', '~> 3.0'
|
47
|
+
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~> 7.0')
|
49
48
|
gem 'rubocop'
|
50
49
|
gem 'rubocop-rspec'
|
50
|
+
gem 'puppetlabs_spec_helper', '~> 4.0'
|
51
51
|
end
|
data/files/pki/make.sh
CHANGED
@@ -73,7 +73,8 @@ for hosts in $*; do
|
|
73
73
|
done
|
74
74
|
done
|
75
75
|
|
76
|
-
|
76
|
+
tgt_file="working/${hname}.cnf"
|
77
|
+
sed -e "s/# subjectAltName = #ALTNAMES#/subjectAltName = ${altnames}/" "$tgt_file" 1<> "$tgt_file"
|
77
78
|
fi
|
78
79
|
|
79
80
|
echo "-- running openssl req"
|
@@ -420,7 +420,11 @@ module Simp::BeakerHelpers
|
|
420
420
|
#
|
421
421
|
# This isn't 100% correct but it's "good enough" for an automated CI
|
422
422
|
# environment to tell us if something is critically out of alignment.
|
423
|
-
|
423
|
+
safe_sed(
|
424
|
+
@sut,
|
425
|
+
's/ssg.build_derivatives.profile_handling/__simp_dontcare__ = None #ssg.build_derivatives.profile_handling/g',
|
426
|
+
'scap-content/build-scripts/enable_derivatives.py'
|
427
|
+
)
|
424
428
|
|
425
429
|
on(@sut, %(cd scap-content/build; cmake ../; make -j4 #{OS_INFO[@os][@os_rel]['ssg']['build_target']}-content && cp *ds.xml #{@scap_working_dir}))
|
426
430
|
end
|
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -12,6 +12,8 @@ module Simp::BeakerHelpers
|
|
12
12
|
require 'simp/beaker_helpers/ssg'
|
13
13
|
require 'simp/beaker_helpers/version'
|
14
14
|
|
15
|
+
@run_in_parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
16
|
+
|
15
17
|
# Stealing this from the Ruby 2.5 Dir::Tmpname workaround from Rails
|
16
18
|
def self.tmpname
|
17
19
|
t = Time.new.strftime("%Y%m%d")
|
@@ -25,8 +27,7 @@ module Simp::BeakerHelpers
|
|
25
27
|
#
|
26
28
|
# Has no effect if yum or dnf is not present.
|
27
29
|
def set_yum_opt_on(suts, key, value)
|
28
|
-
|
29
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
30
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
30
31
|
repo,target = key.split('.')
|
31
32
|
|
32
33
|
unless target
|
@@ -56,8 +57,7 @@ module Simp::BeakerHelpers
|
|
56
57
|
# 'foo.installonly_limit' => '5' # Applies only to the 'foo' repo
|
57
58
|
# }
|
58
59
|
def set_yum_opts_on(suts, yum_opts={})
|
59
|
-
|
60
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
60
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
61
61
|
yum_opts.each_pair do |k,v|
|
62
62
|
set_yum_opt_on(sut, k, v)
|
63
63
|
end
|
@@ -70,8 +70,7 @@ module Simp::BeakerHelpers
|
|
70
70
|
retry_interval: 10
|
71
71
|
}
|
72
72
|
|
73
|
-
|
74
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
73
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
75
74
|
package_source = package_name unless package_source
|
76
75
|
|
77
76
|
unless sut.check_for_package(package_name)
|
@@ -91,8 +90,7 @@ module Simp::BeakerHelpers
|
|
91
90
|
retry_interval: 10
|
92
91
|
}
|
93
92
|
|
94
|
-
|
95
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
93
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
96
94
|
package_source = package_name unless package_source
|
97
95
|
|
98
96
|
if sut.check_for_package(package_name)
|
@@ -380,8 +378,7 @@ module Simp::BeakerHelpers
|
|
380
378
|
opts[:pluginsync] = opts.fetch(:pluginsync, true)
|
381
379
|
|
382
380
|
unless ENV['BEAKER_copy_fixtures'] == 'no'
|
383
|
-
|
384
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
381
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
385
382
|
STDERR.puts " ** copy_fixture_modules_to: '#{sut}'" if ENV['BEAKER_helpers_verbose']
|
386
383
|
|
387
384
|
# Use spec_prep to provide modules (this supports isolated networks)
|
@@ -443,8 +440,7 @@ module Simp::BeakerHelpers
|
|
443
440
|
end
|
444
441
|
|
445
442
|
def munge_ssh_crypto_policies(suts, key_types=['ssh-rsa'])
|
446
|
-
|
447
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
443
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
448
444
|
if has_crypto_policies(sut)
|
449
445
|
install_latest_package_on(sut, 'crypto-policies', nil, :accept_all_exit_codes => true)
|
450
446
|
|
@@ -455,14 +451,31 @@ module Simp::BeakerHelpers
|
|
455
451
|
end
|
456
452
|
end
|
457
453
|
|
454
|
+
# Perform the equivalend of an in-place sed without changing the target inode
|
455
|
+
#
|
456
|
+
# Required for many container targets
|
457
|
+
def safe_sed(suts = hosts, pattern, target_file)
|
458
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
459
|
+
tmpfile = sut.tmpfile('safe_sed')
|
460
|
+
|
461
|
+
command = [
|
462
|
+
"cp #{target_file} #{tmpfile}",
|
463
|
+
"sed -i '#{pattern}' #{tmpfile}",
|
464
|
+
"cat #{tmpfile} > #{target_file}"
|
465
|
+
].join(' && ')
|
466
|
+
|
467
|
+
on(sut, command)
|
468
|
+
|
469
|
+
sut.rm_rf(tmpfile)
|
470
|
+
end
|
471
|
+
end
|
472
|
+
|
458
473
|
# Configure and reboot SUTs into FIPS mode
|
459
474
|
def enable_fips_mode_on( suts = hosts )
|
460
475
|
puts '== configuring FIPS mode on SUTs'
|
461
476
|
puts ' -- (use BEAKER_fips=no to disable)'
|
462
|
-
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
463
477
|
|
464
|
-
|
465
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
478
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
466
479
|
next if sut[:hypervisor] == 'docker'
|
467
480
|
|
468
481
|
if is_windows?(sut)
|
@@ -483,7 +496,7 @@ module Simp::BeakerHelpers
|
|
483
496
|
# that doesn't break vagrant access and is appropriate for
|
484
497
|
# typical module tests.)
|
485
498
|
fips_ssh_ciphers = [ 'aes256-ctr','aes192-ctr','aes128-ctr']
|
486
|
-
|
499
|
+
safe_sed(sut, '/Ciphers /d', '/etc/ssh/sshd_config')
|
487
500
|
on(sut, %(echo 'Ciphers #{fips_ssh_ciphers.join(',')}' >> /etc/ssh/sshd_config))
|
488
501
|
|
489
502
|
fips_enable_modulepath = ''
|
@@ -535,8 +548,7 @@ module Simp::BeakerHelpers
|
|
535
548
|
# - <URL to GPGKEY1>
|
536
549
|
# - <URL to GPGKEY2>
|
537
550
|
def enable_yum_repos_on( suts = hosts )
|
538
|
-
|
539
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
551
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
540
552
|
if sut['yum_repos']
|
541
553
|
sut['yum_repos'].each_pair do |repo, metadata|
|
542
554
|
repo_manifest = create_yum_resource(repo, metadata)
|
@@ -617,8 +629,7 @@ module Simp::BeakerHelpers
|
|
617
629
|
#
|
618
630
|
# Can be disabled by setting BEAKER_enable_epel=no
|
619
631
|
def enable_epel_on(suts)
|
620
|
-
|
621
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
632
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
622
633
|
if ONLINE
|
623
634
|
os_info = fact_on(sut, 'os')
|
624
635
|
os_maj_rel = os_info['release']['major']
|
@@ -661,8 +672,7 @@ module Simp::BeakerHelpers
|
|
661
672
|
end
|
662
673
|
|
663
674
|
def update_package_from_centos_stream(suts, package_name)
|
664
|
-
|
665
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
675
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
666
676
|
sut.install_package('centos-release-stream') unless sut.check_for_package('centos-release-stream')
|
667
677
|
install_latest_package_on(sut, package_name)
|
668
678
|
sut.uninstall_package('centos-release-stream')
|
@@ -670,8 +680,7 @@ module Simp::BeakerHelpers
|
|
670
680
|
end
|
671
681
|
|
672
682
|
def linux_errata( suts )
|
673
|
-
|
674
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
683
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
675
684
|
# Set the locale if not set
|
676
685
|
sut.set_env_var('LANG', 'en_US.UTF-8') unless sut.get_env_var('LANG')
|
677
686
|
|
@@ -688,9 +697,14 @@ module Simp::BeakerHelpers
|
|
688
697
|
if current_domain.empty?
|
689
698
|
new_fqdn = hostname + '.beaker.test'
|
690
699
|
|
691
|
-
|
692
|
-
|
693
|
-
|
700
|
+
safe_sed(sut, 's/#{hostname}.*/#{new_fqdn} #{hostname}/', '/etc/hosts')
|
701
|
+
|
702
|
+
if !sut.which('hostnamectl').empty?
|
703
|
+
on(sut, "hostnamectl set-hostname #{new_fqdn}")
|
704
|
+
else
|
705
|
+
on(sut, "echo '#{new_fqdn}' > /etc/hostname", :accept_all_exit_codes => true)
|
706
|
+
on(sut, "hostname #{new_fqdn}", :accept_all_exit_codes => true)
|
707
|
+
end
|
694
708
|
|
695
709
|
if sut.file_exist?('/etc/sysconfig/network')
|
696
710
|
on(sut, "sed -s '/HOSTNAME=/d' /etc/sysconfig/network")
|
@@ -785,8 +799,7 @@ module Simp::BeakerHelpers
|
|
785
799
|
def rhel_rhsm_subscribe(suts, *opts)
|
786
800
|
require 'securerandom'
|
787
801
|
|
788
|
-
|
789
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
802
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
790
803
|
rhsm_opts = {
|
791
804
|
:username => ENV['BEAKER_RHSM_USER'],
|
792
805
|
:password => ENV['BEAKER_RHSM_PASS'],
|
@@ -838,8 +851,7 @@ module Simp::BeakerHelpers
|
|
838
851
|
end
|
839
852
|
|
840
853
|
def sosreport(suts, dest='sosreports')
|
841
|
-
|
842
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
854
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
843
855
|
install_latest_package_on(sut, 'sos')
|
844
856
|
on(sut, 'sosreport --batch')
|
845
857
|
|
@@ -854,8 +866,7 @@ module Simp::BeakerHelpers
|
|
854
866
|
end
|
855
867
|
|
856
868
|
def rhel_repo_enable(suts, repos)
|
857
|
-
|
858
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
869
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
859
870
|
Array(repos).each do |repo|
|
860
871
|
on(sut, %{subscription-manager repos --enable #{repo}})
|
861
872
|
end
|
@@ -863,8 +874,7 @@ module Simp::BeakerHelpers
|
|
863
874
|
end
|
864
875
|
|
865
876
|
def rhel_repo_disable(suts, repos)
|
866
|
-
|
867
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
877
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
868
878
|
Array(repos).each do |repo|
|
869
879
|
on(sut, %{subscription-manager repos --disable #{repo}}, :accept_all_exit_codes => true)
|
870
880
|
end
|
@@ -872,16 +882,14 @@ module Simp::BeakerHelpers
|
|
872
882
|
end
|
873
883
|
|
874
884
|
def rhel_rhsm_unsubscribe(suts)
|
875
|
-
|
876
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
885
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
877
886
|
on(sut, %{subscription-manager unregister}, :accept_all_exit_codes => true)
|
878
887
|
end
|
879
888
|
end
|
880
889
|
|
881
890
|
# Apply known OS fixes we need to run Beaker on each SUT
|
882
891
|
def fix_errata_on( suts = hosts )
|
883
|
-
|
884
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
892
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
885
893
|
if is_windows?(sut)
|
886
894
|
# Load the Windows requirements
|
887
895
|
require 'simp/beaker_helpers/windows'
|
@@ -1091,8 +1099,7 @@ module Simp::BeakerHelpers
|
|
1091
1099
|
def activate_interfaces(hosts)
|
1092
1100
|
return if ENV['BEAKER_no_fix_interfaces']
|
1093
1101
|
|
1094
|
-
|
1095
|
-
block_on(hosts, :run_in_parallel => parallel) do |host|
|
1102
|
+
block_on(hosts, :run_in_parallel => @run_in_parallel) do |host|
|
1096
1103
|
if host[:platform] =~ /windows/
|
1097
1104
|
puts " -- SKIPPING #{host} because it is windows"
|
1098
1105
|
next
|
@@ -1335,8 +1342,7 @@ module Simp::BeakerHelpers
|
|
1335
1342
|
noop => false
|
1336
1343
|
}
|
1337
1344
|
PLUGINSYNC_MANIFEST
|
1338
|
-
|
1339
|
-
apply_manifest_on(hosts, pluginsync_manifest, :run_in_parallel => parallel)
|
1345
|
+
apply_manifest_on(hosts, pluginsync_manifest, :run_in_parallel => @run_in_parallel)
|
1340
1346
|
end
|
1341
1347
|
|
1342
1348
|
|
@@ -1455,9 +1461,8 @@ module Simp::BeakerHelpers
|
|
1455
1461
|
ENV['BEAKER_PUPPET_COLLECTION'] = install_info[:puppet_collection]
|
1456
1462
|
end
|
1457
1463
|
|
1458
|
-
require 'beaker
|
1459
|
-
|
1460
|
-
run_puppet_install_helper(install_info[:puppet_install_type], install_info[:puppet_install_version])
|
1464
|
+
require 'beaker-puppet'
|
1465
|
+
install_puppet_on(hosts, version: install_info[:puppet_install_version])
|
1461
1466
|
end
|
1462
1467
|
|
1463
1468
|
# Configure all SIMP repos on a host and disable all repos in the disable Array
|
@@ -1494,18 +1499,28 @@ module Simp::BeakerHelpers
|
|
1494
1499
|
|
1495
1500
|
return if (ENV.fetch('SIMP_install_repos', 'yes') == 'no')
|
1496
1501
|
|
1497
|
-
|
1498
|
-
block_on(suts, :run_in_parallel => parallel) do |sut|
|
1502
|
+
block_on(suts, :run_in_parallel => @run_in_parallel) do |sut|
|
1499
1503
|
install_package_unless_present_on(sut, 'yum-utils')
|
1500
1504
|
|
1505
|
+
os = fact_on(sut, 'os.name')
|
1501
1506
|
release = fact_on(sut, 'os.release.major')
|
1502
1507
|
|
1508
|
+
# Work around Amazon 2 compatibility
|
1509
|
+
if (( os == 'Amazon' ) && ( "#{release}" == '2' ))
|
1510
|
+
release = '7'
|
1511
|
+
end
|
1512
|
+
|
1503
1513
|
install_package_unless_present_on(
|
1504
1514
|
sut,
|
1505
1515
|
'simp-release-community',
|
1506
1516
|
"https://download.simp-project.com/simp-release-community.el#{release}.rpm"
|
1507
1517
|
)
|
1508
1518
|
|
1519
|
+
# TODO: Remove this hack-around when there's a version for AL2
|
1520
|
+
if ( os == 'Amazon' )
|
1521
|
+
on(sut, %(sed -i 's/$releasever/#{release}/g' /etc/yum.repos.d/simp*))
|
1522
|
+
end
|
1523
|
+
|
1509
1524
|
to_disable = disable.dup
|
1510
1525
|
to_disable += ENV.fetch('BEAKER_SIMP_disable_repos', '').split(',').map(&:strip)
|
1511
1526
|
|
data/lib/simp/rake/beaker.rb
CHANGED
@@ -2,7 +2,8 @@ require 'rake'
|
|
2
2
|
require 'rake/clean'
|
3
3
|
require 'rake/tasklib'
|
4
4
|
require 'fileutils'
|
5
|
-
require '
|
5
|
+
require 'beaker/tasks/rake_task'
|
6
|
+
require 'beaker-rspec/rake_task'
|
6
7
|
require 'puppetlabs_spec_helper/tasks/fixtures'
|
7
8
|
|
8
9
|
module Simp; end
|
data/simp-beaker-helpers.gemspec
CHANGED
@@ -22,19 +22,14 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.required_ruby_version = '>= 2.3.0'
|
23
23
|
|
24
24
|
s.add_runtime_dependency 'beaker' , ['>= 4.17.0', '< 5.0.0']
|
25
|
-
s.add_runtime_dependency 'beaker-rspec' , '~>
|
25
|
+
s.add_runtime_dependency 'beaker-rspec' , '~> 7.1'
|
26
26
|
s.add_runtime_dependency 'beaker-puppet' , ['>= 1.18.14', '< 2.0.0']
|
27
27
|
s.add_runtime_dependency 'beaker-docker' , ['>= 0.8.3', '< 2.0.0']
|
28
28
|
s.add_runtime_dependency 'docker-api' , ['>= 2.1.0', '< 3.0.0']
|
29
29
|
s.add_runtime_dependency 'beaker-vagrant' , ['>= 0.6.4', '< 2.0.0']
|
30
|
-
s.add_runtime_dependency 'beaker-puppet_install_helper', '~> 0.9'
|
31
30
|
s.add_runtime_dependency 'highline' , '~> 2.0'
|
32
31
|
s.add_runtime_dependency 'nokogiri' , '~> 1.8'
|
33
32
|
|
34
|
-
# Because net-telnet dropped support for Ruby < 2.3.0
|
35
|
-
# TODO: Update this when we no longer support Ruby 2.1.9 (should be October 2018)
|
36
|
-
s.add_runtime_dependency 'net-telnet', '~> 0.1.1'
|
37
|
-
|
38
33
|
### s.files = Dir['Rakefile', '{bin,lib,spec}/**/*', 'README*', 'LICENSE*'] & `git ls-files -z .`.split("\0")
|
39
34
|
s.files = `git ls-files`.split("\n")
|
40
35
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<%
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
4
|
+
else
|
5
|
+
hypervisor = 'vagrant'
|
6
|
+
end
|
7
|
+
-%>
|
8
|
+
HOSTS:
|
9
|
+
amzn2:
|
10
|
+
roles:
|
11
|
+
- master
|
12
|
+
- default
|
13
|
+
platform: el-7-x86_64
|
14
|
+
box: gbailey/amzn2
|
15
|
+
hypervisor: <%= hypervisor %>
|
16
|
+
|
17
|
+
CONFIG:
|
18
|
+
log_level: verbose
|
19
|
+
synced_folder : disabled
|
20
|
+
type: aio
|
21
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
22
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
23
|
+
<% end -%>
|
@@ -18,13 +18,12 @@ HOSTS:
|
|
18
18
|
roles:
|
19
19
|
- el8
|
20
20
|
platform: el-8-x86_64
|
21
|
-
box:
|
21
|
+
box: centos/stream8
|
22
22
|
hypervisor: <%= hypervisor %>
|
23
23
|
|
24
24
|
CONFIG:
|
25
25
|
log_level: verbose
|
26
26
|
type: aio
|
27
|
-
vagrant_memsize: 512
|
28
27
|
vagrant_cpus: 2
|
29
28
|
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
30
29
|
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
@@ -5,8 +5,6 @@ require 'beaker-rspec'
|
|
5
5
|
require 'simp/beaker_helpers'
|
6
6
|
include Simp::BeakerHelpers
|
7
7
|
|
8
|
-
require 'beaker/puppet_install_helper'
|
9
|
-
|
10
8
|
unless ENV['BEAKER_provision'] == 'no'
|
11
9
|
hosts.each do |host|
|
12
10
|
unless Simp::BeakerHelpers::Snapshot.exist?(host, 'puppet_installed')
|
@@ -18,8 +18,40 @@ end
|
|
18
18
|
|
19
19
|
RSpec.configure do |c|
|
20
20
|
# ensure that environment OS is ready on each host
|
21
|
-
fix_errata_on
|
21
|
+
fix_errata_on hosts
|
22
|
+
|
23
|
+
# Detect cases in which no examples are executed (e.g., nodeset does not
|
24
|
+
# have hosts with required roles)
|
25
|
+
c.fail_if_no_examples = true
|
22
26
|
|
23
27
|
# Readable test descriptions
|
24
28
|
c.formatter = :documentation
|
29
|
+
|
30
|
+
# Configure all nodes in nodeset
|
31
|
+
c.before :suite do
|
32
|
+
begin
|
33
|
+
# Install modules and dependencies from spec/fixtures/modules
|
34
|
+
copy_fixture_modules_to( hosts )
|
35
|
+
begin
|
36
|
+
server = only_host_with_role(hosts, 'server')
|
37
|
+
rescue ArgumentError =>e
|
38
|
+
server = only_host_with_role(hosts, 'default')
|
39
|
+
end
|
40
|
+
|
41
|
+
# Generate and install PKI certificates on each SUT
|
42
|
+
Dir.mktmpdir do |cert_dir|
|
43
|
+
run_fake_pki_ca_on(server, hosts, cert_dir )
|
44
|
+
hosts.each{ |sut| copy_pki_to( sut, cert_dir, '/etc/pki/simp-testing' )}
|
45
|
+
end
|
46
|
+
|
47
|
+
# add PKI keys
|
48
|
+
copy_keydist_to(server)
|
49
|
+
rescue StandardError, ScriptError => e
|
50
|
+
if ENV['PRY']
|
51
|
+
require 'pry'; binding.pry
|
52
|
+
else
|
53
|
+
raise e
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
25
57
|
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.
|
4
|
+
version: 1.25.0
|
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-
|
12
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|
@@ -37,14 +37,14 @@ dependencies:
|
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '7.1'
|
41
41
|
type: :runtime
|
42
42
|
prerelease: false
|
43
43
|
version_requirements: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '7.1'
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: beaker-puppet
|
50
50
|
requirement: !ruby/object:Gem::Requirement
|
@@ -125,20 +125,6 @@ dependencies:
|
|
125
125
|
- - "<"
|
126
126
|
- !ruby/object:Gem::Version
|
127
127
|
version: 2.0.0
|
128
|
-
- !ruby/object:Gem::Dependency
|
129
|
-
name: beaker-puppet_install_helper
|
130
|
-
requirement: !ruby/object:Gem::Requirement
|
131
|
-
requirements:
|
132
|
-
- - "~>"
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version: '0.9'
|
135
|
-
type: :runtime
|
136
|
-
prerelease: false
|
137
|
-
version_requirements: !ruby/object:Gem::Requirement
|
138
|
-
requirements:
|
139
|
-
- - "~>"
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
version: '0.9'
|
142
128
|
- !ruby/object:Gem::Dependency
|
143
129
|
name: highline
|
144
130
|
requirement: !ruby/object:Gem::Requirement
|
@@ -167,20 +153,6 @@ dependencies:
|
|
167
153
|
- - "~>"
|
168
154
|
- !ruby/object:Gem::Version
|
169
155
|
version: '1.8'
|
170
|
-
- !ruby/object:Gem::Dependency
|
171
|
-
name: net-telnet
|
172
|
-
requirement: !ruby/object:Gem::Requirement
|
173
|
-
requirements:
|
174
|
-
- - "~>"
|
175
|
-
- !ruby/object:Gem::Version
|
176
|
-
version: 0.1.1
|
177
|
-
type: :runtime
|
178
|
-
prerelease: false
|
179
|
-
version_requirements: !ruby/object:Gem::Requirement
|
180
|
-
requirements:
|
181
|
-
- - "~>"
|
182
|
-
- !ruby/object:Gem::Version
|
183
|
-
version: 0.1.1
|
184
156
|
description: " Beaker helper methods to help scaffold SIMP acceptance tests\n"
|
185
157
|
email: simp@simp-project.org
|
186
158
|
executables: []
|
@@ -219,6 +191,7 @@ files:
|
|
219
191
|
- lib/simp/beaker_helpers/windows.rb
|
220
192
|
- lib/simp/rake/beaker.rb
|
221
193
|
- simp-beaker-helpers.gemspec
|
194
|
+
- spec/acceptance/nodesets/amzn2.yml
|
222
195
|
- spec/acceptance/nodesets/default.yml
|
223
196
|
- spec/acceptance/nodesets/docker.yml
|
224
197
|
- spec/acceptance/nodesets/oel.yml
|