beaker-puppet_install_helper 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: b1634202fd5a2d74c1a6c865c1b2e0d15be6a94c
4
- data.tar.gz: a312db3863c03ce13989e52f1c592461ff2ece88
3
+ metadata.gz: 8238bf66282860a17d554708397faf4d2e6a0adb
4
+ data.tar.gz: fb006b5ca3e07a31fed44ddaba759fbb7c0f46c5
5
5
  SHA512:
6
- metadata.gz: f8b9749673452f4a24300967786253557df3f439f0f0294d010bc41583c0251b7aae357206ba0ce61fd33d2b6faf5f35be1bd36ec43c2f9f12130bb25de487a3
7
- data.tar.gz: 81abf1eb8574e583c7427799d0874235a28ba0a11ee447bd2ca9cde791d29e403b3ec89418f6f4e796bcc2078f8b8e5987591c0f6a165b933e400064766aac84
6
+ metadata.gz: 9914f24a37f7d8e58f62f47d9759a893dd791a81e69d5e41bd4fd1e9932673eaa2f2cc18cd0d99113c19d40a0a7fb612ee0dbaa91b96127dc226bf8942774b1d
7
+ data.tar.gz: c3bb58813e192fd100ea2fabc651f7c480fae854316b8cd171d8b4a0870b141041677c2a21a256e5bc246f0f8c58b36f6846f5b204b6ff50dfaebbff808a7932
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "beaker-puppet_install_helper"
3
- s.version = '0.4.1'
3
+ s.version = '0.4.2'
4
4
  s.authors = ["Puppetlabs"]
5
5
  s.email = ["hunter@puppetlabs.com"]
6
6
  s.homepage = "https://github.com/puppetlabs/beaker-puppet_install_helper"
@@ -1,7 +1,10 @@
1
1
  require 'beaker'
2
- require 'beaker/dsl/helpers/host_helpers'
2
+ require 'beaker/dsl/patterns'
3
+ require 'beaker/dsl/helpers'
3
4
 
4
5
  module Beaker::CaCertHelper
6
+ include Beaker::DSL::Helpers
7
+ include Beaker::DSL::Patterns
5
8
 
6
9
  def install_ca_certs
7
10
  install_ca_certs_on(hosts)
@@ -17,12 +20,12 @@ module Beaker::CaCertHelper
17
20
  def install_ca_certs_on(hosts)
18
21
  [hosts].flatten.each do |host|
19
22
  get_cert_hash.each do |cert_name, ca|
20
- create_cert_on_host(host, cert_name, ca)
21
23
  if host['platform'] =~ /windows/i
24
+ create_cert_on_host(host, cert_name, ca)
22
25
  add_windows_cert host, cert_name
23
- # No longer needed, apparently.
24
- #elsif host['platform'] =~ /solaris/i
25
- # add_solaris_cert host, cert_name
26
+ elsif host['platform'] =~ /solaris/i
27
+ create_cert_on_host(host, cert_name, ca)
28
+ add_solaris_cert host, cert_name
26
29
  end
27
30
  end
28
31
  end
@@ -46,6 +46,9 @@ module Beaker::PuppetInstallHelper
46
46
  when "pe"
47
47
  # This will skip hosts that are not supported
48
48
  install_pe_on(Array(hosts),options.merge({"pe_ver" => version}))
49
+ if version and version_is_less(version, '4.0.0')
50
+ install_ca_certs_on(Array(hosts))
51
+ end
49
52
  when "foss"
