mirror of
https://github.com/inspec/inspec
synced 2024-11-26 22:50:36 +00:00
CFINSPEC-75 Add default_gateway unit test
Signed-off-by: Sonu Saha <sonu.saha@progress.com>
This commit is contained in:
parent
d72125401e
commit
3500d962e6
1 changed files with 26 additions and 0 deletions
26
test/unit/resources/default_gateway_test.rb
Normal file
26
test/unit/resources/default_gateway_test.rb
Normal file
|
@ -0,0 +1,26 @@
|
|||
require "inspec/globals"
|
||||
require "#{Inspec.src_root}/test/helper"
|
||||
require_relative "../../../lib/inspec/resources/default_gateway"
|
||||
|
||||
describe Inspec::Resources::Defaultgateway do
|
||||
# ubuntu
|
||||
it "check ipaddress and interface of default gateway on ubuntu" do
|
||||
resource = MockLoader.new("ubuntu".to_sym).load_resource("default_gateway")
|
||||
_(resource.ipaddress).must_equal "172.31.80.1"
|
||||
_(resource.interface).must_equal "eth0"
|
||||
end
|
||||
|
||||
# darwin
|
||||
it "check ipaddress and interface of default gateway on darwin" do
|
||||
resource = MockLoader.new("macos10_10".to_sym).load_resource("default_gateway")
|
||||
_(resource.ipaddress).must_equal "172.31.80.1"
|
||||
_(resource.interface).must_equal "eth0"
|
||||
end
|
||||
|
||||
# unsupported os
|
||||
it "check ipaddress and interface of default gateway on unsupported os" do
|
||||
resource = MockLoader.new("undefined".to_sym).load_resource("default_gateway")
|
||||
_(resource.resource_skipped?).must_equal true
|
||||
_(resource.resource_failed?).must_equal true
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue