File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 8181 File [$full_filename ] ~> Service <| title == $unit or name == $unit |>
8282
8383 if $daemon_reload {
84- Systemd::Daemon_reload[$unit ] ~ > Service <| title == $unit or name == $unit |>
84+ Systemd::Daemon_reload[$unit ] - > Service <| title == $unit or name == $unit |>
8585 }
8686
8787 if $unit =~ /\.service$/ {
8888 $short_service_name = regsubst($unit , /\.service$/, ' ' )
8989 File [$full_filename ] ~> Service <| title == $short_service_name or name == $short_service_name |>
9090
9191 if $daemon_reload {
92- Systemd::Daemon_reload[$unit ] ~ > Service <| title == $short_service_name or name == $short_service_name |>
92+ Systemd::Daemon_reload[$unit ] - > Service <| title == $short_service_name or name == $short_service_name |>
9393 }
9494 }
9595 }
Original file line number Diff line number Diff line change 6969
7070 it { is_expected . to compile . with_all_deps }
7171 it { is_expected . to contain_service ( 'myservice' ) . that_subscribes_to ( "File[#{ filename } ]" ) }
72- it { is_expected . to contain_systemd__daemon_reload ( params [ :unit ] ) . that_notifies ( 'Service[myservice]' ) }
72+ it { is_expected . not_to contain_systemd__daemon_reload ( params [ :unit ] ) . that_notifies ( 'Service[myservice]' ) }
73+ it { is_expected . to contain_systemd__daemon_reload ( params [ :unit ] ) . that_comes_before ( 'Service[myservice]' ) }
7374 end
7475 end
7576
77+ context 'doesn\'t notify services' do
78+ let ( :params ) do
79+ super ( ) . merge ( notify_service : false )
80+ end
81+ let ( :filename ) { "/etc/systemd/system/#{ params [ :unit ] } .d/#{ title } " }
82+ let ( :pre_condition ) do
83+ <<-PUPPET
84+ service { ['test', 'test.service']:
85+ }
86+ PUPPET
87+ end
88+
89+ it { is_expected . to compile . with_all_deps }
90+ it { is_expected . to contain_service ( 'test' ) }
91+ it { is_expected . not_to contain_service ( 'test' ) . that_subscribes_to ( "File[#{ filename } ]" ) }
92+ it { is_expected . not_to contain_service ( 'test' ) . that_subscribes_to ( "Systemd::Daemon_reload[#{ params [ :unit ] } ]" ) }
93+ it { is_expected . to contain_service ( 'test.service' ) }
94+ it { is_expected . not_to contain_service ( 'test.service' ) . that_subscribes_to ( "File[#{ filename } ]" ) }
95+ it { is_expected . not_to contain_service ( 'test.service' ) . that_subscribes_to ( "Systemd::Daemon_reload[#{ params [ :unit ] } ]" ) }
96+ end
97+
7698 context 'with selinux_ignore_defaults set to true' do
7799 let ( :params ) do
78100 super ( ) . merge ( selinux_ignore_defaults : true )
You can’t perform that action at this time.
0 commit comments