summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Turnbull <james@lovedthanlost.net>2011-03-17 02:38:48 +1100
committerJames Turnbull <james@lovedthanlost.net>2011-03-17 02:38:48 +1100
commit14ca0068a917a0794aeab4ca6e3fbe0f2856b78a (patch)
tree42ad4dba095a585806d849b865a4f343687bd2b0
parent4eb64fe100118f9add401ec2f67812e714f98210 (diff)
parent8d71db38d458186fb5512f41eae55c0c947804ac (diff)
downloadfacter-14ca0068a917a0794aeab4ca6e3fbe0f2856b78a.tar.gz
facter-14ca0068a917a0794aeab4ca6e3fbe0f2856b78a.tar.xz
facter-14ca0068a917a0794aeab4ca6e3fbe0f2856b78a.zip
Fixed #6616 - Spec test failure for vmware
-rw-r--r--lib/facter/virtual.rb2
-rw-r--r--spec/unit/virtual_spec.rb6
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/facter/virtual.rb b/lib/facter/virtual.rb
index 12269d2..468ab77 100644
--- a/lib/facter/virtual.rb
+++ b/lib/facter/virtual.rb
@@ -98,7 +98,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 f5a5c3c..7e50847 100644
--- a/spec/unit/virtual_spec.rb
+++ b/spec/unit/virtual_spec.rb
@@ -70,10 +70,12 @@ describe "Virtual fact" do
end
describe "on Linux" do
+
before do
- Facter.fact(:architecture).stubs(:value).returns(true)
+ FileTest.expects(:exists?).with("/usr/lib/vmware/bin/vmware-vmx").returns false
+ Facter.fact(:architecture).stubs(:value).returns(true)
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")