3 describe 'postgresql::server::pg_hba_rule', :type => :define do
7 :operatingsystem => 'Debian',
8 :operatingsystemrelease => '6.0',
10 :concat_basedir => tmpfilename('pg_hba'),
12 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
19 tmpfilename('pg_hba_rule')
22 context 'test template 1' do
25 class { 'postgresql::server': }
34 :address => '1.1.1.1/24',
35 :auth_method => 'md5',
40 is_expected.to contain_concat__fragment('pg_hba_rule_test').with({
41 :content => /host\s+all\s+all\s+1\.1\.1\.1\/24\s+md5/
46 context 'test template 2' do
49 class { 'postgresql::server': }
58 :auth_method => 'ident',
63 is_expected.to contain_concat__fragment('pg_hba_rule_test').with({
64 :content => /local\s+all\s+all\s+ident/
69 context 'test template 3' do
72 class { 'postgresql::server': }
81 :address => '0.0.0.0/0',
82 :auth_method => 'ldap',
83 :auth_option => 'foo=bar',
88 is_expected.to contain_concat__fragment('pg_hba_rule_test').with({
89 :content => /host\s+all\s+all\s+0\.0\.0\.0\/0\s+ldap\s+foo=bar/
94 context 'validation' do
95 context 'validate supported auth_method' do
98 class { 'postgresql::globals':
101 class { 'postgresql::server': }
110 :address => '0.0.0.0/0',
111 :auth_method => 'peer',
117 is_expected.to contain_concat__fragment('pg_hba_rule_test').with(
119 :content => /local\s+all\s+all\s+0\.0\.0\.0\/0\s+peer/