Skip to content

Commit

Permalink
add unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Nov 3, 2018
1 parent 7b38f35 commit 6c27a46
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions spec/classes/puppet_server_puppetserver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,53 @@
let(:params) { super().merge(server_puppetserver_version: '2.1.0') }
it { should raise_error(Puppet::Error, /puppetserver <2.2 is not supported by this module version/) }
end
describe 'alow jetty specific server threads' do
context 'with thread config' do
let :params do
{
server: true,
server_implementation: 'puppetserver',
server_ca: true,
server_puppetserver_dir: '/etc/custom/puppetserver',
server_jruby_gem_home: '/opt/puppetlabs/server/data/puppetserver/jruby-gems',
server_selector_threads: 1,
server_acceptor_threads: 2,
server_ssl_selector_threads: 3,
server_ssl_acceptor_threads: 4,
server_max_threads: 5
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/custom/puppetserver/conf.d/webserver.conf').
with_content(/selector-threads: 1/).
with_content(/acceptor-threads: 2/).
with_content(/ssl-selector-threads: 3/).
with_content(/ssl-acceptor-threads: 4/).
with_content(/max-threads: 5/)
}
end
context 'without thread config' do
let :params do
{
server: true,
server_implementation: 'puppetserver',
server_ca: true,
server_puppetserver_dir: '/etc/custom/puppetserver',
server_jruby_gem_home: '/opt/puppetlabs/server/data/puppetserver/jruby-gems'
}
end

it { is_expected.to compile.with_all_deps }
it { is_expected.to contain_file('/etc/custom/puppetserver/conf.d/webserver.conf').
without_content(/selector-threads:/).
without_content(/acceptor-threads:/).
without_content(/ssl-selector-threads:/).
without_content(/ssl-acceptor-threads:/).
without_content(/max-threads:/)}
end
end

end
end
end

0 comments on commit 6c27a46

Please sign in to comment.