
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
37 lines
805 B
Ruby
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
|