simp-beaker-helpers 1.19.3 → 1.21.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.gitlab-ci.yml +29 -19
- data/CHANGELOG.md +51 -0
- data/Rakefile +1 -1
- data/lib/simp/beaker_helpers.rb +341 -165
- data/lib/simp/beaker_helpers/constants.rb +5 -1
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/spec/acceptance/nodesets/default.yml +22 -5
- data/spec/acceptance/nodesets/docker.yml +36 -0
- data/spec/acceptance/nodesets/ubuntu.yml +20 -0
- data/spec/acceptance/suites/default/check_puppet_version_spec.rb +1 -1
- data/spec/acceptance/suites/default/fixture_modules_spec.rb +14 -0
- data/spec/acceptance/suites/default/nodesets +1 -0
- data/spec/acceptance/suites/fips_from_fixtures/nodesets +1 -0
- data/spec/acceptance/suites/snapshot/nodesets +1 -0
- data/spec/lib/simp/beaker_helpers_spec.rb +15 -2
- metadata +17 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 876c4f6b1c6dfe6c9230d0c127e6dabdd3cc77c372e0d6def7e42606ecd35cc6
|
4
|
+
data.tar.gz: 062201bba85a2199e442d907b30aae6e2674db29de2c21c7bc49e5ef5dd7c117
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8469baf544e003f9450a6c0b5639a2112c36961846e06faf6222878b5a1f0d6eb5663fd3c921d6b2117174cfdcf74863da67c40364c34a3818a5eb1204a94901
|
7
|
+
data.tar.gz: 2810e22a457f9daf3d91e355d2ead18e1b3dd5aaecbebc8f516930968cc937b1a9322750d305591db47d3f2d0d25cd8895c9189c16ee71f9505756eb447015b0
|
data/.gitignore
CHANGED
data/.gitlab-ci.yml
CHANGED
@@ -97,28 +97,25 @@ variables:
|
|
97
97
|
changes:
|
98
98
|
- .gitlab-ci.yml
|
99
99
|
- .fixtures.yml
|
100
|
+
- .rspec
|
101
|
+
- metadata.json
|
100
102
|
- "spec/spec_helper.rb"
|
101
|
-
- "spec/{classes,unit,defines,type_aliases,types,hosts}/**/*.rb"
|
102
|
-
- "{manifests,files,types}/**/*"
|
103
|
-
- "templates
|
104
|
-
- "lib/**/*"
|
103
|
+
- "spec/{classes,unit,defines,type_aliases,types,hosts,lib}/**/*.rb"
|
104
|
+
- "{SIMP,data,manifests,files,types,lib}/**/*"
|
105
|
+
- "templates/**/*.{erb,epp}"
|
105
106
|
- "Gemfile"
|
106
|
-
- "SIMP/**/*"
|
107
|
-
- "data/**/*"
|
108
107
|
exists:
|
109
|
-
- "spec/{classes,unit,defines,type_aliases,types,hosts}/**/*_spec.rb"
|
108
|
+
- "spec/{classes,unit,defines,type_aliases,types,hosts,lib}/**/*_spec.rb"
|
110
109
|
|
111
110
|
.relevant_file_conditions_trigger_acceptance_tests: &relevant_file_conditions_trigger_acceptance_tests
|
112
111
|
changes:
|
113
112
|
- .gitlab-ci.yml
|
113
|
+
- .fixtures.yml
|
114
114
|
- "spec/spec_helper_acceptance.rb"
|
115
115
|
- "spec/acceptance/**/*"
|
116
|
-
- "{manifests,files,types}/**/*"
|
117
|
-
- "templates
|
118
|
-
- "lib/**/*"
|
116
|
+
- "{SIMP,data,manifests,files,types,lib}/**/*"
|
117
|
+
- "templates/**/*.{erb,epp}"
|
119
118
|
- "Gemfile"
|
120
|
-
- "SIMP/**/*"
|
121
|
-
- "data/**/*"
|
122
119
|
exists:
|
123
120
|
- "spec/acceptance/**/*_spec.rb"
|
124
121
|
|
@@ -286,21 +283,14 @@ variables:
|
|
286
283
|
pup5-unit:
|
287
284
|
<<: *pup_5
|
288
285
|
<<: *unit_tests
|
289
|
-
<<: *with_SIMP_SPEC_MATRIX_LEVEL_2
|
290
286
|
|
291
287
|
pup6-unit:
|
292
288
|
<<: *pup_6
|
293
289
|
<<: *unit_tests
|
294
|
-
<<: *with_SIMP_SPEC_MATRIX_LEVEL_2
|
295
|
-
|
296
|
-
pup6.18.0-unit:
|
297
|
-
<<: *pup_6_18_0
|
298
|
-
<<: *unit_tests
|
299
290
|
|
300
291
|
pup7-unit:
|
301
292
|
<<: *pup_7
|
302
293
|
<<: *unit_tests
|
303
|
-
<<: *with_SIMP_SPEC_MATRIX_LEVEL_2
|
304
294
|
|
305
295
|
# ------------------------------------------------------------------------------
|
306
296
|
# NOTICE: **This file is maintained with puppetsync**
|
@@ -312,6 +302,26 @@ pup7-unit:
|
|
312
302
|
# Repo-specific content
|
313
303
|
# ==============================================================================
|
314
304
|
|
305
|
+
#=======================================================================
|
306
|
+
# Packaging test
|
307
|
+
|
308
|
+
pup5-pkg:
|
309
|
+
<<: *pup_5
|
310
|
+
<<: *unit_tests
|
311
|
+
script:
|
312
|
+
'bundle exec rake pkg:gem'
|
313
|
+
|
314
|
+
pup6-pkg:
|
315
|
+
<<: *pup_6
|
316
|
+
<<: *unit_tests
|
317
|
+
script:
|
318
|
+
'bundle exec rake pkg:gem'
|
319
|
+
|
320
|
+
pup7-pkg:
|
321
|
+
<<: *pup_7
|
322
|
+
<<: *unit_tests
|
323
|
+
script:
|
324
|
+
'bundle exec rake pkg:gem'
|
315
325
|
|
316
326
|
#=======================================================================
|
317
327
|
# Acceptance tests
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,54 @@
|
|
1
|
+
### 1.21.3 / 2021-01-20
|
2
|
+
* Fixed:
|
3
|
+
* Allow all methods that can safely take SUT arrays to do so
|
4
|
+
* Ensure that pfact_on returns a Hash if appropriate
|
5
|
+
* Fix container support in copy_to
|
6
|
+
* Added:
|
7
|
+
* Explicitly support podman local and remote in copy_to
|
8
|
+
|
9
|
+
### 1.21.2 / 2021-01-15
|
10
|
+
* Fixed version mismatch. 1.21.1 was tagged with an incorrect version
|
11
|
+
in version.rb.
|
12
|
+
|
13
|
+
### 1.21.1 / 2021-01-13
|
14
|
+
* Added:
|
15
|
+
* update_package_from_centos_stream method
|
16
|
+
* install_latest_package_on method
|
17
|
+
* Fixed:
|
18
|
+
* Removed some of the extraneous calls to facter
|
19
|
+
* Automatically pull the CentOS 8 kernel to the latest version in
|
20
|
+
CentOS-Stream to work around issues on FIPS systems
|
21
|
+
|
22
|
+
### 1.20.1 / 2021-01-08
|
23
|
+
* Fixed:
|
24
|
+
* Ensure that yum calls commands appropriately depending on whether or not
|
25
|
+
packages are already installed.
|
26
|
+
* Also change all HostKeyAlgorithms settings for SSH connections
|
27
|
+
|
28
|
+
### 1.20.0 / 2021-01-05
|
29
|
+
* Added:
|
30
|
+
* A `enable_epel_on` function that follows the instructions on the EPEL
|
31
|
+
website to properly enable EPEL on hosts. May be disabled using
|
32
|
+
`BEAKER_enable_epel=no`.
|
33
|
+
* An Ubuntu nodeset to make sure our default settings don't destroy other
|
34
|
+
Linux systems.
|
35
|
+
* Added has_crypto_policies method for determining if crypto policies are
|
36
|
+
present on the SUT
|
37
|
+
* Added munge_ssh_crypto_policies to allow vagrant to SSH back into systems
|
38
|
+
with restrictive crypto policies (usually FIPS)
|
39
|
+
* Fixed:
|
40
|
+
* Modify all crypto-policy backend files to support ssh-rsa keys
|
41
|
+
* Try harder when doing yum installations
|
42
|
+
|
43
|
+
### 1.19.4 / 2021-01-05
|
44
|
+
* Fixed:
|
45
|
+
* Only return a default empty string when `pfact_on` finds a `nil` value
|
46
|
+
* Added an acceptance test to validate this
|
47
|
+
* Ensure that we start with `facter -p` for `facter` < 4.0 and continue to
|
48
|
+
`puppet facts` otherwise
|
49
|
+
* Updated the Rakefile to skip symlinks in chmods which fixes the ability to
|
50
|
+
build gems
|
51
|
+
|
1
52
|
### 1.19.3 / 2021-01-01
|
2
53
|
* Fixed:
|
3
54
|
* Ensure that `pfact_on` can handle fact dot notation
|
data/Rakefile
CHANGED
@@ -30,7 +30,7 @@ task :chmod do
|
|
30
30
|
gemspec = File.expand_path( "#{@package}.gemspec", @rakefile_dir ).strip
|
31
31
|
spec = Gem::Specification::load( gemspec )
|
32
32
|
spec.files.each do |file|
|
33
|
-
FileUtils.chmod 'go=r', file
|
33
|
+
FileUtils.chmod 'go=r', file unless File.symlink?(file)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -18,6 +18,33 @@ module Simp::BeakerHelpers
|
|
18
18
|
"simp-beaker-helpers-#{t}-#{$$}-#{rand(0x100000000).to_s(36)}.tmp"
|
19
19
|
end
|
20
20
|
|
21
|
+
def install_latest_package_on(suts, package_name, package_source=nil, opts={})
|
22
|
+
default_opts = {
|
23
|
+
max_retries: 3,
|
24
|
+
retry_interval: 10
|
25
|
+
}
|
26
|
+
|
27
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
28
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
29
|
+
package_source = package_name unless package_source
|
30
|
+
|
31
|
+
if sut.check_for_package(package_name)
|
32
|
+
sut.upgrade_package(
|
33
|
+
package_source,
|
34
|
+
'',
|
35
|
+
default_opts.merge(opts)
|
36
|
+
)
|
37
|
+
else
|
38
|
+
sut.install_package(
|
39
|
+
package_source,
|
40
|
+
'',
|
41
|
+
nil,
|
42
|
+
default_opts.merge(opts)
|
43
|
+
)
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
21
48
|
def is_windows?(sut)
|
22
49
|
sut[:platform] =~ /windows/i
|
23
50
|
end
|
@@ -80,7 +107,30 @@ module Simp::BeakerHelpers
|
|
80
107
|
else
|
81
108
|
container_id = sut.host_hash[:docker_container_id]
|
82
109
|
end
|
83
|
-
|
110
|
+
|
111
|
+
if ENV['BEAKER_docker_cmd']
|
112
|
+
docker_cmd = ENV['BEAKER_docker_cmd']
|
113
|
+
else
|
114
|
+
docker_cmd = 'docker'
|
115
|
+
|
116
|
+
if ::Docker.version['Components'].any?{|x| x['Name'] =~ /podman/i}
|
117
|
+
docker_cmd = 'podman'
|
118
|
+
|
119
|
+
if ENV['CONTAINER_HOST']
|
120
|
+
docker_cmd = 'podman --remote'
|
121
|
+
elsif ENV['DOCKER_HOST']
|
122
|
+
docker_cmd = "podman --remote --url=#{ENV['DOCKER_HOST']}"
|
123
|
+
end
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
unless directory_exists_on(sut, dest)
|
128
|
+
dest = File.dirname(dest)
|
129
|
+
sut.mkdir_p(dest)
|
130
|
+
end
|
131
|
+
|
132
|
+
%x(tar #{exclude_list.join(' ')} -hcf - -C "#{File.dirname(src)}" "#{File.basename(src)}" | #{docker_cmd} exec -i "#{container_id}" tar -C "#{dest}" -xf -)
|
133
|
+
|
84
134
|
elsif rsync_functional_on?(sut)
|
85
135
|
# This makes rsync_to work like beaker and scp usually do
|
86
136
|
exclude_hack = %(__-__' -L --exclude '__-__)
|
@@ -118,13 +168,35 @@ module Simp::BeakerHelpers
|
|
118
168
|
def pfact_on(sut, fact_name)
|
119
169
|
require 'ostruct'
|
120
170
|
|
171
|
+
found_fact = nil
|
172
|
+
# If puppet is not installed, there are no puppet facts to fetch
|
121
173
|
if sut.which('puppet').empty?
|
122
|
-
fact_on(sut, fact_name
|
174
|
+
found_fact = fact_on(sut, fact_name)
|
123
175
|
else
|
124
|
-
facts_json =
|
125
|
-
|
126
|
-
|
176
|
+
facts_json = nil
|
177
|
+
begin
|
178
|
+
cmd_output = on(sut, 'facter -p --json', :silent => true)
|
179
|
+
|
180
|
+
# Facter 4+
|
181
|
+
raise('skip facter -p') if (cmd_output.stderr =~ /no longer supported/)
|
182
|
+
|
183
|
+
facts = JSON.parse(cmd_output.stdout, object_class: OpenStruct)
|
184
|
+
rescue StandardError
|
185
|
+
# If *anything* fails, we need to fall back to `puppet facts`
|
186
|
+
|
187
|
+
facts_json = on(sut, 'puppet facts find garbage_xxx', :silent => true).stdout
|
188
|
+
facts = JSON.parse(facts_json, object_class: OpenStruct).values
|
189
|
+
end
|
190
|
+
|
191
|
+
found_fact = facts.dig(*(fact_name.split('.')))
|
192
|
+
|
193
|
+
# If we did not find a fact, we should use the upstream function since
|
194
|
+
# puppet may be installed via a gem or through some other means.
|
195
|
+
found_fact = fact_on(sut, fact_name) if found_fact.nil?
|
127
196
|
end
|
197
|
+
|
198
|
+
# Ensure that Hashes return as Hash objects
|
199
|
+
found_fact.is_a?(OpenStruct) ? found_fact.marshal_dump : found_fact
|
128
200
|
end
|
129
201
|
|
130
202
|
# Returns the modulepath on the SUT, as an Array
|
@@ -302,6 +374,22 @@ module Simp::BeakerHelpers
|
|
302
374
|
pluginsync_on(suts) if opts[:pluginsync]
|
303
375
|
end
|
304
376
|
|
377
|
+
def has_crypto_policies(sut)
|
378
|
+
file_exists_on(sut, '/etc/crypto-policies/config')
|
379
|
+
end
|
380
|
+
|
381
|
+
def munge_ssh_crypto_policies(suts, key_types=['ssh-rsa'])
|
382
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
383
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
384
|
+
if has_crypto_policies(sut)
|
385
|
+
install_latest_package_on(sut, 'crypto-policies', nil, :accept_all_exit_codes => true)
|
386
|
+
|
387
|
+
# Since we may be doing this prior to having a box flip into FIPS mode, we
|
388
|
+
# need to find and modify *all* of the affected policies
|
389
|
+
on( sut, %{sed --follow-symlinks -i 's/\\(HostKeyAlgorithms\\|PubkeyAcceptedKeyTypes\\)\\(.\\)/\\1\\2#{key_types.join(',')},/g' $( grep -L ssh-rsa $( find /etc/crypto-policies /usr/share/crypto-policies -type f -a \\( -name '*.txt' -o -name '*.config' \\) -exec grep -l PubkeyAcceptedKeyTypes {} \\; ) ) })
|
390
|
+
end
|
391
|
+
end
|
392
|
+
end
|
305
393
|
|
306
394
|
# Configure and reboot SUTs into FIPS mode
|
307
395
|
def enable_fips_mode_on( suts = hosts )
|
@@ -309,7 +397,10 @@ module Simp::BeakerHelpers
|
|
309
397
|
puts ' -- (use BEAKER_fips=no to disable)'
|
310
398
|
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
311
399
|
|
400
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
312
401
|
block_on(suts, :run_in_parallel => parallel) do |sut|
|
402
|
+
next if sut[:hypervisor] == 'docker'
|
403
|
+
|
313
404
|
if is_windows?(sut)
|
314
405
|
puts " -- SKIPPING #{sut} because it is windows"
|
315
406
|
next
|
@@ -355,17 +446,14 @@ module Simp::BeakerHelpers
|
|
355
446
|
on(sut, module_install_cmd)
|
356
447
|
end
|
357
448
|
|
358
|
-
# Enable FIPS and then reboot to finish.
|
359
|
-
on(sut, %(puppet apply --verbose #{fips_enable_modulepath} -e "class { 'fips': enabled => true }"))
|
360
|
-
|
361
449
|
# Work around Vagrant and cipher restrictions in EL8+
|
362
450
|
#
|
363
451
|
# Hopefully, Vagrant will update the used ciphers at some point but who
|
364
452
|
# knows when that will be
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
453
|
+
munge_ssh_crypto_policies(sut)
|
454
|
+
|
455
|
+
# Enable FIPS and then reboot to finish.
|
456
|
+
on(sut, %(puppet apply --verbose #{fips_enable_modulepath} -e "class { 'fips': enabled => true }"))
|
369
457
|
|
370
458
|
sut.reboot
|
371
459
|
end
|
@@ -458,102 +546,171 @@ module Simp::BeakerHelpers
|
|
458
546
|
repo_manifest = repo_manifest + %(\n#{repo_manifest_opts.join(",\n")}) + "\n}\n"
|
459
547
|
end
|
460
548
|
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
549
|
+
# Enable EPEL if appropriate to do so and the system is online
|
550
|
+
#
|
551
|
+
# Can be disabled by setting BEAKER_enable_epel=no
|
552
|
+
def enable_epel_on(suts)
|
553
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
554
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
555
|
+
if ONLINE && (ENV['BEAKER_stringify_facts'] != 'no')
|
556
|
+
os_info = fact_on(sut, 'os')
|
557
|
+
os_maj_rel = os_info['release']['major']
|
558
|
+
|
559
|
+
# This is based on the official EPEL docs https://fedoraproject.org/wiki/EPEL
|
560
|
+
if ['RedHat', 'CentOS'].include?(os_info['name'])
|
561
|
+
install_latest_package_on(
|
562
|
+
sut,
|
563
|
+
'epel-release',
|
564
|
+
"https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm",
|
565
|
+
)
|
566
|
+
|
567
|
+
if os_info['name'] == 'RedHat'
|
568
|
+
if os_maj_rel == '7'
|
569
|
+
on sut, %{subscription-manager repos --enable "rhel-*-optional-rpms"}
|
570
|
+
on sut, %{subscription-manager repos --enable "rhel-*-extras-rpms"}
|
571
|
+
on sut, %{subscription-manager repos --enable "rhel-ha-for-rhel-*-server-rpms"}
|
572
|
+
end
|
472
573
|
|
473
|
-
|
474
|
-
|
475
|
-
|
574
|
+
if os_maj_rel == '8'
|
575
|
+
on sut, %{subscription-manager repos --enable "codeready-builder-for-rhel-8-#{os_info['architecture']}-rpms"}
|
576
|
+
end
|
577
|
+
end
|
476
578
|
|
477
|
-
|
478
|
-
|
479
|
-
|
579
|
+
if os_info['name'] == 'CentOS'
|
580
|
+
if os_maj_rel == '8'
|
581
|
+
# 8.0 fallback
|
582
|
+
install_latest_package_on(sut, 'dnf-plugins-core')
|
583
|
+
on sut, %{dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools}
|
584
|
+
end
|
585
|
+
end
|
586
|
+
end
|
480
587
|
end
|
481
588
|
end
|
589
|
+
end
|
482
590
|
|
483
|
-
|
484
|
-
|
591
|
+
def update_package_from_centos_stream(suts, package_name)
|
592
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
593
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
594
|
+
sut.install_package('centos-release-stream') unless sut.check_for_package('centos-release-stream')
|
595
|
+
install_latest_package_on(sut, package_name)
|
596
|
+
sut.uninstall_package('centos-release-stream')
|
485
597
|
end
|
598
|
+
end
|
486
599
|
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
#
|
491
|
-
on
|
492
|
-
on
|
493
|
-
on(sut, 'chmod 755 /etc/ssh/local_keys')
|
494
|
-
|
495
|
-
user_info = on(sut, 'getent passwd').stdout.lines
|
496
|
-
|
497
|
-
# Hash of user => home_dir
|
498
|
-
# Exclude silly directories
|
499
|
-
# * /
|
500
|
-
# * /dev/*
|
501
|
-
# * /s?bin
|
502
|
-
# * /proc
|
503
|
-
user_info = Hash[
|
504
|
-
user_info.map do |u|
|
505
|
-
u.strip!
|
506
|
-
u = u.split(':')
|
507
|
-
u[5] =~ %r{^(/|/dev/.*|/s?bin/?.*|/proc/?.*)$} ? [nil] : [u[0], u[5]]
|
508
|
-
end
|
509
|
-
]
|
600
|
+
def linux_errata( suts )
|
601
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
602
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
603
|
+
# We need to be able to flip between server and client without issue
|
604
|
+
on sut, 'puppet resource group puppet gid=52'
|
605
|
+
on sut, 'puppet resource user puppet comment="Puppet" gid="52" uid="52" home="/var/lib/puppet" managehome=true'
|
510
606
|
|
511
|
-
|
512
|
-
src_file = "#{user_info[user]}/.ssh/authorized_keys"
|
513
|
-
tgt_file = "/etc/ssh/local_keys/#{user}"
|
607
|
+
os_info = fact_on(sut, 'os')
|
514
608
|
|
515
|
-
|
516
|
-
|
517
|
-
|
609
|
+
# Make sure we have a domain on our host
|
610
|
+
current_domain = fact_on(sut, 'domain').strip
|
611
|
+
hostname = fact_on(sut, 'hostname').strip
|
518
612
|
|
519
|
-
|
520
|
-
|
521
|
-
on sut, 'puppet config set stringify_facts false'
|
522
|
-
end
|
613
|
+
if current_domain.empty?
|
614
|
+
new_fqdn = hostname + '.beaker.test'
|
523
615
|
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
# :hieradatadir is used as a canary here; it isn't the only missing key
|
528
|
-
unless sut.host_hash.key? :hieradatadir
|
529
|
-
configure_type_defaults_on(sut)
|
530
|
-
end
|
616
|
+
on(sut, "sed -i 's/#{hostname}.*/#{new_fqdn} #{hostname}/' /etc/hosts")
|
617
|
+
on(sut, "echo '#{new_fqdn}' > /etc/hostname", :accept_all_exit_codes => true)
|
618
|
+
on(sut, "hostname #{new_fqdn}", :accept_all_exit_codes => true)
|
531
619
|
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
end
|
620
|
+
if sut.file_exist?('/etc/sysconfig/network')
|
621
|
+
on(sut, "sed -s '/HOSTNAME=/d' /etc/sysconfig/network")
|
622
|
+
on(sut, "echo 'HOSTNAME=#{new_fqdn}' >> /etc/sysconfig/network")
|
623
|
+
end
|
624
|
+
end
|
538
625
|
|
539
|
-
|
540
|
-
|
626
|
+
if fact_on(sut, 'domain').strip.empty?
|
627
|
+
fail("Error: hosts must have an FQDN, got domain='#{current_domain}'")
|
628
|
+
end
|
629
|
+
|
630
|
+
# This may not exist in docker so just skip the whole thing
|
631
|
+
if sut.file_exist?('/etc/ssh')
|
632
|
+
# SIMP uses a central ssh key location so we prep that spot in case we
|
633
|
+
# flip to the SIMP SSH module.
|
634
|
+
on(sut, 'mkdir -p /etc/ssh/local_keys')
|
635
|
+
on(sut, 'chown -R root:root /etc/ssh/local_keys')
|
636
|
+
on(sut, 'chmod 755 /etc/ssh/local_keys')
|
637
|
+
|
638
|
+
user_info = on(sut, 'getent passwd').stdout.lines
|
639
|
+
|
640
|
+
# Hash of user => home_dir
|
641
|
+
# Exclude silly directories
|
642
|
+
# * /
|
643
|
+
# * /dev/*
|
644
|
+
# * /s?bin
|
645
|
+
# * /proc
|
646
|
+
user_info = Hash[
|
647
|
+
user_info.map do |u|
|
648
|
+
u.strip!
|
649
|
+
u = u.split(':')
|
650
|
+
u[5] =~ %r{^(/|/dev/.*|/s?bin/?.*|/proc/?.*)$} ? [nil] : [u[0], u[5]]
|
541
651
|
end
|
652
|
+
]
|
653
|
+
|
654
|
+
user_info.keys.each do |user|
|
655
|
+
src_file = "#{user_info[user]}/.ssh/authorized_keys"
|
656
|
+
tgt_file = "/etc/ssh/local_keys/#{user}"
|
657
|
+
|
658
|
+
on(sut, %{if [ -f "#{src_file}" ]; then cp -a -f "#{src_file}" "#{tgt_file}" && chmod 644 "#{tgt_file}"; fi}, :silent => true)
|
542
659
|
end
|
543
660
|
end
|
544
661
|
|
545
|
-
|
662
|
+
# SIMP uses structured facts, therefore stringify_facts must be disabled
|
663
|
+
unless ENV['BEAKER_stringify_facts'] == 'yes'
|
664
|
+
on sut, 'puppet config set stringify_facts false'
|
665
|
+
end
|
546
666
|
|
547
|
-
#
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
667
|
+
# Occasionally we run across something similar to BKR-561, so to ensure we
|
668
|
+
# at least have the host defaults:
|
669
|
+
#
|
670
|
+
# :hieradatadir is used as a canary here; it isn't the only missing key
|
671
|
+
unless sut.host_hash.key? :hieradatadir
|
672
|
+
configure_type_defaults_on(sut)
|
553
673
|
end
|
554
674
|
|
555
|
-
|
556
|
-
|
675
|
+
if os_info['family'] == 'RedHat'
|
676
|
+
# OS-specific items
|
677
|
+
if os_info['name'] == 'RedHat'
|
678
|
+
RSpec.configure do |c|
|
679
|
+
c.before(:all) do
|
680
|
+
rhel_rhsm_subscribe(sut)
|
681
|
+
end
|
682
|
+
|
683
|
+
c.after(:all) do
|
684
|
+
rhel_rhsm_unsubscribe(sut)
|
685
|
+
end
|
686
|
+
end
|
687
|
+
end
|
688
|
+
|
689
|
+
if ['CentOS','RedHat','OracleLinux'].include?(os_info['name'])
|
690
|
+
enable_yum_repos_on(sut)
|
691
|
+
enable_epel_on(sut)
|
692
|
+
|
693
|
+
# net-tools required for netstat utility being used by be_listening
|
694
|
+
if os_info['release']['major'].to_i >= 7
|
695
|
+
pp = <<-EOS
|
696
|
+
package { 'net-tools': ensure => installed }
|
697
|
+
EOS
|
698
|
+
apply_manifest_on(sut, pp, :catch_failures => false)
|
699
|
+
end
|
700
|
+
|
701
|
+
unless sut[:hypervisor] == 'docker'
|
702
|
+
if (os_info['name'] == 'CentOS') && (os_info['release']['major'].to_i >= 8)
|
703
|
+
if os_info['release']['minor'].to_i == 3
|
704
|
+
update_package_from_centos_stream(sut, 'kernel')
|
705
|
+
sut.reboot
|
706
|
+
end
|
707
|
+
end
|
708
|
+
end
|
709
|
+
|
710
|
+
# Clean up YUM prior to starting our test runs.
|
711
|
+
on(sut, 'yum clean all')
|
712
|
+
end
|
713
|
+
end
|
557
714
|
end
|
558
715
|
end
|
559
716
|
|
@@ -561,85 +718,100 @@ module Simp::BeakerHelpers
|
|
561
718
|
#
|
562
719
|
# Must set BEAKER_RHSM_USER and BEAKER_RHSM_PASS environment variables or pass them in as
|
563
720
|
# parameters
|
564
|
-
def rhel_rhsm_subscribe(
|
721
|
+
def rhel_rhsm_subscribe(suts, *opts)
|
565
722
|
require 'securerandom'
|
566
723
|
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
'
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
'
|
582
|
-
|
724
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
725
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
726
|
+
rhsm_opts = {
|
727
|
+
:username => ENV['BEAKER_RHSM_USER'],
|
728
|
+
:password => ENV['BEAKER_RHSM_PASS'],
|
729
|
+
:system_name => "#{sut}_beaker_#{Time.now.to_i}_#{SecureRandom.uuid}",
|
730
|
+
:repo_list => {
|
731
|
+
'7' => [
|
732
|
+
'rhel-7-server-extras-rpms',
|
733
|
+
'rhel-7-server-optional-rpms',
|
734
|
+
'rhel-7-server-rh-common-rpms',
|
735
|
+
'rhel-7-server-rpms',
|
736
|
+
'rhel-7-server-supplementary-rpms'
|
737
|
+
],
|
738
|
+
'8' => [
|
739
|
+
'rhel-8-for-x86_64-baseos-rpms',
|
740
|
+
'rhel-8-for-x86_64-supplementary-rpms'
|
741
|
+
]
|
742
|
+
}
|
583
743
|
}
|
584
|
-
}
|
585
744
|
|
586
|
-
|
587
|
-
|
588
|
-
|
745
|
+
if opts && opts.is_a?(Hash)
|
746
|
+
rhsm_opts.merge!(opts)
|
747
|
+
end
|
589
748
|
|
590
|
-
|
591
|
-
|
749
|
+
os = fact_on(sut, 'operatingsystem').strip
|
750
|
+
os_release = fact_on(sut, 'operatingsystemmajrelease').strip
|
592
751
|
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
752
|
+
if os == 'RedHat'
|
753
|
+
unless rhsm_opts[:username] && rhsm_opts[:password]
|
754
|
+
fail("You must set BEAKER_RHSM_USER and BEAKER_RHSM_PASS environment variables to register RHEL systems")
|
755
|
+
end
|
597
756
|
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
757
|
+
sub_status = on(sut, 'subscription-manager status', :accept_all_exit_codes => true)
|
758
|
+
unless sub_status.exit_code == 0
|
759
|
+
logger.info("Registering #{sut} via subscription-manager")
|
760
|
+
on(sut, %{subscription-manager register --auto-attach --name='#{rhsm_opts[:system_name]}' --username='#{rhsm_opts[:username]}' --password='#{rhsm_opts[:password]}'}, :silent => true)
|
761
|
+
end
|
603
762
|
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
763
|
+
if rhsm_opts[:repo_list][os_release]
|
764
|
+
rhel_repo_enable(sut, rhsm_opts[:repo_list][os_release])
|
765
|
+
else
|
766
|
+
logger.warn("simp-beaker-helpers:#{__method__} => Default repos for RHEL '#{os_release}' not found")
|
767
|
+
end
|
609
768
|
|
610
|
-
|
611
|
-
|
612
|
-
|
769
|
+
# Ensure that all users can access the entitlements since we don't know
|
770
|
+
# who we'll be running jobs as (often not root)
|
771
|
+
on(sut, 'chmod -R ugo+rX /etc/pki/entitlement', :accept_all_exit_codes => true)
|
772
|
+
end
|
613
773
|
end
|
614
774
|
end
|
615
775
|
|
616
|
-
def sosreport(
|
617
|
-
|
618
|
-
|
776
|
+
def sosreport(suts, dest='sosreports')
|
777
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
778
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
779
|
+
install_latest_package_on(sut, 'sos')
|
780
|
+
on(sut, 'sosreport --batch')
|
619
781
|
|
620
|
-
|
782
|
+
files = on(sut, 'ls /var/tmp/sosreport* /tmp/sosreport* 2>/dev/null', :accept_all_exit_codes => true).output.lines.map(&:strip)
|
621
783
|
|
622
|
-
|
784
|
+
FileUtils.mkdir_p(dest)
|
623
785
|
|
624
|
-
|
625
|
-
|
786
|
+
files.each do |file|
|
787
|
+
scp_from(sut, file, File.absolute_path(dest))
|
788
|
+
end
|
626
789
|
end
|
627
790
|
end
|
628
791
|
|
629
|
-
def rhel_repo_enable(
|
630
|
-
|
631
|
-
|
792
|
+
def rhel_repo_enable(suts, repos)
|
793
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
794
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
795
|
+
Array(repos).each do |repo|
|
796
|
+
on(sut, %{subscription-manager repos --enable #{repo}})
|
797
|
+
end
|
632
798
|
end
|
633
799
|
end
|
634
800
|
|
635
|
-
def rhel_repo_disable(
|
636
|
-
|
637
|
-
|
801
|
+
def rhel_repo_disable(suts, repos)
|
802
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
803
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
804
|
+
Array(repos).each do |repo|
|
805
|
+
on(sut, %{subscription-manager repos --disable #{repo}}, :accept_all_exit_codes => true)
|
806
|
+
end
|
638
807
|
end
|
639
808
|
end
|
640
809
|
|
641
|
-
def rhel_rhsm_unsubscribe(
|
642
|
-
|
810
|
+
def rhel_rhsm_unsubscribe(suts)
|
811
|
+
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
812
|
+
block_on(suts, :run_in_parallel => parallel) do |sut|
|
813
|
+
on(sut, %{subscription-manager unregister}, :accept_all_exit_codes => true)
|
814
|
+
end
|
643
815
|
end
|
644
816
|
|
645
817
|
# Apply known OS fixes we need to run Beaker on each SUT
|
@@ -713,6 +885,9 @@ module Simp::BeakerHelpers
|
|
713
885
|
|
714
886
|
host_entry = { fqdn => [] }
|
715
887
|
|
888
|
+
# Add the short name because containers can't change the hostname
|
889
|
+
host_entry[fqdn] << host.name if (host[:hypervisor] == 'docker')
|
890
|
+
|
716
891
|
# Ensure that all interfaces are active prior to collecting data
|
717
892
|
activate_interfaces(host) unless ENV['BEAKER_no_fix_interfaces']
|
718
893
|
|
@@ -726,7 +901,7 @@ module Simp::BeakerHelpers
|
|
726
901
|
host_entry[fqdn] << ipaddress.strip
|
727
902
|
|
728
903
|
unless host_entry[fqdn].empty?
|
729
|
-
suts_network_info[fqdn] = host_entry[fqdn]
|
904
|
+
suts_network_info[fqdn] = host_entry[fqdn].sort.uniq
|
730
905
|
end
|
731
906
|
end
|
732
907
|
end
|
@@ -755,6 +930,7 @@ module Simp::BeakerHelpers
|
|
755
930
|
end
|
756
931
|
|
757
932
|
copy_to(ca_sut, pki_hosts_file, host_dir)
|
933
|
+
|
758
934
|
# generate certs
|
759
935
|
on(ca_sut, "cd #{host_dir}; cat #{host_dir}/pki.hosts | xargs bash make.sh")
|
760
936
|
end
|
@@ -789,8 +965,8 @@ module Simp::BeakerHelpers
|
|
789
965
|
sut.mkdir_p("#{sut_pki_dir}/public")
|
790
966
|
sut.mkdir_p("#{sut_pki_dir}/private")
|
791
967
|
sut.mkdir_p("#{sut_pki_dir}/cacerts")
|
792
|
-
copy_to(sut, "#{local_host_pki_tree}/#{fqdn}.pem",
|
793
|
-
copy_to(sut, "#{local_host_pki_tree}/#{fqdn}.pub",
|
968
|
+
copy_to(sut, "#{local_host_pki_tree}/#{fqdn}.pem", "#{sut_pki_dir}/private/")
|
969
|
+
copy_to(sut, "#{local_host_pki_tree}/#{fqdn}.pub", "#{sut_pki_dir}/public/")
|
794
970
|
|
795
971
|
copy_to(sut, local_cacert, "#{sut_pki_dir}/cacerts/simp_auto_ca.pem")
|
796
972
|
|
@@ -800,18 +976,19 @@ module Simp::BeakerHelpers
|
|
800
976
|
# Need to hash all of the CA certificates so that apps can use them
|
801
977
|
# properly! This must happen on the host itself since it needs to match
|
802
978
|
# the native hashing algorithms.
|
803
|
-
hash_cmd =
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
979
|
+
hash_cmd = <<~EOM.strip
|
980
|
+
PATH=/opt/puppetlabs/puppet/bin:$PATH; \
|
981
|
+
cd #{sut_pki_dir}/cacerts; \
|
982
|
+
for x in *; do \
|
983
|
+
if [ ! -h "$x" ]; then \
|
984
|
+
`openssl x509 -in $x >/dev/null 2>&1`; \
|
985
|
+
if [ $? -eq 0 ]; then \
|
986
|
+
hash=`openssl x509 -in $x -hash | head -1`; \
|
987
|
+
ln -sf $x $hash.0; \
|
988
|
+
fi; \
|
989
|
+
fi; \
|
990
|
+
done
|
991
|
+
EOM
|
815
992
|
|
816
993
|
on(sut, hash_cmd)
|
817
994
|
end
|
@@ -1226,13 +1403,12 @@ done
|
|
1226
1403
|
def install_simp_repos(sut, disable = [])
|
1227
1404
|
# NOTE: Do *NOT* use puppet in this method since it may not be available yet
|
1228
1405
|
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
end
|
1406
|
+
install_latest_package_on(sut, 'yum-utils')
|
1407
|
+
install_latest_package_on(
|
1408
|
+
sut,
|
1409
|
+
'simp-release-community',
|
1410
|
+
"https://download.simp-project.com/simp-release-community.rpm",
|
1411
|
+
)
|
1236
1412
|
|
1237
1413
|
to_disable = disable.dup
|
1238
1414
|
|
@@ -17,7 +17,11 @@ module Simp::BeakerHelpers
|
|
17
17
|
require 'open-uri'
|
18
18
|
|
19
19
|
begin
|
20
|
-
|
20
|
+
if URI.respond_to?(:open)
|
21
|
+
ONLINE = true if URI.open('http://google.com')
|
22
|
+
else
|
23
|
+
ONLINE = true if open('http://google.com')
|
24
|
+
end
|
21
25
|
rescue
|
22
26
|
ONLINE = false
|
23
27
|
end
|
@@ -6,21 +6,27 @@
|
|
6
6
|
end
|
7
7
|
-%>
|
8
8
|
HOSTS:
|
9
|
-
|
9
|
+
el7:
|
10
10
|
roles:
|
11
|
-
- server
|
12
|
-
- master
|
13
|
-
- default
|
14
11
|
- el7
|
12
|
+
- master
|
15
13
|
platform: el-7-x86_64
|
16
14
|
box: centos/7
|
17
15
|
hypervisor: <%= hypervisor %>
|
18
16
|
|
19
|
-
|
17
|
+
el8:
|
18
|
+
roles:
|
19
|
+
- el8
|
20
|
+
platform: el-8-x86_64
|
21
|
+
box: centos/8
|
22
|
+
hypervisor: <%= hypervisor %>
|
23
|
+
|
24
|
+
el8-0:
|
20
25
|
roles:
|
21
26
|
- el8
|
22
27
|
platform: el-8-x86_64
|
23
28
|
box: centos/8
|
29
|
+
box_version: "1905.1"
|
24
30
|
hypervisor: <%= hypervisor %>
|
25
31
|
|
26
32
|
CONFIG:
|
@@ -30,3 +36,14 @@ CONFIG:
|
|
30
36
|
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
31
37
|
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
32
38
|
<% end -%>
|
39
|
+
ssh:
|
40
|
+
keepalive: true
|
41
|
+
keepalive_interval: 10
|
42
|
+
host_key:
|
43
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
|
44
|
+
kex:
|
45
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
|
46
|
+
encryption:
|
47
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
|
48
|
+
hmac:
|
49
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
HOSTS:
|
2
|
+
el7:
|
3
|
+
roles:
|
4
|
+
- el7
|
5
|
+
- master
|
6
|
+
platform: el-7-x86_64
|
7
|
+
hypervisor: docker
|
8
|
+
image: simpproject/simp_build_centos7
|
9
|
+
docker_cmd: '/usr/sbin/sshd -D -E /var/log/sshd.log'
|
10
|
+
|
11
|
+
el8:
|
12
|
+
roles:
|
13
|
+
- el8
|
14
|
+
platform: el-8-x86_64
|
15
|
+
hypervisor: docker
|
16
|
+
image: simpproject/simp_build_centos8
|
17
|
+
docker_cmd: '["/sbin/init"]'
|
18
|
+
|
19
|
+
CONFIG:
|
20
|
+
docker_preserve_image: true
|
21
|
+
log_level: verbose
|
22
|
+
type: aio
|
23
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
24
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
25
|
+
<% end -%>
|
26
|
+
ssh:
|
27
|
+
keepalive: true
|
28
|
+
keepalive_interval: 10
|
29
|
+
host_key:
|
30
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
|
31
|
+
kex:
|
32
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
|
33
|
+
encryption:
|
34
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
|
35
|
+
hmac:
|
36
|
+
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<%
|
2
|
+
if ENV['BEAKER_HYPERVISOR']
|
3
|
+
hypervisor = ENV['BEAKER_HYPERVISOR']
|
4
|
+
else
|
5
|
+
hypervisor = 'vagrant'
|
6
|
+
end
|
7
|
+
-%>
|
8
|
+
HOSTS:
|
9
|
+
focal:
|
10
|
+
platform: ubuntu-20.04-x86_64
|
11
|
+
box: ubuntu/focal64
|
12
|
+
hypervisor: <%= hypervisor %>
|
13
|
+
|
14
|
+
CONFIG:
|
15
|
+
log_level: verbose
|
16
|
+
type: aio
|
17
|
+
vagrant_memsize: 256
|
18
|
+
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
|
19
|
+
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
|
20
|
+
<% end -%>
|
@@ -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').
|
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
|
@@ -29,4 +29,18 @@ context 'after copy_fixture_modules_to( hosts )' do
|
|
29
29
|
expect(pfact_on(master, 'os.release.foo')).to eq ''
|
30
30
|
end
|
31
31
|
end
|
32
|
+
|
33
|
+
describe "pfact_on(master,'fips_enabled')" do
|
34
|
+
expected = (ENV['BEAKER_fips'] == 'yes')
|
35
|
+
|
36
|
+
it 'should return false' do
|
37
|
+
expect(pfact_on(master, 'fips_enabled')).to eq expected
|
38
|
+
end
|
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
|
32
46
|
end
|
@@ -0,0 +1 @@
|
|
1
|
+
spec/acceptance/suites/default/../../nodesets
|
@@ -0,0 +1 @@
|
|
1
|
+
spec/acceptance/suites/fips_from_fixtures/../../nodesets
|
@@ -0,0 +1 @@
|
|
1
|
+
spec/acceptance/suites/snapshot/../../nodesets
|
@@ -103,8 +103,21 @@ describe 'Simp::BeakerHelpers' do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it 'uses defaults when no environment variables are set' do
|
106
|
-
|
107
|
-
|
106
|
+
|
107
|
+
# Prevent namespace pollution
|
108
|
+
pipe_out,pipe_in = IO.pipe
|
109
|
+
fork do
|
110
|
+
pipe_out.close
|
111
|
+
require 'puppet'
|
112
|
+
pipe_in.write(Puppet.version)
|
113
|
+
end
|
114
|
+
pipe_in.close
|
115
|
+
|
116
|
+
expected_version = pipe_out.gets
|
117
|
+
expected_major_version = expected_version.split('.').first
|
118
|
+
|
119
|
+
expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(expected_version)
|
120
|
+
expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq("puppet#{expected_major_version}")
|
108
121
|
expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('agent')
|
109
122
|
end
|
110
123
|
|
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.
|
4
|
+
version: 1.21.3
|
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-
|
12
|
+
date: 2021-01-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|
@@ -188,15 +188,19 @@ files:
|
|
188
188
|
- lib/simp/rake/beaker.rb
|
189
189
|
- simp-beaker-helpers.gemspec
|
190
190
|
- spec/acceptance/nodesets/default.yml
|
191
|
+
- spec/acceptance/nodesets/docker.yml
|
192
|
+
- spec/acceptance/nodesets/ubuntu.yml
|
191
193
|
- spec/acceptance/suites/default/check_puppet_version_spec.rb
|
192
194
|
- spec/acceptance/suites/default/enable_fips_spec.rb
|
193
195
|
- spec/acceptance/suites/default/fixture_modules_spec.rb
|
194
196
|
- spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
|
197
|
+
- spec/acceptance/suites/default/nodesets
|
195
198
|
- spec/acceptance/suites/default/pki_tests_spec.rb
|
196
199
|
- spec/acceptance/suites/default/set_hieradata_on_spec.rb
|
197
200
|
- spec/acceptance/suites/default/write_hieradata_to_spec.rb
|
198
201
|
- spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
|
199
202
|
- spec/acceptance/suites/fips_from_fixtures/metadata.yml
|
203
|
+
- spec/acceptance/suites/fips_from_fixtures/nodesets
|
200
204
|
- spec/acceptance/suites/offline/00_default_spec.rb
|
201
205
|
- spec/acceptance/suites/offline/README
|
202
206
|
- spec/acceptance/suites/offline/nodesets/default.yml
|
@@ -204,6 +208,7 @@ files:
|
|
204
208
|
- spec/acceptance/suites/puppet_collections/metadata.yml
|
205
209
|
- spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
|
206
210
|
- spec/acceptance/suites/snapshot/10_general_usage_spec.rb
|
211
|
+
- spec/acceptance/suites/snapshot/nodesets
|
207
212
|
- spec/acceptance/suites/windows/00_default_spec.rb
|
208
213
|
- spec/acceptance/suites/windows/metadata.yml
|
209
214
|
- spec/acceptance/suites/windows/nodesets/default.yml
|
@@ -217,7 +222,7 @@ licenses:
|
|
217
222
|
- Apache-2.0
|
218
223
|
metadata:
|
219
224
|
issue_tracker: https://simp-project.atlassian.net
|
220
|
-
post_install_message:
|
225
|
+
post_install_message:
|
221
226
|
rdoc_options: []
|
222
227
|
require_paths:
|
223
228
|
- lib
|
@@ -232,21 +237,26 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
237
|
- !ruby/object:Gem::Version
|
233
238
|
version: '0'
|
234
239
|
requirements: []
|
235
|
-
|
236
|
-
|
240
|
+
rubyforge_project:
|
241
|
+
rubygems_version: 2.7.10
|
242
|
+
signing_key:
|
237
243
|
specification_version: 4
|
238
244
|
summary: beaker helper methods for SIMP
|
239
245
|
test_files:
|
240
246
|
- spec/acceptance/nodesets/default.yml
|
247
|
+
- spec/acceptance/nodesets/docker.yml
|
248
|
+
- spec/acceptance/nodesets/ubuntu.yml
|
241
249
|
- spec/acceptance/suites/default/check_puppet_version_spec.rb
|
242
250
|
- spec/acceptance/suites/default/enable_fips_spec.rb
|
243
251
|
- spec/acceptance/suites/default/fixture_modules_spec.rb
|
244
252
|
- spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
|
253
|
+
- spec/acceptance/suites/default/nodesets
|
245
254
|
- spec/acceptance/suites/default/pki_tests_spec.rb
|
246
255
|
- spec/acceptance/suites/default/set_hieradata_on_spec.rb
|
247
256
|
- spec/acceptance/suites/default/write_hieradata_to_spec.rb
|
248
257
|
- spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
|
249
258
|
- spec/acceptance/suites/fips_from_fixtures/metadata.yml
|
259
|
+
- spec/acceptance/suites/fips_from_fixtures/nodesets
|
250
260
|
- spec/acceptance/suites/offline/00_default_spec.rb
|
251
261
|
- spec/acceptance/suites/offline/README
|
252
262
|
- spec/acceptance/suites/offline/nodesets/default.yml
|
@@ -254,6 +264,7 @@ test_files:
|
|
254
264
|
- spec/acceptance/suites/puppet_collections/metadata.yml
|
255
265
|
- spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
|
256
266
|
- spec/acceptance/suites/snapshot/10_general_usage_spec.rb
|
267
|
+
- spec/acceptance/suites/snapshot/nodesets
|
257
268
|
- spec/acceptance/suites/windows/00_default_spec.rb
|
258
269
|
- spec/acceptance/suites/windows/metadata.yml
|
259
270
|
- spec/acceptance/suites/windows/nodesets/default.yml
|