beaker-pe 3.6.2 → 3.6.4
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/CHANGELOG.md +24 -0
- data/lib/beaker-pe/install/pe_utils.rb +53 -12
- data/lib/beaker-pe/version.rb +1 -1
- data/spec/beaker-pe/install/pe_utils_spec.rb +105 -53
- 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: 17f39948dbc58217035cd4e93469070ac5f35309dc2078fb3995e7edc6558d7f
|
|
4
|
+
data.tar.gz: 65d1131709c2e886a82dc29f74a7f5a9907f89b2da0fc799233f325954069193
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bef219e4d18d83b1663764cb203cdeb1f857a889d602e4b22d91e1a47c9d96019a169bc8265cf67d485f3082bd67704e7454bc2caf5dff8548bf333be7fcda23
|
|
7
|
+
data.tar.gz: 420a8f53c44f65636413a31b292b8f510369a740fa619c9c163143e4af02f0de115c7fca9c9bae7cf29d4a63a94a103cf8fd8d26cc4048e6202a4292a1194248
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.6.4](https://github.com/puppetlabs/beaker-pe/tree/3.6.4) (2026-07-23)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.3...3.6.4)
|
|
6
|
+
|
|
7
|
+
**Fixed bugs:**
|
|
8
|
+
|
|
9
|
+
- [PE-41009]: Fall back to agent-downloads when promoted agent is missing from the public mirror [#306](https://github.com/puppetlabs/beaker-pe/pull/306) ([Magisus](https://github.com/Magisus))
|
|
10
|
+
|
|
11
|
+
## [3.6.3](https://github.com/puppetlabs/beaker-pe/tree/3.6.3) (2026-07-16)
|
|
12
|
+
|
|
13
|
+
[Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.2...3.6.3)
|
|
14
|
+
|
|
15
|
+
**Fixed bugs:**
|
|
16
|
+
|
|
17
|
+
- [PE-45082]: Broaden is_expected_pe_postgres_failure? allowlist [#303](https://github.com/puppetlabs/beaker-pe/pull/303) ([steveax](https://github.com/steveax))
|
|
18
|
+
|
|
19
|
+
## [3.6.2](https://github.com/puppetlabs/beaker-pe/tree/3.6.2) (2026-06-05)
|
|
20
|
+
|
|
21
|
+
[Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.1...3.6.2)
|
|
22
|
+
|
|
23
|
+
**Fixed bugs:**
|
|
24
|
+
|
|
25
|
+
- Add waitforlock flag to second puppet runs to prevent lock collisions [#300](https://github.com/puppetlabs/beaker-pe/pull/300) ([jonathannewman](https://github.com/jonathannewman))
|
|
26
|
+
|
|
3
27
|
## [3.6.1](https://github.com/puppetlabs/beaker-pe/tree/3.6.1) (2025-11-21)
|
|
4
28
|
|
|
5
29
|
[Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.0...3.6.1)
|
|
@@ -43,6 +43,13 @@ module Beaker
|
|
|
43
43
|
NODE_CONF_PATH = "#{MEEP_DATA_DIR}/conf.d/nodes"
|
|
44
44
|
BEAKER_MEEP_TMP = "pe_conf"
|
|
45
45
|
|
|
46
|
+
# Base URL for promoted puppet-agent packages on the internal
|
|
47
|
+
# build-output host. Newer promoted agents (>= 8.11.0) are no longer
|
|
48
|
+
# published to the public pm.puppet.com / S3 mirror; el/windows installs
|
|
49
|
+
# fall back here. This is the same host the sles-11 and
|
|
50
|
+
# solaris-10-sparc install paths already use.
|
|
51
|
+
AGENT_DOWNLOADS_URL = 'http://agent-downloads.delivery.puppetlabs.net/puppet-agent'.freeze
|
|
52
|
+
|
|
46
53
|
# @!macro [new] common_opts
|
|
47
54
|
# @param [Hash{Symbol=>String}] opts Options to alter execution.
|
|
48
55
|
# @option opts [Boolean] :silent (false) Do not produce log output
|
|
@@ -332,7 +339,7 @@ module Beaker
|
|
|
332
339
|
# @api private
|
|
333
340
|
def agent_package_common_vars(puppet_agent_ver, opts)
|
|
334
341
|
{
|
|
335
|
-
agent_downloads_url:
|
|
342
|
+
agent_downloads_url: AGENT_DOWNLOADS_URL,
|
|
336
343
|
master_aio_version: puppet_fact(master, 'aio_agent_build'),
|
|
337
344
|
stream: opts[:puppet_collection] || "puppet#{puppet_agent_ver[0]}"
|
|
338
345
|
}
|
|
@@ -1113,6 +1120,36 @@ NOASK
|
|
|
1113
1120
|
raise RuntimeError("#{host.class} not one of Beaker::(Windows|Mac|Unix)::Host")
|
|
1114
1121
|
end
|
|
1115
1122
|
|
|
1123
|
+
# Fetch a promoted puppet-agent package into copy_dir_local. Tries the
|
|
1124
|
+
# primary (pm.puppet.com/S3) promoted mirror first; if that returns a
|
|
1125
|
+
# 404 — newer agents (>= 8.11.0) are no longer published there — fall
|
|
1126
|
+
# back to the internal agent-downloads host. Any non-404 failure is
|
|
1127
|
+
# re-raised unchanged.
|
|
1128
|
+
#
|
|
1129
|
+
# @param [String] release_path Primary base URL, already including the
|
|
1130
|
+
# /v2/agent/<pe_ver>/<agent_ver>/repos suffix and release_path_end
|
|
1131
|
+
# @param [String] release_path_end Platform suffix ('' unix, '/windows')
|
|
1132
|
+
# @param [String] download_file The package file name
|
|
1133
|
+
# @param [String] copy_dir_local Local destination directory
|
|
1134
|
+
# @param [String] agent_version The puppet-agent version being installed
|
|
1135
|
+
# @api private
|
|
1136
|
+
def fetch_promoted_agent_with_fallback(release_path, release_path_end, download_file, copy_dir_local, agent_version)
|
|
1137
|
+
download_uri = URI.parse("#{release_path}/#{download_file}")
|
|
1138
|
+
redirect = Net::HTTP.start(download_uri.host) { |http| http.head(download_uri.path).response['location'] }
|
|
1139
|
+
primary_base = redirect ? redirect.chomp("/#{download_file}") : release_path
|
|
1140
|
+
|
|
1141
|
+
begin
|
|
1142
|
+
fetch_http_file(primary_base, download_file, copy_dir_local)
|
|
1143
|
+
rescue => e
|
|
1144
|
+
raise unless e.message.include?('404')
|
|
1145
|
+
|
|
1146
|
+
fallback_base = "#{AGENT_DOWNLOADS_URL}/#{agent_version}/repos#{release_path_end}"
|
|
1147
|
+
logger.warn("Promoted puppet-agent not found at #{primary_base}/#{download_file} (#{e.message}); " \
|
|
1148
|
+
"falling back to #{fallback_base}/#{download_file}")
|
|
1149
|
+
fetch_http_file(fallback_base, download_file, copy_dir_local)
|
|
1150
|
+
end
|
|
1151
|
+
end
|
|
1152
|
+
|
|
1116
1153
|
# Install shared repo of the puppet-agent on the given host(s). Downloaded from
|
|
1117
1154
|
# location of the form PE_PROMOTED_BUILDS_URL/PE_VER/puppet-agent/AGENT_VERSION/repo
|
|
1118
1155
|
#
|
|
@@ -1159,12 +1196,7 @@ NOASK
|
|
|
1159
1196
|
|
|
1160
1197
|
onhost_copied_download = File.join(onhost_copy_base, download_file)
|
|
1161
1198
|
onhost_copied_file = File.join(onhost_copy_base, release_file)
|
|
1162
|
-
|
|
1163
|
-
if (redirect = Net::HTTP.start(download_uri.host) { |http| http.head(download_uri.path).response['location'] })
|
|
1164
|
-
fetch_http_file(redirect.chomp("/#{download_file}"), download_file, copy_dir_local)
|
|
1165
|
-
else
|
|
1166
|
-
fetch_http_file(release_path, download_file, copy_dir_local)
|
|
1167
|
-
end
|
|
1199
|
+
fetch_promoted_agent_with_fallback(release_path, release_path_end, download_file, copy_dir_local, opts[:puppet_agent_version])
|
|
1168
1200
|
scp_to host, File.join(copy_dir_local, download_file), onhost_copy_base
|
|
1169
1201
|
|
|
1170
1202
|
if variant == 'windows'
|
|
@@ -2084,7 +2116,7 @@ EOM
|
|
|
2084
2116
|
execute_installer_cmd(master, opts)
|
|
2085
2117
|
rescue Beaker::Host::CommandFailure => e
|
|
2086
2118
|
unless is_expected_pe_postgres_failure?(master)
|
|
2087
|
-
raise "Install on master failed in an unexpected manner"
|
|
2119
|
+
raise "Install on master failed in an unexpected manner: #{e.message}"
|
|
2088
2120
|
end
|
|
2089
2121
|
end
|
|
2090
2122
|
end
|
|
@@ -2132,14 +2164,23 @@ EOM
|
|
|
2132
2164
|
def is_expected_pe_postgres_failure?(host)
|
|
2133
2165
|
installer_log_dir = '/var/log/puppetlabs/installer'
|
|
2134
2166
|
latest_installer_log_file = on(host, "ls -1t #{installer_log_dir} | head -n1").stdout.chomp
|
|
2135
|
-
#
|
|
2167
|
+
# The initial master install pass runs before pe-postgres is fully
|
|
2168
|
+
# up, so it's expected to fail: the RBAC/console database isn't
|
|
2169
|
+
# reachable yet, and depending on timing any core PE service
|
|
2170
|
+
# (pe-console-services, pe-puppetdb, pe-puppetserver, etc.) may
|
|
2171
|
+
# not (re)start before this pass' own timeouts trip. All of these
|
|
2172
|
+
# are recoverable by the later "Install/Upgrade postgres service"
|
|
2173
|
+
# and "Finish install/upgrade" steps, so they shouldn't fail the
|
|
2174
|
+
# test. Match the service-startup failure class generically
|
|
2175
|
+
# rather than enumerating individual services/ports here.
|
|
2136
2176
|
allowed_errors = ["The operation could not be completed because RBACs database has not been initialized",
|
|
2137
2177
|
"Timeout waiting for the database pool to become ready",
|
|
2138
|
-
"Systemd restart for pe
|
|
2139
|
-
"Execution of.*service pe-console-services.*: Reload timed out after 120 seconds"
|
|
2178
|
+
"Systemd (start|restart) for pe-\\S+ failed",
|
|
2179
|
+
"Execution of.*service pe-console-services.*: Reload timed out after 120 seconds",
|
|
2180
|
+
"Connection refused"]
|
|
2140
2181
|
|
|
2141
2182
|
allowed_errors.each do |error|
|
|
2142
|
-
if(on(host, "grep '#{error}' #{installer_log_dir}/#{latest_installer_log_file}", :acceptable_exit_codes => [0,1]).exit_code == 0)
|
|
2183
|
+
if(on(host, "grep -E '#{error}' #{installer_log_dir}/#{latest_installer_log_file}", :acceptable_exit_codes => [0,1]).exit_code == 0)
|
|
2143
2184
|
return true
|
|
2144
2185
|
end
|
|
2145
2186
|
end
|
data/lib/beaker-pe/version.rb
CHANGED
|
@@ -106,6 +106,73 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
106
106
|
end
|
|
107
107
|
end
|
|
108
108
|
|
|
109
|
+
context 'AGENT_DOWNLOADS_URL' do
|
|
110
|
+
it 'points at the internal agent-downloads host' do
|
|
111
|
+
expect(Beaker::DSL::InstallUtils::PEUtils::AGENT_DOWNLOADS_URL)
|
|
112
|
+
.to eq('http://agent-downloads.delivery.puppetlabs.net/puppet-agent')
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
context '#fetch_promoted_agent_with_fallback' do
|
|
117
|
+
let(:download_file) { 'puppet-agent-el-8-x86_64.tar.gz' }
|
|
118
|
+
let(:release_path) { 'https://pm.puppet.com/v2/agent/2023.8.3/8.11.0/repos' }
|
|
119
|
+
let(:s3_base) { 'https://s3.amazonaws.com/puppet-agents/puppet-agent/8.11.0/repos' }
|
|
120
|
+
let(:agent_dl_base) { 'http://agent-downloads.delivery.puppetlabs.net/puppet-agent/8.11.0/repos' }
|
|
121
|
+
|
|
122
|
+
before do
|
|
123
|
+
# HEAD on the pm.puppet.com URL resolves (via 302) to the S3 promoted mirror.
|
|
124
|
+
allow(Net::HTTP).to receive(:start).with('pm.puppet.com')
|
|
125
|
+
.and_return("#{s3_base}/#{download_file}")
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
it 'fetches from the primary mirror when the package is present' do
|
|
129
|
+
expect(subject).to receive(:fetch_http_file)
|
|
130
|
+
.with(s3_base, download_file, 'tmp/repo_configs/el')
|
|
131
|
+
expect(subject).not_to receive(:fetch_http_file)
|
|
132
|
+
.with(a_string_including('agent-downloads'), anything, anything)
|
|
133
|
+
|
|
134
|
+
subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
it 'falls back to agent-downloads on a 404' do
|
|
138
|
+
allow(subject).to receive(:fetch_http_file)
|
|
139
|
+
.with(s3_base, download_file, 'tmp/repo_configs/el')
|
|
140
|
+
.and_raise("Failed to fetch_remote_file '#{s3_base}/#{download_file}' (404 Not Found)")
|
|
141
|
+
expect(subject).to receive(:fetch_http_file)
|
|
142
|
+
.with(agent_dl_base, download_file, 'tmp/repo_configs/el')
|
|
143
|
+
|
|
144
|
+
subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
it 're-raises non-404 fetch errors without falling back' do
|
|
148
|
+
allow(subject).to receive(:fetch_http_file)
|
|
149
|
+
.with(s3_base, download_file, 'tmp/repo_configs/el')
|
|
150
|
+
.and_raise('Failed to fetch_remote_file (500 Server Error)')
|
|
151
|
+
expect(subject).not_to receive(:fetch_http_file)
|
|
152
|
+
.with(a_string_including('agent-downloads'), anything, anything)
|
|
153
|
+
|
|
154
|
+
expect {
|
|
155
|
+
subject.fetch_promoted_agent_with_fallback(release_path, '', download_file, 'tmp/repo_configs/el', '8.11.0')
|
|
156
|
+
}.to raise_error(/500/)
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
it 'preserves the /windows suffix in the fallback URL' do
|
|
160
|
+
win_file = 'puppet-agent-x64.msi'
|
|
161
|
+
win_release_path = 'https://pm.puppet.com/v2/agent/2023.8.3/8.11.0/repos/windows'
|
|
162
|
+
win_s3_base = "#{s3_base}/windows"
|
|
163
|
+
win_dl_base = "#{agent_dl_base}/windows"
|
|
164
|
+
allow(Net::HTTP).to receive(:start).with('pm.puppet.com')
|
|
165
|
+
.and_return("#{win_s3_base}/#{win_file}")
|
|
166
|
+
allow(subject).to receive(:fetch_http_file)
|
|
167
|
+
.with(win_s3_base, win_file, 'tmp/repo_configs/windows')
|
|
168
|
+
.and_raise("Failed to fetch_remote_file '#{win_s3_base}/#{win_file}' (404 Not Found)")
|
|
169
|
+
expect(subject).to receive(:fetch_http_file)
|
|
170
|
+
.with(win_dl_base, win_file, 'tmp/repo_configs/windows')
|
|
171
|
+
|
|
172
|
+
subject.fetch_promoted_agent_with_fallback(win_release_path, '/windows', win_file, 'tmp/repo_configs/windows', '8.11.0')
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
|
|
109
176
|
context '#prep_host_for_upgrade' do
|
|
110
177
|
|
|
111
178
|
it 'sets per host options before global options' do
|
|
@@ -1305,76 +1372,61 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1305
1372
|
describe 'is_expected_pe_postgres_failure? method' do
|
|
1306
1373
|
let(:mono_master) { make_host('mono_master', :pe_ver => '2017.2', :platform => 'ubuntu-16.04-x86_64', :roles => ['master', 'database', 'dashboard']) }
|
|
1307
1374
|
|
|
1308
|
-
|
|
1375
|
+
let(:zero_exit_code_mock) do
|
|
1376
|
+
mock = Object.new
|
|
1377
|
+
allow(mock).to receive(:exit_code).and_return(0)
|
|
1378
|
+
mock
|
|
1379
|
+
end
|
|
1380
|
+
let(:one_exit_code_mock) do
|
|
1381
|
+
mock = Object.new
|
|
1382
|
+
allow(mock).to receive(:exit_code).and_return(1)
|
|
1383
|
+
mock
|
|
1384
|
+
end
|
|
1385
|
+
|
|
1386
|
+
def stub_installer_log_greps(all_but: nil)
|
|
1309
1387
|
@installer_log_file_name = Beaker::Result.new( {}, '' )
|
|
1310
1388
|
@installer_log_file_name.stdout = "installer_log_name"
|
|
1311
|
-
zero_exit_code_mock = Object.new
|
|
1312
|
-
allow(zero_exit_code_mock).to receive(:exit_code).and_return(0)
|
|
1313
|
-
one_exit_code_mock = Object.new
|
|
1314
|
-
allow(one_exit_code_mock).to receive(:exit_code).and_return(1)
|
|
1315
1389
|
allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1390
|
+
|
|
1391
|
+
patterns = ["The operation could not be completed because RBACs database has not been initialized",
|
|
1392
|
+
"Timeout waiting for the database pool to become ready",
|
|
1393
|
+
"Systemd (start|restart) for pe-\\S+ failed",
|
|
1394
|
+
"Execution of.*service pe-console-services.*: Reload timed out after 120 seconds",
|
|
1395
|
+
"Connection refused"]
|
|
1396
|
+
|
|
1397
|
+
patterns.each do |pattern|
|
|
1398
|
+
result = (pattern == all_but) ? zero_exit_code_mock : one_exit_code_mock
|
|
1399
|
+
allow(subject).to receive(:on).with(mono_master, "grep -E '#{pattern}' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(result)
|
|
1400
|
+
end
|
|
1401
|
+
end
|
|
1402
|
+
|
|
1403
|
+
it 'will return true if it is the RBAC database string matcher' do
|
|
1404
|
+
stub_installer_log_greps(all_but: "The operation could not be completed because RBACs database has not been initialized")
|
|
1320
1405
|
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
|
|
1321
1406
|
end
|
|
1322
1407
|
|
|
1323
1408
|
it 'will return true if it is the database pool timeout string matcher' do
|
|
1324
|
-
|
|
1325
|
-
@installer_log_file_name.stdout = "installer_log_name"
|
|
1326
|
-
zero_exit_code_mock = Object.new
|
|
1327
|
-
allow(zero_exit_code_mock).to receive(:exit_code).and_return(0)
|
|
1328
|
-
one_exit_code_mock = Object.new
|
|
1329
|
-
allow(one_exit_code_mock).to receive(:exit_code).and_return(1)
|
|
1330
|
-
allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
|
|
1331
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'The operation could not be completed because RBACs database has not been initialized' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1332
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Timeout waiting for the database pool to become ready' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(zero_exit_code_mock)
|
|
1333
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Systemd restart for pe-console-services failed' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1334
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Execution of.*service pe-console-services.*: Reload timed out after 120 seconds' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1409
|
+
stub_installer_log_greps(all_but: "Timeout waiting for the database pool to become ready")
|
|
1335
1410
|
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
|
|
1336
1411
|
end
|
|
1337
1412
|
|
|
1338
|
-
it 'will return true if it is the systemd restart of
|
|
1339
|
-
|
|
1340
|
-
@installer_log_file_name.stdout = "installer_log_name"
|
|
1341
|
-
zero_exit_code_mock = Object.new
|
|
1342
|
-
allow(zero_exit_code_mock).to receive(:exit_code).and_return(0)
|
|
1343
|
-
one_exit_code_mock = Object.new
|
|
1344
|
-
allow(one_exit_code_mock).to receive(:exit_code).and_return(1)
|
|
1345
|
-
allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
|
|
1346
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'The operation could not be completed because RBACs database has not been initialized' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1347
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Timeout waiting for the database pool to become ready' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1348
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Systemd restart for pe-console-services failed' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(zero_exit_code_mock)
|
|
1349
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Execution of.*service pe-console-services.*: Reload timed out after 120 seconds' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1413
|
+
it 'will return true if it is the systemd start/restart of a pe-* service failure matcher (e.g. pe-console-services, pe-puppetdb, pe-puppetserver)' do
|
|
1414
|
+
stub_installer_log_greps(all_but: "Systemd (start|restart) for pe-\\S+ failed")
|
|
1350
1415
|
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
|
|
1351
1416
|
end
|
|
1352
1417
|
|
|
1353
1418
|
it 'will return true if it is the console-services reload timeout string matcher' do
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
|
|
1361
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'The operation could not be completed because RBACs database has not been initialized' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1362
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Timeout waiting for the database pool to become ready' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1363
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Systemd restart for pe-console-services failed' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1364
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Execution of.*service pe-console-services.*: Reload timed out after 120 seconds' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(zero_exit_code_mock)
|
|
1419
|
+
stub_installer_log_greps(all_but: "Execution of.*service pe-console-services.*: Reload timed out after 120 seconds")
|
|
1420
|
+
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
|
|
1421
|
+
end
|
|
1422
|
+
|
|
1423
|
+
it 'will return true if it is the connection refused matcher' do
|
|
1424
|
+
stub_installer_log_greps(all_but: "Connection refused")
|
|
1365
1425
|
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
|
|
1366
1426
|
end
|
|
1367
1427
|
|
|
1368
1428
|
it 'will return false if no error messages are matched' do
|
|
1369
|
-
|
|
1370
|
-
@installer_log_file_name.stdout = "installer_log_name"
|
|
1371
|
-
one_exit_code_mock = Object.new
|
|
1372
|
-
allow(one_exit_code_mock).to receive(:exit_code).and_return(1)
|
|
1373
|
-
allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
|
|
1374
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'The operation could not be completed because RBACs database has not been initialized' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1375
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Timeout waiting for the database pool to become ready' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1376
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Systemd restart for pe-console-services failed' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1377
|
-
allow(subject).to receive(:on).with(mono_master, "grep 'Execution of.*service pe-console-services.*: Reload timed out after 120 seconds' /var/log/puppetlabs/installer/installer_log_name", :acceptable_exit_codes=>[0, 1]).and_return(one_exit_code_mock)
|
|
1429
|
+
stub_installer_log_greps
|
|
1378
1430
|
expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(false)
|
|
1379
1431
|
end
|
|
1380
1432
|
end
|
|
@@ -1458,7 +1510,7 @@ describe ClassMixedWithDSLInstallUtils do
|
|
|
1458
1510
|
expect(subject).to receive(:execute_installer_cmd).with(mono_master, {}).and_raise(Beaker::Host::CommandFailure).once.ordered
|
|
1459
1511
|
allow(subject).to receive(:is_expected_pe_postgres_failure?).and_return(false)
|
|
1460
1512
|
|
|
1461
|
-
expect{ subject.do_install_pe_with_pe_managed_external_postgres([mono_master, pe_postgres, agent], {}) }.to raise_error(RuntimeError,
|
|
1513
|
+
expect{ subject.do_install_pe_with_pe_managed_external_postgres([mono_master, pe_postgres, agent], {}) }.to raise_error(RuntimeError, /\AInstall on master failed in an unexpected manner: /)
|
|
1462
1514
|
end
|
|
1463
1515
|
|
|
1464
1516
|
it 'will do a monolithic upgrade of PE with an external postgres that is managed by PE' do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: beaker-pe
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.6.
|
|
4
|
+
version: 3.6.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Puppetlabs
|
|
@@ -320,7 +320,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
320
320
|
- !ruby/object:Gem::Version
|
|
321
321
|
version: '0'
|
|
322
322
|
requirements: []
|
|
323
|
-
rubygems_version: 4.0.
|
|
323
|
+
rubygems_version: 4.0.16
|
|
324
324
|
specification_version: 4
|
|
325
325
|
summary: Beaker PE DSL Helpers!
|
|
326
326
|
test_files: []
|