-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,9 @@ | |
|
||
require 'spec_helper' | ||
|
||
RSpec::Matchers.define_negated_matcher :that_doesnt_notify, :that_notifies | ||
RSpec::Matchers.define_negated_matcher :that_doesnt_subscribe_to, :that_subscribes_to | ||
|
||
describe 'systemd::dropin_file' do | ||
context 'supported operating systems' do | ||
on_supported_os.each do |os, facts| | ||
|
@@ -69,8 +72,28 @@ | |
|
||
it { is_expected.to compile.with_all_deps } | ||
it { is_expected.to contain_service('myservice').that_subscribes_to("File[#{filename}]") } | ||
it { is_expected.to contain_systemd__daemon_reload(params[:unit]).that_notifies('Service[myservice]') } | ||
it { is_expected.to contain_systemd__daemon_reload(params[:unit]).that_comes_before('Service[myservice]') } | ||
it { is_expected.to contain_systemd__daemon_reload(params[:unit]).that_doesnt_notify('Service[myservice]') } | ||
Check failure on line 76 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 76 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 76 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
Check failure on line 76 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
|
||
end | ||
end | ||
|
||
context 'doesn\'t notify services' do | ||
let(:params) do | ||
super().merge(notify_service: false) | ||
end | ||
let(:filename) { "/etc/systemd/system/#{params[:unit]}.d/#{title}" } | ||
let(:pre_condition) do | ||
<<-PUPPET | ||
service { ['test', 'test.service']: | ||
} | ||
PUPPET | ||
end | ||
|
||
it { is_expected.to compile.with_all_deps } | ||
it { is_expected.to contain_service('test').that_doesnt_subscribe_to("File[#{filename}]") } | ||
Check failure on line 93 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 93 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 93 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
Check failure on line 93 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
|
||
it { is_expected.to contain_service('test.service').that_doesnt_subscribe_to("File[#{filename}]") } | ||
Check failure on line 94 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 94 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 94 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
Check failure on line 94 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
|
||
it { is_expected.to contain_service('test').that_doesnt_subscribe_to("Systemd::Daemon_reload[#{params[:unit]}]") } | ||
Check failure on line 95 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 95 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 95 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
Check failure on line 95 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
|
||
it { is_expected.to contain_service('test.service').that_doesnt_subscribe_to("Systemd::Daemon_reload[#{params[:unit]}]") } | ||
Check failure on line 96 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 96 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 8 (Ruby 3.2)
Check failure on line 96 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
Check failure on line 96 in spec/defines/dropin_file_spec.rb GitHub Actions / Puppet / 7 (Ruby 2.7)
|
||
end | ||
|
||
context 'with selinux_ignore_defaults set to true' do | ||
|