Skip to content

Commit

Permalink
enh: Update code to set status parameter optional
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Mutel authored and smutel committed Oct 18, 2020
1 parent 50ea3ba commit ae1ecd5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,21 @@
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^client\-disconnect\s+"/etc/openvpn/test_server/scripts/disconnect\.sh"$}) }
end

context 'when not using status log' do
let(:params) do
{
'country' => 'CO',
'province' => 'ST',
'city' => 'Some City',
'organization' => 'example.org',
'email' => '[email protected]',
'status_log' => ''
}
end

it { is_expected.not_to contain_file("#{server_directory}/test_server.conf").with_content(%r{^status}) }
end

context 'when not using scripts' do
let(:params) do
{
Expand Down
2 changes: 2 additions & 0 deletions templates/server.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ user <%= @user %>
<% if @logfile -%>
log-append <%= @logfile %>
<% end -%>
<% if @status_log != '' -%>
status <%= @status_log %>
<% end -%>
<% if @status_version != '' -%>
status-version <%= @status_version %>
<% end -%>
Expand Down

0 comments on commit ae1ecd5

Please sign in to comment.