simp-beaker-helpers 1.25.0 → 1.26.1

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: b361d19ffb83f7ce149363e948e0e9580d6c85c378638bbaff77d6252d36f1e1
4
+ data.tar.gz: edaf5e05b246e96ea81e33c588c9c3d71d7e1f610ef5f782e0d02be6dc2c5816
5
5
  SHA512:
6
- metadata.gz: 9ea99cff5b4a6e7e0f7fe1720efe7e439215ea14cbc0f278fe7a0f314470a3026fe64717d55559e1c80945ac4cb28289f25344b5e5e7a978516d11029b1f1add
7
- data.tar.gz: 336a178662a391759629d6d539aaf78b3ecb7d7fc93804e49e63bf03057cb87a6d9f996298c8a203a31e4aec4ee299df8dd49ba68e950df216769553edf4d2f7
6
+ metadata.gz: 63232d87cc0b63deef62fbb61964aa0cd2a60935ea5a2746c76cecf2d261601c89b8703e36325052c9243bdee4f023e2591b7dcc8b8354b13cbe0f03c3881d4c
7
+ data.tar.gz: c2019a1a3aa4fc7b2b4d10e00e1fd87318926c55e9e3572892d24f2b314c37bbdbba7f56ac8fdf20948cf1674a133cf85c82d3366372d8460114ed1e83f7ab0f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 1.26.1 / 2022-06-24
2
+ * Fixed:
3
+ * Ensure that `multi_node` is enabled by default for backwards compatibility
4
+ * Sort the discovered nodesets by default when running with `ALL` nodesets
5
+
6
+ ### 1.26.0 / 2022-06-24
7
+ * Added:
8
+ * Allow for sequential nodesets by setting `multi_node: false` in the
9
+ `CONFIG:` section of your nodeset.
10
+
1
11
  ### 1.25.0 / 2022-06-11
2
12
  * Fixed:
3
13
  * Replaced calls to `sed -c` with something POSIX compliant that should work
@@ -1,5 +1,5 @@
1
1
  module Simp; end
2
2
 
3
3
  module Simp::BeakerHelpers
4
- VERSION = '1.25.0'
4
+ VERSION = '1.26.1'
5
5
  end
@@ -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.26.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: 2022-06-17 00:00:00.000000000 Z
12
+ date: 2022-06-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: beaker