beaker_puppet_helpers 3.3.1 → 3.4.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/.github/workflows/release.yml +2 -2
- data/.github/workflows/test.yml +2 -2
- data/CHANGELOG.md +18 -0
- data/Rakefile +5 -3
- data/acceptance/tests/install_utils.rb +2 -2
- data/beaker_puppet_helpers.gemspec +2 -2
- data/lib/beaker_puppet_helpers/install_utils.rb +33 -5
- data/spec/beaker_puppet_helpers/install_utils_spec.rb +245 -0
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12c7a727a67dede56f954564783f205e7613c99d0d986480212894b6b3c56dd1
|
|
4
|
+
data.tar.gz: 745675405aad3a169881035b6f1eefc85f970728c51e912583b79dc60b344632
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 815977ef1b59e8fc8d64d5f3a27469d377d234fa9d97bb7a4fcc7c40726405edc18c225447cad968a38105a8617cc30c5d6d1d1023a8dc9fd7fb709fd42e6ea8
|
|
7
|
+
data.tar.gz: 98301d2e8a15fb1483e78c618c7fcc225ee5db6929629e309fdb57ac58f68c090adb8c25d3895366e7973124c7282ff1d2ec0306f16f999a4b1add138abac9fa
|
|
@@ -15,7 +15,7 @@ jobs:
|
|
|
15
15
|
name: Build the gem
|
|
16
16
|
runs-on: ubuntu-24.04
|
|
17
17
|
steps:
|
|
18
|
-
- uses: actions/checkout@
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
19
|
- name: Install Ruby
|
|
20
20
|
uses: ruby/setup-ruby@v1
|
|
21
21
|
with:
|
|
@@ -76,7 +76,7 @@ jobs:
|
|
|
76
76
|
uses: actions/download-artifact@v8
|
|
77
77
|
with:
|
|
78
78
|
name: gem-artifact
|
|
79
|
-
- uses: rubygems/configure-rubygems-credentials@
|
|
79
|
+
- uses: rubygems/configure-rubygems-credentials@v2.1.0
|
|
80
80
|
- name: Publish gem to rubygems.org
|
|
81
81
|
shell: bash
|
|
82
82
|
run: gem push *.gem
|
data/.github/workflows/test.yml
CHANGED
|
@@ -19,7 +19,7 @@ jobs:
|
|
|
19
19
|
outputs:
|
|
20
20
|
ruby: ${{ steps.ruby.outputs.versions }}
|
|
21
21
|
steps:
|
|
22
|
-
- uses: actions/checkout@
|
|
22
|
+
- uses: actions/checkout@v7
|
|
23
23
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
24
24
|
uses: ruby/setup-ruby@v1
|
|
25
25
|
with:
|
|
@@ -39,7 +39,7 @@ jobs:
|
|
|
39
39
|
ruby: ${{ fromJSON(needs.rubocop_and_matrix.outputs.ruby) }}
|
|
40
40
|
name: Ruby ${{ matrix.ruby }}
|
|
41
41
|
steps:
|
|
42
|
-
- uses: actions/checkout@
|
|
42
|
+
- uses: actions/checkout@v7
|
|
43
43
|
- name: Install Ruby ${{ matrix.ruby }}
|
|
44
44
|
uses: ruby/setup-ruby@v1
|
|
45
45
|
with:
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.4.0](https://github.com/voxpupuli/beaker_puppet_helpers/tree/3.4.0) (2026-11-17)
|
|
6
|
+
|
|
7
|
+
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/3.3.1...3.4.0)
|
|
8
|
+
|
|
9
|
+
**Implemented enhancements:**
|
|
10
|
+
|
|
11
|
+
- Implement support for installing openvox-agent on macOS [\#115](https://github.com/voxpupuli/beaker_puppet_helpers/pull/115) ([nmburgan](https://github.com/nmburgan))
|
|
12
|
+
|
|
13
|
+
**Closed issues:**
|
|
14
|
+
|
|
15
|
+
- Dependency Dashboard [\#114](https://github.com/voxpupuli/beaker_puppet_helpers/issues/114)
|
|
16
|
+
|
|
17
|
+
**Merged pull requests:**
|
|
18
|
+
|
|
19
|
+
- Small fixes and specs [\#117](https://github.com/voxpupuli/beaker_puppet_helpers/pull/117) ([nmburgan](https://github.com/nmburgan))
|
|
20
|
+
- Test installing OpenVox in the acceptance run [\#116](https://github.com/voxpupuli/beaker_puppet_helpers/pull/116) ([nmburgan](https://github.com/nmburgan))
|
|
21
|
+
- Update voxpupuli-rubocop requirement from ~\> 5.1.0 to ~\> 5.2.0 [\#109](https://github.com/voxpupuli/beaker_puppet_helpers/pull/109) ([dependabot[bot]](https://github.com/apps/dependabot))
|
|
22
|
+
|
|
5
23
|
## [3.3.1](https://github.com/voxpupuli/beaker_puppet_helpers/tree/3.3.1) (2026-04-02)
|
|
6
24
|
|
|
7
25
|
[Full Changelog](https://github.com/voxpupuli/beaker_puppet_helpers/compare/3.3.0...3.3.1)
|
data/Rakefile
CHANGED
|
@@ -34,10 +34,11 @@ desc <<~DESC
|
|
|
34
34
|
DESC
|
|
35
35
|
task :acceptance do
|
|
36
36
|
hosts = {
|
|
37
|
-
aio
|
|
38
|
-
|
|
37
|
+
'type=aio' => %w[centos9 debian12 ubuntu2404],
|
|
38
|
+
'type=aio,collection=openvox9' => %w[centos10 debian13 ubuntu2604],
|
|
39
|
+
'type=foss' => %w[debian12 debian13 fedora43 fedora44],
|
|
39
40
|
}
|
|
40
|
-
default_hosts = hosts.map { |
|
|
41
|
+
default_hosts = hosts.map { |settings, h| h.map { |host| "#{host}-64{#{settings}}" }.join('-') }.join('-')
|
|
41
42
|
hosts = ENV['BEAKER_HOSTS'] || default_hosts
|
|
42
43
|
|
|
43
44
|
tests = ENV['TESTS'] || 'acceptance/tests'
|
|
@@ -46,6 +47,7 @@ task :acceptance do
|
|
|
46
47
|
|
|
47
48
|
args = [
|
|
48
49
|
"--hosts=#{hosts}",
|
|
50
|
+
'--log-prefix=acceptance',
|
|
49
51
|
"--tests=#{tests}",
|
|
50
52
|
"--log-level=#{log_level}",
|
|
51
53
|
"--preserve-hosts=#{preserve_hosts}",
|
|
@@ -4,14 +4,14 @@ require 'beaker_puppet_helpers'
|
|
|
4
4
|
|
|
5
5
|
test_name '#install_puppet_release_repo_on' do
|
|
6
6
|
block_on hosts, run_in_parallel: true do |host|
|
|
7
|
-
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host) if host['type'] == 'aio'
|
|
7
|
+
BeakerPuppetHelpers::InstallUtils.install_puppet_release_repo_on(host, host['collection'] || 'puppet') if host['type'] == 'aio'
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
test_name 'install puppet' do
|
|
12
12
|
step 'run installation' do
|
|
13
13
|
block_on hosts, run_in_parallel: true do |host|
|
|
14
|
-
package_name = BeakerPuppetHelpers::InstallUtils.
|
|
14
|
+
package_name = BeakerPuppetHelpers::InstallUtils.collection2packagename(host, host['collection'] || 'puppet', prefer_aio: host['type'] == 'aio')
|
|
15
15
|
host.install_package(package_name)
|
|
16
16
|
end
|
|
17
17
|
end
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Gem::Specification.new do |s|
|
|
4
4
|
s.name = 'beaker_puppet_helpers'
|
|
5
|
-
s.version = '3.
|
|
5
|
+
s.version = '3.4.0'
|
|
6
6
|
s.authors = ['Vox Pupuli']
|
|
7
7
|
s.email = ['voxpupuli@groups.io']
|
|
8
8
|
s.homepage = 'https://github.com/voxpupuli/beaker_puppet_helpers'
|
|
@@ -28,5 +28,5 @@ Gem::Specification.new do |s|
|
|
|
28
28
|
s.add_dependency 'open-uri', '< 0.6'
|
|
29
29
|
s.add_dependency 'puppet-modulebuilder', '>= 0.3', '< 3'
|
|
30
30
|
|
|
31
|
-
s.add_development_dependency 'voxpupuli-rubocop', '~> 5.
|
|
31
|
+
s.add_development_dependency 'voxpupuli-rubocop', '~> 5.2.0'
|
|
32
32
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'beaker/command'
|
|
4
|
+
require 'net/http'
|
|
5
|
+
require 'nokogiri'
|
|
4
6
|
|
|
5
7
|
module BeakerPuppetHelpers
|
|
6
8
|
# Methods to install Puppet
|
|
@@ -9,8 +11,8 @@ module BeakerPuppetHelpers
|
|
|
9
11
|
REPOS = {
|
|
10
12
|
openvox: {
|
|
11
13
|
release: {
|
|
12
|
-
apt: 'https://apt.voxpupuli.org
|
|
13
|
-
yum: 'https://yum.voxpupuli.org
|
|
14
|
+
apt: 'https://apt.voxpupuli.org',
|
|
15
|
+
yum: 'https://yum.voxpupuli.org',
|
|
14
16
|
},
|
|
15
17
|
},
|
|
16
18
|
puppet: {
|
|
@@ -64,8 +66,9 @@ module BeakerPuppetHelpers
|
|
|
64
66
|
# package. We'll have to remember to update this block when
|
|
65
67
|
# we update the signing keys
|
|
66
68
|
if variant == 'sles' && version >= '11'
|
|
67
|
-
%w[puppet puppet-20250406]
|
|
68
|
-
|
|
69
|
+
gpg_keys = (implementation == 'openvox') ? %w[GPG-KEY-openvox.pub] : %w[RPM-GPG-KEY-puppet RPM-GPG-KEY-puppet-20250406]
|
|
70
|
+
gpg_keys.each do |gpg_key|
|
|
71
|
+
wget_on(host, "#{repos[:yum]}/#{gpg_key}") do |filename|
|
|
69
72
|
host.exec(Beaker::Command.new("rpm --import '#{filename}'"))
|
|
70
73
|
end
|
|
71
74
|
end
|
|
@@ -145,7 +148,7 @@ module BeakerPuppetHelpers
|
|
|
145
148
|
'sysutils/puppet8'
|
|
146
149
|
when 'ubuntu'
|
|
147
150
|
# 23.04 started to ship puppet-agent with puppet as a legacy package
|
|
148
|
-
(prefer_aio || host['packaging_platform'].split('-', 3)[1].to_i >= 2304) ? 'puppet-agent' : 'puppet'
|
|
151
|
+
(prefer_aio || host['packaging_platform'].split('-', 3)[1].delete('.').to_i >= 2304) ? 'puppet-agent' : 'puppet'
|
|
149
152
|
else
|
|
150
153
|
'puppet'
|
|
151
154
|
end
|
|
@@ -250,5 +253,30 @@ module BeakerPuppetHelpers
|
|
|
250
253
|
"(packaging_platform: '#{host['packaging_platform']}')"
|
|
251
254
|
end
|
|
252
255
|
end
|
|
256
|
+
|
|
257
|
+
# Install the newest openvox-agent release of a collection on a macOS
|
|
258
|
+
# host. The collection has one DMG per architecture for every macOS
|
|
259
|
+
# version.
|
|
260
|
+
#
|
|
261
|
+
# @example
|
|
262
|
+
# InstallUtils.install_openvox_agent_dmg_on(host, 'openvox9')
|
|
263
|
+
#
|
|
264
|
+
# @param [Beaker::Host] host The macOS host on which to install the agent
|
|
265
|
+
# @param [String] collection The collection, e.g. 'openvox9'
|
|
266
|
+
# @raise [RuntimeError] if the collection has no DMG for the host's architecture
|
|
267
|
+
def self.install_openvox_agent_dmg_on(host, collection)
|
|
268
|
+
url = "https://downloads.voxpupuli.org/mac/#{collection}/"
|
|
269
|
+
response = Net::HTTP.get_response(URI.parse(url))
|
|
270
|
+
raise "Failed to fetch URL: #{response.code} #{response.message}" unless response.is_a?(Net::HTTPSuccess)
|
|
271
|
+
|
|
272
|
+
arch = host['platform'].arch
|
|
273
|
+
dmg_regex = /\Aopenvox-agent-(\d+\.\d+\.\d+)-(\d+)\.macos\.all\.#{arch}\.dmg\z/
|
|
274
|
+
dmgs = Nokogiri::HTML(response.body).css('a').filter_map { |a| a['href'] }.grep(dmg_regex)
|
|
275
|
+
raise "No openvox-agent DMG for #{arch} found at #{url}" if dmgs.empty?
|
|
276
|
+
|
|
277
|
+
dmg = dmgs.max_by { |file| Gem::Version.new(file.match(dmg_regex).captures.join('.')) }
|
|
278
|
+
version, release = dmg.match(dmg_regex).captures
|
|
279
|
+
host.generic_install_dmg("#{url}#{dmg}", "openvox-agent-#{version}", "openvox-agent-#{version}-#{release}-installer.pkg")
|
|
280
|
+
end
|
|
253
281
|
end
|
|
254
282
|
end
|
|
@@ -3,12 +3,201 @@
|
|
|
3
3
|
require 'spec_helper'
|
|
4
4
|
|
|
5
5
|
describe BeakerPuppetHelpers::InstallUtils do
|
|
6
|
+
describe '.implementation_from_collection' do
|
|
7
|
+
{
|
|
8
|
+
'none' => 'puppet',
|
|
9
|
+
'puppet' => 'puppet',
|
|
10
|
+
'puppet8' => 'puppet',
|
|
11
|
+
'openvox' => 'openvox',
|
|
12
|
+
'openvox9' => 'openvox',
|
|
13
|
+
}.each do |collection, implementation|
|
|
14
|
+
it "returns #{implementation} for the #{collection} collection" do
|
|
15
|
+
expect(described_class.implementation_from_collection(collection)).to eq(implementation)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
describe '.package_name' do
|
|
21
|
+
let(:host) { instance_double(Beaker::Host) }
|
|
22
|
+
let(:packaging_platform) { Beaker::Platform.new(platform) }
|
|
23
|
+
|
|
24
|
+
before { allow(host).to receive(:[]).with('packaging_platform').and_return(packaging_platform) }
|
|
25
|
+
|
|
26
|
+
context 'with EL 9 platform' do
|
|
27
|
+
let(:platform) { 'el-9-x86_64' }
|
|
28
|
+
|
|
29
|
+
it 'returns openvox-agent for the openvox implementation' do
|
|
30
|
+
expect(described_class.package_name(host, implementation: 'openvox')).to eq('openvox-agent')
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
it 'returns puppet-agent for the puppet implementation with prefer_aio true' do
|
|
34
|
+
expect(described_class.package_name(host, prefer_aio: true, implementation: 'puppet')).to eq('puppet-agent')
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
it 'returns puppet for the puppet implementation with prefer_aio false' do
|
|
38
|
+
expect(described_class.package_name(host, prefer_aio: false, implementation: 'puppet')).to eq('puppet')
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
it 'returns puppet for the none implementation with prefer_aio true' do
|
|
42
|
+
expect(described_class.package_name(host, prefer_aio: true, implementation: 'none')).to eq('puppet')
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
it 'raises an error naming an unknown implementation' do
|
|
46
|
+
expect { described_class.package_name(host, implementation: 'foo') }.to raise_error(StandardError, "Unknown requirement 'foo'")
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
context 'with Debian 12 platform' do
|
|
51
|
+
let(:platform) { 'debian-12-amd64' }
|
|
52
|
+
|
|
53
|
+
it 'returns puppet-agent for the puppet implementation with prefer_aio false' do
|
|
54
|
+
expect(described_class.package_name(host, prefer_aio: false, implementation: 'puppet')).to eq('puppet-agent')
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
describe '.collection2packagename' do
|
|
60
|
+
let(:host) { instance_double(Beaker::Host) }
|
|
61
|
+
let(:packaging_platform) { Beaker::Platform.new(platform) }
|
|
62
|
+
|
|
63
|
+
before { allow(host).to receive(:[]).with('packaging_platform').and_return(packaging_platform) }
|
|
64
|
+
|
|
65
|
+
context 'with Debian 11 platform' do
|
|
66
|
+
let(:platform) { 'debian-11-amd64' }
|
|
67
|
+
|
|
68
|
+
it 'returns openvox-agent for the openvox9 collection' do
|
|
69
|
+
expect(described_class.collection2packagename(host, 'openvox9')).to eq('openvox-agent')
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
it 'returns the AIO package puppet-agent for the puppet8 collection' do
|
|
73
|
+
expect(described_class.collection2packagename(host, 'puppet8')).to eq('puppet-agent')
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
it 'returns the distribution package puppet for the puppet8 collection with prefer_aio false' do
|
|
77
|
+
expect(described_class.collection2packagename(host, 'puppet8', prefer_aio: false)).to eq('puppet')
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
it 'returns the distribution package puppet for the none collection' do
|
|
81
|
+
expect(described_class.collection2packagename(host, 'none')).to eq('puppet')
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
context 'with Debian 12 platform' do
|
|
86
|
+
let(:platform) { 'debian-12-amd64' }
|
|
87
|
+
|
|
88
|
+
it 'returns the distribution package puppet-agent for the none collection' do
|
|
89
|
+
expect(described_class.collection2packagename(host, 'none')).to eq('puppet-agent')
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
describe '.puppet_package_name' do
|
|
95
|
+
let(:host) { instance_double(Beaker::Host) }
|
|
96
|
+
let(:packaging_platform) { Beaker::Platform.new(platform) }
|
|
97
|
+
|
|
98
|
+
before { allow(host).to receive(:[]).with('packaging_platform').and_return(packaging_platform) }
|
|
99
|
+
|
|
100
|
+
{
|
|
101
|
+
'debian-11-amd64' => %w[puppet-agent puppet],
|
|
102
|
+
'debian-12-amd64' => %w[puppet-agent puppet-agent],
|
|
103
|
+
'el-9-x86_64' => %w[puppet-agent puppet],
|
|
104
|
+
'fedora-44-x86_64' => %w[puppet-agent puppet],
|
|
105
|
+
'sles-15-x86_64' => %w[puppet-agent puppet],
|
|
106
|
+
'freebsd-14-amd64' => %w[sysutils/puppet8 sysutils/puppet8],
|
|
107
|
+
'ubuntu-22.04-amd64' => %w[puppet-agent puppet],
|
|
108
|
+
'ubuntu-24.04-amd64' => %w[puppet-agent puppet-agent],
|
|
109
|
+
'ubuntu-2404-amd64' => %w[puppet-agent puppet-agent],
|
|
110
|
+
'archlinux-rolling-x64' => %w[puppet puppet],
|
|
111
|
+
}.each do |platform_name, (aio_package, os_package)|
|
|
112
|
+
context "with #{platform_name} platform" do
|
|
113
|
+
let(:platform) { platform_name }
|
|
114
|
+
|
|
115
|
+
it "returns #{aio_package} with prefer_aio true" do
|
|
116
|
+
expect(described_class.puppet_package_name(host, prefer_aio: true)).to eq(aio_package)
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
it "returns #{os_package} with prefer_aio false" do
|
|
120
|
+
expect(described_class.puppet_package_name(host, prefer_aio: false)).to eq(os_package)
|
|
121
|
+
end
|
|
122
|
+
end
|
|
123
|
+
end
|
|
124
|
+
end
|
|
125
|
+
|
|
6
126
|
describe '.install_puppet_release_repo_on' do
|
|
7
127
|
let(:host) { instance_double(Beaker::Host) }
|
|
8
128
|
let(:packaging_platform) { Beaker::Platform.new(platform) }
|
|
9
129
|
|
|
10
130
|
before { allow(host).to receive(:[]).with('packaging_platform').and_return(packaging_platform) }
|
|
11
131
|
|
|
132
|
+
context 'with the openvox9 collection' do
|
|
133
|
+
subject(:install_puppet_release_repo_on) { described_class.install_puppet_release_repo_on(host, 'openvox9') }
|
|
134
|
+
|
|
135
|
+
context 'with EL 10 platform' do
|
|
136
|
+
let(:platform) { 'el-10-x86_64' }
|
|
137
|
+
|
|
138
|
+
it 'installs from the OpenVox yum url' do
|
|
139
|
+
expect(host).to receive(:install_package).with('https://yum.voxpupuli.org/openvox9-release-el-10.noarch.rpm')
|
|
140
|
+
|
|
141
|
+
install_puppet_release_repo_on
|
|
142
|
+
end
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
context 'with SLES 15 platform' do
|
|
146
|
+
let(:platform) { 'sles-15-x86_64' }
|
|
147
|
+
|
|
148
|
+
it 'imports the OpenVox signing key and installs from the OpenVox yum url' do
|
|
149
|
+
expect(host).to receive(:install_package).with('https://yum.voxpupuli.org/openvox9-release-sles-15.noarch.rpm')
|
|
150
|
+
|
|
151
|
+
expect(described_class).to receive(:wget_on).with(host, 'https://yum.voxpupuli.org/GPG-KEY-openvox.pub').and_yield('openvox.pub').once
|
|
152
|
+
expect(Beaker::Command).to receive(:new).with("rpm --import 'openvox.pub'").and_return("rpm --import 'openvox.pub'").once
|
|
153
|
+
expect(host).to receive(:exec).with("rpm --import 'openvox.pub'").once
|
|
154
|
+
|
|
155
|
+
install_puppet_release_repo_on
|
|
156
|
+
end
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
{
|
|
160
|
+
'debian-13-amd64' => 'openvox9-release-debian13.deb',
|
|
161
|
+
'ubuntu-26.04-amd64' => 'openvox9-release-ubuntu26.04.deb',
|
|
162
|
+
}.each do |platform_name, package_file|
|
|
163
|
+
context "with #{platform_name} platform" do
|
|
164
|
+
let(:platform) { platform_name }
|
|
165
|
+
|
|
166
|
+
it "installs #{package_file}, runs apt-get update and adds /opt/puppetlabs/bin to PATH" do
|
|
167
|
+
expect(described_class).to receive(:wget_on).with(host, "https://apt.voxpupuli.org/#{package_file}").and_yield('filename.deb')
|
|
168
|
+
expect(host).to receive(:install_package).with('filename.deb')
|
|
169
|
+
expect(Beaker::Command).to receive(:new).with('apt-get update').and_return('apt-get update')
|
|
170
|
+
expect(host).to receive(:exec).with('apt-get update')
|
|
171
|
+
expect(host).to receive(:add_env_var).with('PATH', '/opt/puppetlabs/bin')
|
|
172
|
+
|
|
173
|
+
install_puppet_release_repo_on
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
context 'with Arch Linux platform' do
|
|
179
|
+
let(:platform) { 'archlinux-rolling-x64' }
|
|
180
|
+
|
|
181
|
+
it 'raises an error that the platform has no repository installation step' do
|
|
182
|
+
expect { install_puppet_release_repo_on }.to raise_error(RuntimeError, 'No repository installation step for archlinux yet...')
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
context 'with the puppet8 collection' do
|
|
188
|
+
subject(:install_puppet_release_repo_on) { described_class.install_puppet_release_repo_on(host, 'puppet8') }
|
|
189
|
+
|
|
190
|
+
context 'with EL 9 platform' do
|
|
191
|
+
let(:platform) { 'el-9-x86_64' }
|
|
192
|
+
|
|
193
|
+
it 'installs from the Perforce yum url for the puppet8 collection' do
|
|
194
|
+
expect(host).to receive(:install_package).with('https://yum.puppet.com/puppet8-release-el-9.noarch.rpm')
|
|
195
|
+
|
|
196
|
+
install_puppet_release_repo_on
|
|
197
|
+
end
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
12
201
|
context 'with default options' do
|
|
13
202
|
subject(:install_puppet_release_repo_on) { described_class.install_puppet_release_repo_on(host) }
|
|
14
203
|
|
|
@@ -67,4 +256,60 @@ describe BeakerPuppetHelpers::InstallUtils do
|
|
|
67
256
|
end
|
|
68
257
|
end
|
|
69
258
|
end
|
|
259
|
+
|
|
260
|
+
describe '.install_openvox_agent_dmg_on' do
|
|
261
|
+
subject(:install_openvox_agent_dmg_on) { described_class.install_openvox_agent_dmg_on(host, 'openvox9') }
|
|
262
|
+
|
|
263
|
+
let(:host) { instance_double(Mac::Host) }
|
|
264
|
+
let(:url) { 'https://downloads.voxpupuli.org/mac/openvox9/' }
|
|
265
|
+
let(:files) do
|
|
266
|
+
%w[
|
|
267
|
+
openbolt-9.0.0-1.macos.all.arm64.dmg
|
|
268
|
+
openvox-agent-9.0.0~rc1-1.macos.all.arm64.dmg
|
|
269
|
+
openvox-agent-9.2.1-1.macos.all.arm64.dmg
|
|
270
|
+
openvox-agent-9.9.0-1.macos.all.arm64.dmg
|
|
271
|
+
openvox-agent-9.9.0-2.macos.all.arm64.dmg
|
|
272
|
+
openvox-agent-9.9.0-1.macos.all.x86_64.dmg
|
|
273
|
+
openvox-agent-9.10.0-1.macos.all.x86_64.dmg
|
|
274
|
+
]
|
|
275
|
+
end
|
|
276
|
+
let(:index_html) { "<html><body>#{files.map { |file| %(<a href="#{file}">#{file}</a>) }.join}</body></html>" }
|
|
277
|
+
|
|
278
|
+
before do
|
|
279
|
+
allow(host).to receive(:[]).with('platform').and_return(Beaker::Platform.new(platform))
|
|
280
|
+
allow(Net::HTTP).to receive(:get_response).with(URI.parse(url))
|
|
281
|
+
.and_return(instance_double(Net::HTTPOK, is_a?: true, body: index_html))
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
context 'with an arm64 host' do
|
|
285
|
+
let(:platform) { 'osx-15-arm64' }
|
|
286
|
+
|
|
287
|
+
it 'installs the newest release and build for its architecture' do
|
|
288
|
+
expect(host).to receive(:generic_install_dmg).with("#{url}openvox-agent-9.9.0-2.macos.all.arm64.dmg",
|
|
289
|
+
'openvox-agent-9.9.0', 'openvox-agent-9.9.0-2-installer.pkg')
|
|
290
|
+
|
|
291
|
+
install_openvox_agent_dmg_on
|
|
292
|
+
end
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
context 'with an x86_64 host' do
|
|
296
|
+
let(:platform) { 'osx-26-x86_64' }
|
|
297
|
+
|
|
298
|
+
it 'compares versions by number' do
|
|
299
|
+
expect(host).to receive(:generic_install_dmg).with("#{url}openvox-agent-9.10.0-1.macos.all.x86_64.dmg",
|
|
300
|
+
'openvox-agent-9.10.0', 'openvox-agent-9.10.0-1-installer.pkg')
|
|
301
|
+
|
|
302
|
+
install_openvox_agent_dmg_on
|
|
303
|
+
end
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
context 'when the collection has no DMG for the architecture' do
|
|
307
|
+
let(:platform) { 'osx-15-arm64' }
|
|
308
|
+
let(:files) { %w[openvox-agent-9.9.0-1.macos.all.x86_64.dmg] }
|
|
309
|
+
|
|
310
|
+
it 'raises' do
|
|
311
|
+
expect { install_openvox_agent_dmg_on }.to raise_error(RuntimeError, "No openvox-agent DMG for arm64 found at #{url}")
|
|
312
|
+
end
|
|
313
|
+
end
|
|
314
|
+
end
|
|
70
315
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker_puppet_helpers
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vox Pupuli
|
|
@@ -89,14 +89,14 @@ dependencies:
|
|
|
89
89
|
requirements:
|
|
90
90
|
- - "~>"
|
|
91
91
|
- !ruby/object:Gem::Version
|
|
92
|
-
version: 5.
|
|
92
|
+
version: 5.2.0
|
|
93
93
|
type: :development
|
|
94
94
|
prerelease: false
|
|
95
95
|
version_requirements: !ruby/object:Gem::Requirement
|
|
96
96
|
requirements:
|
|
97
97
|
- - "~>"
|
|
98
98
|
- !ruby/object:Gem::Version
|
|
99
|
-
version: 5.
|
|
99
|
+
version: 5.2.0
|
|
100
100
|
description: For use for the Beaker acceptance testing tool
|
|
101
101
|
email:
|
|
102
102
|
- voxpupuli@groups.io
|
|
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
154
154
|
- !ruby/object:Gem::Version
|
|
155
155
|
version: '0'
|
|
156
156
|
requirements: []
|
|
157
|
-
rubygems_version: 4.0.
|
|
157
|
+
rubygems_version: 4.0.20
|
|
158
158
|
specification_version: 4
|
|
159
159
|
summary: Beaker's Puppet DSL Extension Helpers
|
|
160
160
|
test_files: []
|