[virtual] use manufacturer instead of product name in Bochs/KVM detection
Lex Rivera authored 11 years ago
Adrien Thebo committed 11 years ago
136 | 136 |
result = "hyperv" if pd =~ /Product Name: Virtual Machine/
|
137 | 137 |
result = "rhev" if pd =~ /Product Name: RHEV Hypervisor/
|
138 | 138 |
result = "ovirt" if pd =~ /Product Name: oVirt Node/
|
139 | |
result = "kvm" if pd =~ /Product Name: Bochs/
|
|
139 |
result = "kvm" if pd =~ /Manufacturer: Bochs/
|
140 | 140 |
end
|
141 | 141 |
elsif Facter.value(:kernel) == 'SunOS'
|
142 | 142 |
res = Facter::Util::Resolution.new('prtdiag')
|
179 | 179 |
Facter.fact(:virtual).value.should == "hyperv"
|
180 | 180 |
end
|
181 | 181 |
|
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
|
186 | 187 |
|
187 | 188 |
context "In Google Compute Engine" do
|
188 | 189 |
before :each do
|