File tree 1 file changed +23
-1
lines changed
1 file changed +23
-1
lines changed 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