spec/unit/virtual_spec.rb in facter-1.6.6 vs spec/unit/virtual_spec.rb in facter-1.6.7

- old
+ new

@@ -79,37 +79,37 @@ FileTest.stubs(:exists?).with("/sys/bus/xen").returns false FileTest.stubs(:exists?).with("/proc/xen").returns false Facter.fact(:architecture).stubs(:value).returns(true) end - it "should be parallels with Parallels vendor id from lspci" do + it "should be parallels with Parallels vendor id from lspci 2>/dev/null" 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") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("01:00.0 VGA compatible controller: Unknown device 1ab8:4005") Facter.fact(:virtual).value.should == "parallels" end - it "should be parallels with Parallels vendor name from lspci" do + it "should be parallels with Parallels vendor name from lspci 2>/dev/null" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns("01:00.0 VGA compatible controller: Parallels Display Adapter") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("01:00.0 VGA compatible controller: Parallels Display Adapter") Facter.fact(:virtual).value.should == "parallels" end - it "should be vmware with VMware vendor name from lspci" do + it "should be vmware with VMware vendor name from lspci 2>/dev/null" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns("00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("00:0f.0 VGA compatible controller: VMware Inc [VMware SVGA II] PCI Display Adapter") Facter.fact(:virtual).value.should == "vmware" end - it "should be virtualbox with VirtualBox vendor name from lspci" do + it "should be virtualbox with VirtualBox vendor name from lspci 2>/dev/null" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns("00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("00:02.0 VGA compatible controller: InnoTek Systemberatung GmbH VirtualBox Graphics Adapter") Facter.fact(:virtual).value.should == "virtualbox" end it "should be vmware with VMWare vendor name from dmidecode" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device 1 Information\nType: Video\nStatus: Disabled\nDescription: VMware SVGA II") Facter.fact(:virtual).value.should == "vmware" end it "should be xen0 with xen dom0 files in /proc" do @@ -129,46 +129,46 @@ FileTest.expects(:exists?).with("/proc/xen/xsd_kva").returns(false) FileTest.expects(:exists?).with("/proc/xen/capabilities").returns(true) Facter.fact(:virtual).value.should == "xenu" end - it "should be xenhvm with Xen HVM vendor name from lspci" do + it "should be xenhvm with Xen HVM vendor name from lspci 2>/dev/null" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns("00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("00:03.0 Unassigned class [ff80]: XenSource, Inc. Xen Platform Device (rev 01)") Facter.fact(:virtual).value.should == "xenhvm" end it "should be xenhvm with Xen HVM vendor name from dmidecode" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("System Information\nManufacturer: Xen\nProduct Name: HVM domU") Facter.fact(:virtual).value.should == "xenhvm" end it "should be parallels with Parallels vendor name from dmidecode" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("On Board Device Information\nType: Video\nStatus: Disabled\nDescription: Parallels Video Adapter") Facter.fact(:virtual).value.should == "parallels" end it "should be virtualbox with VirtualBox vendor name from dmidecode" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("BIOS Information\nVendor: innotek GmbH\nVersion: VirtualBox\n\nSystem Information\nManufacturer: innotek GmbH\nProduct Name: VirtualBox\nFamily: Virtual Machine") Facter.fact(:virtual).value.should == "virtualbox" end - it "should be hyperv with Microsoft vendor name from lspci" do + it "should be hyperv with Microsoft vendor name from lspci 2>/dev/null" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns("00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA") + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns("00:08.0 VGA compatible controller: Microsoft Corporation Hyper-V virtual VGA") Facter.fact(:virtual).value.should == "hyperv" end it "should be hyperv with Microsoft vendor name from dmidecode" do Facter.fact(:kernel).stubs(:value).returns("Linux") - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns("System Information\nManufacturer: Microsoft Corporation\nProduct Name: Virtual Machine") Facter.fact(:virtual).value.should == "hyperv" end end @@ -178,29 +178,29 @@ end it "should be vmware with VMWare vendor name from prtdiag" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter.fact(:hardwaremodel).stubs(:value).returns(nil) - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: VMware, Inc. VMware Virtual Platform") Facter.fact(:virtual).value.should == "vmware" end it "should be parallels with Parallels vendor name from prtdiag" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter.fact(:hardwaremodel).stubs(:value).returns(nil) - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: Parallels Virtual Platform") Facter.fact(:virtual).value.should == "parallels" end it "should be virtualbox with VirtualBox vendor name from prtdiag" do Facter.fact(:kernel).stubs(:value).returns("SunOS") Facter.fact(:hardwaremodel).stubs(:value).returns(nil) - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) Facter::Util::Resolution.stubs(:exec).with('prtdiag').returns("System Configuration: innotek GmbH VirtualBox") Facter.fact(:virtual).value.should == "virtualbox" end end @@ -208,10 +208,10 @@ describe "on OpenBSD" do before do Facter::Util::Resolution.stubs(:exec).with("vmware -v").returns false Facter.fact(:kernel).stubs(:value).returns("OpenBSD") Facter.fact(:hardwaremodel).stubs(:value).returns(nil) - Facter::Util::Resolution.stubs(:exec).with('lspci').returns(nil) + Facter::Util::Resolution.stubs(:exec).with('lspci 2>/dev/null').returns(nil) Facter::Util::Resolution.stubs(:exec).with('dmidecode').returns(nil) end it "should be parallels with Parallels product name from sysctl" do Facter::Util::Resolution.stubs(:exec).with('sysctl -n hw.product 2>/dev/null').returns("Parallels Virtual Platform")