simp-beaker-helpers 1.18.4 → 1.18.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ceefebc12043c8bea9d8e93c4b70fc7280cd2cc36d00bb018d1851eb0639248a
4
- data.tar.gz: 16289c99c4e61061c7a082b2ffca131169fe291a4481baab187c9ca9cef3451d
3
+ metadata.gz: 6af360e25b0c27681121e57724c9440c886489aab74d9bff7a96f32a2fb1805d
4
+ data.tar.gz: b9e0ea633c7e5a274e868abd4203fc3c02861a396f043cdc6c682ca550beacfd
5
5
  SHA512:
6
- metadata.gz: 8644658439aa893965fa13120de357e5ef85bafdf4fb5cc865623588b405bec77c9215dddd360c74a03e758e89eb454d29c2d046b2bc20fbc66805fe958d26f4
7
- data.tar.gz: b41a01714e053599dd0a514c8c57667688622c757601299b30a84c0ef965a257d6f77e1e324d948fc2476456bb2aabf747615e1d8df2b4db7e1292958ee452a6
6
+ metadata.gz: 0430e3ab6942bc368478f64dfb8243d76975e25e48d78965d52c7c22b916c80c7ad509af4b63a646dad92d87587e6e5dcdf0a4650b6495e4c3e6138daa05c387
7
+ data.tar.gz: e357315e04adadc555cb3ba8819e1a082c460a6c93c5842e3aa235c1d88faded4c2dea547b29c05689e5eb84de3ce76742d248c2645905f5756b9ddafd58592b
@@ -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: "https://github.com/simp/puppetlabs-stdlib"
4
+ stdlib: https://github.com/simp/puppetlabs-stdlib
5
+ compliance_markup: https://github.com/simp/pupmod-simp-compliance_markup
8
6
 
@@ -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
- puppet_collections:
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
- BEAKER_PUPPET_COLLECTION: 'puppet5'
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
@@ -1,4 +1,23 @@
1
- ### 1.18.4 /2020-03-31
1
+ ### 1.18.9 / 2020-08-04
2
+ * Change windows 2012r2 VM to work around issues where the old image had
3
+ duplicate ports trying to be opened
4
+ * Increase test CA bits to 4096
5
+
6
+ ### 1.18.8 / 2020-07-14
7
+ * Allow the beaker version to be pinned by environment variable
8
+
9
+ ### 1.18.7 / 2020-07-07
10
+ * Fix host reference bug when switching to FIPS mode
11
+ * Ensure that net-ssh 6+ can access older FIPS systems
12
+
13
+ ### 1.18.6 / 2020-06-24
14
+ * Fix Vagrant snapshot issues
15
+
16
+ ### 1.18.5 / 2020-06-24
17
+ * Allow Vagrant to connect to EL8+ hosts in FIPS mode
18
+ * Add EL8 support to the SSG scans
19
+
20
+ ### 1.18.4 / 2020-03-31
2
21
  * Fix capturing error messages when inspec fails to generate results
3
22
 
4
23
  ### 1.18.3 / 2020-02-24
data/Gemfile CHANGED
@@ -13,7 +13,34 @@ gem 'bundler'
13
13
  gem 'rake'
14
14
 
15
15
  group :system_tests do
16
- gem 'beaker'
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'
@@ -93,7 +93,7 @@ emailAddress = optional
93
93
 
94
94
  ####################################################################
95
95
  [ req ]
96
- default_bits = 2048
96
+ default_bits = 4096
97
97
  default_keyfile = privkey.pem
98
98
  distinguished_name = req_distinguished_name
99
99
  attributes = req_attributes
@@ -96,7 +96,7 @@ emailAddress = optional
96
96
 
97
97
  ####################################################################
98
98
  [ req ]
99
- default_bits = 2048
99
+ default_bits = 4096
100
100
  default_keyfile = privkey.pem
101
101
  distinguished_name = req_distinguished_name
102
102
  attributes = req_attributes
@@ -297,7 +297,7 @@ module Simp::BeakerHelpers
297
297
  # TODO Use simp-ssh Puppet module appropriately (i.e., in a fashion
