|
125 | 125 | selinux_ignore_defaults = os_facts[:os]['family'] == 'RedHat' |
126 | 126 |
|
127 | 127 | it do |
128 | | - is_expected.to contain_systemd__service_limits("#{name}.service"). |
| 128 | + is_expected.to contain_systemd__manage_dropin('service-90-limits.conf'). |
129 | 129 | with_selinux_ignore_defaults(selinux_ignore_defaults). |
130 | | - with_limits({ 'LimitNOFILE' => value, 'OOMScoreAdjust' => 0 }). |
131 | | - with_restart_service(false) |
| 130 | + with_service_entry({ 'LimitNOFILE' => value, 'OOMScoreAdjust' => 0 }) |
132 | 131 | end |
133 | 132 | end |
134 | 133 | end |
|
147 | 146 | context "with oom_score_adj => '#{value}'", if: os_facts['systemd'] do |
148 | 147 | let(:params) { { oom_score_adj: value } } |
149 | 148 |
|
150 | | - it do |
151 | | - is_expected.to contain_systemd__service_limits("#{name}.service"). |
152 | | - with_limits({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }). |
153 | | - with_restart_service(false) |
154 | | - end |
| 149 | + it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf').with_service_entry({ 'LimitNOFILE' => 16_384, 'OOMScoreAdjust' => value }) } |
155 | 150 | end |
156 | 151 | end |
157 | 152 |
|
|
166 | 161 | end |
167 | 162 |
|
168 | 163 | context 'on systems with systemd', if: os_facts['systemd'] do |
169 | | - it do |
170 | | - is_expected.to contain_systemd__service_limits("#{name}.service"). |
171 | | - with_restart_service(false) |
172 | | - end |
| 164 | + it { is_expected.to contain_systemd__manage_dropin('service-90-limits.conf') } |
173 | 165 | end |
174 | 166 |
|
175 | 167 | context 'on systems without systemd', unless: os_facts['systemd'] do |
176 | | - it { is_expected.not_to contain_systemd__service_limits("#{name}.service") } |
| 168 | + it { is_expected.not_to contain_systemd__manage_dropin('service-90-limits.conf') } |
177 | 169 | end |
178 | 170 |
|
179 | 171 | context 'with admin_enable set to true' do |
|
0 commit comments