Files
puppet-mistral/spec/unit/provider/mistral_api_uwsgi_config/openstackconfig_spec.rb
Thomas Goirand 92ca9b40e2 Add support for mistral_api_uwsgi_config in Debian
This patch is adding the configuration of the number of workers,
threads, and the size of the listen queue in Debian, which uses
uwsgi to run Mistral API. Therefore, this patch adds a new
mistral_api_uwsgi_config provider as well as a new
mistral::wsgi::uwsgi class.

Signed-off-by: Thomas Goirand <zigo@debian.org>
Change-Id: I3e1a7b170c9840b0de83e0eb97c596154790d019
2025-10-03 12:43:32 +00:00

42 lines
1.4 KiB
Ruby

require 'spec_helper'
provider_class = Puppet::Type.type(:mistral_api_uwsgi_config).provider(:ini_setting)
describe provider_class do
it 'should default to the default setting when no other one is specified' do
resource = Puppet::Type::Mistral_api_uwsgi_config.new(
{:name => 'DEFAULT/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('DEFAULT')
expect(provider.setting).to eq('foo')
end
it 'should allow setting to be set explicitly' do
resource = Puppet::Type::Mistral_api_uwsgi_config.new(
{:name => 'dude/foo', :value => 'bar'}
)
provider = provider_class.new(resource)
expect(provider.section).to eq('dude')
expect(provider.setting).to eq('foo')
end
it 'should ensure absent when <SERVICE DEFAULT> is specified as a value' do
resource = Puppet::Type::Mistral_api_uwsgi_config.new(
{:name => 'dude/foo', :value => '<SERVICE DEFAULT>'}
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
it 'should ensure absent when value matches ensure_absent_val' do
resource = Puppet::Type::Mistral_api_uwsgi_config.new(
{:name => 'dude/foo', :value => 'foo', :ensure_absent_val => 'foo' }
)
provider = provider_class.new(resource)
provider.exists?
expect(resource[:ensure]).to eq :absent
end
end