beaker-puppet 1.18.12 → 1.18.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f74846dbd9ab793e04e052df3fd3059af667b0b42221c5d4505237f3b57f6074
4
- data.tar.gz: ba44e5139f6596f2c3d5501701b4a8bb82bfe0f0b1fbd0f5f9b426344dbca21a
3
+ metadata.gz: 16fa6b2a09e5b987520d65351e9dd34ede8494a3995ea103468118c3cf1ff269
4
+ data.tar.gz: 3e0631f16d941336d5247d7caaa4cf861fcc1d860544df109dbc3eae442d16e0
5
5
  SHA512:
6
- metadata.gz: 3fd8f76111d3226bf9ceee47827c04a3d6163c9f29d2a64496003a9e4b7be39e0821af9b5e8678589d6e2578fb33d8a4bbf94f3c18dbfd50bb24950100fc4ad2
7
- data.tar.gz: 71474c705fa2fb388ea95adbca9b23a9883e79735c2d3693e624ffa28d6b682d45b3776c2e8f541a7cc89ad1fdf89975639b2233fc758febec7daf6032816ed0
6
+ metadata.gz: 3ee81de0a0526bf05c1546f6b07db7ccf049fd13efa504baefd64ac53b9bb52485c1ce6b431bd143421b080266748a036d8f3147d1b8958d7661a0580839a4df
7
+ data.tar.gz: a8bdb1c26c35d6175bf7bfd8d86761df28828a1eb25dd716b1c2330d6a3af7f9b064bb6a0c360cd2e08fddf6577a37c2a95e2abfb961b5361640cae462c56cdc
@@ -118,7 +118,7 @@ module Beaker
118
118
  repoconfig_url = "#{build_url}/#{repoconfig_buildserver_path}" unless repoconfig_buildserver_path.nil?
119
119
  artifact_url_correct = link_exists?( artifact_url )
120
120
  logger.debug("- artifact url: '#{artifact_url}'. Exists? #{artifact_url_correct}")
121
- fail_test('artifact url built incorrectly') unless artifact_url_correct
121
+ fail_test('artifact url built incorrectly') if !artifact_url_correct
122
122
 
123
123
  return artifact_url, repoconfig_url
124
124
  end
@@ -208,11 +208,10 @@ module Beaker
208
208
  #
209
209
  # @return nil
210
210
  def install_from_build_data_url(project_name, sha_yaml_url, local_hosts = nil)
211
- unless link_exists?( sha_yaml_url )
211
+ if !link_exists?( sha_yaml_url )
212
212
  message = <<-EOF
213
213
  Unable to locate a downloadable build of #{project_name} (tried #{sha_yaml_url})
214
214
  EOF
215
-
216
215
  fail_test( message )
217
216
  end
218
217
 
@@ -46,7 +46,6 @@ module Beaker
46
46
  if not host.is_powershell?
47
47
  separator = ':'
48
48
  end
49
-
50
49
  path.join(separator)
51
50
  end
52
51
 
@@ -56,7 +55,6 @@ module Beaker
56
55
  def add_puppet_paths_on(hosts)
57
56
  block_on hosts do | host |
58
57
  puppet_path = construct_puppet_path(host)
59
-
60
58
  host.add_env_var('PATH', puppet_path)
61
59
  host.add_env_var('PATH', 'PATH') # don't destroy the path!
62
60
  end
@@ -120,24 +120,19 @@ exit /B %errorlevel%
120
120
  begin
121
121
  # 1641 = ERROR_SUCCESS_REBOOT_INITIATED
122
122
  # 3010 = ERROR_SUCCESS_REBOOT_REQUIRED
123
- on host, Command.new(%{"#{batch_path}"}, [], { :cmdexe => true }), :acceptable_exit_codes => [0, 1641, 3010]
123
+ on host, Command.new("\"#{batch_path}\"", [], { :cmdexe => true }), :acceptable_exit_codes => [0, 1641, 3010]
124
124
  rescue
125
- on host, Command.new(%{more "#{log_file}"}, [], { :cmdexe => true })
125
+ on host, Command.new("type \"#{log_file}\"", [], { :cmdexe => true })
126
126
  raise
