Files
puppet-openstacklib/spec/unit/facter/os_workers_heat_engine_spec.rb
Emilien Macchi 7df431c81e Implement os_workers_heat_engine
Re-using the classic os_workers fact but changing the minimum from 2 to
4, specific to the fact Heat Engine can be stressed out.
Also cap to 24 workers at maximum.

Change-Id: I31d02bea6dd55d65a7014503398adc4422ce7303
2017-12-22 22:31:56 +00:00

37 lines
805 B
Ruby

require 'spec_helper'
describe 'os_workers_heat_engine' do
before { Facter.flush }
context 'with processorcount=1' do
before do
Facter.fact(:processorcount).stubs(:value).returns(1)
end
it 'returns a minimum of 2' do
expect(Facter.fact(:os_workers_heat_engine).value).to eq(4)
end
end
context 'with processorcount=8' do
before do
Facter.fact(:processorcount).stubs(:value).returns(8)
end
it 'returns processorcount/2' do
expect(Facter.fact(:os_workers_heat_engine).value).to eq(4)
end
end
context 'with processorcount=64' do
before do
Facter.fact(:processorcount).stubs(:value).returns(64)
end
it 'returns a maximum of 24' do
expect(Facter.fact(:os_workers_heat_engine).value).to eq(24)
end
end
end