simp-beaker-helpers 1.18.6 → 1.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.fips_fixtures +8 -0
- data/.fixtures.yml +2 -4
- data/.gitlab-ci.yml +15 -47
- data/CHANGELOG.md +28 -0
- data/Gemfile +29 -2
- data/files/pki/template_ca.cnf +1 -1
- data/files/pki/template_host.cnf +1 -1
- data/lib/simp/beaker_helpers.rb +96 -63
- data/lib/simp/beaker_helpers/constants.rb +1 -1
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/spec/acceptance/nodesets/default.yml +5 -5
- data/spec/acceptance/suites/default/check_puppet_version_spec.rb +2 -2
- data/spec/acceptance/suites/default/install_simp_deps_repo_spec.rb +14 -20
- data/spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb +3 -0
- data/spec/acceptance/suites/puppet_collections/00_default_spec.rb +11 -13
- data/spec/acceptance/suites/windows/nodesets/default.yml +3 -1
- data/spec/lib/simp/beaker_helpers_spec.rb +4 -34
- metadata +5 -34
- data/spec/acceptance/suites/puppet_collections/nodesets/default.yml +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de616faf054a99c350f9a6241296669ce630fff0d6d622fd60c9a36ea2e2a036
|
4
|
+
data.tar.gz: cdbc0d01a23a79472998e87ccbd850e5a32f4e56aa04b623c1b05c050254df92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9539f40a2fbf685e6d3a4763a69aaf5670d80e73a695eab4c029d294523612e847ca16132119a459d4381508e267642065c9f7ff99198ddabe8e4008562d7674
|
7
|
+
data.tar.gz: b6ed70ae00c28cfe70705cc704df6206318734ae941ef5848751caa8a37506a1e6a4432fd324a7752aae5dfdcd5fc38baa0e029ae3e17fd5cb6094649432b29e
|
data/.fips_fixtures
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
---
|
2
|
+
fixtures:
|
3
|
+
repositories:
|
4
|
+
fips: https://github.com/simp/pupmod-simp-fips
|
5
|
+
augeasproviders_core: https://github.com/simp/augeasproviders_core
|
6
|
+
augeasproviders_grub: https://github.com/simp/augeasproviders_grub
|
7
|
+
simplib: https://github.com/simp/pupmod-simp-simplib
|
8
|
+
stdlib: https://github.com/simp/puppetlabs-stdlib
|
data/.fixtures.yml
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
---
|
2
2
|
fixtures:
|
3
|
-
# Needed for Hiera v5 to work
|
4
|
-
forge_modules:
|
5
|
-
compliance_markup: "simp/compliance_markup"
|
6
3
|
repositories:
|
7
|
-
stdlib:
|
4
|
+
stdlib: https://github.com/simp/puppetlabs-stdlib
|
5
|
+
compliance_markup: https://github.com/simp/pupmod-simp-compliance_markup
|
8
6
|
|
data/.gitlab-ci.yml
CHANGED
@@ -20,16 +20,6 @@
|
|
20
20
|
- 'rm -rf pkg/ || :'
|
21
21
|
- bundle check || rm -f Gemfile.lock && ("${BUNDLER_INSTALL[@]}" --local || "${BUNDLER_INSTALL[@]}")
|
22
22
|
|
23
|
-
|
24
|
-
.validation_checks: &validation_checks
|
25
|
-
script:
|
26
|
-
- bundle exec rake syntax
|
27
|
-
- bundle exec rake check:dot_underscore
|
28
|
-
- bundle exec rake check:test_file
|
29
|
-
- bundle exec rake lint
|
30
|
-
# - bundle exec rake pkg:check_version
|
31
|
-
# - bundle exec rake pkg:compare_latest_tag
|
32
|
-
|
33
23
|
.spec_tests: &spec_tests
|
34
24
|
script:
|
35
25
|
- bundle exec rake spec
|
@@ -42,43 +32,8 @@
|
|
42
32
|
- $SIMP_FULL_MATRIX
|
43
33
|
|
44
34
|
stages:
|
45
|
-
- validation
|
46
35
|
- unit
|
47
36
|
- acceptance
|
48
|
-
- deploy
|
49
|
-
|
50
|
-
# Puppet 4.10 for PE 2017.2 support (EOL:2018-02-21)
|
51
|
-
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
|
52
|
-
# --------------------------------------
|
53
|
-
2_1-validation:
|
54
|
-
stage: validation
|
55
|
-
tags:
|
56
|
-
- docker
|
57
|
-
image: ruby:2.1
|
58
|
-
<<: *cache_bundler
|
59
|
-
<<: *setup_bundler_env
|
60
|
-
<<: *validation_checks
|
61
|
-
|
62
|
-
2_1-unit:
|
63
|
-
stage: unit
|
64
|
-
tags:
|
65
|
-
- docker
|
66
|
-
image: ruby:2.1
|
67
|
-
<<: *cache_bundler
|
68
|
-
<<: *setup_bundler_env
|
69
|
-
<<: *spec_tests
|
70
|
-
|
71
|
-
# Puppet 4.10 for PE 2017.2 support (EOL:2018-02-21)
|
72
|
-
# See: https://puppet.com/misc/puppet-enterprise-lifecycle
|
73
|
-
# --------------------------------------
|
74
|
-
2_4-validation:
|
75
|
-
stage: validation
|
76
|
-
tags:
|
77
|
-
- docker
|
78
|
-
image: ruby:2.4
|
79
|
-
<<: *cache_bundler
|
80
|
-
<<: *setup_bundler_env
|
81
|
-
<<: *validation_checks
|
82
37
|
|
83
38
|
2_4-unit:
|
84
39
|
stage: unit
|
@@ -127,7 +82,7 @@ fips_from_fixtures:
|
|
127
82
|
- bundle exec rake spec_clean
|
128
83
|
- bundle exec rake beaker:suites[fips_from_fixtures]
|
129
84
|
|
130
|
-
|
85
|
+
puppet5_collections:
|
131
86
|
stage: acceptance
|
132
87
|
tags:
|
133
88
|
- beaker
|
@@ -135,7 +90,18 @@ puppet_collections:
|
|
135
90
|
<<: *setup_bundler_env
|
136
91
|
variables:
|
137
92
|
PUPPET_VERSION: '~> 5.3'
|
138
|
-
|
93
|
+
script:
|
94
|
+
- bundle exec rake spec_clean
|
95
|
+
- bundle exec rake beaker:suites[puppet_collections]
|
96
|
+
|
97
|
+
puppet6_collections:
|
98
|
+
stage: acceptance
|
99
|
+
tags:
|
100
|
+
- beaker
|
101
|
+
<<: *cache_bundler
|
102
|
+
<<: *setup_bundler_env
|
103
|
+
variables:
|
104
|
+
BEAKER_PUPPET_COLLECTION: 'puppet6'
|
139
105
|
script:
|
140
106
|
- bundle exec rake spec_clean
|
141
107
|
- bundle exec rake beaker:suites[puppet_collections]
|
@@ -152,6 +118,8 @@ windows:
|
|
152
118
|
|
153
119
|
snapshot:
|
154
120
|
stage: acceptance
|
121
|
+
# This is prone to breakage in the underlying system
|
122
|
+
allow_failure: true
|
155
123
|
tags:
|
156
124
|
- beaker
|
157
125
|
<<: *cache_bundler
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
### 1.19.1 / 2020-12-02
|
2
|
+
* Fixed:
|
3
|
+
* Bumped the core puppet version to 6.X
|
4
|
+
* Fixed the file_content_on method
|
5
|
+
* Removed EL 6 support from the tests since the core repos are defunct
|
6
|
+
* Started removing some of the puppet 4 tests
|
7
|
+
|
8
|
+
### 1.19.0 / 2020-09-30
|
9
|
+
* Fixed:
|
10
|
+
* rsync handling has a better check to see if rsync actually works prior to
|
11
|
+
using it. The old method had the potential to try and use rsync even if it
|
12
|
+
no longer worked (FIPS flipped for example).
|
13
|
+
* Changed:
|
14
|
+
* Migrated from PackageCloud to the SIMP download server for updates moving
|
15
|
+
forward.
|
16
|
+
|
17
|
+
### 1.18.9 / 2020-08-04
|
18
|
+
* Change windows 2012r2 VM to work around issues where the old image had
|
19
|
+
duplicate ports trying to be opened
|
20
|
+
* Increase test CA bits to 4096
|
21
|
+
|
22
|
+
### 1.18.8 / 2020-07-14
|
23
|
+
* Allow the beaker version to be pinned by environment variable
|
24
|
+
|
25
|
+
### 1.18.7 / 2020-07-07
|
26
|
+
* Fix host reference bug when switching to FIPS mode
|
27
|
+
* Ensure that net-ssh 6+ can access older FIPS systems
|
28
|
+
|
1
29
|
### 1.18.6 / 2020-06-24
|
2
30
|
* Fix Vagrant snapshot issues
|
3
31
|
|
data/Gemfile
CHANGED
@@ -13,11 +13,38 @@ gem 'bundler'
|
|
13
13
|
gem 'rake'
|
14
14
|
|
15
15
|
group :system_tests do
|
16
|
-
|
16
|
+
beaker_gem_options = ENV.fetch('BEAKER_GEM_OPTIONS', ['>= 4.17.0', '< 5.0.0'])
|
17
|
+
|
18
|
+
if "#{beaker_gem_options}".include?(':')
|
19
|
+
# Just pass in BEAKER_GEM_OPTIONS as a string that would represent the usual
|
20
|
+
# hash of options.
|
21
|
+
#
|
22
|
+
# Something like: BEAKER_GEM_OPTIONS=':git => "https://my.repo/beaker.git", :tag => "1.2.3"'
|
23
|
+
#
|
24
|
+
# No, this isn't robust, but it's not really an 'every day' sort of thing
|
25
|
+
# and safer than an `eval`
|
26
|
+
begin
|
27
|
+
gem 'beaker', Hash[
|
28
|
+
beaker_gem_options.split(',').map do |x| # Split passed options on k/v pairs
|
29
|
+
x.gsub('"', '').strip.split(/:\s|\s+=>\s+/) # Allow for either format hash keys
|
30
|
+
end.map do |k,v|
|
31
|
+
[
|
32
|
+
k.delete(':').to_sym, # Convert all keys to symbols
|
33
|
+
v.strip
|
34
|
+
]
|
35
|
+
end
|
36
|
+
] # Convert the whole thing to a valid Hash
|
37
|
+
rescue => e
|
38
|
+
raise "Invalid BEAKER_GEM_OPTIONS: '#{beaker_gem_options}' => '#{e}'"
|
39
|
+
end
|
40
|
+
else
|
41
|
+
gem 'beaker', beaker_gem_options
|
42
|
+
end
|
43
|
+
|
17
44
|
gem 'beaker-rspec'
|
18
45
|
gem 'beaker-windows'
|
19
46
|
gem 'net-ssh'
|
20
|
-
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~>
|
47
|
+
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~> 6.0')
|
21
48
|
gem 'puppetlabs_spec_helper'
|
22
49
|
gem 'rubocop'
|
23
50
|
gem 'rubocop-rspec'
|
data/files/pki/template_ca.cnf
CHANGED
@@ -93,7 +93,7 @@ emailAddress = optional
|
|
93
93
|
|
94
94
|
####################################################################
|
95
95
|
[ req ]
|
96
|
-
default_bits =
|
96
|
+
default_bits = 4096
|
97
97
|
default_keyfile = privkey.pem
|
98
98
|
distinguished_name = req_distinguished_name
|
99
99
|
attributes = req_attributes
|
data/files/pki/template_host.cnf
CHANGED
@@ -96,7 +96,7 @@ emailAddress = optional
|
|
96
96
|
|
97
97
|
####################################################################
|
98
98
|
[ req ]
|
99
|
-
default_bits =
|
99
|
+
default_bits = 4096
|
100
100
|
default_keyfile = privkey.pem
|
101
101
|
distinguished_name = req_distinguished_name
|
102
102
|
attributes = req_attributes
|
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -30,16 +30,38 @@ module Simp::BeakerHelpers
|
|
30
30
|
).output.strip == '1'
|
31
31
|
end
|
32
32
|
|
33
|
+
def rsync_functional_on?(sut)
|
34
|
+
# We have to check if rsync *still* works otherwise
|
35
|
+
return false if (@rsync_functional == false)
|
36
|
+
|
37
|
+
require 'facter'
|
38
|
+
unless Facter::Util::Resolution.which('rsync')
|
39
|
+
@rsync_functional = false
|
40
|
+
return @rsync_functional
|
41
|
+
end
|
42
|
+
|
43
|
+
require 'tempfile'
|
44
|
+
|
45
|
+
testfile = Tempfile.new('rsync_check')
|
46
|
+
testfile.puts('test')
|
47
|
+
testfile.close
|
48
|
+
|
49
|
+
begin
|
50
|
+
rsync_to(sut, testfile.path, sut.system_temp_path)
|
51
|
+
rescue Beaker::Host::CommandFailure
|
52
|
+
@rsync_functional = false
|
53
|
+
return false
|
54
|
+
ensure
|
55
|
+
testfile.unlink
|
56
|
+
end
|
57
|
+
|
58
|
+
return true
|
59
|
+
end
|
60
|
+
|
33
61
|
# Figure out the best method to copy files to a host and use it
|
34
62
|
#
|
35
63
|
# Will create the directories leading up to the target if they don't exist
|
36
64
|
def copy_to(sut, src, dest, opts={})
|
37
|
-
unless fips_enabled(sut) || @has_rsync
|
38
|
-
%x{which rsync 2>/dev/null}.strip
|
39
|
-
|
40
|
-
@has_rsync = !$?.nil? && $?.success?
|
41
|
-
end
|
42
|
-
|
43
65
|
sut.mkdir_p(File.dirname(dest))
|
44
66
|
|
45
67
|
if sut[:hypervisor] == 'docker'
|
@@ -57,7 +79,7 @@ module Simp::BeakerHelpers
|
|
57
79
|
container_id = sut.host_hash[:docker_container_id]
|
58
80
|
end
|
59
81
|
%x(tar #{exclude_list.join(' ')} -hcf - -C "#{File.dirname(src)}" "#{File.basename(src)}" | docker exec -i "#{container_id}" tar -C "#{dest}" -xf -)
|
60
|
-
elsif
|
82
|
+
elsif rsync_functional_on?(sut)
|
61
83
|
# This makes rsync_to work like beaker and scp usually do
|
62
84
|
exclude_hack = %(__-__' -L --exclude '__-__)
|
63
85
|
|
@@ -297,7 +319,7 @@ module Simp::BeakerHelpers
|
|
297
319
|
# TODO Use simp-ssh Puppet module appropriately (i.e., in a fashion
|
298
320
|
# that doesn't break vagrant access and is appropriate for
|
299
321
|
# typical module tests.)
|
300
|
-
fips_ssh_ciphers = [ 'aes256-
|
322
|
+
fips_ssh_ciphers = [ 'aes256-ctr','aes192-ctr','aes128-ctr']
|
301
323
|
on(sut, %(sed -i '/Ciphers /d' /etc/ssh/sshd_config))
|
302
324
|
on(sut, %(echo 'Ciphers #{fips_ssh_ciphers.join(',')}' >> /etc/ssh/sshd_config))
|
303
325
|
|
@@ -333,8 +355,8 @@ module Simp::BeakerHelpers
|
|
333
355
|
# Hopefully, Vagrant will update the used ciphers at some point but who
|
334
356
|
# knows when that will be
|
335
357
|
opensshserver_config = '/etc/crypto-policies/back-ends/opensshserver.config'
|
336
|
-
if file_exists_on(
|
337
|
-
on(
|
358
|
+
if file_exists_on(sut, opensshserver_config)
|
359
|
+
on(sut, "sed --follow-symlinks -i 's/PubkeyAcceptedKeyTypes=/PubkeyAcceptedKeyTypes=ssh-rsa,/' #{opensshserver_config}")
|
338
360
|
end
|
339
361
|
|
340
362
|
sut.reboot
|
@@ -584,7 +606,7 @@ module Simp::BeakerHelpers
|
|
584
606
|
end
|
585
607
|
|
586
608
|
def sosreport(sut, dest='sosreports')
|
587
|
-
sut
|
609
|
+
on(sut, 'puppet resource package sos ensure=latest')
|
588
610
|
on(sut, 'sosreport --batch')
|
589
611
|
|
590
612
|
files = on(sut, 'ls /var/tmp/sosreport* /tmp/sosreport* 2>/dev/null', :accept_all_exit_codes => true).output.lines.map(&:strip)
|
@@ -864,10 +886,10 @@ done
|
|
864
886
|
file_content = nil
|
865
887
|
|
866
888
|
if file_exists_on(sut, path)
|
867
|
-
Dir.
|
868
|
-
scp_from(
|
889
|
+
Dir.mktmpdir do |dir|
|
890
|
+
scp_from(sut, path, dir)
|
869
891
|
|
870
|
-
file_content = File.read(File.basename(path))
|
892
|
+
file_content = File.read(File.join(dir,File.basename(path)))
|
871
893
|
end
|
872
894
|
end
|
873
895
|
|
@@ -1170,62 +1192,73 @@ done
|
|
1170
1192
|
run_puppet_install_helper(install_info[:puppet_install_type], install_info[:puppet_install_version])
|
1171
1193
|
end
|
1172
1194
|
|
1173
|
-
# Configure all SIMP repos on a host and
|
1195
|
+
# Configure all SIMP repos on a host and disable all repos in the disable Array
|
1174
1196
|
#
|
1175
|
-
# @param sut Host on which to configure SIMP repos
|
1176
|
-
# @param disable List of
|
1177
|
-
# @raise if disable contains an invalid repo name.
|
1197
|
+
# @param sut [Beaker::Host] Host on which to configure SIMP repos
|
1198
|
+
# @param disable [Array[String]] List of repos to disable
|
1199
|
+
# @raise [StandardError] if disable contains an invalid repo name.
|
1178
1200
|
#
|
1179
1201
|
# Examples:
|
1180
1202
|
# install_simp_repos( myhost ) # install all the repos an enable them.
|
1181
1203
|
# install_simp_repos( myhost, ['simp']) # install the repos but disable the simp repo.
|
1182
1204
|
#
|
1183
|
-
#
|
1184
|
-
# 'simp'
|
1185
|
-
# 'simp_deps'
|
1205
|
+
# Valid repo names include any repository available on the system.
|
1186
1206
|
#
|
1187
|
-
|
1188
|
-
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
|
1203
|
-
|
1204
|
-
|
1205
|
-
|
1206
|
-
|
1207
|
-
|
1208
|
-
|
1209
|
-
|
1210
|
-
|
1211
|
-
|
1212
|
-
|
1213
|
-
|
1214
|
-
|
1215
|
-
}
|
1216
|
-
# Verify that the repos passed to disable are in the list of valid repos
|
1217
|
-
disable.each { |d|
|
1218
|
-
unless repos.has_key?(d)
|
1219
|
-
raise("ERROR: install_simp_repo - disable contains invalid SIMP repo '#{d}'.")
|
1207
|
+
# For backwards compatibility purposes, the following translations are
|
1208
|
+
# automatically performed:
|
1209
|
+
#
|
1210
|
+
# * 'simp'
|
1211
|
+
# * 'simp-community-simp'
|
1212
|
+
#
|
1213
|
+
# * 'simp_deps'
|
1214
|
+
# * 'simp-community-epel'
|
1215
|
+
# * 'simp-community-postgres'
|
1216
|
+
# * 'simp-community-puppet'
|
1217
|
+
#
|
1218
|
+
def install_simp_repos(sut, disable = [])
|
1219
|
+
# NOTE: Do *NOT* use puppet in this method since it may not be available yet
|
1220
|
+
|
1221
|
+
if on(sut, 'rpm -q yum-utils', :accept_all_exit_codes => true).exit_code != 0
|
1222
|
+
on(sut, 'yum -y install yum-utils')
|
1223
|
+
end
|
1224
|
+
|
1225
|
+
if on(sut, 'rpm -q simp-release-community', :accept_all_exit_codes => true).exit_code != 0
|
1226
|
+
on(sut, 'yum -y install "https://download.simp-project.com/simp-release-community.rpm"')
|
1227
|
+
end
|
1228
|
+
|
1229
|
+
to_disable = disable.dup
|
1230
|
+
|
1231
|
+
unless to_disable.empty?
|
1232
|
+
if to_disable.include?('simp')
|
1233
|
+
to_disable.delete('simp')
|
1234
|
+
to_disable << 'simp-community-simp'
|
1220
1235
|
end
|
1221
|
-
}
|
1222
|
-
repo_manifest = ''
|
1223
|
-
repos.each { | repo, metadata|
|
1224
|
-
metadata[:enabled] = disable.include?(repo) ? 0 : 1
|
1225
|
-
repo_manifest << create_yum_resource(repo, metadata)
|
1226
|
-
}
|
1227
|
-
apply_manifest_on(sut, repo_manifest, :catch_failures => true)
|
1228
|
-
end
|
1229
|
-
end
|
1230
1236
|
|
1237
|
+
if to_disable.include?('simp_deps')
|
1238
|
+
to_disable.delete('simp_deps')
|
1239
|
+
to_disable << 'simp-community-epel'
|
1240
|
+
to_disable << 'simp-community-postgres'
|
1241
|
+
to_disable << 'simp-community-puppet'
|
1242
|
+
end
|
1243
|
+
|
1244
|
+
# NOTE: This --enablerepo enables the repos for listing and is inherited
|
1245
|
+
# from YUM. This does not actually "enable" the repos, that would require
|
1246
|
+
# the "--enable" option (from yum-config-manager) :-D.
|
1247
|
+
#
|
1248
|
+
# Note: Certain versions of EL8 do not dump by default and EL7 does not
|
1249
|
+
# have the '--dump' option.
|
1250
|
+
available_repos = on(sut, %{yum-config-manager --enablerepo="*" || yum-config-manager --enablerepo="*" --dump}).stdout.lines.grep(/\A\[(.+)\]\Z/){|x| $1}
|
1251
|
+
|
1252
|
+
invalid_repos = (to_disable - available_repos)
|
1253
|
+
|
1254
|
+
# Verify that the repos passed to disable are in the list of valid repos
|
1255
|
+
unless invalid_repos.empty?
|
1256
|
+
logger.warn(%{WARN: install_simp_repo - requested repos to disable do not exist on the target system '#{invalid_repos.join("', '")}'.})
|
1257
|
+
end
|
1231
1258
|
|
1259
|
+
(to_disable - invalid_repos).each do |repo|
|
1260
|
+
on(sut, %{yum-config-manager --disable "#{repo}"})
|
1261
|
+
end
|
1262
|
+
end
|
1263
|
+
end
|
1264
|
+
end
|
@@ -5,7 +5,7 @@ module Simp::BeakerHelpers
|
|
5
5
|
#
|
6
6
|
# This is done so that we know if some new thing that we're using breaks the
|
7
7
|
# oldest system that we support
|
8
|
-
DEFAULT_PUPPET_AGENT_VERSION = '~>
|
8
|
+
DEFAULT_PUPPET_AGENT_VERSION = '~> 6.0'
|
9
9
|
|
10
10
|
SSG_REPO_URL = ENV['BEAKER_ssg_repo'] || 'https://github.com/ComplianceAsCode/content.git'
|
11
11
|
|
@@ -9,18 +9,18 @@ HOSTS:
|
|
9
9
|
server-el7:
|
10
10
|
roles:
|
11
11
|
- server
|
12
|
-
- default
|
13
12
|
- master
|
13
|
+
- default
|
14
14
|
- el7
|
15
15
|
platform: el-7-x86_64
|
16
16
|
box: centos/7
|
17
17
|
hypervisor: <%= hypervisor %>
|
18
18
|
|
19
|
-
server-
|
19
|
+
server-el8:
|
20
20
|
roles:
|
21
|
-
-
|
22
|
-
platform: el-
|
23
|
-
box: centos/
|
21
|
+
- el8
|
22
|
+
platform: el-8-x86_64
|
23
|
+
box: centos/8
|
24
24
|
hypervisor: <%= hypervisor %>
|
25
25
|
|
26
26
|
CONFIG:
|
@@ -14,8 +14,8 @@ hosts.each do |host|
|
|
14
14
|
expect(client_puppet_version.split('.').first).to eq(puppet_collection_version)
|
15
15
|
end
|
16
16
|
else
|
17
|
-
it 'should
|
18
|
-
expect(client_puppet_version.split('.').first).to eq '
|
17
|
+
it 'should be running puppet 6' do
|
18
|
+
expect(client_puppet_version.split('.').first).to eq '6'
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -2,42 +2,36 @@ require 'spec_helper_acceptance'
|
|
2
2
|
|
3
3
|
hosts.each do |host|
|
4
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
|
5
9
|
|
6
10
|
it 'should install yum utils' do
|
7
11
|
host.install_package('yum-utils')
|
8
12
|
end
|
9
13
|
|
10
|
-
context '
|
14
|
+
context 'default settings' do
|
11
15
|
before(:all) { install_simp_repos(host) }
|
12
16
|
|
13
|
-
it 'creates the repo' do
|
14
|
-
on host, 'test -f /etc/yum.repos.d/simp.repo'
|
15
|
-
on host, 'test -f /etc/yum.repos.d/simp_deps.repo'
|
16
|
-
end
|
17
|
-
|
18
17
|
it 'enables the correct repos' do
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
expect(simp6depsinfo).to match(/.*Repo-status.*enabled.*/)
|
18
|
+
skip "#{host} is not supported yet" if expect_failures
|
19
|
+
on(host, 'yum -y list simp')
|
20
|
+
on(host, 'yum -y list postgresql96')
|
23
21
|
end
|
24
22
|
end
|
25
23
|
|
26
24
|
context 'when passed a disabled list ' do
|
27
|
-
before(:all) { install_simp_repos(host, ['simp'] ) }
|
25
|
+
before(:all) { install_simp_repos(host, ['simp-community-simp'] ) }
|
28
26
|
|
29
|
-
it '
|
30
|
-
|
31
|
-
on
|
27
|
+
it 'enables the correct repos' do
|
28
|
+
skip "#{host} is not supported yet" if expect_failures
|
29
|
+
on(host, 'yum -y list postgresql96')
|
32
30
|
end
|
33
31
|
|
34
|
-
it '
|
35
|
-
|
36
|
-
expect(simp6info).to match(/.*Repo-status.*disabled.*/)
|
37
|
-
simp6depsinfo = on(host, 'yum repolist -v simp_deps| grep ^Repo-status').stdout.strip
|
38
|
-
expect(simp6depsinfo).to match(/.*Repo-status.*enabled.*/)
|
32
|
+
it 'disables the correct repos' do
|
33
|
+
on(host, 'yum -y list simp', :acceptable_exit_codes => [1])
|
39
34
|
end
|
40
35
|
end
|
41
|
-
|
42
36
|
end
|
43
37
|
end
|
@@ -31,7 +31,10 @@ ScrubFixtures.new
|
|
31
31
|
ENV['BEAKER_fips'] = 'yes'
|
32
32
|
ENV['FIXTURES_YML'] = alt_fixtures
|
33
33
|
|
34
|
+
beaker_gem_options = ENV['BEAKER_GEM_OPTIONS']
|
35
|
+
|
34
36
|
Bundler.with_clean_env{
|
37
|
+
ENV['BEAKER_GEM_OPTIONS'] = beaker_gem_options
|
35
38
|
ENV['FIXTURES_YML'] = alt_fixtures
|
36
39
|
|
37
40
|
%x{bundle exec rake spec_prep}
|
@@ -1,24 +1,22 @@
|
|
1
|
-
# This needs to be done so that we actually bring in a collection at the start
|
2
|
-
# of the run
|
3
|
-
#
|
4
|
-
# Choosing an arbitrary number in the middle of 5 so that we're not fooled by
|
5
|
-
# edge cases
|
6
|
-
#
|
7
|
-
ENV['PUPPET_VERSION'] = '5.1'
|
8
|
-
|
9
1
|
require 'spec_helper_acceptance'
|
10
2
|
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
unless ENV['PUPPET_VERSION'] || ENV['BEAKER_PUPPET_COLLECTION']
|
4
|
+
fail('You must set either PUPPET_VERSION or BEAKER_PUPPET_COLLECTION as an environment variable')
|
5
|
+
end
|
6
|
+
|
7
|
+
if ENV['BEAKER_PUPPET_COLLECTION']
|
8
|
+
target_version = ENV['BEAKER_PUPPET_COLLECTION'][/(\d+)$/,1]
|
9
|
+
elsif ENV['PUPPET_VERSION']
|
10
|
+
target_version = ENV['PUPPET_VERSION'].split('.').first
|
11
|
+
end
|
14
12
|
|
15
13
|
hosts.each do |host|
|
16
14
|
describe 'make sure puppet version is valid' do
|
17
15
|
context "on #{host}" do
|
18
16
|
client_puppet_version = on(host, 'puppet --version').output.strip
|
19
17
|
|
20
|
-
it "should be running puppet version #{
|
21
|
-
expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(
|
18
|
+
it "should be running puppet version #{target_version}" do
|
19
|
+
expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(target_version)
|
22
20
|
end
|
23
21
|
end
|
24
22
|
end
|
@@ -10,12 +10,14 @@ HOSTS:
|
|
10
10
|
roles:
|
11
11
|
- windows
|
12
12
|
platform: windows-server-amd64
|
13
|
-
box:
|
13
|
+
box: devopsgroup-io/windows_server-2012r2-standard-amd64-nocm
|
14
14
|
hypervisor: <%= hypervisor %>
|
15
15
|
vagrant_memsize: 2048
|
16
16
|
vagrant_cpus: 2
|
17
17
|
user: vagrant
|
18
18
|
is_cygwin: false
|
19
|
+
ssh:
|
20
|
+
host_key: ssh-dss
|
19
21
|
|
20
22
|
el7:
|
21
23
|
roles:
|
@@ -103,21 +103,11 @@ describe 'Simp::BeakerHelpers' do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it 'uses defaults when no environment variables are set' do
|
106
|
-
expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^
|
107
|
-
expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('
|
106
|
+
expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^6\./)
|
107
|
+
expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet6')
|
108
108
|
expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('agent')
|
109
109
|
end
|
110
110
|
|
111
|
-
it 'extracts info from PUPPET_INSTALL_VERSION for Puppet 4' do
|
112
|
-
ENV['PUPPET_INSTALL_VERSION']= '4.10.5'
|
113
|
-
expected = {
|
114
|
-
:puppet_install_version => '1.10.5',
|
115
|
-
:puppet_collection => nil,
|
116
|
-
:puppet_install_type => 'agent'
|
117
|
-
}
|
118
|
-
expect( @helper.get_puppet_install_info ).to eq expected
|
119
|
-
end
|
120
|
-
|
121
111
|
it 'extracts info from PUPPET_INSTALL_VERSION for Puppet 5' do
|
122
112
|
allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
|
123
113
|
ENV['PUPPET_INSTALL_VERSION']= '5.5.0'
|
@@ -153,26 +143,6 @@ describe 'Simp::BeakerHelpers' do
|
|
153
143
|
expect( @helper.get_puppet_install_info ).to eq expected
|
154
144
|
end
|
155
145
|
|
156
|
-
it 'extracts info from BEAKER_PUPPET_AGENT_VERSION' do
|
157
|
-
ENV['BEAKER_PUPPET_AGENT_VERSION']= '4.10.5'
|
158
|
-
expected = {
|
159
|
-
:puppet_install_version => '1.10.5',
|
160
|
-
:puppet_collection => nil,
|
161
|
-
:puppet_install_type => 'agent'
|
162
|
-
}
|
163
|
-
expect( @helper.get_puppet_install_info ).to eq expected
|
164
|
-
end
|
165
|
-
|
166
|
-
it 'extracts info from PUPPET_VERSION' do
|
167
|
-
ENV['PUPPET_VERSION']= '4.10.5'
|
168
|
-
expected = {
|
169
|
-
:puppet_install_version => '1.10.5',
|
170
|
-
:puppet_collection => nil,
|
171
|
-
:puppet_install_type => 'agent'
|
172
|
-
}
|
173
|
-
expect( @helper.get_puppet_install_info ).to eq expected
|
174
|
-
end
|
175
|
-
|
176
146
|
it 'extracts info from BEAKER_PUPPET_COLLECTION' do
|
177
147
|
allow(@helper).to receive(:`).with('gem search -ra -e puppet').and_return(gem_search_results)
|
178
148
|
ENV['BEAKER_PUPPET_COLLECTION']= 'puppet5'
|
@@ -198,9 +168,9 @@ describe 'Simp::BeakerHelpers' do
|
|
198
168
|
it 'extracts info from PUPPET_INSTALL_TYPE' do
|
199
169
|
ENV['PUPPET_INSTALL_TYPE'] = 'pe'
|
200
170
|
|
201
|
-
expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('
|
171
|
+
expect( @helper.get_puppet_install_info[:puppet_collection] ).to eq('puppet6')
|
202
172
|
expect( @helper.get_puppet_install_info[:puppet_install_type] ).to eq('pe')
|
203
|
-
expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^
|
173
|
+
expect( @helper.get_puppet_install_info[:puppet_install_version] ).to match(/^6\./)
|
204
174
|
end
|
205
175
|
|
206
176
|
it 'fails when BEAKER_PUPPET_COLLECTION is invalid' do
|
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.19.1
|
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: 2020-
|
12
|
+
date: 2020-12-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|
@@ -161,6 +161,7 @@ executables: []
|
|
161
161
|
extensions: []
|
162
162
|
extra_rdoc_files: []
|
163
163
|
files:
|
164
|
+
- ".fips_fixtures"
|
164
165
|
- ".fixtures.yml"
|
165
166
|
- ".gitignore"
|
166
167
|
- ".gitlab-ci.yml"
|
@@ -203,7 +204,6 @@ files:
|
|
203
204
|
- spec/acceptance/suites/offline/nodesets/default.yml
|
204
205
|
- spec/acceptance/suites/puppet_collections/00_default_spec.rb
|
205
206
|
- spec/acceptance/suites/puppet_collections/metadata.yml
|
206
|
-
- spec/acceptance/suites/puppet_collections/nodesets/default.yml
|
207
207
|
- spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
|
208
208
|
- spec/acceptance/suites/snapshot/10_general_usage_spec.rb
|
209
209
|
- spec/acceptance/suites/snapshot/nodesets
|
@@ -235,37 +235,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
235
235
|
- !ruby/object:Gem::Version
|
236
236
|
version: '0'
|
237
237
|
requirements: []
|
238
|
-
rubygems_version: 3.0.
|
238
|
+
rubygems_version: 3.0.8
|
239
239
|
signing_key:
|
240
240
|
specification_version: 4
|
241
241
|
summary: beaker helper methods for SIMP
|
242
|
-
test_files:
|
243
|
-
- spec/acceptance/nodesets/default.yml
|
244
|
-
- spec/acceptance/suites/default/check_puppet_version_spec.rb
|
245
|
-
- spec/acceptance/suites/default/enable_fips_spec.rb
|
246
|
-
- spec/acceptance/suites/default/fixture_modules_spec.rb
|
247
|
-
- spec/acceptance/suites/default/install_simp_deps_repo_spec.rb
|
248
|
-
- spec/acceptance/suites/default/nodesets
|
249
|
-
- spec/acceptance/suites/default/pki_tests_spec.rb
|
250
|
-
- spec/acceptance/suites/default/set_hieradata_on_spec.rb
|
251
|
-
- spec/acceptance/suites/default/write_hieradata_to_spec.rb
|
252
|
-
- spec/acceptance/suites/fips_from_fixtures/00_default_spec.rb
|
253
|
-
- spec/acceptance/suites/fips_from_fixtures/metadata.yml
|
254
|
-
- spec/acceptance/suites/fips_from_fixtures/nodesets
|
255
|
-
- spec/acceptance/suites/offline/00_default_spec.rb
|
256
|
-
- spec/acceptance/suites/offline/README
|
257
|
-
- spec/acceptance/suites/offline/nodesets/default.yml
|
258
|
-
- spec/acceptance/suites/puppet_collections/00_default_spec.rb
|
259
|
-
- spec/acceptance/suites/puppet_collections/metadata.yml
|
260
|
-
- spec/acceptance/suites/puppet_collections/nodesets/default.yml
|
261
|
-
- spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
|
262
|
-
- spec/acceptance/suites/snapshot/10_general_usage_spec.rb
|
263
|
-
- spec/acceptance/suites/snapshot/nodesets
|
264
|
-
- spec/acceptance/suites/windows/00_default_spec.rb
|
265
|
-
- spec/acceptance/suites/windows/metadata.yml
|
266
|
-
- spec/acceptance/suites/windows/nodesets/default.yml
|
267
|
-
- spec/acceptance/suites/windows/nodesets/win2016.yml
|
268
|
-
- spec/acceptance/suites/windows/nodesets/win2019.yml
|
269
|
-
- spec/lib/simp/beaker_helpers_spec.rb
|
270
|
-
- spec/spec_helper.rb
|
271
|
-
- spec/spec_helper_acceptance.rb
|
242
|
+
test_files: []
|
@@ -1,30 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
if ENV['BEAKER_HYPERVISOR']
|
3
|
-
hypervisor = ENV['BEAKER_HYPERVISOR']
|
4
|
-
else
|
5
|
-
hypervisor = 'vagrant'
|
6
|
-
end
|
7
|
-
-%>
|
8
|
-
HOSTS:
|
9
|
-
server-el7:
|
10
|
-
roles:
|
11
|
-
- server
|
12
|
-
- default
|
13
|
-
- master
|
14
|
-
- el7
|
15
|
-
platform: el-7-x86_64
|
16
|
-
box: centos/7
|
17
|
-
hypervisor: <%= hypervisor %>
|
18
|
-
|
19
|
-
server-el6:
|
20
|
-
roles:
|
21
|
-
- el6
|
22
|
-
platform: el-6-x86_64
|
23
|
-
box: centos/6
|
24
|
-
hypervisor: <%= hypervisor %>
|
25
|
-
|
26
|
-
CONFIG:
|
27
|
-
log_level: verbose
|
28
|
-
type: aio
|
29
|
-
puppet_collection: puppet5
|
30
|
-
vagrant_memsize: 256
|