298
298
  # that doesn't break vagrant access and is appropriate for
299
299
  # typical module tests.)
300
- fips_ssh_ciphers = [ 'aes256-cbc','aes192-cbc','aes128-cbc']
300
+ fips_ssh_ciphers = [ 'aes256-ctr','aes192-ctr','aes128-ctr']
301
301
  on(sut, %(sed -i '/Ciphers /d' /etc/ssh/sshd_config))
302
302
  on(sut, %(echo 'Ciphers #{fips_ssh_ciphers.join(',')}' >> /etc/ssh/sshd_config))
303
303
 
@@ -327,6 +327,16 @@ module Simp::BeakerHelpers
327
327
 
328
328
  # Enable FIPS and then reboot to finish.
329
329
  on(sut, %(puppet apply --verbose #{fips_enable_modulepath} -e "class { 'fips': enabled => true }"))
330
+
331
+ # Work around Vagrant and cipher restrictions in EL8+
332
+ #
333
+ # Hopefully, Vagrant will update the used ciphers at some point but who
334
+ # knows when that will be
335
+ opensshserver_config = '/etc/crypto-policies/back-ends/opensshserver.config'
336
+ if file_exists_on(sut, opensshserver_config)
337
+ on(sut, "sed --follow-symlinks -i 's/PubkeyAcceptedKeyTypes=/PubkeyAcceptedKeyTypes=ssh-rsa,/' #{opensshserver_config}")
338
+ end
339
+
330
340
  sut.reboot
331
341
  end
332
342
  end
@@ -1,5 +1,5 @@
1
1
  module Simp::BeakerHelpers
2
- # Helpers for working with the SCAP Security Guide
2
+ # Helpers for managing Vagrant snapshots
3
3
  class Snapshot
4
4
  # The name of the base snapshot that is created if no snapshots currently exist
5
5
  BASE_NAME = '_simp_beaker_base'
@@ -18,9 +18,7 @@ module Simp::BeakerHelpers
18
18
 
19
19
  if vdir
20
20
  Dir.chdir(vdir) do
21
- unless exist?(host, BASE_NAME)
22
- save(host, BASE_NAME)
23
- end
21
+ save(host, BASE_NAME) unless exist?(host, BASE_NAME)
24
22
 
25
23
  snap = "#{host.name}_#{snapshot_name}"
26
24
 
@@ -67,7 +65,7 @@ module Simp::BeakerHelpers
67
65
  Dir.chdir(vdir) do
68
66
  output = %x(vagrant snapshot list #{host.name}).lines
69
67
  output.map! do |x|
70
- x.split(/^#{host.name}_/).last.strip
68
+ x.split(/^#{host.name}_/).last.split(':').first.delete('==>').strip
71
69
  end
72
70
  end
73
71
  end
@@ -29,6 +29,17 @@ module Simp::BeakerHelpers
29
29
  'python-jinja2'
30
30
  ]
31
31
 
32
+ EL8_PACKAGES = [
33
+ 'python3',
34
+ 'python3-pyyaml',
35
+ 'cmake',
36
+ 'git',
37
+ 'openscap-python3',
38
+ 'openscap-utils',
39
+ 'python3-lxml',
40
+ 'python3-jinja2'
41
+ ]
42
+
32
43
  OS_INFO = {
33
44
  'RedHat' => {
34
45
  '6' => {
@@ -46,6 +57,14 @@ module Simp::BeakerHelpers
46
57
  'build_target' => 'rhel7',
47
58
  'datastream' => 'ssg-rhel7-ds.xml'
48
59
  }
60
+ },
61
+ '8' => {
62
+ 'required_packages' => EL8_PACKAGES,
63
+ 'ssg' => {
64
+ 'profile_target' => 'rhel8',
65
+ 'build_target' => 'rhel8',
66
+ 'datastream' => 'ssg-rhel8-ds.xml'
67
+ }
49
68
  }
50
69
  },
51
70
  'CentOS' => {
@@ -64,6 +83,14 @@ module Simp::BeakerHelpers
64
83
  'build_target' => 'centos7',
65
84
  'datastream' => 'ssg-centos7-ds.xml'
66
85
  }
86
+ },
87
+ '8' => {
88
+ 'required_packages' => EL8_PACKAGES,
89
+ 'ssg' => {
90
+ 'profile_target' => 'rhel8',
91
+ 'build_target' => 'centos8',
92
+ 'datastream' => 'ssg-centos8-ds.xml'
93
+ }
67
94
  }
68
95
  },
69
96
  'OracleLinux' => {
@@ -73,8 +100,16 @@ module Simp::BeakerHelpers
73
100
  'profile_target' => 'ol7',
74
101
  'build_target' => 'ol7',
75
102
  'datastream' => 'ssg-ol7-ds.xml'
103
+ },
104
+ '8' => {
105
+ 'required_packages' => EL8_PACKAGES,
106
+ 'ssg' => {
107
+ 'profile_target' => 'ol8',
108
+ 'build_target' => 'ol8',
109
+ 'datastream' => 'ssg-ol8-ds.xml'
76
110
  }
77
111
  }
112
+ }
78
113
  }
79
114
  }
80
115
 
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.18.4'
4
+ VERSION = '1.18.9'
5
5
  end
@@ -9,8 +9,8 @@ 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
@@ -23,6 +23,13 @@ HOSTS:
23
23
  box: centos/6
24
24
  hypervisor: <%= hypervisor %>
25
25
 
26
+ server-el8:
27
+ roles:
28
+ - el8
29
+ platform: el-8-x86_64
30
+ box: centos/8
31
+ hypervisor: <%= hypervisor %>
32
+
26
33
  CONFIG:
27
34
  log_level: verbose
28
35
  type: aio
@@ -1 +1 @@
1
- spec/acceptance/suites/default/../../nodesets
1
+ ../../nodesets
@@ -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 +1 @@
1
- spec/acceptance/suites/fips_from_fixtures/../../nodesets
1
+ ../../nodesets
@@ -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
- Bundler.with_clean_env{
12
- %x{bundle exec rake spec_prep}
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 #{ENV['PUPPET_VERSION']}}" do
21
- expect(Gem::Version.new(client_puppet_version)).to be >= Gem::Version.new(ENV['PUPPET_VERSION'])
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
@@ -57,7 +57,7 @@ hosts.each do |host|
57
57
  end
58
58
 
59
59
  it 'can list the snapshots' do
60
- expect(Simp::BeakerHelpers::Snapshot.list(host)).to eq ['test', 'test2']
60
+ expect(Simp::BeakerHelpers::Snapshot.list(host)).to eq ["#{host}", 'test', 'test2']
61
61
  end
62
62
 
63
63
  it 'can query for a specific snapshot' do
@@ -1 +1 @@
1
- spec/acceptance/suites/snapshot/../../nodesets
1
+ ../../nodesets
@@ -10,12 +10,14 @@ HOSTS:
10
10
  roles:
11
11
  - windows
12
12
  platform: windows-server-amd64
13
- box: opentable/win-2012r2-standard-amd64-nocm # VBOX ONLY
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:
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.18.4
4
+ version: 1.18.9
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-04-07 00:00:00.000000000 Z
12
+ date: 2020-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker
@@ -203,7 +203,6 @@ files:
203
203
  - spec/acceptance/suites/offline/nodesets/default.yml
204
204
  - spec/acceptance/suites/puppet_collections/00_default_spec.rb
205
205
  - spec/acceptance/suites/puppet_collections/metadata.yml
206
- - spec/acceptance/suites/puppet_collections/nodesets/default.yml
207
206
  - spec/acceptance/suites/snapshot/00_snapshot_test_spec.rb
208
207
  - spec/acceptance/suites/snapshot/10_general_usage_spec.rb
209
208
  - spec/acceptance/suites/snapshot/nodesets
@@ -235,8 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
234
  - !ruby/object:Gem::Version
236
235
  version: '0'
237
236
  requirements: []
238
- rubyforge_project:
239
- rubygems_version: 2.7.7
237
+ rubygems_version: 3.0.8
240
238
  signing_key:
241
239
  specification_version: 4
242
240
  summary: beaker helper methods for SIMP
@@ -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