|
52 | 52 | context 'manage_service false' do
|
53 | 53 | let(:params) { super().merge(manage_service: false) }
|
54 | 54 |
|
55 |
| - it { is_expected.not_to contain_file('/etc/init.d/kafka') } |
56 | 55 | it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service') }
|
57 | 56 | it { is_expected.not_to contain_service('kafka') }
|
58 | 57 | end
|
59 | 58 |
|
60 | 59 | context 'defaults' do
|
61 |
| - if os_facts['service_provider'] == 'systemd' |
62 |
| - it { is_expected.to contain_file('/etc/init.d/kafka').with_ensure('absent') } |
63 |
| - it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} } |
64 |
| - it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} } |
65 |
| - else |
66 |
| - it { is_expected.to contain_file('/etc/init.d/kafka') } |
67 |
| - end |
68 |
| - |
| 60 | + it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=} } |
| 61 | + it { is_expected.not_to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=} } |
69 | 62 | it { is_expected.to contain_service('kafka') }
|
70 | 63 | end
|
71 | 64 |
|
72 | 65 | context 'limit_nofile set' do
|
73 | 66 | let(:params) { super().merge(limit_nofile: '65536') }
|
74 | 67 |
|
75 |
| - if os_facts['service_provider'] == 'systemd' |
76 |
| - it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} } |
77 |
| - else |
78 |
| - it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -n 65536$} } |
79 |
| - end |
| 68 | + it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitNOFILE=65536$} } |
80 | 69 | end
|
81 | 70 |
|
82 | 71 | context 'limit_core set' do
|
83 | 72 | let(:params) { super().merge(limit_core: 'infinity') }
|
84 | 73 |
|
85 |
| - if os_facts['service_provider'] == 'systemd' |
86 |
| - it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} } |
87 |
| - else |
88 |
| - it { is_expected.to contain_file('/etc/init.d/kafka').with_content %r{ulimit -c infinity$} } |
89 |
| - end |
| 74 | + it { is_expected.to contain_file('/etc/systemd/system/kafka.service').with_content %r{^LimitCORE=infinity$} } |
90 | 75 | end
|
91 | 76 |
|
92 | 77 | context 'service_requires set', if: os_facts['service_provider'] == 'systemd' do
|
|
0 commit comments