diff --git a/spec/classes/agent_spec.rb b/spec/classes/agent_spec.rb index e2e82566..a87eea0e 100644 --- a/spec/classes/agent_spec.rb +++ b/spec/classes/agent_spec.rb @@ -352,6 +352,30 @@ end end + context 'tlsaccept with one value array' do + if facts[:kernel] == 'Linux' + let :params do + { + tlsaccept: ['cert'] + } + end + + it { is_expected.to contain_file(config_path).with_content %r{^TLSAccept=cert$} } + end + end + + context 'tlsaccept with two value array' do + if facts[:kernel] == 'Linux' + let :params do + { + tlsaccept: ['unencrypted','cert'] + } + end + + it { is_expected.to contain_file(config_path).with_content %r{^TLSAccept=unencrypted,cert$} } + end + end + context 'without ListenIP' do let :params do { diff --git a/spec/classes/proxy_spec.rb b/spec/classes/proxy_spec.rb index 6b38bf58..eb7dbb0e 100644 --- a/spec/classes/proxy_spec.rb +++ b/spec/classes/proxy_spec.rb @@ -415,6 +415,37 @@ it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^LogFileSize=10$} } end end + + context 'tlsaccept with one string value' do + let :params do + { + tlsaccept: 'cert', + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^TLSAccept=cert$} } + end + + context 'tlsaccept with one value array' do + let :params do + { + tlsaccept: ['cert'] + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^TLSAccept=cert$} } + end + + context 'tlsaccept with two value array' do + let :params do + { + tlsaccept: ['unencrypted','cert'] + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^TLSAccept=unencrypted,cert$} } + end + end end end