-
-
Notifications
You must be signed in to change notification settings - Fork 197
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 #369 from Rubueno/easyrsa_3_fix
Enable revocation when easyrsa version 3.0 is used
- Loading branch information
Showing
3 changed files
with
61 additions
and
4 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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
describe 'openvpn::revoke', type: :define do | ||
on_supported_os.each do |os, facts| | ||
context "on #{os}" do | ||
context "on #{os} with easyrsa version 2.0" do | ||
let(:pre_condition) do | ||
[ | ||
'openvpn::server { "test_server": | ||
|
@@ -18,7 +18,9 @@ | |
].join | ||
end | ||
let(:facts) do | ||
facts | ||
facts.merge( | ||
easyrsa: '2.0' | ||
) | ||
end | ||
let(:title) { 'test_client' } | ||
let(:params) { { 'server' => 'test_server' } } | ||
|
@@ -31,5 +33,36 @@ | |
) | ||
} | ||
end | ||
context "on #{os} with easyrsa version 3.0" do | ||
let(:pre_condition) do | ||
[ | ||
'openvpn::server { "test_server": | ||
country => "CO", | ||
province => "ST", | ||
city => "Some City", | ||
organization => "example.org", | ||
email => "[email protected]" | ||
}', | ||
'openvpn::client { "test_client3": | ||
server => "test_server" | ||
}' | ||
].join | ||
end | ||
let(:facts) do | ||
facts.merge( | ||
easyrsa: '3.0' | ||
) | ||
end | ||
let(:title) { 'test_client3' } | ||
let(:params) { { 'server' => 'test_server' } } | ||
|
||
it { is_expected.to compile.with_all_deps } | ||
|
||
it { | ||
is_expected.to contain_exec('revoke certificate for test_client3 in context of test_server').with( | ||
'command' => ". ./vars && ./easyrsa revoke --batch test_client3; echo \"exit $?\" | grep -qE '(error 23|exit (0|2))' && touch revoked/test_client3" | ||
) | ||
} | ||
end | ||
end | ||
end |
84ba714
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
$revocation_command
also need a default value?