beaker-pe 2.1.1 → 2.1.2

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
  SHA1:
3
- metadata.gz: 3836bb5be9ca1f5c0b6d979ff83124f1711b14d6
4
- data.tar.gz: c607fd4a611be985864f6a55f31bc3d8f9a13871
3
+ metadata.gz: 73d231599095e931cf054b800746fb39665542f8
4
+ data.tar.gz: bec99267d66d13224c9a8940d968314ad9a3ff28
5
5
  SHA512:
6
- metadata.gz: c114903f80197effa0935591e6a9c57ea0a8649606441f46f510a3ed79f8d861aff6a80f9960332247f727527d54c6792ea636936d9689a211254de1f3a256ad
7
- data.tar.gz: a80eaaa44c7f346ed4aee07fcf08fc4a3229a2ec055b52dfa239eed6964b9e389cc1d5899452eed6f3f218226662adcab2f17c042702442d9c00664dee2d7585
6
+ metadata.gz: 137573f028c61d473ff5ff344493bd73cc2849f23d6da2a8fc569930ff4146b69563a2b9d967679d8404e29593d9482f5913a09ac01439ab38c525905cb7b42a
7
+ data.tar.gz: 2cd43286b2ca2d7c0cac7f451f273b913bdf1db609e346b31c2e1b5fdf5baf91a560d97567d6a1f2b5138b476673d54f3ccb773f75c23615b4f982392b431675
@@ -139,7 +139,7 @@ module Beaker
139
139
  #Return true if tlsv1 protocol needs to be enforced
140
140
  #param [Host] the host
141
141
  def require_tlsv1?(host)
142
- tlsv1_platforms = [/aix/, /el-5/, /solaris10/]
142
+ tlsv1_platforms = [/aix/, /el-5/, /solaris10/, /windows-2008/]
143
143
  return tlsv1_platforms.any? {|platform_regex| host['platform'] =~ platform_regex}
144
144
  end
145
145
 
@@ -191,8 +191,13 @@ module Beaker
191
191
  else
192
192
  cert_validator = '[Net.ServicePointManager]::ServerCertificateValidationCallback = {\\$true}'
193
193
  end
194
+ if version_is_less(pe_version, '2019.1.0') || require_tlsv1?(host) then
195
+ protocol_to_use =''
196
+ else
197
+ protocol_to_use = '[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12'
198
+ end
194
199
 
195
- cmd = %Q{powershell -c "cd #{host['working_dir']};#{cert_validator};\\$webClient = New-Object System.Net.WebClient;\\$webClient.DownloadFile('https://#{downloadhost}:8140/packages/current/install.ps1', '#{host['working_dir']}/install.ps1');#{host['working_dir']}/install.ps1 -verbose #{frictionless_install_opts.join(' ')}"}
200
+ cmd = %Q{powershell -c "cd #{host['working_dir']};#{protocol_to_use};#{cert_validator};\\$webClient = New-Object System.Net.WebClient;\\$webClient.DownloadFile('https://#{downloadhost}:8140/packages/current/install.ps1', '#{host['working_dir']}/install.ps1');#{host['working_dir']}/install.ps1 -verbose #{frictionless_install_opts.join(' ')}"}
196
201
  else
197
202
  curl_opts = %w{-O}
198
203
  if version_is_less(pe_version, '2019.1.0') || require_tlsv1?(host)
@@ -3,7 +3,7 @@ module Beaker
3
3
  module PE
4
4
 
5
5
  module Version
6
- STRING = '2.1.1'
6
+ STRING = '2.1.2'
7
7
  end
8
8
 
9
9
  end
@@ -270,9 +270,11 @@ describe ClassMixedWithDSLInstallUtils do
270
270
 
271
271
  it 'generates a PS1 frictionless install command for windows' do
272
272
  host['platform'] = 'windows-2012-64'
273
+ protocol = ''
273
274
  expecting = "powershell -c \"" +
274
275
  [
275
276
  "cd /tmp",
277
+ "#{protocol}",
276
278
  "[Net.ServicePointManager]::ServerCertificateValidationCallback = {\\$true}",
277
279
  "\\$webClient = New-Object System.Net.WebClient",
278
280
  "\\$webClient.DownloadFile('https://testmaster:8140/packages/current/install.ps1', '/tmp/install.ps1')",
@@ -286,9 +288,11 @@ describe ClassMixedWithDSLInstallUtils do
286
288
  host['platform'] = 'windows-2012-64'
287
289
  host['puppetpath'] = '/PuppetLabs/puppet/etc'
288
290
  host['use_puppet_ca_cert'] = true
291
+ protocol = ''
289
292
  expecting = "powershell -c \"" +
290
293
  [
291
294
  "cd /tmp",
295
+ "#{protocol}",
292
296
  "\\$callback = {param(\\$sender,[System.Security.Cryptography.X509Certificates.X509Certificate]\\$certificate,[System.Security.Cryptography.X509Certificates.X509Chain]\\$chain,[System.Net.Security.SslPolicyErrors]\\$sslPolicyErrors)",
293
297
  "\\$CertificateType=[System.Security.Cryptography.X509Certificates.X509Certificate2]",
294
298
  "\\$CACert=\\$CertificateType::CreateFromCertFile('/PuppetLabs/puppet/etc/ssl/certs/ca.pem') -as \\$CertificateType",
@@ -303,6 +307,38 @@ describe ClassMixedWithDSLInstallUtils do
303
307
  expect( subject.frictionless_agent_installer_cmd( host, {}, '2016.4.0' ) ).to eq(expecting)
304
308
  end
305
309
 
310
+ it 'generates a PS1 frictionless install command for windows with Tls12 protocol' do
311
+ host['platform'] = 'windows-20012-64'
312
+ protocol = '[System.Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12'
313
+ expecting = "powershell -c \"" +
314
+ [
315
+ "cd /tmp",
316
+ "#{protocol}",
317
+ "[Net.ServicePointManager]::ServerCertificateValidationCallback = {\\$true}",
318
+ "\\$webClient = New-Object System.Net.WebClient",
319
+ "\\$webClient.DownloadFile('https://testmaster:8140/packages/current/install.ps1', '/tmp/install.ps1')",
320
+ "/tmp/install.ps1 -verbose "
321
+ ].join(";") +
322
+ "\""
323
+ expect( subject.frictionless_agent_installer_cmd( host, {}, '2019.1.0' ) ).to eq(expecting)
324
+ end
325
+
326
+ it 'generates a PS1 frictionless install command for windows-2008 without Tls12 protocol' do
327
+ host['platform'] = 'windows-2008-64'
328
+ protocol = ''
329
+ expecting = "powershell -c \"" +
330
+ [
331
+ "cd /tmp",
332
+ "#{protocol}",
333
+ "[Net.ServicePointManager]::ServerCertificateValidationCallback = {\\$true}",
334
+ "\\$webClient = New-Object System.Net.WebClient",
335
+ "\\$webClient.DownloadFile('https://testmaster:8140/packages/current/install.ps1', '/tmp/install.ps1')",
336
+ "/tmp/install.ps1 -verbose "
337
+ ].join(";") +
338
+ "\""
339
+ expect( subject.frictionless_agent_installer_cmd( host, {}, '2019.1.0' ) ).to eq(expecting)
340
+ end
341
+
306
342
  it 'generates a frictionless install command with loadbalancer as download host' do
307
343
  hosts = lb_test_hosts
308
344
  expect( subject ).to receive( :get_lb_downloadhost ).with(lb_test_hosts[3]).and_return( 'testloadbalancer' )
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-pe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-28 00:00:00.000000000 Z
11
+ date: 2019-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec