-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #327 from jkroepke/tcp6
Allow 4 and 6 suffix inside proto to limit ip4 or ip6 connection only.
- Loading branch information
Showing
3 changed files
with
77 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,81 @@ | |
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^rcvbuf\s+393215$}) } | ||
end | ||
|
||
context 'when using udp4' do | ||
let(:params) do | ||
{ | ||
'country' => 'CO', | ||
'province' => 'ST', | ||
'city' => 'Some City', | ||
'organization' => 'example.org', | ||
'email' => '[email protected]', | ||
'proto' => 'udp4' | ||
} | ||
end | ||
|
||
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^proto\s+udp4$}) } | ||
end | ||
|
||
context 'when using udp6' do | ||
let(:params) do | ||
{ | ||
'country' => 'CO', | ||
'province' => 'ST', | ||
'city' => 'Some City', | ||
'organization' => 'example.org', | ||
'email' => '[email protected]', | ||
'proto' => 'udp6' | ||
} | ||
end | ||
|
||
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^proto\s+udp6$}) } | ||
end | ||
|
||
context 'when using tcp4' do | ||
let(:params) do | ||
{ | ||
'country' => 'CO', | ||
'province' => 'ST', | ||
'city' => 'Some City', | ||
'organization' => 'example.org', | ||
'email' => '[email protected]', | ||
'proto' => 'tcp4' | ||
} | ||
end | ||
|
||
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^proto\s+tcp4-server$}) } | ||
end | ||
|
||
context 'when using tcp6' do | ||
let(:params) do | ||
{ | ||
'country' => 'CO', | ||
'province' => 'ST', | ||
'city' => 'Some City', | ||
'organization' => 'example.org', | ||
'email' => '[email protected]', | ||
'proto' => 'tcp6' | ||
} | ||
end | ||
|
||
it { is_expected.to contain_file('/etc/openvpn/test_server.conf').with_content(%r{^proto\s+tcp6-server$}) } | ||
end | ||
|
||
context 'when using invalid value for proto' do | ||
let(:params) do | ||
{ | ||
'country' => 'CO', | ||
'province' => 'ST', | ||
'city' => 'Some City', | ||
'organization' => 'example.org', | ||
'email' => '[email protected]', | ||
'proto' => 'tcp5' | ||
} | ||
end | ||
|
||
it { expect { is_expected.to contain_file('/etc/openvpn/test_server') }.to raise_error(Puppet::PreformattedError) } | ||
end | ||
|
||
context 'creating a server in client mode' do | ||
let(:title) { 'test_client' } | ||
let(:nobind) { false } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters