Codebase list facter / 3eab7bf
[virtual] use manufacturer instead of product name in Bochs/KVM detection Lex Rivera authored 11 years ago Adrien Thebo committed 11 years ago
2 changed file(s) with 6 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
136136 result = "hyperv" if pd =~ /Product Name: Virtual Machine/
137137 result = "rhev" if pd =~ /Product Name: RHEV Hypervisor/
138138 result = "ovirt" if pd =~ /Product Name: oVirt Node/
139 result = "kvm" if pd =~ /Product Name: Bochs/
139 result = "kvm" if pd =~ /Manufacturer: Bochs/
140140 end
141141 elsif Facter.value(:kernel) == 'SunOS'
142142 res = Facter::Util::Resolution.new('prtdiag')
179179 Facter.fact(:virtual).value.should == "hyperv"
180180 end
181181
182 it "should be kvm with Bochs product name from dmidecode" do
183 Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("Product Name: Bochs")
184 Facter.fact(:virtual).value.should == "kvm"
185 end
182 it "should be kvm with Bochs vendor name from dmidecode" do
183 Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil)
184 Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("Manufacturer: Bochs")
185 Facter.fact(:virtual).value.should == "kvm"
186 end
186187
187188 context "In Google Compute Engine" do
188189 before :each do