Merge pull request #6161 from inspec/nm/build-issues

Fixes for Buildkite Issues
This commit is contained in:
Clinton Wolfe 2022-06-27 16:14:04 -04:00 committed by GitHub
commit adaff04db3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 5 deletions

View file

@ -29,7 +29,7 @@ group :test do
gem "json_schemer", ">= 0.2.1", "< 0.2.19"
gem "m"
gem "minitest-sprint", "~> 1.0"
gem "minitest", "~> 5.5"
gem "minitest", "5.15.0"
gem "mocha", "~> 1.1"
gem "nokogiri", "~> 1.9"
gem "pry-byebug"

View file

@ -227,7 +227,7 @@ class MockLoader
'sh -c \'type "/sbin/auditctl"\'' => empty.call,
'sh -c \'type "sql"\'' => cmd_exit_1.call,
'type "pwsh"' => empty.call,
'type "netstat"' => empty.call,
'type "/usr/sbin/netstat"' => empty.call,
"sh -c 'find /etc/apache2/ports.conf -type l -maxdepth 1'" => empty.call,
"sh -c 'find /etc/httpd/conf.d/*.conf -type l -maxdepth 1'" => empty.call,
"sh -c 'find /etc/httpd/mods-enabled/*.conf -type l -maxdepth 1'" => empty.call,
@ -409,6 +409,7 @@ class MockLoader
"php -c /etc/php/7.4/cli/php.ini -r 'echo get_cfg_var(\"default_mimetype\");'" => cmd.call("get-cfg-var"),
# routing_table
"netstat -rn" => cmd.call("netstat-rn-linux"),
"/usr/sbin/netstat -rn" => cmd.call("netstat-rn-linux"),
%{sh -c 'type "netstat"'} => empty.call,
# mocks for be_immutable matcher for file resource
"lsattr constantfile.txt" => cmd.call("lsattr-output"),

View file

@ -26,7 +26,7 @@ describe Inspec::Resources::Cgroup do
# undefined
it "check carrotking cgroup information on unsupported os" do
resource = MockLoader.new("undefined".to_sym).load_resource("cgroup", "carrotking")
resource = MockLoader.new("exsi".to_sym).load_resource("cgroup", "carrotking")
_(resource.resource_skipped?).must_equal true
_(resource.resource_exception_message).must_equal "The `cgroup` resource is not supported on your OS yet."
end

View file

@ -19,7 +19,7 @@ describe Inspec::Resources::Defaultgateway do
# 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 = MockLoader.new("esxi".to_sym).load_resource("default_gateway")
_(resource.resource_skipped?).must_equal true
_(resource.resource_failed?).must_equal true
end

View file

@ -26,7 +26,7 @@ describe Inspec::Resources::Routingtable do
# unsupported os
it "check routing table information on unsupported os" do
resource = MockLoader.new("undefined".to_sym).load_resource("routing_table")
resource = MockLoader.new("esxi".to_sym).load_resource("routing_table")
_(resource.resource_skipped?).must_equal true
_(resource.resource_failed?).must_equal true
end