2019-06-11 22:24:35 +00:00
require " functional/helper "
2018-02-17 15:49:52 +00:00
2019-06-11 22:24:35 +00:00
describe " inspec supermarket " do
2018-02-17 15:49:52 +00:00
include FunctionalHelper
2019-06-11 22:24:35 +00:00
it " help " do
out = inspec ( " supermarket help " )
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stdout ) . must_include " inspec supermarket exec PROFILE "
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stderr ) . must_equal " "
2019-07-23 01:44:43 +00:00
assert_exit_code 0 , out
2018-02-17 15:49:52 +00:00
end
2019-06-11 22:24:35 +00:00
it " info " do
out = inspec ( " supermarket info dev-sec/ssh-baseline " )
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stdout ) . must_include " name: \e [0m ssh-baseline "
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stderr ) . must_equal " "
2019-07-23 01:44:43 +00:00
assert_exit_code 0 , out
2018-02-17 15:49:52 +00:00
end
2019-06-11 22:24:35 +00:00
it " supermarket exec " do
2018-11-08 17:00:14 +00:00
if is_windows?
2019-06-11 22:24:35 +00:00
out = inspec ( " supermarket exec dev-sec/windows-patch-baseline " )
2018-11-08 17:00:14 +00:00
else
2019-06-11 22:24:35 +00:00
out = inspec ( " supermarket exec dev-sec/ssh-baseline " )
2018-11-08 17:00:14 +00:00
end
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stdout ) . must_include " Profile Summary "
_ ( out . stdout ) . must_include " Test Summary "
2019-07-23 01:44:43 +00:00
2019-09-30 22:31:55 +00:00
_ ( out . stderr ) . must_equal " "
2019-07-23 01:44:43 +00:00
2020-08-17 12:27:58 +00:00
skip_windows! # Breakage confirmed, only on CI: https://buildkite.com/chef-oss/inspec-inspec-master-verify/builds/2355#2c9d032e-4a24-4e7c-aef2-1c9e2317d9e2
2019-07-23 01:44:43 +00:00
assert_exit_code 100 , out
2018-02-17 15:49:52 +00:00
end
2021-11-29 13:42:28 +00:00
it " supermarket profiles " do
out = inspec ( " supermarket profiles --supermarket_url='https://supermarket.chef.io' " )
_ ( out . stdout ) . must_include " dev-sec/linux-patch-baseline "
_ ( out . stdout ) . must_include " dev-sec/windows-baseline "
_ ( out . stderr ) . must_equal " "
assert_exit_code 0 , out
end
it " info with --supermarket_url option " do
out = inspec ( " supermarket info dev-sec/ssh-baseline --supermarket_url='https://supermarket.chef.io' " )
_ ( out . stdout ) . must_include " name: \e [0m ssh-baseline "
_ ( out . stderr ) . must_equal " "
assert_exit_code 0 , out
end
it " supermarket exec with --supermarket_url option " do
if is_windows?
out = inspec ( " supermarket exec dev-sec/windows-patch-baseline --supermarket_url='https://supermarket.chef.io' " )
else
out = inspec ( " supermarket exec dev-sec/ssh-baseline --supermarket_url='https://supermarket.chef.io' " )
end
_ ( out . stdout ) . must_include " Profile Summary "
_ ( out . stdout ) . must_include " Test Summary "
_ ( out . stderr ) . must_equal " "
skip_windows! # Breakage confirmed, only on CI: https://buildkite.com/chef-oss/inspec-inspec-master-verify/builds/2355#2c9d032e-4a24-4e7c-aef2-1c9e2317d9e2
assert_exit_code 100 , out
end
it " supermarket profiles with --supermarket_url option " do
out = inspec ( " supermarket profiles --supermarket_url='https://supermarket.chef.io' " )
_ ( out . stdout ) . must_include " dev-sec/linux-patch-baseline "
_ ( out . stdout ) . must_include " dev-sec/windows-baseline "
_ ( out . stderr ) . must_equal " "
assert_exit_code 0 , out
end
end