diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-02-08 11:51:10 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2022-02-08 11:51:10 +0100 |
commit | 74e2687fa98ea5ba25fbe07c038253d1fc14584e (patch) | |
tree | a390be820f6b3bd91f849acb41415d610e41b186 /code/environments/production/modules/certregen/spec/classes | |
parent | 49c9d906fd74f51484977736d78f16095d4f1a69 (diff) | |
download | puppet.KATH-74e2687fa98ea5ba25fbe07c038253d1fc14584e.tar.gz puppet.KATH-74e2687fa98ea5ba25fbe07c038253d1fc14584e.tar.bz2 puppet.KATH-74e2687fa98ea5ba25fbe07c038253d1fc14584e.zip |
code/environments/production/modules: Drop certregen module again.
Diffstat (limited to 'code/environments/production/modules/certregen/spec/classes')
-rw-r--r-- | code/environments/production/modules/certregen/spec/classes/client_spec.rb | 81 |
1 files changed, 0 insertions, 81 deletions
diff --git a/code/environments/production/modules/certregen/spec/classes/client_spec.rb b/code/environments/production/modules/certregen/spec/classes/client_spec.rb deleted file mode 100644 index 843c3b1..0000000 --- a/code/environments/production/modules/certregen/spec/classes/client_spec.rb +++ /dev/null @@ -1,81 +0,0 @@ -require 'spec_helper' - -RSpec.shared_examples "managing the CRL on the client" do |setting| - describe "when manage_crl is false" do - let(:params) {{'manage_crl' => false}} - - it "doesn't manage the hostcrl on the client" do - should_not contain_file(client_hostcrl) - end - end - - describe "when manage_crl is true" do - let(:params) {{'manage_crl' => true}} - - it "manages the hostcrl on the client from the server '#{setting}' setting" do - should contain_file(client_hostcrl).with( - 'ensure' => 'present', - 'content' => Puppet.settings.setting(setting).open(&:read), - 'mode' => '0644', - ) - end - end -end - -RSpec.describe 'certregen::client' do - include_context "Initialize CA" - - let(:client_localcacert) { tmpfilename('ca.pem') } - let(:client_hostcrl) { tmpfilename('crl.pem') } - - let(:facts) do - { - 'localcacert' => client_localcacert, - 'hostcrl' => client_hostcrl, - 'pe_build' => '2016.4.0', - } - end - - before do - Puppet.settings.setting(:localcacert).open('w') { |f| f.write("local CA cert") } - Puppet.settings.setting(:hostcrl).open('w') { |f| f.write("local CRL") } - end - - describe 'when the compile master has CA ssl files' do - before do - Puppet.settings.setting(:cacert).open('w') { |f| f.write("CA cert") } - Puppet.settings.setting(:cacrl).open('w') { |f| f.write("CA CRL") } - end - - describe "managing the localcacert on the client" do - it do - should contain_file(client_localcacert).with( - 'ensure' => 'present', - 'content' => Puppet.settings.setting(:cacert).open(&:read), - 'mode' => '0644', - ) - end - end - - it_behaves_like "managing the CRL on the client", :cacrl - end - - describe "when the compile master only has agent SSL files" do - before do - FileUtils.rm(Puppet[:cacert]) - FileUtils.rm(Puppet[:cacrl]) - end - - describe "managing the localcacert on the client" do - it 'manages the client CA cert from the `localcacert` setting' do - should contain_file(client_localcacert).with( - 'ensure' => 'present', - 'content' => Puppet.settings.setting(:localcacert).open(&:read), - 'mode' => '0644', - ) - end - end - - it_behaves_like "managing the CRL on the client", :hostcrl - end -end |