File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 166166 it { is_expected . not_to contain_class ( 'zabbix::resources::web' ) }
167167 end
168168
169+ describe 'with parameter: database_schema' do
170+ let :params do
171+ super ( ) . merge ( database_schema : 'zabbix' )
172+ end
173+
174+ it { is_expected . to contain_file ( '/etc/zabbix/web/zabbix.conf.php' ) . with_content ( %r{^\$ DB\[ 'SCHEMA'\] = 'zabbix'} ) }
175+ end
176+
169177 it { is_expected . to contain_apache__vhost ( 'zabbix.example.com' ) . with_name ( 'zabbix.example.com' ) }
170178
171179 context 'with database_* settings' do
Original file line number Diff line number Diff line change @@ -15,8 +15,12 @@ $DB['DATABASE'] = '<%= @database_name %>';
1515$DB['USER'] = '<%= @database_user %> ';
1616$DB['PASSWORD'] = '<%= @database_password %> ';
1717
18- // SCHEMA is relevant only for IBM_DB2 database
18+ // SCHEMA is relevant only for IBM_DB2 and PostgreSQL database
19+ <% if @database_schema -%>
20+ $DB['SCHEMA'] = '<%= @database_schema %> ';
21+ <% else -%>
1922$DB['SCHEMA'] = '';
23+ <% end -%>
2024
2125$ZBX_SERVER = '<%= @zabbix_server %> ';
2226$ZBX_SERVER_PORT = '<%= @zabbix_listenport %> ';
You can’t perform that action at this time.
0 commit comments