-
-
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.
Enable revocation when easyrsa version 3.0 is used
The `remote_host` parameter is set, because the expected value of `foo.example.com` is not evaluated correctly on ArchLinux.
- Loading branch information
Ruben Bosch
committed
Dec 13, 2019
1 parent
c2b95e9
commit 2ef61b4
Showing
3 changed files
with
59 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 |