|
6 | 6 | describe 'kafka::broker', type: :class do
|
7 | 7 | on_supported_os.each do |os, os_facts|
|
8 | 8 | context "on #{os}" do
|
9 |
| - os_facts = os_facts.merge({ service_provider: 'systemd' }) |
10 |
| - |
11 | 9 | let(:facts) do
|
12 | 10 | os_facts
|
13 | 11 | end
|
|
60 | 58 | end
|
61 | 59 |
|
62 | 60 | context 'defaults' do
|
63 |
| - if os_facts[:service_provider] == 'systemd' |
| 61 | + if os_facts['service_provider'] == 'systemd' |
64 | 62 | it { is_expected.to contain_file('/etc/init.d/kafka').with_ensure('absent') }
|
65 | 63 | it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} }
|
66 | 64 | it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} }
|
|
74 | 72 | context 'limit_nofile set' do
|
75 | 73 | let(:params) { super().merge(limit_nofile: '65536') }
|
76 | 74 |
|
77 |
| - if os_facts[:service_provider] == 'systemd' |
| 75 | + if os_facts['service_provider'] == 'systemd' |
78 | 76 | it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} }
|
79 | 77 | else
|
80 | 78 | it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -n 65536$} }
|
|
84 | 82 | context 'limit_core set' do
|
85 | 83 | let(:params) { super().merge(limit_core: 'infinity') }
|
86 | 84 |
|
87 |
| - if os_facts[:service_provider] == 'systemd' |
| 85 | + if os_facts['service_provider'] == 'systemd' |
88 | 86 | it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} }
|
89 | 87 | else
|
90 | 88 | it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -c infinity$} }
|
91 | 89 | end
|
92 | 90 | end
|
93 | 91 |
|
94 |
| - context 'service_requires set', if: os_facts[:service_provider] == 'systemd' do |
| 92 | + context 'service_requires set', if: os_facts['service_provider'] == 'systemd' do |
95 | 93 | let(:params) { super().merge(service_requires: ['dummy.target']) }
|
96 | 94 |
|
97 | 95 | it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^After=dummy\.target$} }
|
|
0 commit comments