2019-06-11 15:24:35 -07:00
|
|
|
require "functional/helper"
|
2018-02-17 10:49:52 -05:00
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
describe "inspec supermarket" do
|
2018-02-17 10:49:52 -05:00
|
|
|
include FunctionalHelper
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "help" do
|
|
|
|
out = inspec("supermarket help")
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stdout).must_include "inspec supermarket exec PROFILE"
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stderr).must_equal ""
|
2019-07-22 18:44:43 -07:00
|
|
|
|
|
|
|
assert_exit_code 0, out
|
2018-02-17 10:49:52 -05:00
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "info" do
|
|
|
|
out = inspec("supermarket info dev-sec/ssh-baseline")
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stdout).must_include "name: \e[0m ssh-baseline"
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stderr).must_equal ""
|
2019-07-22 18:44:43 -07:00
|
|
|
|
|
|
|
assert_exit_code 0, out
|
2018-02-17 10:49:52 -05:00
|
|
|
end
|
|
|
|
|
2019-06-11 15:24:35 -07:00
|
|
|
it "supermarket exec" do
|
2018-11-08 12:00:14 -05:00
|
|
|
if is_windows?
|
2019-06-11 15:24:35 -07:00
|
|
|
out = inspec("supermarket exec dev-sec/windows-patch-baseline")
|
2018-11-08 12:00:14 -05:00
|
|
|
else
|
2019-06-11 15:24:35 -07:00
|
|
|
out = inspec("supermarket exec dev-sec/ssh-baseline")
|
2018-11-08 12:00:14 -05:00
|
|
|
end
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stdout).must_include "Profile Summary"
|
|
|
|
_(out.stdout).must_include "Test Summary"
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-09-30 15:31:55 -07:00
|
|
|
_(out.stderr).must_equal ""
|
2019-07-22 18:44:43 -07:00
|
|
|
|
2019-07-24 18:59:01 -07:00
|
|
|
skip_windows!
|
2019-07-22 18:44:43 -07:00
|
|
|
assert_exit_code 100, out
|
2018-02-17 10:49:52 -05:00
|
|
|
end
|
|
|
|
end
|