127
127
  end
128
128
 
129
129
  if opts[:debug]
130
- on host, Command.new(%{more "#{log_file}"}, [], { :cmdexe => true })
130
+ on host, Command.new("type \"#{log_file}\"", [], { :cmdexe => true })
131
131
  end
132
132
 
133
133
  if !host.is_cygwin?
134
- # Enable the PATH updates
134
+ # HACK: for some reason, post install we need to refresh the connection to make puppet available for execution
135
135
  host.close
136
-
137
- # Some systems require a full reboot to trigger the enabled path
138
- unless on(host, Command.new('puppet -h', [], { :cmdexe => true}), :accept_all_exit_codes => true).exit_code == 0
139
- host.reboot
140
- end
141
136
  end
142
137
 
143
138
  # verify service status post install
@@ -175,10 +170,10 @@ exit /B %errorlevel%
175
170
  # emit the misc/versions.txt file which contains component versions for
176
171
  # puppet, facter, hiera, pxp-agent, packaging and vendored Ruby
177
172
  [
178
- '%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt',
179
- '%ProgramFiles(x86)%/Puppet Labs/puppet/misc/versions.txt'
173
+ "\\\"%ProgramFiles%\\Puppet Labs\\puppet\\misc\\versions.txt\\\"",
174
+ "\\\"%ProgramFiles(x86)%\\Puppet Labs\\puppet\\misc\\versions.txt\\\""
180
175
  ].each do |path|
181
- on(host, Command.new(%{if exist "#{path}" more "#{path}"}, [], { :cmdexe => true }))
176
+ on host, Command.new("\"if exist #{path} type #{path}\"", [], { :cmdexe => true })
182
177
  end
183
178
  end
184
179
  end
@@ -204,23 +199,25 @@ exit /B %errorlevel%
204
199
  begin
205
200
  # 1641 = ERROR_SUCCESS_REBOOT_INITIATED
206
201
  # 3010 = ERROR_SUCCESS_REBOOT_REQUIRED
207
- on host, Command.new(%{"#{batch_path}"}, [], { :cmdexe => true }), :acceptable_exit_codes => [0, 1641, 3010]
202
+ on host, Command.new("\"#{batch_path}\"", [], { :cmdexe => true }), :acceptable_exit_codes => [0, 1641, 3010]
208
203
  rescue
209
- on host, Command.new(%{more "#{log_file}"}, [], { :cmdexe => true })
204
+ on host, Command.new("type \"#{log_file}\"", [], { :cmdexe => true })
210
205
  raise
211
206
  end
212
207
 
213
208
  if opts[:debug]
214
- on host, Command.new(%{more "#{log_file}"}, [], { :cmdexe => true })
209
+ on host, Command.new("type \"#{log_file}\"", [], { :cmdexe => true })
215
210
  end
216
211
 
217
212
  if !host.is_cygwin?
218
213
  # HACK: for some reason, post install we need to refresh the connection to make puppet available for execution
219
214
  host.close
220
215
  end
216
+
221
217
  end
222
218
  end
219
+
223
220
  end
224
221
  end
225
222
  end
226
- end
223
+ end
@@ -1,3 +1,3 @@
1
1
  module BeakerPuppet
2
- VERSION = '1.18.12'
2
+ VERSION = '1.18.13'
3
3
  end
@@ -391,31 +391,16 @@ describe ClassMixedWithDSLInstallUtils do
391
391
  end
392
392
 
393
393
  describe '#install_puppet_agent_from_dev_builds_on' do
394
- ref="sha"
395
- sha_yaml_url="#{Beaker::DSL::Puppet5::DEFAULT_DEV_BUILDS_URL}/puppet-agent/#{ref}/artifacts/#{ref}.yaml"
396
-
397
- begin
398
- require 'net/http'
399
-
400
- Net::HTTP.get(sha_yaml_url)
401
- rescue
402
- real_world = true
403
- end
404
-
405
394
  let(:host) { make_host('test_host', { platform: 'el-7-x86_64' }) }
