File tree 2 files changed +25
-3
lines changed
2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 81
81
File [$full_filename ] ~> Service <| title == $unit or name == $unit |>
82
82
83
83
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 |>
85
85
}
86
86
87
87
if $unit =~ /\.service$/ {
88
88
$short_service_name = regsubst($unit , /\.service$/, ' ' )
89
89
File [$full_filename ] ~> Service <| title == $short_service_name or name == $short_service_name |>
90
90
91
91
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 |>
93
93
}
94
94
}
95
95
}
Original file line number Diff line number Diff line change 69
69
70
70
it { is_expected . to compile . with_all_deps }
71
71
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]' ) }
73
74
end
74
75
end
75
76
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
+
76
98
context 'with selinux_ignore_defaults set to true' do
77
99
let ( :params ) do
78
100
super ( ) . merge ( selinux_ignore_defaults : true )
You can’t perform that action at this time.
0 commit comments