beaker-pe 3.6.4 → 3.6.6

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: 17f39948dbc58217035cd4e93469070ac5f35309dc2078fb3995e7edc6558d7f
4
- data.tar.gz: 65d1131709c2e886a82dc29f74a7f5a9907f89b2da0fc799233f325954069193
3
+ metadata.gz: aa8b72f2297a472ddc6291dd99dba0607bee54af45ebf9599675aac36823ecc7
4
+ data.tar.gz: 8186462c53f80d68b4d0c19c46d1fafdb24bd4af604b18d2b40a3ca0820dbf23
5
5
  SHA512:
6
- metadata.gz: bef219e4d18d83b1663764cb203cdeb1f857a889d602e4b22d91e1a47c9d96019a169bc8265cf67d485f3082bd67704e7454bc2caf5dff8548bf333be7fcda23
7
- data.tar.gz: 420a8f53c44f65636413a31b292b8f510369a740fa619c9c163143e4af02f0de115c7fca9c9bae7cf29d4a63a94a103cf8fd8d26cc4048e6202a4292a1194248
6
+ metadata.gz: 723ce4a758aaa6cfd40b907ae7a6877349d6402393e445b9a9f147437d60db22d64d9ef29f795884f0f16a9b07c8cb566e9a9bcf50383cfd1819266a59ef0d6d
7
+ data.tar.gz: b862c17a232e7c30b7d5d623a0d947a0cf95c58554722f76cba6f5f23e5b60a224e30ba0ca04fa2f8058192b0ab46b831d101831fb894ea9270d745fe839d16e
data/CHANGELOG.md CHANGED
@@ -1,20 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.6.6](https://github.com/puppetlabs/beaker-pe/tree/3.6.6) (2026-08-12)
4
+
5
+ [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.5...3.6.6)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - \(PE-45827\) Prefer the ssl status endpoint for PuppetDB liveness validation [\#311](https://github.com/puppetlabs/beaker-pe/pull/311) ([jonathannewman](https://github.com/jonathannewman))
10
+
11
+ ## [3.6.5](https://github.com/puppetlabs/beaker-pe/tree/3.6.5) (2026-07-30)
12
+
13
+ [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.4...3.6.5)
14
+
15
+ **Implemented enhancements:**
16
+
17
+ - \(PE-45366\) Add pe\_run\_in\_parallel option, serial by default on macOS [\#309](https://github.com/puppetlabs/beaker-pe/pull/309) ([Magisus](https://github.com/Magisus))
18
+
19
+ **Merged pull requests:**
20
+
21
+ - \(maint\) prepare for release 3.6.5 [\#310](https://github.com/puppetlabs/beaker-pe/pull/310) ([Magisus](https://github.com/Magisus))
22
+
3
23
  ## [3.6.4](https://github.com/puppetlabs/beaker-pe/tree/3.6.4) (2026-07-23)
4
24
 
5
25
  [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.3...3.6.4)
6
26
 
7
- **Fixed bugs:**
27
+ **Merged pull requests:**
8
28
 
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))
29
+ - \(maint\) prepare for release 3.6.4 [\#307](https://github.com/puppetlabs/beaker-pe/pull/307) ([Magisus](https://github.com/Magisus))
30
+ - \(PE-41009\) Fall back to agent-downloads when promoted agent is missing from public mirror [\#306](https://github.com/puppetlabs/beaker-pe/pull/306) ([Magisus](https://github.com/Magisus))
10
31
 
11
32
  ## [3.6.3](https://github.com/puppetlabs/beaker-pe/tree/3.6.3) (2026-07-16)
12
33
 
13
34
  [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.6.2...3.6.3)
14
35
 
15
- **Fixed bugs:**
36
+ **Implemented enhancements:**
16
37
 
17
- - [PE-45082]: Broaden is_expected_pe_postgres_failure? allowlist [#303](https://github.com/puppetlabs/beaker-pe/pull/303) ([steveax](https://github.com/steveax))
38
+ - \(PE-45082\) Broaden is\_expected\_pe\_postgres\_failure? allowlist [\#303](https://github.com/puppetlabs/beaker-pe/pull/303) ([steveax](https://github.com/steveax))
39
+
40
+ **Merged pull requests:**
41
+
42
+ - \(maint\) prepare for release 3.6.3 [\#304](https://github.com/puppetlabs/beaker-pe/pull/304) ([steveax](https://github.com/steveax))
18
43
 
19
44
  ## [3.6.2](https://github.com/puppetlabs/beaker-pe/tree/3.6.2) (2026-06-05)
20
45
 
@@ -22,7 +47,7 @@
22
47
 
23
48
  **Fixed bugs:**
24
49
 
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))
50
+ - 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
51
 
27
52
  ## [3.6.1](https://github.com/puppetlabs/beaker-pe/tree/3.6.1) (2025-11-21)
28
53
 
@@ -46,15 +71,20 @@
46
71
 
47
72
  **Implemented enhancements:**
48
73
 
49
- - \(PE-40793\) Follow https->>http redirects [\#287](https://github.com/puppetlabs/beaker-pe/pull/287) ([tvpartytonight](https://github.com/tvpartytonight))
74
+ - \(maint\) prepare for 3.5.0 release [\#288](https://github.com/puppetlabs/beaker-pe/pull/288) ([tvpartytonight](https://github.com/tvpartytonight))
75
+ - \(PE-40793\) Follow https-\>\>http redirects [\#287](https://github.com/puppetlabs/beaker-pe/pull/287) ([tvpartytonight](https://github.com/tvpartytonight))
50
76
 
51
- ## [3.4.0](https://github.com/puppetlabs/beaker-pe/tree/3.4.0) (2025-03-12)
77
+ ## [3.4.0](https://github.com/puppetlabs/beaker-pe/tree/3.4.0) (2025-03-13)
52
78
 
53
79
  [Full Changelog](https://github.com/puppetlabs/beaker-pe/compare/3.3.1...3.4.0)
54
80
 
55
81
  **Implemented enhancements:**
56
82
 
57
- - \(PE-40143\) Add ruby 3.2 support [\#285](https://github.com/puppetlabs/beaker-pe/pull/285) ([tvpartytonight](https://github.com/tvpartytonight))
83
+ - \(PE-40143\) Update beaker-pe for ruby 3.2 compatibility [\#285](https://github.com/puppetlabs/beaker-pe/pull/285) ([tvpartytonight](https://github.com/tvpartytonight))
84
+
85
+ **Merged pull requests:**
86
+
87
+ - \(maint\) prep for 3.4.0 release [\#286](https://github.com/puppetlabs/beaker-pe/pull/286) ([tvpartytonight](https://github.com/tvpartytonight))
58
88
 
59
89
  ## [3.3.1](https://github.com/puppetlabs/beaker-pe/tree/3.3.1) (2024-12-05)
60
90
 
@@ -720,7 +750,7 @@
720
750
  **Merged pull requests:**
721
751
 
722
752
  - PE-11351 clear puppet jenkins slaves [\#98](https://github.com/puppetlabs/beaker-pe/pull/98) ([mwbutcher](https://github.com/mwbutcher))
723
- - \(maint\) Add beaker-abs to gemspec [\#97](https://github.com/puppetlabs/beaker-pe/pull/97) ([smcelmurry](https://github.com/smcelmurry))
753
+ - \(maint\) Add beaker-abs to gemspec [\#97](https://github.com/puppetlabs/beaker-pe/pull/97) ([junebug-spencer](https://github.com/junebug-spencer))
724
754
  - \(RE-9922\) Migrate from stickler to artifactory [\#96](https://github.com/puppetlabs/beaker-pe/pull/96) ([sarameisburger](https://github.com/sarameisburger))
725
755
 
726
756
  ## [1.32.0](https://github.com/puppetlabs/beaker-pe/tree/1.32.0) (2018-01-09)
@@ -791,7 +821,6 @@
791
821
 
792
822
  - Fix agent installation failure caused by previous commit [\#87](https://github.com/puppetlabs/beaker-pe/pull/87) ([shaigy](https://github.com/shaigy))
793
823
  - PE-22051 Changes for adding loadbalancer to LEI job [\#86](https://github.com/puppetlabs/beaker-pe/pull/86) ([shaigy](https://github.com/shaigy))
794
- - \(MAINT\) Fix linux masterless installation [\#70](https://github.com/puppetlabs/beaker-pe/pull/70) ([Renelast](https://github.com/Renelast))
795
824
 
796
825
  ## [1.23.0](https://github.com/puppetlabs/beaker-pe/tree/1.23.0) (2017-09-15)
797
826
 
@@ -1145,7 +1174,6 @@
1145
1174
 
1146
1175
  - \(maint\) Remove leftover comments [\#7](https://github.com/puppetlabs/beaker-pe/pull/7) ([tvpartytonight](https://github.com/tvpartytonight))
1147
1176
  - BKR-656 [\#6](https://github.com/puppetlabs/beaker-pe/pull/6) ([tvpartytonight](https://github.com/tvpartytonight))
1148
- - Fixes windows masterless installation [\#1](https://github.com/puppetlabs/beaker-pe/pull/1) ([Renelast](https://github.com/Renelast))
1149
1177
 
1150
1178
  ## [0.1.2](https://github.com/puppetlabs/beaker-pe/tree/0.1.2) (2016-04-05)
1151
1179
 
data/README.md CHANGED
@@ -31,6 +31,27 @@ of key concepts.
31
31
  involved in addressing key problems and use-cases. For instance, checkout our
32
32
  [How-to Install Puppet Enterprise doc](docs/how_to/install_puppet_enterprise.md).
33
33
 
34
+ ## Configuration
35
+
36
+ ### Running install/upgrade steps serially (`pe_run_in_parallel`)
37
+
38
+ Several PE install/upgrade steps act on many hosts at once by `fork()`ing a child
39
+ process per host, each with its own SSH connection. **On macOS, forking a Ruby
40
+ process that has already used `Net::SSH` deadlocks the child**, so these steps hang
41
+ until beaker's watchdog kills them (`RuntimeError: Child process ran longer than
42
+ timeout of 1800`). This does not happen on Linux/CI.
43
+
44
+ Because of this, beaker-pe defaults to running these steps **serially on macOS** and
45
+ **in parallel on every other platform**. You can override the default either way:
46
+
47
+ - Option: set `pe_run_in_parallel: true` (or `false`) in your beaker options.
48
+ - Env var: `export BEAKER_PE_RUN_IN_PARALLEL=1` (or `0`) before running beaker.
49
+
50
+ Precedence, highest first: the `BEAKER_PE_RUN_IN_PARALLEL` env var, then the
51
+ `pe_run_in_parallel` option, then the platform default (`false` on macOS, `true`
52
+ elsewhere). For the env var, `1`, `true`, or `yes` force parallel; `0`, `false`, or
53
+ `no` force serial.
54
+
34
55
  ## Upgrading from 0.y to 1.y?
35
56
 
36
57
  If you've used beaker-pe previously (during the 0.y versions), you'll
@@ -1519,12 +1519,27 @@ NOASK
1519
1519
  (host['platform'] =~ /windows-2008r2/ && (!version_is_less(host['pe_ver'], '2016.4.99') && version_is_less(host['pe_ver'], '2016.5.99') && !version_is_less(host['pe_ver'], '3.99')))
1520
1520
  end
1521
1521
 
1522
+ # Whether PE install/upgrade steps that act on many hosts should fork and
1523
+ # run in parallel. Forking + Net::SSH deadlocks on macOS, so the default is
1524
+ # serial there and parallel everywhere else; a developer can override either
1525
+ # way. Precedence, highest first:
1526
+ # BEAKER_PE_RUN_IN_PARALLEL env var > :pe_run_in_parallel option > default
1527
+ # (false on macOS, true elsewhere)
1528
+ # @api private
1529
+ # @return [Boolean]
1530
+ def pe_run_in_parallel?
1531
+ env = ENV['BEAKER_PE_RUN_IN_PARALLEL']
1532
+ return %w[1 true yes].include?(env.downcase) unless env.nil? || env.empty?
1533
+ opt = options[:pe_run_in_parallel]
1534
+ opt.nil? ? (RUBY_PLATFORM !~ /darwin/) : !!opt
1535
+ end
1536
+
1522
1537
  # Runs puppet on all nodes, unless they have the roles: master,database,console/dashboard
1523
1538
  # @param [Array<Host>] hosts The sorted hosts to install or upgrade PE on
1524
1539
  def run_puppet_on_non_infrastructure_nodes(all_hosts)
1525
1540
  pe_infrastructure = select_hosts({:roles => ['master', 'compile_master', 'pe_compiler', 'dashboard', 'database']}, all_hosts)
1526
1541
  non_infrastructure = all_hosts.reject{|host| pe_infrastructure.include? host}
1527
- on non_infrastructure, puppet_agent('-t'), :acceptable_exit_codes => [0,2], :run_in_parallel => true
1542
+ on non_infrastructure, puppet_agent('-t'), :acceptable_exit_codes => [0,2], :run_in_parallel => pe_run_in_parallel?
1528
1543
  end
1529
1544
 
1530
1545
  # Whether or not PE should be managing the puppet service on agents.
@@ -1825,11 +1840,33 @@ EOM
1825
1840
  if version_is_less(host['pe_ver'], '2016.1.0')
1826
1841
  return true
1827
1842
  end
1843
+
1844
+ ssl_port = options[:puppetdb_port_ssl] || 8081
1845
+ nonssl_port = options[:puppetdb_port_nonssl] || 8080
1846
+
1828
1847
  Timeout.timeout(60) do
1829
1848
  match = nil
1830
1849
  while not match
1831
- output = on(host, "curl -s http://localhost:8080/pdb/meta/v1/version", :accept_all_exit_codes => true)
1850
+ # Prefer the ssl status endpoint. PuppetDB's jetty listener is
1851
+ # explicitly configured with `client-auth = want`, not `need`
1852
+ # (see puppet_enterprise::puppetdb::jetty_ini.pp), and
1853
+ # /pdb/meta/v1/version -- like the rest of /status/v1/* -- is
1854
+ # allow-unauthenticated in PuppetDB's auth.conf. So `curl -k`
1855
+ # gets a real, validated response with no client cert needed,
1856
+ # and it's the only path that still works once the cleartext
1857
+ # listener is disabled by default (PE-45384/PE-44906,
1858
+ # SECVULN-1792; PE-45827).
1859
+ output = on(host, "curl -s -k https://localhost:#{ssl_port}/pdb/meta/v1/version", :accept_all_exit_codes => true)
1832
1860
  match = output.stdout =~ /version.*\d+\.\d+\.\d+/
1861
+
1862
+ # Fall back to the cleartext port for older or nonstandard
1863
+ # configurations where the ssl endpoint doesn't behave as
1864
+ # above.
1865
+ if !match
1866
+ output = on(host, "curl -s http://localhost:#{nonssl_port}/pdb/meta/v1/version", :accept_all_exit_codes => true)
1867
+ match = output.stdout =~ /version.*\d+\.\d+\.\d+/
1868
+ end
1869
+
1833
1870
  sleep 1
1834
1871
  end
1835
1872
  end
@@ -2133,7 +2170,7 @@ EOM
2133
2170
  end
2134
2171
 
2135
2172
  step "Stop agent service on infrastructure nodes" do
2136
- stop_agent_on(pe_infrastructure, :run_in_parallel => true)
2173
+ stop_agent_on(pe_infrastructure, :run_in_parallel => pe_run_in_parallel?)
2137
2174
  end
2138
2175
 
2139
2176
  # waitforlock in case stopping the agent run after stopping the agent service
@@ -2488,7 +2525,7 @@ EOM
2488
2525
  end
2489
2526
 
2490
2527
  step "Install agents" do
2491
- block_on(agent_nodes, {:run_in_parallel => true}) do |host|
2528
+ block_on(agent_nodes, {:run_in_parallel => pe_run_in_parallel?}) do |host|
2492
2529
  install_ca_cert_on(host, opts)
2493
2530
  on(host, installer_cmd(host, opts))
2494
2531
  end
@@ -2500,13 +2537,13 @@ EOM
2500
2537
  end
2501
2538
 
2502
2539
  step "Stop puppet agents to avoid interfering with tests" do
2503
- stop_agent_on(agent_nodes, :run_in_parallel => true)
2540
+ stop_agent_on(agent_nodes, :run_in_parallel => pe_run_in_parallel?)
2504
2541
  end
2505
2542
 
2506
2543
  # waitforlock in case stopping the agent run after stopping the agent service
2507
2544
  # takes a little longer than usual
2508
2545
  step "Run puppet on all agent nodes" do
2509
- block_on(agent_nodes, {:run_in_parallel => true}) do |host|
2546
+ block_on(agent_nodes, {:run_in_parallel => pe_run_in_parallel?}) do |host|
2510
2547
  on host, puppet_agent("-t #{waitforlock_flag(host)}"), :acceptable_exit_codes => [0,2]
2511
2548
  end
2512
2549
  end
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '3.6.4'
6
+ STRING = '3.6.6'
7
7
  end
8
8
 
9
9
  end
@@ -25,6 +25,17 @@ class ClassMixedWithDSLInstallUtils
25
25
  end
26
26
 
27
27
  describe ClassMixedWithDSLInstallUtils do
28
+ # Neutralize BEAKER_PE_RUN_IN_PARALLEL and pin RUBY_PLATFORM to a non-macOS value
29
+ # for every example in this file, so that pre-existing specs asserting the default
30
+ # (:run_in_parallel => true) are not affected by whatever a developer happens to
31
+ # have exported in their shell or by running the suite on a Mac (where the default
32
+ # is serial). Examples that exercise the macOS default stub RUBY_PLATFORM to darwin.
33
+ before do
34
+ allow(ENV).to receive(:[]).and_call_original
35
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return(nil)
36
+ stub_const('RUBY_PLATFORM', 'x86_64-linux')
37
+ end
38
+
28
39
  let(:presets) { Beaker::Options::Presets.new }
29
40
  let(:opts) { presets.presets.merge(presets.env_vars) }
30
41
  let(:basic_hosts) { make_hosts( { :pe_ver => '3.0',
@@ -612,6 +623,35 @@ describe ClassMixedWithDSLInstallUtils do
612
623
  end
613
624
  end
614
625
 
626
+ describe '#run_puppet_on_non_infrastructure_nodes parallel wiring' do
627
+ let(:master) { make_host('master', :pe_ver => '2016.4', :platform => 'el-7-x86_64', :roles => ['master', 'database', 'dashboard']) }
628
+ let(:el_agent) { make_host('agent', :pe_ver => '2016.4', :platform => 'el-7-x86_64', :roles => ['frictionless']) }
629
+
630
+ before do
631
+ allow(ENV).to receive(:[]).and_call_original
632
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return(nil)
633
+ end
634
+
635
+ it 'passes run_in_parallel => false when the option disables it' do
636
+ subject.options[:pe_run_in_parallel] = false
637
+ expect(subject).to receive(:on).with(
638
+ [el_agent],
639
+ anything,
640
+ hash_including(:run_in_parallel => false)
641
+ ).once
642
+ subject.run_puppet_on_non_infrastructure_nodes([master, el_agent])
643
+ end
644
+
645
+ it 'passes run_in_parallel => true by default' do
646
+ expect(subject).to receive(:on).with(
647
+ [el_agent],
648
+ anything,
649
+ hash_including(:run_in_parallel => true)
650
+ ).once
651
+ subject.run_puppet_on_non_infrastructure_nodes([master, el_agent])
652
+ end
653
+ end
654
+
615
655
  describe 'install_via_msi?' do
616
656
  it 'returns true if pe_version is before PE 2016.4.0' do
617
657
  the_host = winhost.dup
@@ -661,6 +701,71 @@ describe ClassMixedWithDSLInstallUtils do
661
701
 
662
702
  end
663
703
 
704
+ describe '#pe_run_in_parallel?' do
705
+ before do
706
+ # Default: pretend the env var is unset unless a specific example sets it.
707
+ allow(ENV).to receive(:[]).and_call_original
708
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return(nil)
709
+ end
710
+
711
+ context 'with no option and no env var' do
712
+ it 'defaults to true off macOS' do
713
+ stub_const('RUBY_PLATFORM', 'x86_64-linux')
714
+ expect(subject.send(:pe_run_in_parallel?)).to eq(true)
715
+ end
716
+
717
+ it 'defaults to false on macOS' do
718
+ stub_const('RUBY_PLATFORM', 'x86_64-darwin21')
719
+ expect(subject.send(:pe_run_in_parallel?)).to eq(false)
720
+ end
721
+ end
722
+
723
+ context 'with the :pe_run_in_parallel option' do
724
+ it 'returns false when the option is false' do
725
+ subject.options[:pe_run_in_parallel] = false
726
+ expect(subject.send(:pe_run_in_parallel?)).to eq(false)
727
+ end
728
+
729
+ it 'returns true when the option is true' do
730
+ subject.options[:pe_run_in_parallel] = true
731
+ expect(subject.send(:pe_run_in_parallel?)).to eq(true)
732
+ end
733
+ end
734
+
735
+ context 'with the BEAKER_PE_RUN_IN_PARALLEL env var set' do
736
+ %w[1 true yes TRUE Yes].each do |truthy|
737
+ it "returns true for #{truthy.inspect}" do
738
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return(truthy)
739
+ expect(subject.send(:pe_run_in_parallel?)).to eq(true)
740
+ end
741
+ end
742
+
743
+ %w[0 false no off].each do |falsey|
744
+ it "returns false for #{falsey.inspect}" do
745
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return(falsey)
746
+ expect(subject.send(:pe_run_in_parallel?)).to eq(false)
747
+ end
748
+ end
749
+
750
+ it 'overrides the option (env true beats option false)' do
751
+ subject.options[:pe_run_in_parallel] = false
752
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return('1')
753
+ expect(subject.send(:pe_run_in_parallel?)).to eq(true)
754
+ end
755
+
756
+ it 'overrides the option (env false beats option true)' do
757
+ subject.options[:pe_run_in_parallel] = true
758
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return('0')
759
+ expect(subject.send(:pe_run_in_parallel?)).to eq(false)
760
+ end
761
+
762
+ it 'falls through to the default when the env var is empty' do
763
+ allow(ENV).to receive(:[]).with('BEAKER_PE_RUN_IN_PARALLEL').and_return('')
764
+ expect(subject.send(:pe_run_in_parallel?)).to eq(true)
765
+ end
766
+ end
767
+ end
768
+
664
769
  describe 'higgs installer' do
665
770
  let(:host) { unixhost }
666
771
  let(:higgs_regex) { %r{cd .* ; nohup \./puppet-enterprise-installer <<<#{higgs_answer} .*} }
@@ -2558,6 +2663,48 @@ NOASK
2558
2663
  end
2559
2664
  end
2560
2665
 
2666
+ describe '#check_puppetdb_status_endpoint' do
2667
+ it 'does not do anything if version is less than 2016.1.0' do
2668
+ allow(subject).to receive(:version_is_less).and_return(true)
2669
+
2670
+ expect(subject).not_to receive(:on)
2671
+ subject.check_puppetdb_status_endpoint(unixhost)
2672
+ end
2673
+
2674
+ it 'succeeds via the ssl endpoint alone, without ever falling back to cleartext (PE-45827)' do
2675
+ allow(subject).to receive(:version_is_less).and_return(false)
2676
+ allow(subject).to receive(:sleep)
2677
+ ssl_result = double(Beaker::Result, :stdout => '{"version":"7.12.1"}', :exit_code => 0)
2678
+ expect(subject).to receive(:on).with(anything, %r{-k https://localhost:8081/}, anything).once.and_return(ssl_result)
2679
+ expect(subject).not_to receive(:on).with(anything, %r{http://localhost:8080/}, anything)
2680
+
2681
+ expect { subject.check_puppetdb_status_endpoint(unixhost) }.not_to raise_error
2682
+ end
2683
+
2684
+ context 'when the ssl endpoint never returns valid content (older or nonstandard config)' do
2685
+ it 'falls back to the cleartext endpoint' do
2686
+ allow(subject).to receive(:version_is_less).and_return(false)
2687
+ allow(subject).to receive(:sleep)
2688
+ ssl_result = double(Beaker::Result, :stdout => '', :exit_code => 0)
2689
+ nonssl_result = double(Beaker::Result, :stdout => '{"version":"7.12.1"}', :exit_code => 0)
2690
+ expect(subject).to receive(:on).with(anything, %r{-k https://localhost:8081/}, anything).once.ordered.and_return(ssl_result)
2691
+ expect(subject).to receive(:on).with(anything, %r{http://localhost:8080/}, anything).once.ordered.and_return(nonssl_result)
2692
+
2693
+ expect { subject.check_puppetdb_status_endpoint(unixhost) }.not_to raise_error
2694
+ end
2695
+ end
2696
+
2697
+ context 'when neither endpoint ever returns valid content' do
2698
+ it 'still fails the test, preserving the original PE-14934 race guard' do
2699
+ allow(subject).to receive(:version_is_less).and_return(false)
2700
+ allow(Timeout).to receive(:timeout).and_raise(Timeout::Error)
2701
+ expect(subject).to receive(:fail_test).with('PuppetDB took too long to start')
2702
+
2703
+ subject.check_puppetdb_status_endpoint(unixhost)
2704
+ end
2705
+ end
2706
+ end
2707
+
2561
2708
  describe '#get_puppet_agent_version' do
2562
2709
 
2563
2710
  context 'when the puppet_agent version is set on an argument' 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
4
+ version: 3.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs