module-puppetdb/spec/unit/classes/master/config_spec.rb
Philip Wigg 6d58b2286e Fix use_ssl behaviour for the validator and new puppetdb_disable_ssl parameter
Previously the defined check wasn't working as expected, this patches fixes
this by relying on the check for the `puppetdb` class instead.

Tests have been added, and the README has been updated to include the new
puppetdb_disable_ssl parameter for the `puppetdb::master::config` class.
2014-10-08 12:56:46 +01:00

79 lines
1.9 KiB
Ruby

require 'spec_helper'
describe 'puppetdb::master::config', :type => :class do
let(:facts) do
{
:fqdn => 'puppetdb.example.com',
:osfamily => 'Debian',
:operatingsystem => 'Debian',
:operatingsystemrelease => '6.0',
:kernel => 'Linux',
:concat_basedir => '/var/lib/puppet/concat',
:id => 'root',
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
}
end
context 'when PuppetDB on remote server' do
context 'when using default values' do
it { should compile.with_all_deps }
end
end
context 'when PuppetDB and Puppet Master are on the same server' do
context 'when using default values' do
let(:pre_condition) { 'class { "puppetdb": }' }
it { should contain_puppetdb_conn_validator('puppetdb_conn').with(
:puppetdb_server => 'puppetdb.example.com',
:puppetdb_port => '8081',
:use_ssl => 'true') }
end
context 'when puppetdb class is declared with disable_ssl => true' do
let(:pre_condition) { 'class { "puppetdb": disable_ssl => true }' }
it { should contain_puppetdb_conn_validator('puppetdb_conn').with(
:puppetdb_port => '8080',
:use_ssl => 'false')
}
end
context 'when puppetdb_port => 1234' do
let(:pre_condition) { 'class { "puppetdb": }' }
let(:params) do { :puppetdb_port => '1234' } end
it { should contain_puppetdb_conn_validator('puppetdb_conn').with(
:puppetdb_port => '1234',
:use_ssl => 'true')
}
end
context 'when puppetdb_port => 1234 AND the puppetdb class is declared with disable_ssl => true' do
let(:pre_condition) { 'class { "puppetdb": disable_ssl => true }' }
let(:params) do {
:puppetdb_port => '1234'
} end
it { should contain_puppetdb_conn_validator('puppetdb_conn').with(
:puppetdb_port => '1234',
:use_ssl => 'false')
}
end
end
end