59c1cbfbf8
This is a very very large change to the module. It started out as a fix to add postgresl::server::config_entry, and quickly became a rewrite to fix a lot of ordering issues inherent in the API. Since this changes the Public API it is considered a backwards compatible change. See the upgrading guide in README.md for more details as to what has been modified in this patch. Signed-off-by: Ken Barber <ken@bob.sh>
50 lines
1.3 KiB
Ruby
50 lines
1.3 KiB
Ruby
require 'spec_helper_system'
|
|
|
|
describe 'common patterns:' do
|
|
describe 'postgresql.conf include pattern' do
|
|
after :all do
|
|
pp = <<-EOS
|
|
class { 'postgresql::server': ensure => absent }
|
|
|
|
file { '/tmp/include.conf':
|
|
ensure => absent
|
|
}
|
|
EOS
|
|
puppet_apply(pp) do |r|
|
|
r.exit_code.should_not == 1
|
|
end
|
|
end
|
|
|
|
it "should support an 'include' directive at the end of postgresql.conf" do
|
|
pending('no support for include directive with centos 5/postgresql 8.1',
|
|
:if => (node.facts['osfamily'] == 'RedHat' and node.facts['lsbmajdistrelease'] == '5'))
|
|
pp = <<-EOS
|
|
class { 'postgresql::server': }
|
|
|
|
$extras = "/tmp/include.conf"
|
|
|
|
file { $extras:
|
|
content => 'max_connections = 123',
|
|
notify => Class['postgresql::server::service'],
|
|
}
|
|
|
|
postgresql::server::config_entry { 'include':
|
|
value => $extras,
|
|
require => File[$extras],
|
|
}
|
|
EOS
|
|
|
|
puppet_apply(pp) do |r|
|
|
r.exit_code.should == 2
|
|
r.refresh
|
|
r.exit_code.should == 0
|
|
end
|
|
|
|
psql('--command="show max_connections" -t') do |r|
|
|
r.stdout.should =~ /123/
|
|
r.stderr.should == ''
|
|
r.exit_code.should == 0
|
|
end
|
|
end
|
|
end
|
|
end
|