File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 134134 }
135135 end
136136
137- it { is_expected . to contain_concat ( '/etc/ssh/sshd_config' ) . with_validate_cmd ( '/usr/sbin/sshd -tf %' ) }
137+ case os_facts [ :os ] [ 'family' ]
138+ when 'FreeBSD'
139+ sshd_binary = '/usr/local/sbin/sshd'
140+ when 'Archlinux'
141+ sshd_binary = '/usr/bin/sshd'
142+ else
143+ sshd_binary = '/usr/sbin/sshd'
144+ end
145+
146+ it { is_expected . to contain_concat ( '/etc/ssh/sshd_config' ) . with_validate_cmd ( "#{ sshd_binary } -tf %" ) }
138147 end
139148
140149 context 'without resource purging' do
Original file line number Diff line number Diff line change 7676 }
7777 end
7878
79- it { is_expected . to contain_concat ( '/etc/ssh/sshd_config' ) . with_validate_cmd ( '/usr/sbin/sshd -tf %' ) }
79+ case os_facts [ :os ] [ 'family' ]
80+ when 'FreeBSD'
81+ sshd_binary = '/usr/local/sbin/sshd'
82+ when 'Archlinux'
83+ sshd_binary = '/usr/bin/sshd'
84+ else
85+ sshd_binary = '/usr/sbin/sshd'
86+ end
87+
88+ it { is_expected . to contain_concat ( '/etc/ssh/sshd_config' ) . with_validate_cmd ( "#{ sshd_binary } -tf %" ) }
89+ end
90+
91+ context 'with a different sshd_binary location' do
92+ let :params do
93+ {
94+ validate_sshd_file : true ,
95+ sshd_binary : '/usr/another_bin/sshd'
96+ }
97+ end
98+
99+ it { is_expected . to contain_concat ( '/etc/ssh/sshd_config' ) . with_validate_cmd ( '/usr/another_bin/sshd -tf %' ) }
80100 end
81101
82102 context 'with a different sshd_config location' do
You can’t perform that action at this time.
0 commit comments