summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2011-03-15 18:39:04 +1100
committerJames Turnbull <james@lovedthanlost.net>2011-03-15 18:39:04 +1100
commit8d71db38d458186fb5512f41eae55c0c947804ac (patch)
tree3338390ce5b79047a04f78253a3c2e8f74a0b27f
parent469d2a26a467c50af9f9732d7f98e8a01ecc369f (diff)
downloadfacter-8d71db38d458186fb5512f41eae55c0c947804ac.tar.gz
facter-8d71db38d458186fb5512f41eae55c0c947804ac.tar.xz
facter-8d71db38d458186fb5512f41eae55c0c947804ac.zip
Fixed #6616 - Stubbing in VMware tests on Linux
-rw-r--r--lib/facter/virtual.rb2
-rw-r--r--spec/unit/virtual_spec.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 47c9504..cf84f75 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -92,7 +92,7 @@ Facter.add("virtual") do
end
end
end
- # VMware server 1.0.3 rpm places vmware-vmx in this place, other versions or platforms may not.
+
if FileTest.exists?("/usr/lib/vmware/bin/vmware-vmx")
result = "vmware_server"
end
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb
index 5f63dab..c1bc3cb 100644
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -64,6 +64,10 @@ describe "Virtual fact" do
describe "on Linux" do
+ before do
+ FileTest.expects(:exists?).with("/usr/lib/vmware/bin/vmware-vmx").returns false
+ end
+
it "should be parallels with Parallels vendor id from lspci" do
Facter.fact(:kernel).stubs(:value).returns("Linux")
Facter::Util::Resolution.stubs(:exec).with('lspci').returns("01:00.0 VGA compatible controller: Unknown device 1ab8:4005")