Skip to content

Commit

Permalink
add reverse test of nobind server parameter, refs #156
Browse files Browse the repository at this point in the history
  • Loading branch information
luxflux committed May 12, 2015
1 parent baffc40 commit 355d416
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions spec/defines/openvpn_server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,23 @@

context "creating a server in client mode" do
let(:title) { 'test_client' }
let(:nobind) { false }
let(:params) { {
'remote' => ['vpn.example.com 12345'],
'server_poll_timeout' => 1,
'ping_timer_rem' => true,
'tls_auth' => true,
'tls_client' => true,
'nobind' => true,
'nobind' => nobind,
} }

context 'nobind is true' do
let(:nobind) { true }

it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^nobind$}) }
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(%r{port\s+\d+}) }
end

let(:facts) { {
:ipaddress_eth0 => '1.2.3.4',
:network_eth0 => '1.2.3.0',
Expand Down Expand Up @@ -268,8 +276,8 @@
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(/^dh/) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^tls-client$}) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^key-direction 1$}) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^nobind$}) }
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(%r{^port\s+\d+$}) }
it { should_not contain_file('/etc/openvpn/test_client.conf').with_content(%r{nobind}) }
it { should contain_file('/etc/openvpn/test_client.conf').with_content(%r{^port\s+\d+$}) }

it { should_not contain_openvpn__ca('test_client') }
end
Expand Down

0 comments on commit 355d416

Please sign in to comment.