simp-beaker-helpers 1.23.4 → 1.24.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/pr_glci.yml +2 -2
- data/.github/workflows/pr_glci_cleanup.yml +1 -1
- data/.github/workflows/tag_deploy_rubygem.yml +1 -1
- data/.gitlab-ci.yml +0 -10
- data/CHANGELOG.md +11 -0
- data/Gemfile +1 -1
- data/files/pki/make.sh +1 -1
- data/lib/simp/beaker_helpers/inspec.rb +3 -1
- data/lib/simp/beaker_helpers/ssg.rb +2 -2
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/lib/simp/beaker_helpers.rb +39 -23
- data/spec/acceptance/nodesets/default.yml +1 -1
- data/spec/acceptance/nodesets/oel.yml +1 -1
- data/spec/acceptance/nodesets/ubuntu.yml +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4403e18b35abbd1622d13e0fac49c4c22a20bf6b80b142b9db9fb5743a96bdf0
|
4
|
+
data.tar.gz: a490a356a2e18cda7611213d53e0202a3790377e722cd23d56228766d93351a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d9ab525dd5345fac7fb7c66fb8aab2c8449b6fce2e5812518a4341d8bdbd5a208e5a31c5b12fc912e664f1f4dbb11fb41419576eddd1fe09844f4aaa8af4cf2
|
7
|
+
data.tar.gz: 26a688025f283009ba338823369e26a2d65db16db212592ab9fe3432f3c1892b251ec176c1c0faa6a5f7abab727c4d2d25994c8af316a199027279a4ffec02d1
|
@@ -63,7 +63,7 @@ jobs:
|
|
63
63
|
# we restrict ourselves to sending data elsewhere.
|
64
64
|
glci-syntax:
|
65
65
|
name: '.gitlab-ci.yml Syntax'
|
66
|
-
runs-on: ubuntu-
|
66
|
+
runs-on: ubuntu-latest
|
67
67
|
outputs:
|
68
68
|
valid: ${{ steps.validate-glci-file.outputs.valid }}
|
69
69
|
steps:
|
@@ -174,7 +174,7 @@ jobs:
|
|
174
174
|
### examine_contexts:
|
175
175
|
### name: 'Examine Context contents'
|
176
176
|
### if: always()
|
177
|
-
### runs-on: ubuntu-
|
177
|
+
### runs-on: ubuntu-latest
|
178
178
|
### needs: [ glci-syntax, contributor-permissions ]
|
179
179
|
### steps:
|
180
180
|
### - name: Dump contexts
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# When SemVer tag is pushed: create GitHub release & publish gem to rubygems.org
|
2
2
|
#
|
3
3
|
# This workflow's jobs are only triggered in repos under the `simp` organization
|
4
4
|
# ------------------------------------------------------------------------------
|
data/.gitlab-ci.yml
CHANGED
@@ -273,10 +273,6 @@ variables:
|
|
273
273
|
# Unit Tests
|
274
274
|
#-----------------------------------------------------------------------
|
275
275
|
|
276
|
-
pup5.x-unit:
|
277
|
-
<<: *pup_5_x
|
278
|
-
<<: *unit_tests
|
279
|
-
|
280
276
|
pup6.x-unit:
|
281
277
|
<<: *pup_6_x
|
282
278
|
<<: *unit_tests
|
@@ -292,12 +288,6 @@ pup7.x-unit:
|
|
292
288
|
#=======================================================================
|
293
289
|
# Packaging test
|
294
290
|
|
295
|
-
pup5.x-pkg:
|
296
|
-
<<: *pup_5_x
|
297
|
-
<<: *unit_tests
|
298
|
-
script:
|
299
|
-
'bundle exec rake pkg:gem'
|
300
|
-
|
301
291
|
pup6.x-pkg:
|
302
292
|
<<: *pup_6_x
|
303
293
|
<<: *unit_tests
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
### 1.24.0 / 2021-10-05
|
2
|
+
* Fixed:
|
3
|
+
* Pinned the version of inspec to 4.39.0 since 4.41 broke tag processing
|
4
|
+
* Only call `activate_interfaces` once per test run instead of at each context
|
5
|
+
which saves quite a bit of time during testing
|
6
|
+
* SSG tag selection logic
|
7
|
+
* Use `sed -ci` which works with docker volume mounts
|
8
|
+
* Added:
|
9
|
+
* Modified the `activate_interfaces` method to use the `networking` fact if
|
10
|
+
available which shaves quite a bit of time off of each test run
|
11
|
+
|
1
12
|
### 1.23.4 / 2021-07-07
|
2
13
|
* Fixed:
|
3
14
|
* Ensure that the openscap-scanner package is installed during SSG runs
|
data/Gemfile
CHANGED
data/files/pki/make.sh
CHANGED
@@ -73,7 +73,7 @@ for hosts in $*; do
|
|
73
73
|
done
|
74
74
|
done
|
75
75
|
|
76
|
-
sed -
|
76
|
+
sed -ci "s/# subjectAltName = #ALTNAMES#/subjectAltName = ${altnames}/" "working/${hname}.cnf"
|
77
77
|
fi
|
78
78
|
|
79
79
|
echo "-- running openssl req"
|
@@ -34,7 +34,9 @@ module Simp::BeakerHelpers
|
|
34
34
|
# The name of the profile against which to run
|
35
35
|
#
|
36
36
|
def initialize(sut, profile)
|
37
|
-
|
37
|
+
# The 4.41 release is currently broken
|
38
|
+
# @inspec_version = ENV['BEAKER_inspec_version'] || 'latest'
|
39
|
+
@inspec_version = ENV['BEAKER_inspec_version'] || '4.39.0'
|
38
40
|
|
39
41
|
@sut = sut
|
40
42
|
|
@@ -407,7 +407,7 @@ module Simp::BeakerHelpers
|
|
407
407
|
else
|
408
408
|
tags = on(@sut, %(cd scap-content; git tag -l)).output
|
409
409
|
target_tag = tags.lines.map(&:strip)
|
410
|
-
.select{|x| x.
|
410
|
+
.select{|x| x.match?(/^v(\d+\.)+\d+$/)}
|
411
411
|
.sort.last
|
412
412
|
|
413
413
|
on(@sut, %(cd scap-content; git checkout #{target_tag}))
|
@@ -419,7 +419,7 @@ module Simp::BeakerHelpers
|
|
419
419
|
#
|
420
420
|
# This isn't 100% correct but it's "good enough" for an automated CI
|
421
421
|
# environment to tell us if something is critically out of alignment.
|
422
|
-
on(@sut, %(cd scap-content/build-scripts; sed -
|
422
|
+
on(@sut, %(cd scap-content/build-scripts; sed -ci 's/ssg.build_derivatives.profile_handling/#ssg.build_derivatives.profile_handling/g' enable_derivatives.py))
|
423
423
|
|
424
424
|
on(@sut, %(cd scap-content/build; cmake ../; make -j4 #{OS_INFO[@os][@os_rel]['ssg']['build_target']}-content && cp *ds.xml #{@scap_working_dir}))
|
425
425
|
end
|
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -483,7 +483,7 @@ module Simp::BeakerHelpers
|
|
483
483
|
# that doesn't break vagrant access and is appropriate for
|
484
484
|
# typical module tests.)
|
485
485
|
fips_ssh_ciphers = [ 'aes256-ctr','aes192-ctr','aes128-ctr']
|
486
|
-
on(sut, %(sed -
|
486
|
+
on(sut, %(sed -ci '/Ciphers /d' /etc/ssh/sshd_config))
|
487
487
|
on(sut, %(echo 'Ciphers #{fips_ssh_ciphers.join(',')}' >> /etc/ssh/sshd_config))
|
488
488
|
|
489
489
|
fips_enable_modulepath = ''
|
@@ -688,7 +688,7 @@ module Simp::BeakerHelpers
|
|
688
688
|
if current_domain.empty?
|
689
689
|
new_fqdn = hostname + '.beaker.test'
|
690
690
|
|
691
|
-
on(sut, "sed -
|
691
|
+
on(sut, "sed -ci 's/#{hostname}.*/#{new_fqdn} #{hostname}/' /etc/hosts")
|
692
692
|
on(sut, "echo '#{new_fqdn}' > /etc/hostname", :accept_all_exit_codes => true)
|
693
693
|
on(sut, "hostname #{new_fqdn}", :accept_all_exit_codes => true)
|
694
694
|
|
@@ -953,21 +953,31 @@ module Simp::BeakerHelpers
|
|
953
953
|
host_entry[fqdn] << host.name if (host[:hypervisor] == 'docker')
|
954
954
|
|
955
955
|
# Ensure that all interfaces are active prior to collecting data
|
956
|
-
activate_interfaces(host)
|
956
|
+
activate_interfaces(host)
|
957
957
|
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
958
|
+
networking_fact = pfact_on(host, 'networking')
|
959
|
+
if networking_fact && networking_fact['interfaces']
|
960
|
+
networking_fact['interfaces'].each do |iface, data|
|
961
|
+
next unless data['ip']
|
962
|
+
next if data['ip'].start_with?('127.')
|
962
963
|
|
963
|
-
|
964
|
+
host_entry[fqdn] << data['ip'].strip
|
965
|
+
end
|
966
|
+
else
|
967
|
+
# Gather the IP Addresses for the host to embed in the cert
|
968
|
+
interfaces = fact_on(host, 'interfaces').strip.split(',')
|
969
|
+
interfaces.each do |interface|
|
970
|
+
ipaddress = fact_on(host, "ipaddress_#{interface}")
|
964
971
|
|
965
|
-
|
972
|
+
next if ipaddress.nil? || ipaddress.empty? || ipaddress.start_with?('127.')
|
966
973
|
|
967
|
-
|
968
|
-
suts_network_info[fqdn] = host_entry[fqdn].sort.uniq
|
974
|
+
host_entry[fqdn] << ipaddress.strip
|
969
975
|
end
|
970
976
|
end
|
977
|
+
|
978
|
+
unless host_entry[fqdn].empty?
|
979
|
+
suts_network_info[fqdn] = host_entry[fqdn].sort.uniq
|
980
|
+
end
|
971
981
|
end
|
972
982
|
|
973
983
|
# Get all of the repeated SUT IP addresses:
|
@@ -1072,7 +1082,6 @@ module Simp::BeakerHelpers
|
|
1072
1082
|
on ca_sut, "chgrp -R puppet #{host_keydist_dir}"
|
1073
1083
|
end
|
1074
1084
|
|
1075
|
-
|
1076
1085
|
# Activate all network interfaces on the target system
|
1077
1086
|
#
|
1078
1087
|
# This is generally needed if the upstream vendor does not activate all
|
@@ -1080,6 +1089,8 @@ module Simp::BeakerHelpers
|
|
1080
1089
|
#
|
1081
1090
|
# Can be passed any number of hosts either singly or as an Array
|
1082
1091
|
def activate_interfaces(hosts)
|
1092
|
+
return if ENV['BEAKER_no_fix_interfaces']
|
1093
|
+
|
1083
1094
|
parallel = (ENV['BEAKER_SIMP_parallel'] == 'yes')
|
1084
1095
|
block_on(hosts, :run_in_parallel => parallel) do |host|
|
1085
1096
|
if host[:platform] =~ /windows/
|
@@ -1087,14 +1098,22 @@ module Simp::BeakerHelpers
|
|
1087
1098
|
next
|
1088
1099
|
end
|
1089
1100
|
|
1090
|
-
|
1101
|
+
networking_fact = pfact_on(host, 'networking')
|
1102
|
+
if networking_fact && networking_fact['interfaces']
|
1103
|
+
networking_fact['interfaces'].each do |iface, data|
|
1104
|
+
next if ( ( data['ip'] && !data['ip'].empty? ) || ( data['ip6'] && !data['ip6'].empty? ) )
|
1105
|
+
on(host, "ifup #{iface}", :accept_all_exit_codes => true)
|
1106
|
+
end
|
1107
|
+
else
|
1108
|
+
interfaces_fact = pfact_on(host, 'interfaces')
|
1091
1109
|
|
1092
|
-
|
1093
|
-
|
1110
|
+
interfaces = interfaces_fact.strip.split(',')
|
1111
|
+
interfaces.delete_if { |x| x =~ /^lo/ }
|
1094
1112
|
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1113
|
+
interfaces.each do |iface|
|
1114
|
+
if pfact_on(host, "ipaddress_#{iface}")
|
1115
|
+
on(host, "ifup #{iface}", :accept_all_exit_codes => true)
|
1116
|
+
end
|
1098
1117
|
end
|
1099
1118
|
end
|
1100
1119
|
end
|
@@ -1111,12 +1130,9 @@ module Simp::BeakerHelpers
|
|
1111
1130
|
RSpec.configure do |c|
|
1112
1131
|
c.before(:all) do
|
1113
1132
|
@temp_hieradata_dirs = @temp_hieradata_dirs || []
|
1114
|
-
end
|
1115
1133
|
|
1116
|
-
|
1117
|
-
|
1118
|
-
c.before(:context) do
|
1119
|
-
activate_interfaces(hosts) unless ENV['BEAKER_no_fix_interfaces']
|
1134
|
+
# We can't guarantee that the upstream vendor isn't disabling interfaces
|
1135
|
+
activate_interfaces(hosts)
|
1120
1136
|
end
|
1121
1137
|
|
1122
1138
|
c.after(:all) 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.24.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: 2021-
|
12
|
+
date: 2021-10-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|