Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

Commit

Permalink
(maint) Fix CI
Browse files Browse the repository at this point in the history
This is still not working as expected: on FreeBSD the processors facts
are built by running Facter::Resolvers::Bsd::Processors and
Facter::Resolvers::Freebsd::Processors, the later being supposed to
inherit from the former, I would not expect this to happen.

I did not find an example of provider that inherits from another
provider, and I guess that what I did is not the proper way of doing it.

Maybe using two distinct and independant providers for processors speed
for BSD and FreeBSD, and another one for the code common to all BSD
makes more sense, but I am not sure how to aggregate the os-dependent
speed into the processors fact.
  • Loading branch information
smortex committed May 9, 2020
1 parent 0089b57 commit 077bdde
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions spec/facter/resolvers/freebsd/processors_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@
subject(:resolver) { Facter::Resolvers::Freebsd::Processors }

let(:log_spy) { instance_spy(Facter::Log) }
let(:logicalcount) { 2 }
let(:models) do
['Intel(r) Xeon(r) Gold 6138 CPU @ 2.00GHz', 'Intel(r) Xeon(r) Gold 6138 CPU @ 2.00GHz']
end
let(:speed_expected) { 2_592_000_000 }

before do
allow(Facter::Bsd::FfiHelper)
.to receive(:sysctl)
.with(:uint32_t, [6, 3])
.and_return(logicalcount)
allow(Facter::Bsd::FfiHelper)
.to receive(:sysctl)
.with(:string, [6, 2])
.and_return(models[0])
allow(Facter::Freebsd::FfiHelper)
.to receive(:sysctl_by_name)
.with(:uint32_t, 'hw.clockrate')
Expand Down

0 comments on commit 077bdde

Please sign in to comment.