|
179 | 179 | it { is_expected.to compile.with_all_deps }
|
180 | 180 | it { is_expected.to contain_systemd__service_limits('openstack-nova-compute.service').with_limits('LimitNOFILE' => 32_768) }
|
181 | 181 | end
|
| 182 | + context 'when passing networks' do |
| 183 | + let :params do |
| 184 | + { |
| 185 | + networks: { 'uplink.network' => { 'content' => 'foo' }, 'uplink.netdev' => { 'content' => 'bar' }, }, |
| 186 | + } |
| 187 | + end |
| 188 | + |
| 189 | + it { is_expected.to compile.with_all_deps } |
| 190 | + it { is_expected.to contain_systemd__network('uplink.network').with_content('foo') } |
| 191 | + it { is_expected.to contain_systemd__network('uplink.netdev').with_content('bar') } |
| 192 | + it { is_expected.to contain_file('/etc/systemd/network/uplink.network') } |
| 193 | + it { is_expected.to contain_file('/etc/systemd/network/uplink.netdev') } |
| 194 | + it { is_expected.to have_systemd__network_resource_count(2) } |
| 195 | + end |
| 196 | + context 'when passing timers' do |
| 197 | + let :params do |
| 198 | + { |
| 199 | + timers: { 'first.timer' => { 'timer_content' => 'foo' }, 'second.timer' => { 'timer_content' => 'bar' }, }, |
| 200 | + } |
| 201 | + end |
182 | 202 |
|
| 203 | + it { is_expected.to compile.with_all_deps } |
| 204 | + it { is_expected.to contain_systemd__timer('first.timer').with_timer_content('foo') } |
| 205 | + it { is_expected.to contain_systemd__timer('second.timer').with_timer_content('bar') } |
| 206 | + it { is_expected.to contain_systemd__unit_file('first.timer').with_content('foo') } |
| 207 | + it { is_expected.to contain_systemd__unit_file('second.timer').with_content('bar') } |
| 208 | + it { is_expected.to contain_file('/etc/systemd/system/first.timer') } |
| 209 | + it { is_expected.to contain_file('/etc/systemd/system/second.timer') } |
| 210 | + it { is_expected.to have_systemd__timer_resource_count(2) } |
| 211 | + it { is_expected.to have_systemd__unit_file_resource_count(2) } |
| 212 | + end |
| 213 | + context 'when passing tmpfiles' do |
| 214 | + let :params do |
| 215 | + { |
| 216 | + tmpfiles: { 'first_tmpfile.conf' => { 'content' => 'foo' }, 'second_tmpfile.conf' => { 'content' => 'bar' }, }, |
| 217 | + } |
| 218 | + end |
| 219 | + |
| 220 | + it { is_expected.to compile.with_all_deps } |
| 221 | + it { is_expected.to contain_systemd__tmpfile('first_tmpfile.conf').with_content('foo') } |
| 222 | + it { is_expected.to contain_systemd__tmpfile('second_tmpfile.conf').with_content('bar') } |
| 223 | + it { is_expected.to contain_file('/etc/tmpfiles.d/first_tmpfile.conf') } |
| 224 | + it { is_expected.to contain_file('/etc/tmpfiles.d/second_tmpfile.conf') } |
| 225 | + it { is_expected.to have_systemd__tmpfile_resource_count(2) } |
| 226 | + end |
| 227 | + context 'when passing unit_files' do |
| 228 | + let :params do |
| 229 | + { |
| 230 | + unit_files: { 'first.service' => { 'content' => 'foo' }, 'second.service' => { 'content' => 'bar' }, }, |
| 231 | + } |
| 232 | + end |
| 233 | + |
| 234 | + it { is_expected.to compile.with_all_deps } |
| 235 | + it { is_expected.to contain_systemd__unit_file('first.service').with_content('foo') } |
| 236 | + it { is_expected.to contain_systemd__unit_file('second.service').with_content('bar') } |
| 237 | + it { is_expected.to contain_file('/etc/systemd/system/first.service') } |
| 238 | + it { is_expected.to contain_file('/etc/systemd/system/second.service') } |
| 239 | + it { is_expected.to have_systemd__unit_file_resource_count(2) } |
| 240 | + end |
183 | 241 | context 'when managing Accounting options' do
|
184 | 242 | let :params do
|
185 | 243 | {
|
|
0 commit comments