50
53
  opts = options.merge({
51
54
  :version => version,
@@ -2,7 +2,10 @@ require 'spec_helper'
2
2
 
3
3
  describe 'beaker::ca_cert_helper' do
4
4
  let :subject do
5
- Class.new { include Beaker::CaCertHelper }
5
+ Class.new do
6
+ include Beaker::PuppetInstallHelper
7
+ include Beaker::CaCertHelper
8
+ end
6
9
  end
7
10
 
8
11
 
@@ -23,15 +26,15 @@ describe 'beaker::ca_cert_helper' do
23
26
  subject.install_ca_certs_on w2k3
24
27
  end
25
28
 
26
- #it "solaris 11 node" do
27
- # sol = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
29
+ it "solaris 11 node" do
30
+ sol = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
28
31
 
29
- # expect(subject).to receive(:add_solaris_cert).with(sol, 'geotrustglobal.pem')
30
- # expect(subject).to receive(:create_cert_on_host).with(sol, 'geotrustglobal.pem', 'my cert string')
31
- # expect(subject).to receive(:add_solaris_cert).with(sol, 'usertrust-network.pem')
32
- # expect(subject).to receive(:create_cert_on_host).with(sol, 'usertrust-network.pem', 'my user trust cert')
33
- # subject.install_ca_certs_on sol
34
- #end
32
+ expect(subject).to receive(:add_solaris_cert).with(sol, 'geotrustglobal.pem')
33
+ expect(subject).to receive(:create_cert_on_host).with(sol, 'geotrustglobal.pem', 'my cert string')
34
+ expect(subject).to receive(:add_solaris_cert).with(sol, 'usertrust-network.pem')
35
+ expect(subject).to receive(:create_cert_on_host).with(sol, 'usertrust-network.pem', 'my user trust cert')
36
+ subject.install_ca_certs_on sol
37
+ end
35
38
  end
36
39
 
37
40
  describe 'add_windows_cert' do
@@ -42,14 +45,14 @@ describe 'beaker::ca_cert_helper' do
42
45
  }
43
46
  end
44
47
 
45
- #describe 'add_solaris_cert' do
46
- # it {
47
- # host = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
48
- # expect(subject).to receive(:on).with(host, 'echo \'# geotrustglobal.pem\' >> /opt/puppet/ssl/cert.pem')
49
- # expect(subject).to receive(:on).with(host, 'cat geotrustglobal.pem >> /opt/puppet/ssl/cert.pem')
50
- # subject.add_solaris_cert host, 'geotrustglobal.pem'
51
- # }
52
- #end
48
+ describe 'add_solaris_cert' do
49
+ it {
50
+ host = {"platform" => 'solaris-11-x86_64', 'distmoduledir' => '/dne', 'hieraconf' => '/dne'}
51
+ expect(subject).to receive(:on).with(host, 'echo \'# geotrustglobal.pem\' >> /opt/puppet/ssl/cert.pem')
52
+ expect(subject).to receive(:on).with(host, 'cat geotrustglobal.pem >> /opt/puppet/ssl/cert.pem')
53
+ subject.add_solaris_cert host, 'geotrustglobal.pem'
54
+ }
55
+ end
53
56
 
54
57
  describe 'get_cert_hash' do
55
58
  it 'should contain 3 certs' do
@@ -97,6 +97,16 @@ describe 'beaker::puppet_install_helper' do
97
97
  expect(subject).to receive(:install_pe_on).with(hosts,{"pe_ver" => "3.8.1"})
98
98
  subject.run_puppet_install_helper_on(hosts)
99
99
  end
100
+ it "installs certs on PE 3 solaris" do
101
+ sol = {"platform" => 'solaris-11-64', 'distmoduledir' => '/dne','hieraconf' => '/dne'}
102
+ hosts = [ sol ]
103
+ ENV["PUPPET_INSTALL_TYPE"] = "pe"
104
+ ENV["PUPPET_INSTALL_VERSION"] = "3.8.1"
105
+ expect(subject).to receive(:install_pe_on).with(hosts,{"pe_ver" => "3.8.1"})
106
+ expect(subject).to receive(:create_cert_on_host).exactly(3).times
107
+ expect(subject).to receive(:add_solaris_cert).exactly(3).times
108
+ subject.run_puppet_install_helper_on(hosts)
109
+ end
100
110
  end
101
111
  context "for puppet-agent" do
102
112
  it "uses agent explicitly" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-puppet_install_helper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppetlabs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec