File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 8686 fail(" Systemd::Manage_dropin[${name} ]: for unit ${unit} path_entry is only valid for path units" )
8787 }
8888
89+ if $socket_entry and $unit !~ Pattern[' ^[^/]+\. socket' ] {
90+ fail(" Systemd::Manage_dropin[${name} ]: for unit ${unit} socket_entry is only valid for socket units" )
91+ }
92+
8993 systemd::dropin_file { $name:
9094 ensure => $ensure ,
9195 filename => $filename ,
Original file line number Diff line number Diff line change 124124 fail(" Systemd::Manage_unit[${name} ]: path_entry is only valid for path units" )
125125 }
126126
127+ if $socket_entry and $name !~ Pattern[' ^[^/]+\. socket' ] {
128+ fail(" Systemd::Manage_unit[${name} ]: socket_entry is only valid for socket units" )
129+ }
130+
127131 if $ensure != ' absent' and $name =~ Pattern[' ^[^/]+\. service' ] and !$service_entry {
128132 fail(" Systemd::Manage_unit[${name} ]: service_entry is required for service units" )
129133 }
Original file line number Diff line number Diff line change 7575
7676 it { is_expected . to compile . and_raise_error ( %r{path_entry is only valid for path units} ) }
7777 end
78+
79+ context 'with a socket entry' do
80+ let ( :params ) do
81+ super ( ) . merge ( socket_entry : { 'ListenStream' => '1337' } )
82+ end
83+
84+ it { is_expected . to compile . and_raise_error ( %r{socket_entry is only valid for socket units} ) }
85+ end
7886 end
7987
8088 context 'on a timer' do
You can’t perform that action at this time.
0 commit comments