@@ -216,34 +216,37 @@ class { 'postgresql::server':
216216 describe 'on Gentoo' do
217217 include_examples 'Gentoo'
218218
219- let ( :pre_condition ) do
220- <<-EOS
221- class { 'postgresql::globals':
222- version => '9.5',
223- }->
224- class { 'postgresql::server': }
225- EOS
226- end
219+ describe 'with systemd' do
220+ let ( :facts ) { super ( ) . merge ( service_provider : 'systemd' ) }
221+ let ( :pre_condition ) do
222+ <<-EOS
223+ class { 'postgresql::globals':
224+ version => '9.5',
225+ }->
226+ class { 'postgresql::server': }
227+ EOS
228+ end
227229
228- it 'does not have SELinux port defined' do
229- is_expected . not_to contain_exec ( '/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432' )
230- end
230+ it 'does not have SELinux port defined' do
231+ is_expected . not_to contain_exec ( '/usr/sbin/semanage port -a -t postgresql_port_t -p tcp 5432' )
232+ end
231233
232- it 'removes the old systemd-override file' do
233- is_expected . to contain_file ( 'old-systemd-override' )
234- . with ( ensure : 'absent' , path : '/etc/systemd/system/postgresql-9.5.service' )
235- end
234+ it 'removes the old systemd-override file' do
235+ is_expected . to contain_file ( 'old-systemd-override' )
236+ . with ( ensure : 'absent' , path : '/etc/systemd/system/postgresql-9.5.service' )
237+ end
236238
237- it 'has the correct systemd-override drop file' do
238- is_expected . to contain_file ( 'systemd-override' ) . with (
239- ensure : 'file' , path : '/etc/systemd/system/postgresql-9.5.service.d/postgresql-9.5.conf' ,
240- owner : 'root' , group : 'root'
241- )
242- end
239+ it 'has the correct systemd-override drop file' do
240+ is_expected . to contain_file ( 'systemd-override' ) . with (
241+ ensure : 'file' , path : '/etc/systemd/system/postgresql-9.5.service.d/postgresql-9.5.conf' ,
242+ owner : 'root' , group : 'root'
243+ )
244+ end
243245
244- it 'has the correct systemd-override file #regex' do
245- is_expected . to contain_file ( 'systemd-override' ) \
246- . with_content ( %r{(?!^.include)} )
246+ it 'has the correct systemd-override file #regex' do
247+ is_expected . to contain_file ( 'systemd-override' ) \
248+ . with_content ( %r{(?!^.include)} )
249+ end
247250 end
248251 end
249252end
0 commit comments