1 require 'spec_helper_acceptance'
3 describe 'postgresql::server::recovery', :unless => UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do
4 describe 'should manage recovery' do
7 file { '/tmp/recovery.conf':
12 apply_manifest(pp, :catch_failures => true)
15 it 'adds conf file' do
17 class { 'postgresql::globals':
18 recovery_conf_path => '/tmp/recovery.conf',
19 manage_recovery_conf => true,
22 class { 'postgresql::server': }
24 # Create a recovery.conf file
25 postgresql::server::recovery { "recovery.conf":
26 restore_command => 'restore_command',
27 recovery_target_timeline => 'recovery_target_timeline',
31 apply_manifest(pp, :catch_failures => true)
32 apply_manifest(pp, :catch_changes => true)
35 describe file('/tmp/recovery.conf') do
36 it { is_expected.to be_file }
37 it { is_expected.to contain /restore_command = 'restore_command'/ }
38 it { is_expected.to contain /recovery_target_timeline = 'recovery_target_timeline'/ }
42 describe 'should not manage recovery' do
43 it 'does not add conf file' do
45 class { 'postgresql::globals':
46 manage_recovery_conf => false,
49 class { 'postgresql::server': }
52 apply_manifest(pp, :catch_failures => true)
53 apply_manifest(pp, :catch_changes => true)
56 describe file('/tmp/recovery.conf') do
57 it { is_expected.not_to be_file }