
processorcount is a legacy fact name. Lets switch the newer fact name. Change-Id: I310818ffd03ef92890bc5d9f10ad334b5281b126 Related-Bug: #1868454
37 lines
832 B
Ruby
37 lines
832 B
Ruby
require 'spec_helper'
|
|
|
|
describe 'os_workers_heat_engine' do
|
|
|
|
before { Facter.clear }
|
|
|
|
context 'with processorcount=1' do
|
|
before do
|
|
Facter.fact(:processors).stubs(:value).returns({'count' => 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(:processors).stubs(:value).returns({'count' => 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(:processors).stubs(:value).returns({'count' => 64})
|
|
end
|
|
|
|
it 'returns a maximum of 24' do
|
|
expect(Facter.fact(:os_workers_heat_engine).value).to eq(24)
|
|
end
|
|
end
|
|
end
|