Added puppetlabs-firewall (required by puppetlabs-postgresql), updated the other modules.
This commit is contained in:
parent
5f4b7a3b72
commit
dee66abcdd
137 changed files with 11118 additions and 419 deletions
|
@ -7,6 +7,7 @@ describe 'postgresql::globals', :type => :class do
|
|||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:lsbdistid => 'Debian',
|
||||
:lsbdistcodename => 'squeeze',
|
||||
}
|
||||
end
|
||||
|
||||
|
|
31
modules/postgresql/spec/unit/classes/lib/perl_spec.rb
Normal file
31
modules/postgresql/spec/unit/classes/lib/perl_spec.rb
Normal file
|
@ -0,0 +1,31 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'postgresql::lib::perl', :type => :class do
|
||||
|
||||
describe 'on a redhat based os' do
|
||||
let :facts do {
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystem => 'RedHat',
|
||||
:operatingsystemrelease => '6.4',
|
||||
}
|
||||
end
|
||||
it { should contain_package('perl-DBD-Pg').with(
|
||||
:name => 'perl-DBD-Pg',
|
||||
:ensure => 'present'
|
||||
)}
|
||||
end
|
||||
|
||||
describe 'on a debian based os' do
|
||||
let :facts do {
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
}
|
||||
end
|
||||
it { should contain_package('perl-DBD-Pg').with(
|
||||
:name => 'libdbd-pg-perl',
|
||||
:ensure => 'present'
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
|
@ -7,6 +7,7 @@ describe 'postgresql::repo', :type => :class do
|
|||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:lsbdistid => 'Debian',
|
||||
:lsbdistcodename => 'squeeze',
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -12,6 +12,8 @@ describe 'postgresql::server::contrib', :type => :class do
|
|||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('contrib'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
|
|
@ -11,6 +11,9 @@ describe 'postgresql::server::initdb', :type => :class do
|
|||
:operatingsystem => 'CentOS',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:concat_basedir => tmpfilename('server'),
|
||||
:kernel => 'Linux',
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
it { should contain_file('/var/lib/pgsql/data').with_ensure('directory') }
|
||||
|
@ -20,7 +23,11 @@ describe 'postgresql::server::initdb', :type => :class do
|
|||
{
|
||||
:osfamily => 'RedHat',
|
||||
:operatingsystem => 'Amazon',
|
||||
:operatingsystemrelease => '1.0',
|
||||
:concat_basedir => tmpfilename('server'),
|
||||
:kernel => 'Linux',
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
it { should contain_file('/var/lib/pgsql9/data').with_ensure('directory') }
|
||||
|
|
|
@ -8,6 +8,8 @@ describe 'postgresql::server::plperl', :type => :class do
|
|||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('plperl'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
|
44
modules/postgresql/spec/unit/classes/server/postgis_spec.rb
Normal file
44
modules/postgresql/spec/unit/classes/server/postgis_spec.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
require 'spec_helper'
|
||||
|
||||
describe 'postgresql::server::postgis', :type => :class do
|
||||
let :pre_condition do
|
||||
"class { 'postgresql::server': }"
|
||||
end
|
||||
|
||||
let :facts do
|
||||
{
|
||||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('postgis'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
describe 'with parameters' do
|
||||
let(:params) do
|
||||
{
|
||||
:package_name => 'mypackage',
|
||||
:package_ensure => 'absent',
|
||||
}
|
||||
end
|
||||
|
||||
it 'should create package with correct params' do
|
||||
should contain_package('postgresql-postgis').with({
|
||||
:ensure => 'absent',
|
||||
:name => 'mypackage',
|
||||
:tag => 'postgresql',
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with no parameters' do
|
||||
it 'should create package with postgresql tag' do
|
||||
should contain_package('postgresql-postgis').with({
|
||||
:tag => 'postgresql',
|
||||
})
|
||||
end
|
||||
end
|
||||
end
|
|
@ -8,6 +8,8 @@ describe 'postgresql::server', :type => :class do
|
|||
:operatingsystemrelease => '6.0',
|
||||
:concat_basedir => tmpfilename('server'),
|
||||
:kernel => 'Linux',
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -19,6 +21,24 @@ describe 'postgresql::server', :type => :class do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'service_ensure => running' do
|
||||
let(:params) {{ :service_ensure => 'running' }}
|
||||
it { should contain_class("postgresql::params") }
|
||||
it { should contain_class("postgresql::server") }
|
||||
it 'should validate connection' do
|
||||
should contain_postgresql__validate_db_connection('validate_service_is_running')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'service_ensure => stopped' do
|
||||
let(:params) {{ :service_ensure => 'stopped' }}
|
||||
it { should contain_class("postgresql::params") }
|
||||
it { should contain_class("postgresql::server") }
|
||||
it 'shouldnt validate connection' do
|
||||
should_not contain_postgresql__validate_db_connection('validate_service_is_running')
|
||||
end
|
||||
end
|
||||
|
||||
describe 'manage_firewall => true' do
|
||||
let(:params) do
|
||||
{
|
||||
|
@ -49,7 +69,7 @@ describe 'postgresql::server', :type => :class do
|
|||
|
||||
it 'stop the service' do
|
||||
should contain_service('postgresqld').with({
|
||||
:ensure => false,
|
||||
:ensure => 'stopped',
|
||||
})
|
||||
end
|
||||
|
||||
|
@ -81,7 +101,7 @@ describe 'postgresql::server', :type => :class do
|
|||
|
||||
it 'should still enable the service' do
|
||||
should contain_service('postgresqld').with({
|
||||
:ensure => true,
|
||||
:ensure => 'running',
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue