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
|
@ -6,6 +6,10 @@ describe 'postgresql::server::config_entry', :type => :define do
|
|||
:osfamily => 'RedHat',
|
||||
:operatingsystem => 'RedHat',
|
||||
:operatingsystemrelease => '6.4',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('contrib'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -16,6 +20,10 @@ describe 'postgresql::server::config_entry', :type => :define do
|
|||
end
|
||||
|
||||
context "syntax check" do
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
let(:params) { { :ensure => 'present'} }
|
||||
it { should contain_postgresql__server__config_entry('config_entry') }
|
||||
end
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::database_grant', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
: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
|
||||
|
||||
|
@ -21,6 +25,10 @@ describe 'postgresql::server::database_grant', :type => :define do
|
|||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__database_grant('test') }
|
||||
it { should contain_postgresql__server__grant('database:test') }
|
||||
end
|
||||
|
|
|
@ -6,11 +6,20 @@ describe 'postgresql::server::database', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
: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
|
||||
let :title do
|
||||
'test'
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__database('test') }
|
||||
it { should contain_postgresql_psql("Check for existence of db 'test'") }
|
||||
end
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::db', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
: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
|
||||
|
||||
|
@ -13,16 +17,42 @@ describe 'postgresql::server::db', :type => :define do
|
|||
'test'
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:user => 'test',
|
||||
:password => 'test',
|
||||
:owner => 'tester',
|
||||
}
|
||||
context 'without dbname param' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:user => 'test',
|
||||
:password => 'test',
|
||||
:owner => 'tester',
|
||||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('test') }
|
||||
it { should contain_postgresql__server__database('test').with_owner('tester') }
|
||||
it { should contain_postgresql__server__role('test') }
|
||||
it { should contain_postgresql__server__database_grant('GRANT test - ALL - test') }
|
||||
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__db('test') }
|
||||
it { should contain_postgresql__server__database('test').with_owner('tester') }
|
||||
it { should contain_postgresql__server__role('test') }
|
||||
it { should contain_postgresql__server__database_grant('GRANT test - ALL - test') }
|
||||
context 'dbname' do
|
||||
|
||||
let :params do
|
||||
{
|
||||
:dbname => 'testtest',
|
||||
:user => 'test',
|
||||
:password => 'test',
|
||||
:owner => 'tester',
|
||||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__database('testtest') }
|
||||
end
|
||||
end
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::grant', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
: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
|
||||
|
||||
|
@ -20,5 +24,9 @@ describe 'postgresql::server::grant', :type => :define do
|
|||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__grant('test') }
|
||||
end
|
||||
|
|
|
@ -6,7 +6,10 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('pg_hba'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
let :title do
|
||||
|
@ -17,6 +20,12 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
end
|
||||
|
||||
context 'test template 1' do
|
||||
let :pre_condition do
|
||||
<<-EOS
|
||||
class { 'postgresql::server': }
|
||||
EOS
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:type => 'host',
|
||||
|
@ -28,12 +37,19 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
}
|
||||
end
|
||||
it do
|
||||
content = param('concat::fragment', 'pg_hba_rule_test', 'content')
|
||||
content.should =~ /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/
|
||||
should contain_concat__fragment('pg_hba_rule_test').with({
|
||||
:content => /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
context 'test template 2' do
|
||||
let :pre_condition do
|
||||
<<-EOS
|
||||
class { 'postgresql::server': }
|
||||
EOS
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:type => 'local',
|
||||
|
@ -44,12 +60,19 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
}
|
||||
end
|
||||
it do
|
||||
content = param('concat::fragment', 'pg_hba_rule_test', 'content')
|
||||
content.should =~ /local\s+all\s+all\s+ident/
|
||||
should contain_concat__fragment('pg_hba_rule_test').with({
|
||||
:content => /local\s+all\s+all\s+ident/
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
context 'test template 3' do
|
||||
let :pre_condition do
|
||||
<<-EOS
|
||||
class { 'postgresql::server': }
|
||||
EOS
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:type => 'host',
|
||||
|
@ -62,13 +85,20 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
}
|
||||
end
|
||||
it do
|
||||
content = param('concat::fragment', 'pg_hba_rule_test', 'content')
|
||||
content.should =~ /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/
|
||||
should contain_concat__fragment('pg_hba_rule_test').with({
|
||||
:content => /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
context 'validation' do
|
||||
context 'validate type test 1' do
|
||||
let :pre_condition do
|
||||
<<-EOS
|
||||
class { 'postgresql::server': }
|
||||
EOS
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:type => 'invalid',
|
||||
|
@ -86,6 +116,12 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
end
|
||||
|
||||
context 'validate auth_method' do
|
||||
let :pre_condition do
|
||||
<<-EOS
|
||||
class { 'postgresql::server': }
|
||||
EOS
|
||||
end
|
||||
|
||||
let :params do
|
||||
{
|
||||
:type => 'local',
|
||||
|
@ -152,8 +188,9 @@ describe 'postgresql::server::pg_hba_rule', :type => :define do
|
|||
end
|
||||
|
||||
it do
|
||||
content = param('concat::fragment', 'pg_hba_rule_test', 'content')
|
||||
content.should =~ /local\s+all\s+all\s+0\.0\.0\.0\/0\s+peer/
|
||||
should contain_concat__fragment('pg_hba_rule_test').with({
|
||||
:content => /local\s+all\s+all\s+0\.0\.0\.0\/0\s+peer/
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::role', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
: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
|
||||
|
||||
|
@ -19,5 +23,9 @@ describe 'postgresql::server::role', :type => :define do
|
|||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__role('test') }
|
||||
end
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::table_grant', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('table_grant'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -22,6 +26,10 @@ describe 'postgresql::server::table_grant', :type => :define do
|
|||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__table_grant('test') }
|
||||
it { should contain_postgresql__server__grant('table:test') }
|
||||
end
|
||||
|
|
|
@ -6,6 +6,10 @@ describe 'postgresql::server::tablespace', :type => :define do
|
|||
:osfamily => 'Debian',
|
||||
:operatingsystem => 'Debian',
|
||||
:operatingsystemrelease => '6.0',
|
||||
:kernel => 'Linux',
|
||||
:concat_basedir => tmpfilename('tablespace'),
|
||||
:id => 'root',
|
||||
:path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -19,5 +23,9 @@ describe 'postgresql::server::tablespace', :type => :define do
|
|||
}
|
||||
end
|
||||
|
||||
let :pre_condition do
|
||||
"class {'postgresql::server':}"
|
||||
end
|
||||
|
||||
it { should contain_postgresql__server__tablespace('test') }
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue