3 describe 'postgresql::server::initdb', :type => :class do
4 let (:pre_condition) do
5 "include postgresql::server"
7 describe 'on RedHat' do
10 :osfamily => 'RedHat',
11 :operatingsystem => 'CentOS',
12 :operatingsystemrelease => '6.0',
13 :concat_basedir => tmpfilename('server'),
16 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
20 it { is_expected.to contain_file('/var/lib/pgsql/data').with_ensure('directory') }
22 describe 'on Amazon' do
25 :osfamily => 'RedHat',
26 :operatingsystem => 'Amazon',
27 :operatingsystemrelease => '1.0',
28 :concat_basedir => tmpfilename('server'),
31 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
35 it { is_expected.to contain_file('/var/lib/pgsql92/data').with_ensure('directory') }
38 describe 'exec with module_workdir => /var/tmp' do
41 :osfamily => 'RedHat',
42 :operatingsystem => 'CentOS',
43 :operatingsystemrelease => '6.0',
44 :concat_basedir => tmpfilename('server'),
47 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
51 let (:pre_condition) do
53 class { 'postgresql::globals':
54 module_workdir => '/var/tmp',
56 class { 'postgresql::server': }
60 it 'should contain exec with specified working directory' do
61 is_expected.to contain_exec('postgresql_initdb').with ({
67 describe 'exec with module_workdir => undef' do
70 :osfamily => 'RedHat',
71 :operatingsystem => 'CentOS',
72 :operatingsystemrelease => '6.0',
73 :concat_basedir => tmpfilename('server'),
76 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
80 let (:pre_condition) do
82 class { 'postgresql::globals':
84 class { 'postgresql::server': }
88 it 'should contain exec with default working directory' do
89 is_expected.to contain_exec('postgresql_initdb').with ({
96 describe 'postgresql_psql with module_workdir => /var/tmp' do
99 :osfamily => 'RedHat',
100 :operatingsystem => 'CentOS',
101 :operatingsystemrelease => '6.0',
102 :concat_basedir => tmpfilename('server'),
105 :path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
110 let (:pre_condition) do
112 class { 'postgresql::globals':
113 module_workdir => '/var/tmp',
115 needs_initdb => false,
117 class { 'postgresql::server': }
120 it 'should contain postgresql_psql with specified working directory' do
121 is_expected.to contain_postgresql_psql('Set template1 encoding to test').with({