simp-beaker-helpers 1.35.1 → 1.36.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 +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/lib/simp/beaker_helpers/version.rb +1 -1
- data/lib/simp/beaker_helpers.rb +18 -10
- data/spec/acceptance/suites/default/fixture_modules_spec.rb +2 -1
- data/spec/lib/simp/beaker_helpers_spec.rb +16 -0
- 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: d1a600b8c573c9fb56e57bf0b7f9293ca97a04c3c9db4c81326c180e146c2512
|
4
|
+
data.tar.gz: 036714fc1cb88bd3bb5b6fa07b37fcecd8c8ffaab47f6b7d748c22bc287b2867
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42e4a7823d3b312d549751b6497d8938a018b9c089c15b8bf3ef12d24217e71158b8d2c3accbd815d8f44ca04af5457f71b23324bfeece60400dea94b8614c79
|
7
|
+
data.tar.gz: 6c87c3f220ca11b10015da816c1a39ecd3e5fc5d5b738e886b436e88cd90b00831db42a5ac67e878fd46b47d237e364d0f0c58f3437a0dd71a15bcf94e0b9a6e
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/simp/beaker_helpers.rb
CHANGED
@@ -764,7 +764,7 @@ module Simp::BeakerHelpers
|
|
764
764
|
u.strip!
|
765
765
|
u = u.split(':')
|
766
766
|
%r{^(/|/dev/.*|/s?bin/?.*|/proc/?.*)$}.match?(u[5]) ? [nil] : [u[0], u[5]]
|
767
|
-
end
|
767
|
+
end,
|
768
768
|
]
|
769
769
|
|
770
770
|
user_info.each_key do |user|
|
@@ -1393,7 +1393,7 @@ module Simp::BeakerHelpers
|
|
1393
1393
|
#
|
1394
1394
|
# @return [String,Nil] the `puppet-agent` version or nil
|
1395
1395
|
#
|
1396
|
-
def latest_puppet_agent_version_for(puppet_version)
|
1396
|
+
def latest_puppet_agent_version_for(puppet_version, puppet_collection_name = 'puppet')
|
1397
1397
|
return nil if puppet_version.nil?
|
1398
1398
|
|
1399
1399
|
require 'rubygems/requirement'
|
@@ -1418,7 +1418,7 @@ module Simp::BeakerHelpers
|
|
1418
1418
|
puppet_gems = nil
|
1419
1419
|
|
1420
1420
|
Bundler.with_unbundled_env do
|
1421
|
-
puppet_gems = `gem search -ra -e
|
1421
|
+
puppet_gems = `gem search -ra -e #{puppet_collection_name}`.match(%r{\((.+)\)})
|
1422
1422
|
end
|
1423
1423
|
|
1424
1424
|
if puppet_gems
|
@@ -1467,10 +1467,10 @@ module Simp::BeakerHelpers
|
|
1467
1467
|
|
1468
1468
|
if puppet_agent_version.nil?
|
1469
1469
|
if (puppet_collection = ENV['BEAKER_PUPPET_COLLECTION'] || host.options['puppet_collection'])
|
1470
|
-
raise("Error: Puppet Collection '#{puppet_collection}' must match /puppet(\\d+)/") unless puppet_collection =~ %r{puppet(\d+)}
|
1471
|
-
|
1472
|
-
|
1473
|
-
|
1470
|
+
raise("Error: Puppet Collection '#{puppet_collection}' must match /(puppet|openvox)(\\d+)/") unless puppet_collection =~ %r{(puppet|openvox)(\d+)}
|
1471
|
+
puppet_collection_name = ::Regexp.last_match(1)
|
1472
|
+
puppet_install_version = "~> #{::Regexp.last_match(2)}"
|
1473
|
+
puppet_agent_version = latest_puppet_agent_version_for(puppet_install_version, puppet_collection_name)
|
1474
1474
|
else
|
1475
1475
|
puppet_agent_version = latest_puppet_agent_version_for(DEFAULT_PUPPET_AGENT_VERSION)
|
1476
1476
|
end
|
@@ -1488,19 +1488,27 @@ module Simp::BeakerHelpers
|
|
1488
1488
|
}
|
1489
1489
|
end
|
1490
1490
|
|
1491
|
+
def run_puppet_install_helper_on(hosts)
|
1492
|
+
block_on hosts, run_in_parallel: true do |host|
|
1493
|
+
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, ENV['BEAKER_PUPPET_COLLECTION'])
|
1494
|
+
package_name = ENV.fetch('BEAKER_PUPPET_PACKAGE_NAME', BeakerPuppetHelpers::InstallUtils.collection2packagename(host, ENV['BEAKER_PUPPET_COLLECTION']))
|
1495
|
+
host.install_package(package_name)
|
1496
|
+
end
|
1497
|
+
end
|
1498
|
+
|
1491
1499
|
# Replacement for `install_puppet` in spec_helper_acceptance.rb
|
1492
1500
|
def install_puppet
|
1493
1501
|
install_info = get_puppet_install_info
|
1494
1502
|
|
1495
1503
|
# In case Beaker needs this info internally
|
1496
|
-
ENV['PUPPET_INSTALL_VERSION'] = install_info[:puppet_install_version]
|
1497
1504
|
if install_info[:puppet_collection]
|
1498
1505
|
ENV['BEAKER_PUPPET_COLLECTION'] = install_info[:puppet_collection]
|
1499
1506
|
end
|
1500
1507
|
|
1501
|
-
require '
|
1502
|
-
|
1508
|
+
require 'beaker_puppet_helpers'
|
1509
|
+
run_puppet_install_helper_on(hosts)
|
1503
1510
|
end
|
1511
|
+
alias install_openvox install_puppet
|
1504
1512
|
|
1505
1513
|
# Configure all SIMP repos on a host and disable all repos in the disable Array
|
1506
1514
|
#
|
@@ -8,7 +8,8 @@ context 'after copy_fixture_modules_to( hosts )' do
|
|
8
8
|
|
9
9
|
describe "fact_on(default,'root_home')" do
|
10
10
|
it 'does not return value of `root_home`' do
|
11
|
-
|
11
|
+
pending 'Conflicts with beaker_puppet_helpers' unless Gem::Version.new(pfact_on(default, 'puppetversion').to_s) < Gem::Version.new('8')
|
12
|
+
expect(Beaker::DSL::Helpers::FacterHelpers.fact_on(default, 'root_home').to_s).to eq ''
|
12
13
|
end
|
13
14
|
end
|
14
15
|
|
@@ -64,6 +64,11 @@ describe 'Simp::BeakerHelpers' do
|
|
64
64
|
].join(', ')})\n"
|
65
65
|
end
|
66
66
|
|
67
|
+
let(:openvox_gem_search_results) do
|
68
|
+
# subset of results, but still exercises code
|
69
|
+
"openvox (8.19.2, 8.19.1, 8.19.0, 7.37.2, 7.37.1)\n"
|
70
|
+
end
|
71
|
+
|
67
72
|
context '#latest_puppet_agent_version_for' do
|
68
73
|
context 'using table' do
|
69
74
|
it 'maps exact Puppet version' do
|
@@ -206,6 +211,17 @@ describe 'Simp::BeakerHelpers' do
|
|
206
211
|
expect(helper.get_puppet_install_info).to eq expected
|
207
212
|
end
|
208
213
|
|
214
|
+
it 'extracts openvox info from BEAKER_PUPPET_COLLECTION' do
|
215
|
+
allow(helper).to receive(:`).with('gem search -ra -e openvox').and_return(openvox_gem_search_results)
|
216
|
+
helper.host.options = { 'puppet_collection' => 'openvox8' }
|
217
|
+
expected = {
|
218
|
+
puppet_install_version: '8.19.2',
|
219
|
+
puppet_collection: 'openvox8',
|
220
|
+
puppet_install_type: 'agent'
|
221
|
+
}
|
222
|
+
expect(helper.get_puppet_install_info).to eq expected
|
223
|
+
end
|
224
|
+
|
209
225
|
it 'extracts info from PUPPET_INSTALL_TYPE' do
|
210
226
|
ENV['PUPPET_INSTALL_TYPE'] = 'pe'
|
211
227
|
|
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.36.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: 2025-06-
|
12
|
+
date: 2025-06-24 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: beaker
|