beaker-pe 3.6.2 → 3.6.3

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: 82fe681f6a5d8f304089ca2dca03e4e9080cbf502b0665e072103dac9e9e4aa9
4
- data.tar.gz: 22f5065db00df1654fdc261de80272b0a3719db9fc6e2027b0f92d3e300f90e8
3
+ metadata.gz: 03bf3c005114d8ea4bc9e8a2f10b1d25afcd1e3919d09a0a079e925ef35b51ff
4
+ data.tar.gz: c5507077282d107fdab48081b9736fcfb9a9af8ca600faf316e76fc26ba16067
5
5
  SHA512:
6
- metadata.gz: bc742e9c75813510b30970550c55ec34c56727e1209e2c8a71ea69c89ff1fe1a67e4abd1e4f98ae39ed5d01140f4ad04b6afd795ed264f9c3fd840c749c9ab9a
7
- data.tar.gz: 20d4a84d869295af9703cc72e0c2f3f277e8735f0380337f13ea1be23c51a081c6171ae73c5c4edfee98899327490325ed4f5252513b331ff819b968e05c4066
6
+ metadata.gz: efb6f1688532acf22b13e6978d4b5cc65df15b2c1e781c886a701deb42206d0985d3bd1af74ddcda09377700777fb83c8278971ef567f682aee71478c278c918
7
+ data.tar.gz: c9a0843cf5ee0dffa774db34b254214ffc0df72bc54bda36afb4ce89650e6060f481729721f43f67bd2396b0700f61f54d92595114b9314c51205a47a5693708
@@ -2084,7 +2084,7 @@ EOM
2084
2084
  execute_installer_cmd(master, opts)
2085
2085
  rescue Beaker::Host::CommandFailure => e
2086
2086
  unless is_expected_pe_postgres_failure?(master)
2087
- raise "Install on master failed in an unexpected manner"
2087
+ raise "Install on master failed in an unexpected manner: #{e.message}"
2088
2088
  end
2089
2089
  end
2090
2090
  end
@@ -2132,14 +2132,23 @@ EOM
2132
2132
  def is_expected_pe_postgres_failure?(host)
2133
2133
  installer_log_dir = '/var/log/puppetlabs/installer'
2134
2134
  latest_installer_log_file = on(host, "ls -1t #{installer_log_dir} | head -n1").stdout.chomp
2135
- # As of PE Irving (PE 2018.1.x), these are the only two expected errors
2135
+ # The initial master install pass runs before pe-postgres is fully
2136
+ # up, so it's expected to fail: the RBAC/console database isn't
2137
+ # reachable yet, and depending on timing any core PE service
2138
+ # (pe-console-services, pe-puppetdb, pe-puppetserver, etc.) may
2139
+ # not (re)start before this pass' own timeouts trip. All of these
2140
+ # are recoverable by the later "Install/Upgrade postgres service"
2141
+ # and "Finish install/upgrade" steps, so they shouldn't fail the
2142
+ # test. Match the service-startup failure class generically
2143
+ # rather than enumerating individual services/ports here.
2136
2144
  allowed_errors = ["The operation could not be completed because RBACs database has not been initialized",
2137
2145
  "Timeout waiting for the database pool to become ready",
2138
- "Systemd restart for pe-console-services failed",
2139
- "Execution of.*service pe-console-services.*: Reload timed out after 120 seconds"]
2146
+ "Systemd (start|restart) for pe-\\S+ failed",
2147
+ "Execution of.*service pe-console-services.*: Reload timed out after 120 seconds",
2148
+ "Connection refused"]
2140
2149
 
2141
2150
  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)
2151
+ if(on(host, "grep -E '#{error}' #{installer_log_dir}/#{latest_installer_log_file}", :acceptable_exit_codes => [0,1]).exit_code == 0)
2143
2152
  return true
2144
2153
  end
2145
2154
  end
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '3.6.2'
6
+ STRING = '3.6.3'
7
7
  end
8
8
 
9
9
  end
@@ -1305,76 +1305,61 @@ describe ClassMixedWithDSLInstallUtils do
1305
1305
  describe 'is_expected_pe_postgres_failure? method' do
1306
1306
  let(:mono_master) { make_host('mono_master', :pe_ver => '2017.2', :platform => 'ubuntu-16.04-x86_64', :roles => ['master', 'database', 'dashboard']) }
1307
1307
 
1308
- it 'will return true if it is the RBAC database string matcher' do
1308
+ let(:zero_exit_code_mock) do
1309
+ mock = Object.new
1310
+ allow(mock).to receive(:exit_code).and_return(0)
1311
+ mock
1312
+ end
1313
+ let(:one_exit_code_mock) do
1314
+ mock = Object.new
1315
+ allow(mock).to receive(:exit_code).and_return(1)
1316
+ mock
1317
+ end
1318
+
1319
+ def stub_installer_log_greps(all_but: nil)
1309
1320
  @installer_log_file_name = Beaker::Result.new( {}, '' )
1310
1321
  @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
1322
  allow(subject).to receive(:on).with(mono_master, "ls -1t /var/log/puppetlabs/installer | head -n1").and_return(@installer_log_file_name)
1316
- 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(zero_exit_code_mock)
1317
- 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)
1318
- 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)
1319
- 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)
1323
+
1324
+ patterns = ["The operation could not be completed because RBACs database has not been initialized",
1325
+ "Timeout waiting for the database pool to become ready",
1326
+ "Systemd (start|restart) for pe-\\S+ failed",
1327
+ "Execution of.*service pe-console-services.*: Reload timed out after 120 seconds",
1328
+ "Connection refused"]
1329
+
1330
+ patterns.each do |pattern|
1331
+ result = (pattern == all_but) ? zero_exit_code_mock : one_exit_code_mock
1332
+ 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)
1333
+ end
1334
+ end
1335
+
1336
+ it 'will return true if it is the RBAC database string matcher' do
1337
+ stub_installer_log_greps(all_but: "The operation could not be completed because RBACs database has not been initialized")
1320
1338
  expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
1321
1339
  end
1322
1340
 
1323
1341
  it 'will return true if it is the database pool timeout string matcher' do
1324
- @installer_log_file_name = Beaker::Result.new( {}, '' )
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)
1342
+ stub_installer_log_greps(all_but: "Timeout waiting for the database pool to become ready")
1335
1343
  expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
1336
1344
  end
1337
1345
 
1338
- it 'will return true if it is the systemd restart of cosnole-services failure matcher' do
1339
- @installer_log_file_name = Beaker::Result.new( {}, '' )
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)
1346
+ 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
1347
+ stub_installer_log_greps(all_but: "Systemd (start|restart) for pe-\\S+ failed")
1350
1348
  expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
1351
1349
  end
1352
1350
 
1353
1351
  it 'will return true if it is the console-services reload timeout string matcher' do
1354
- @installer_log_file_name = Beaker::Result.new( {}, '' )
1355
- @installer_log_file_name.stdout = "installer_log_name"
1356
- zero_exit_code_mock = Object.new
1357
- allow(zero_exit_code_mock).to receive(:exit_code).and_return(0)
1358
- one_exit_code_mock = Object.new
1359
- allow(one_exit_code_mock).to receive(:exit_code).and_return(1)
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)
1352
+ stub_installer_log_greps(all_but: "Execution of.*service pe-console-services.*: Reload timed out after 120 seconds")
1353
+ expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
1354
+ end
1355
+
1356
+ it 'will return true if it is the connection refused matcher' do
1357
+ stub_installer_log_greps(all_but: "Connection refused")
1365
1358
  expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(true)
1366
1359
  end
1367
1360
 
1368
1361
  it 'will return false if no error messages are matched' do
1369
- @installer_log_file_name = Beaker::Result.new( {}, '' )
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)
1362
+ stub_installer_log_greps
1378
1363
  expect(subject.is_expected_pe_postgres_failure?(mono_master)). to eq(false)
1379
1364
  end
1380
1365
  end
@@ -1458,7 +1443,7 @@ describe ClassMixedWithDSLInstallUtils do
1458
1443
  expect(subject).to receive(:execute_installer_cmd).with(mono_master, {}).and_raise(Beaker::Host::CommandFailure).once.ordered
1459
1444
  allow(subject).to receive(:is_expected_pe_postgres_failure?).and_return(false)
1460
1445
 
1461
- expect{ subject.do_install_pe_with_pe_managed_external_postgres([mono_master, pe_postgres, agent], {}) }.to raise_error(RuntimeError, "Install on master failed in an unexpected manner")
1446
+ 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
1447
  end
1463
1448
 
1464
1449
  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.2
4
+ version: 3.6.3
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.10
323
+ rubygems_version: 4.0.16
324
324
  specification_version: 4
325
325
  summary: Beaker PE DSL Helpers!
326
326
  test_files: []