simp-beaker-helpers 1.25.0 → 1.27.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bce7304da1a7425de25af167725291b8889ca26e1bbbed5559b0583fb900a1b4
4
- data.tar.gz: 359b9c5c9eda2855e7eab95f1afc7837f3fbc108ccef4aaf2eb6d2b0d9f7858f
3
+ metadata.gz: 3e12166a33cca84b167545aee4efc3028ba09d46e1067aa00d62d6eb41a170b7
4
+ data.tar.gz: 41b71fae99411f4817927d40aa7763d46ec0ba96246054768149b04e763a0fe0
5
5
  SHA512:
6
- metadata.gz: 9ea99cff5b4a6e7e0f7fe1720efe7e439215ea14cbc0f278fe7a0f314470a3026fe64717d55559e1c80945ac4cb28289f25344b5e5e7a978516d11029b1f1add
7
- data.tar.gz: 336a178662a391759629d6d539aaf78b3ecb7d7fc93804e49e63bf03057cb87a6d9f996298c8a203a31e4aec4ee299df8dd49ba68e950df216769553edf4d2f7
6
+ metadata.gz: 44b3731e4953d446ddccb495934ac334b3aaee62f4d768921d8be6aae9c8425c31997334c10dea0f84b1a38d4205aa3e1ce272ffefb1ff04003ec49979691776
7
+ data.tar.gz: 522e33939ad65d12416792e9241f7891eefc55dcf4f5d4fc1c02b0efffe7758a015a36c9115706e61df764e59df3a9e9d03f36c6a2ce3b449b1b7747dcc4b846
data/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ### 1.27.0 / 2022-07-30
2
+ * Added:
3
+ * Add EPEL support for Amazon, Rocky, and Alma distributions
4
+
5
+ ### 1.26.2 / 2022-07-26
6
+ * Fixed:
7
+ * Limit the length of the CN field of the certificates to 64 bytes
8
+
9
+ ### 1.26.1 / 2022-06-24
10
+ * Fixed:
11
+ * Ensure that `multi_node` is enabled by default for backwards compatibility
12
+ * Sort the discovered nodesets by default when running with `ALL` nodesets
13
+
14
+ ### 1.26.0 / 2022-06-24
15
+ * Added:
16
+ * Allow for sequential nodesets by setting `multi_node: false` in the
17
+ `CONFIG:` section of your nodeset.
18
+
1
19
  ### 1.25.0 / 2022-06-11
2
20
  * Fixed:
3
21
  * Replaced calls to `sed -c` with something POSIX compliant that should work
data/files/pki/make.sh CHANGED
@@ -46,7 +46,7 @@ for hosts in $*; do
46
46
  echo "-- $hname"
47
47
  mkdir -p "${keydist}/${hname}/cacerts"
48
48
 
49
- sed -e "s/#HOSTNAME#/${hname}/" template_host.cnf > "working/${hname}.cnf"
49
+ sed -e "s/#HOSTNAME#/${hname:0:63}/" template_host.cnf > "working/${hname}.cnf"
50
50
 
51
51
  if [ "$hname" != "$hosts" ];
52
52
  then
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.25.0'
4
+ VERSION = '1.27.0'
5
5
  end
@@ -636,7 +636,7 @@ module Simp::BeakerHelpers
636
636
 
637
637
  # This is based on the official EPEL docs https://fedoraproject.org/wiki/EPEL
638
638
  case os_info['name']