395
+ let(:ref) { "sha" }
396
+ let(:sha_yaml_url) { "#{Beaker::DSL::Puppet5::DEFAULT_DEV_BUILDS_URL}/puppet-agent/#{ref}/artifacts/#{ref}.yaml" }
406
397
 
407
- if real_world
408
- it 'installs puppet-agent from internal builds when they are accessible' do
409
- skip('The Puppet development network is not available in the real world')
410
- end
411
- else
412
- it 'installs puppet-agent from internal builds when they are accessible' do
413
- expect( subject ).to receive(:block_on).with(anything, :run_in_parallel => true)
414
- allow(subject).to receive(:dev_builds_accessible_on?).and_return(true)
415
- allow(subject).to receive(:install_from_build_data_url).with('puppet-agent', sha_yaml_url, host)
416
- subject.install_puppet_agent_from_dev_builds_on(host, ref)
417
- expect(subject).to have_received(:install_from_build_data_url).with('puppet-agent', sha_yaml_url, host)
418
- end
398
+ it 'installs puppet-agent from internal builds when they are accessible' do
399
+ expect( subject ).to receive(:block_on).with(anything, :run_in_parallel => true)
400
+ allow(subject).to receive(:dev_builds_accessible_on?).and_return(true)
401
+ allow(subject).to receive(:install_from_build_data_url).with('puppet-agent', sha_yaml_url, host)
402
+ subject.install_puppet_agent_from_dev_builds_on(host, ref)
403
+ expect(subject).to have_received(:install_from_build_data_url).with('puppet-agent', sha_yaml_url, host)
419
404
  end
420
405
 
421
406
  it 'fails the test when internal builds are inaccessible' do
@@ -12,7 +12,7 @@ end
12
12
 
13
13
  describe ClassMixedWithDSLInstallUtils do
14
14
  let(:windows_temp) { 'C:\\Windows\\Temp' }
15
- let(:batch_path) { '/fake/batch/path' }
15
+ let( :batch_path ) { '/fake/batch/path' }
16
16
  let(:msi_path) { 'c:\\foo\\puppet.msi' }
17
17
  let(:winhost) { make_host( 'winhost',
18
18
  { :platform => Beaker::Platform.new('windows-2008r2-64'),
@@ -42,11 +42,11 @@ describe ClassMixedWithDSLInstallUtils do
42
42
 
43
43
  def expect_version_log_called(times = hosts.length)
44
44
  [
45
- %{%ProgramFiles%/Puppet Labs/puppet/misc/versions.txt},
46
- %{%ProgramFiles(x86)%/Puppet Labs/puppet/misc/versions.txt}
45
+ "\\\"%ProgramFiles%\\Puppet Labs\\puppet\\misc\\versions.txt\\\"",
46
+ "\\\"%ProgramFiles(x86)%\\Puppet Labs\\puppet\\misc\\versions.txt\\\"",
47
47
  ].each do |path|
48
48
  expect( Beaker::Command ).to receive( :new )
49
- .with( %{if exist "#{path}" more "#{path}"}, [], {:cmdexe => true} )
49
+ .with( "\"if exist #{path} type #{path}\"", [], {:cmdexe => true} )
50
50
  .exactly( times ).times
51
51
  end
52
52
  end
@@ -71,25 +71,15 @@ describe ClassMixedWithDSLInstallUtils do
71
71
  .exactly(times).times
72
72
  end
73
73
 
74
- def expect_check_puppet_path_called(times = 1)
75
- expect( Beaker::Command ).to receive( :new )
76
- .with( 'puppet -h', [], {:cmdexe => true} )
77
- .exactly( times ).times
78
- end
79
-
80
74
  describe "#install_msi_on" do
81
75
  let( :log_file ) { '/fake/log/file.log' }
82
76
  before :each do
83
- exit_code_result = Beaker::Result.new(nil, 'temp')
84
- exit_code_result.exit_code = 0
85
-
86
- allow( subject ).to receive( :on ).and_return( exit_code_result )
77
+ allow( subject ).to receive( :on ).and_return( true )
87
78
  allow( subject ).to receive( :create_install_msi_batch_on ).and_return( [batch_path, log_file] )
88
79
  end
89
80
 
90
81
  it "will specify a PUPPET_AGENT_STARTUP_MODE of Manual (disabling the service) by default" do
91
82
  expect_install_called
92
- expect_check_puppet_path_called
93
83
  expect_status_called
94
84
  expect_reg_query_called
95
85
  expect_version_log_called
@@ -101,7 +91,6 @@ describe ClassMixedWithDSLInstallUtils do
101
91
 
102
92
  it "allows configuration of PUPPET_AGENT_STARTUP_MODE" do
103
93
  expect_install_called
104
- expect_check_puppet_path_called
105
94
  expect_status_called
106
95
  expect_reg_query_called
107
96
  expect_version_log_called
@@ -114,9 +103,8 @@ describe ClassMixedWithDSLInstallUtils do
114
103
 
115
104
  it "will not generate a command to emit a log file without the :debug option set" do
116
105
  expect_install_called
117
- expect_check_puppet_path_called
118
106
  expect_status_called
119
- expect( Beaker::Command ).not_to receive( :new ).with( /^more .*\.log$/, [], {:cmdexe => true} )
107
+ expect( Beaker::Command ).not_to receive( :new ).with( /^type .*\.log$/, [], {:cmdexe => true} )
120
108
  subject.install_msi_on(hosts, msi_path)
121
109
  end
122
110
 
@@ -125,28 +113,25 @@ describe ClassMixedWithDSLInstallUtils do
125
113
  hosts_affected = 1
126
114
 
127
115
  expect_install_called(hosts_affected) { |e| e.and_raise }
128
- expect_check_puppet_path_called(0)
129
116
  expect_status_called(0)
130
117
 
131
- expect( Beaker::Command ).to receive( :new ).with( /^more \".*\.log\"$/, [], {:cmdexe => true} ).exactly( hosts_affected ).times
118
+ expect( Beaker::Command ).to receive( :new ).with( /^type \".*\.log\"$/, [], {:cmdexe => true} ).exactly( hosts_affected ).times
132
119
  expect { subject.install_msi_on(hosts, msi_path) }.to raise_error(RuntimeError)
133
120
  end
134
121
 
135
122
  it "will generate a command to emit a log file with the :debug option set" do
136
123
  expect_install_called
137
124
  expect_reg_query_called
138
- expect_check_puppet_path_called
139
125
  expect_status_called
140
126
  expect_version_log_called
141
127
 
142
- expect( Beaker::Command ).to receive( :new ).with( /^more \".*\.log\"$/, [], {:cmdexe => true} ).exactly( hosts.length ).times
128
+ expect( Beaker::Command ).to receive( :new ).with( /^type \".*\.log\"$/, [], {:cmdexe => true} ).exactly( hosts.length ).times
143
129
  subject.install_msi_on(hosts, msi_path, {}, { :debug => true })
144
130
  end
145
131
 
146
132
  it 'will pass msi_path to #create_install_msi_batch_on as-is' do
147
133
  expect_install_called
148
134
  expect_reg_query_called
149
- expect_check_puppet_path_called
150
135
  expect_status_called
151
136
  expect_version_log_called
152
137
  test_path = 'test/path'
@@ -157,7 +142,6 @@ describe ClassMixedWithDSLInstallUtils do
157
142
 
158
143
  it 'will search in Wow6432Node for the remembered startup setting on 64-bit hosts' do
159
144
  expect_install_called
160
- expect_check_puppet_path_called
161
145
  expect_status_called
162
146
  expect_version_log_called
163
147
 
@@ -174,7 +158,6 @@ describe ClassMixedWithDSLInstallUtils do
174
158
 
175
159
  it 'will omit Wow6432Node in the registry search for remembered startup setting on 32-bit hosts' do
176
160
  expect_install_called
177
- expect_check_puppet_path_called
178
161
  expect_status_called
179
162
  expect_version_log_called
180
163
 
@@ -277,4 +260,4 @@ describe ClassMixedWithDSLInstallUtils do
277
260
  end
278
261
  end
279
262
  end
280
- end
263
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.18.12
4
+ version: 1.18.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-06 00:00:00.000000000 Z
11
+ date: 2020-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec