2013-04-09 14:26:02 +02:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe 'puppetdb', :type => :class do
|
|
|
|
ttl_args = ['node_ttl','node_purge_ttl','report_ttl']
|
|
|
|
|
|
|
|
context 'on a supported platform' do
|
|
|
|
let(:facts) do
|
|
|
|
{
|
2013-10-21 17:21:12 +02:00
|
|
|
:osfamily => 'Debian',
|
|
|
|
:operatingsystem => 'Debian',
|
|
|
|
:operatingsystemrelease => '6.0',
|
|
|
|
:kernel => 'Linux',
|
2013-04-09 14:26:02 +02:00
|
|
|
:concat_basedir => '/var/lib/puppet/concat',
|
2015-06-24 18:10:32 +02:00
|
|
|
:lsbdistid => 'Debian',
|
|
|
|
:lsbdistcodename => 'foo',
|
2014-04-08 16:28:02 +02:00
|
|
|
:id => 'root',
|
|
|
|
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
2016-04-20 15:55:26 +02:00
|
|
|
:selinux => false,
|
|
|
|
:iptables_persistent_version => '0.5.7',
|
2013-04-09 14:26:02 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
|
|
|
|
describe 'when using default values for puppetdb class' do
|
|
|
|
it { should contain_class('puppetdb') }
|
2016-04-28 13:39:54 +02:00
|
|
|
it { should contain_class('puppetdb::server') }
|
|
|
|
it { should contain_class('puppetdb::database::postgresql') }
|
2013-04-09 14:26:02 +02:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'with invalid arguments on a supported platform' do
|
|
|
|
let(:facts) do
|
|
|
|
{
|
|
|
|
:osfamily => 'RedHat',
|
2013-10-21 17:21:12 +02:00
|
|
|
:operatingsystem => 'Debian',
|
|
|
|
:operatingsystemrelease => '6.0',
|
|
|
|
:kernel => 'Linux',
|
2013-04-09 14:26:02 +02:00
|
|
|
:concat_basedir => '/var/lib/puppet/concat',
|
2016-04-20 15:55:26 +02:00
|
|
|
:selinux => true,
|
|
|
|
:iptables_persistent_version => '0.5.7',
|
2013-04-09 14:26:02 +02:00
|
|
|
}
|
|
|
|
end
|
|
|
|
ttl_args.each do |ttl_arg|
|
|
|
|
let(:params) do
|
|
|
|
{
|
|
|
|
ttl_arg => 'invalid_value'
|
|
|
|
}
|
|
|
|
end
|
|
|
|
it "when using a value that does not match the validation regex for #{ttl_arg} puppetdb class" do
|
|
|
|
expect { should contain_class('puppetdb') }.to raise_error(Puppet::Error)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|