639
- when 'RedHat','CentOS'
639
+ when 'RedHat','CentOS','AlmaLinux','Rocky'
640
640
  install_latest_package_on(
641
641
  sut,
642
642
  'epel-release',
@@ -655,7 +655,7 @@ module Simp::BeakerHelpers
655
655
  end
656
656
  end
657
657
 
658
- if os_info['name'] == 'CentOS'
658
+ if ['CentOS','AlmaLinux','Rocky'].include?(os_info['name'])
659
659
  if os_maj_rel == '8'
660
660
  # 8.0 fallback
661
661
  install_latest_package_on(sut, 'dnf-plugins-core')
@@ -665,8 +665,9 @@ module Simp::BeakerHelpers
665
665
  when 'OracleLinux'
666
666
  package_name = "oracle-epel-release-el#{os_maj_rel}"
667
667
  install_latest_package_on(sut,package_name)
668
+ when 'Amazon'
669
+ on sut, %{amazon-linux-extras install epel -y}
668
670
  end
669
-
670
671
  end
671
672
  end
672
673
  end
@@ -773,12 +774,19 @@ module Simp::BeakerHelpers
773
774
  end
774
775
  end
775
776
 
776
- if ['CentOS','RedHat','OracleLinux'].include?(os_info['name'])
777
+ if [
778
+ 'AlmaLinux',
779
+ 'Amazon',
780
+ 'CentOS',
781
+ 'OracleLinux',
782
+ 'RedHat',
783
+ 'Rocky'
784
+ ].include?(os_info['name'])
777
785
  enable_yum_repos_on(sut)
778
786
  enable_epel_on(sut)
779
787
 
780
788
  # net-tools required for netstat utility being used by be_listening
781
- if os_info['release']['major'].to_i >= 7
789
+ if (os_info['release']['major'].to_i >= 7) ||((os_info['name'] == 'Amazon') && (os_info['release']['major'].to_i >= 2))
782
790
  pp = <<-EOS
783
791
  package { 'net-tools': ensure => installed }
784
792
  EOS
@@ -225,7 +225,46 @@ module Simp::Rake
225
225
  nodesets << File.join(nodeset_path, 'default.yml')
226
226
  end
227
227
 
228
+ refined_nodesets = []
229
+
228
230
  nodesets.each do |nodeset_yml|
231
+ parsed_nodeset = ::Beaker::Options::HostsFileParser.parse_hosts_file(nodeset_yml)
232
+
233
+ # Default to multi-node testing for backwards compatibility
234
+ multi_node = (parsed_nodeset[:multi_node] == false ? false: true)
235
+
236
+ if multi_node
237
+ refined_nodesets.push(nodeset_yml)
238
+ else
239
+ parsed_nodeset_hosts = parsed_nodeset.delete(:HOSTS)
240
+
241
+ parsed_nodeset_hosts.each do |k,v|
242
+
243
+ v[:roles] ||= []
244
+ v[:roles] |= ['default']
245
+
246
+ tmp_nodeset = {
247
+ :HOSTS => { k => v },
248
+ :CONFIG => parsed_nodeset
249
+ }
250
+
251
+ tmp_nodeset_file = Tempfile.new("nodeset_#{k}-")
252
+ tmp_nodeset_file.write(tmp_nodeset.to_yaml)
253
+ tmp_nodeset_file.close
254
+
255
+ refined_nodesets.push(tmp_nodeset_file.path)
256
+
257
+ at_exit do
258
+ if tmp_nodeset_file && File.exist?(tmp_nodeset_file.path)
259
+ tmp_nodeset_file.close
260
+ tmp_nodeset_file.unlink
261
+ end
262
+ end
263
+ end
264
+ end
265
+ end
266
+
267
+ refined_nodesets.sort.each do |nodeset_yml|
229
268
  unless File.file?(nodeset_yml)
230
269
  # Get here if user has specified a non-existent nodeset or the
231
270
  # implied `default` nodeset does not exist.
@@ -8,7 +8,6 @@
8
8
  HOSTS:
9
9
  amzn2:
10
10
  roles:
11
- - master
12
11
  - default
13
12
  platform: el-7-x86_64
14
13
  box: gbailey/amzn2
@@ -8,8 +8,8 @@
8
8
  HOSTS:
9
9
  el7:
10
10
  roles:
11
+ - default
11
12
  - el7
12
- - master
13
13
  platform: el-7-x86_64
14
14
  box: centos/7
15
15
  hypervisor: <%= hypervisor %>
@@ -22,6 +22,7 @@ HOSTS:
22
22
  hypervisor: <%= hypervisor %>
23
23
 
24
24
  CONFIG:
25
+ multi_node: <%= ['yes','true'].include?(ENV['BEAKER_multi_node']) ? true : false %>
25
26
  log_level: verbose
26
27
  type: aio
27
28
  vagrant_cpus: 2
@@ -1,8 +1,8 @@
1
1
  HOSTS:
2
2
  el7.test.net:
3
3
  roles:
4
+ - default
4
5
  - el7
5
- - master
6
6
  platform: el-7-x86_64
7
7
  hypervisor: docker
8
8
  image: simpproject/simp_beaker_el7
@@ -8,8 +8,8 @@
8
8
  HOSTS:
9
9
  oel7:
10
10
  roles:
11
+ - default
11
12
  - el7
12
- - master
13
13
  platform: el-7-x86_64
14
14
  box: generic/oracle7
15
15
  hypervisor: <%= hypervisor %>
@@ -7,6 +7,8 @@
7
7
  -%>
8
8
  HOSTS:
9
9
  focal:
10
+ roles:
11
+ - default
10
12
  platform: ubuntu-20.04-x86_64
11
13
  box: ubuntu/focal64
12
14
  hypervisor: <%= hypervisor %>
@@ -6,41 +6,41 @@ context 'after copy_fixture_modules_to( hosts )' do
6
6
  copy_fixture_modules_to( hosts )
7
7
  end
8
8
 
9
- describe "fact_on(master,'root_home')" do
9
+ describe "fact_on(default,'root_home')" do
10
10
  it 'should not return value of `root_home`' do
11
- expect(fact_on(master, 'root_home')).to eq ''
11
+ expect(fact_on(default, 'root_home')).to eq ''
12
12
  end
13
13
  end
14
14
 
15
- describe "pfact_on(master,'root_home')" do
15
+ describe "pfact_on(default,'root_home')" do
16
16
  it 'should return value of `root_home`' do
17
- expect(pfact_on(master, 'root_home')).to eq '/root'
17
+ expect(pfact_on(default, 'root_home')).to eq '/root'
18
18
  end
19
19
  end
20
20
 
21
- describe "pfact_on(master,'os.release.major')" do
21
+ describe "pfact_on(default,'os.release.major')" do
22
22
  it 'should return the value of `os.release.major`' do
23
- expect(pfact_on(master, 'os.release.major')).to match(/.+/)
23
+ expect(pfact_on(default, 'os.release.major')).to match(/.+/)
24
24
  end
25
25
  end
26
26
 
27
- describe "pfact_on(master,'os.release.foo')" do
27
+ describe "pfact_on(default,'os.release.foo')" do
28
28
  it 'should not return the value of `os.release.foo`' do
29
- expect(pfact_on(master, 'os.release.foo')).to eq ''
29
+ expect(pfact_on(default, 'os.release.foo')).to eq ''
30
30
  end
31
31
  end
32
32
 
33
- describe "pfact_on(master,'fips_enabled')" do
33
+ describe "pfact_on(default,'fips_enabled')" do
34
34
  expected = (ENV['BEAKER_fips'] == 'yes')
35
35
 
36
36
  it 'should return false' do
37
- expect(pfact_on(master, 'fips_enabled')).to eq expected
37
+ expect(pfact_on(default, 'fips_enabled')).to eq expected
38
38
  end
39
39
  end
40
40
 
41
41
  describe "pfact_on returns a hash" do
42
42
  it 'should return a Hash' do
43
- expect(pfact_on(master, 'os')).to be_a(Hash)
43
+ expect(pfact_on(default, 'os')).to be_a(Hash)
44
44
  end
45
45
  end
46
46
  end
@@ -4,21 +4,21 @@ require 'tmpdir'
4
4
 
5
5
  context 'PKI operations' do
6
6
 
7
- context 'after run_fake_pki_ca_on(master,hosts)' do
7
+ context 'after run_fake_pki_ca_on(default,hosts)' do
8
8
  before(:all) do
9
9
  copy_fixture_modules_to( hosts )
10
10
  end
11
11
 
12
12
  shared_examples_for 'a correctly copied keydist/ tree' do |test_dir|
13
13
  it 'correctly copies keydist/ tree' do
14
- on(master, "ls -d #{test_dir}" +
14
+ on(default, "ls -d #{test_dir}" +
15
15
  " #{test_dir}/cacerts" +
16
16
  " #{test_dir}/cacerts/cacert_*.pem"
17
17
  )
18
18
 
19
19
  hosts.each do |host|
20
20
  name = host.node_name
21
- on(master, "ls -d #{test_dir}/#{name}/cacerts" +
21
+ on(default, "ls -d #{test_dir}/#{name}/cacerts" +
22
22
  " #{test_dir}/#{name}/#{name}.pem" +
23
23
  " #{test_dir}/#{name}/#{name}.pub" +
24
24
  " #{test_dir}/cacerts/cacert_*.pem"
@@ -29,10 +29,10 @@ context 'PKI operations' do
29
29
 
30
30
  describe 'a Fake CA under /root' do
31
31
  tmp_keydist_dir = Dir.mktmpdir 'simp-beaker-helpers__pki-tests'
32
- run_fake_pki_ca_on( master, hosts, tmp_keydist_dir )
32
+ run_fake_pki_ca_on( default, hosts, tmp_keydist_dir )
33
33
 
34
34
  it 'should create /root/pki' do
35
- on(master, 'test -d /root/pki')
35
+ on(default, 'test -d /root/pki')
36
36
  end
37
37
 
38
38
  it_behaves_like 'a correctly copied keydist/ tree', '/root/pki/keydist'
@@ -41,13 +41,13 @@ context 'PKI operations' do
41
41
 
42
42
  describe 'after copy_keydist_to' do
43
43
  test_dir = '/etc/puppetlabs/code/environments/production/modules/pki/files/keydist'
44
- copy_keydist_to(master)
44
+ copy_keydist_to(default)
45
45
  it_behaves_like 'a correctly copied keydist/ tree', test_dir
46
46
  end
47
47
 
48
- describe 'after copy_keydist_to(master,"/tmp/foo")' do
48
+ describe 'after copy_keydist_to(default,"/tmp/foo")' do
49
49
  test_dir = '/tmp/foo'
50
- copy_keydist_to(master, test_dir)
50
+ copy_keydist_to(default, test_dir)
51
51
  it_behaves_like 'a correctly copied keydist/ tree', test_dir
52
52
  end
53
53
 
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.25.0
4
+ version: 1.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Tessmer
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2022-06-17 00:00:00.000000000 Z
12
+ date: 2022-07-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker