forked from puppetlabs/puppetlabs-postgresql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config_spec.rb
55 lines (50 loc) · 1.58 KB
/
config_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
require 'spec_helper'
describe 'postgresql::server::config', :type => :class do
let (:pre_condition) do
"include postgresql::server"
end
describe 'on RedHat 7' do
let :facts do
{
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '7.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 have the correct systemd-override file' do
is_expected.to contain_file('systemd-override').with ({
:ensure => 'present',
:path => '/etc/systemd/system/postgresql.service',
:owner => 'root',
:group => 'root',
})
is_expected.to contain_file('systemd-override') \
.with_content(/postgresql.service/)
end
describe 'with manage_package_repo => true and a version' do
let (:pre_condition) do
<<-EOS
class { 'postgresql::globals':
manage_package_repo => true,
version => '9.4',
}->
class { 'postgresql::server': }
EOS
end
it 'should have the correct systemd-override file' do
is_expected.to contain_file('systemd-override').with ({
:ensure => 'present',
:path => '/etc/systemd/system/postgresql-9.4.service',
:owner => 'root',
:group => 'root',
})
is_expected.to contain_file('systemd-override') \
.with_content(/postgresql-9.4.service/)
end
end
end
end