Skip to content

Commit 9c8864b

Browse files
committed
chore: first attempt at adding unit tests for SMSDevices
1 parent 6e76728 commit 9c8864b

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/classes/server_spec.rb

+28
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,34 @@
367367
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').without_content %r{^StartODBCPollers=1} }
368368
end
369369

370+
context 'with zabbix_server.conf and version 7.0' do
371+
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i <= 12
372+
next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'].to_i <= 20
373+
374+
let :params do
375+
{
376+
smsdevices: '/dev/ttyS0',
377+
zabbix_version: '7.0'
378+
}
379+
end
380+
381+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SMSDevices=/dev/ttyS0} }
382+
end
383+
384+
context 'with zabbix_server.conf and version 7.2' do
385+
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i <= 12
386+
next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'].to_i <= 20
387+
388+
let :params do
389+
{
390+
smsdevices: '/dev/ttyS0',
391+
zabbix_version: '7.2'
392+
}
393+
end
394+
395+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SMSDevices=/dev/ttyS0} }
396+
end
397+
370398
context 'with zabbix_server.conf and logtype declared' do
371399
describe 'as system' do
372400
let :params do

0 commit comments

Comments
 (0)