mirror of
https://github.com/inspec/inspec
synced 2024-12-11 13:54:07 +00:00
add darwin/OSX tests
Signed-off-by: Eike Waldt <waldt@b1-systems.de>
This commit is contained in:
parent
73f729e4b1
commit
da4168f83d
3 changed files with 11 additions and 1 deletions
|
@ -365,7 +365,7 @@ class MockLoader
|
|||
"netstat -an -f inet" => cmd.call("hpux-netstat-inet"),
|
||||
# ipv6 ports on hpux
|
||||
"netstat -an -f inet6" => cmd.call("hpux-netstat-inet6"),
|
||||
# hostname linux
|
||||
# hostname linux and darwin
|
||||
"hostname" => cmd.call("hostname"),
|
||||
# hostname windows
|
||||
"$env:computername" => cmd.call("$env-computername"),
|
||||
|
@ -375,6 +375,8 @@ class MockLoader
|
|||
"Get-CimInstance -ClassName Win32_ComputerSystem | Select Manufacturer -ExpandProperty Manufacturer" => cmd.call("manufacturer"),
|
||||
# Model linux
|
||||
"cat /sys/class/dmi/id/product_name" => cmd.call("model"),
|
||||
# Model darwin
|
||||
"sysctl -n hw.model" => cmd.call("model_darwin"),
|
||||
# Model windows
|
||||
"Get-CimInstance -ClassName Win32_ComputerSystem | Select Model -ExpandProperty Model" => cmd.call("model"),
|
||||
# windows_hotfix windows
|
||||
|
|
1
test/unit/mock/cmd/model_darwin
Normal file
1
test/unit/mock/cmd/model_darwin
Normal file
|
@ -0,0 +1 @@
|
|||
MacBookPro13,3
|
|
@ -11,6 +11,13 @@ describe "Inspec::Resources::SysInfo" do
|
|||
_(resource.model).must_equal "Flux Capacitor"
|
||||
end
|
||||
|
||||
it "check sys_info on OSX" do
|
||||
resource = MockLoader.new(:osx104).load_resource("sys_info")
|
||||
_(resource.hostname).must_equal "example.com"
|
||||
_(resource.manufacturer).must_equal "Apple Inc."
|
||||
_(resource.model).must_equal "MacBookPro13,3"
|
||||
end
|
||||
|
||||
it "check sys_info on Windows" do
|
||||
resource = MockLoader.new(:windows).load_resource("sys_info")
|
||||
_(resource.hostname).must_equal "WIN-CIV7VMLVHLD"
|
||||
|
|
Loading…
Reference in a new issue