mirror of
https://github.com/inspec/inspec
synced 2024-11-27 23:20:33 +00:00
Merge pull request #1873 from chef/dr/fix-sudo-test
bugfix: adjust localhost+sudo test output to train update
This commit is contained in:
commit
72f4d4be89
3 changed files with 3 additions and 3 deletions
|
@ -4,7 +4,6 @@ driver:
|
||||||
|
|
||||||
provisioner:
|
provisioner:
|
||||||
name: chef_solo
|
name: chef_solo
|
||||||
require_chef_omnibus: 12.12.15
|
|
||||||
|
|
||||||
verifier:
|
verifier:
|
||||||
name: inspec
|
name: inspec
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
driver:
|
driver:
|
||||||
name: dokken
|
name: dokken
|
||||||
chef_version: 12.5.1
|
chef_version: 12.19.36
|
||||||
privileged: true # because Docker and SystemD/Upstart
|
privileged: true # because Docker and SystemD/Upstart
|
||||||
|
|
||||||
transport:
|
transport:
|
||||||
|
|
|
@ -252,7 +252,8 @@ Test Summary: \e[38;5;41m2 successful\e[0m, \e[38;5;9m0 failures\e[0m, \e[38;5;2
|
||||||
describe 'when trying to use --sudo with a local target' do
|
describe 'when trying to use --sudo with a local target' do
|
||||||
it 'must print an error and exit' do
|
it 'must print an error and exit' do
|
||||||
out = inspec("exec #{File.join(profile_path, 'profile-support-skip')} --sudo")
|
out = inspec("exec #{File.join(profile_path, 'profile-support-skip')} --sudo")
|
||||||
out.stdout.force_encoding(Encoding::UTF_8).must_include "--sudo is only valid when running against a remote host using --target"
|
str = "Sudo is only valid when running against a remote host. To run this locally with elevated privileges, run the command with `sudo ...`.\n"
|
||||||
|
out.stderr.force_encoding(Encoding::UTF_8).must_include str
|
||||||
out.exit_status.must_equal 1
|
out.exit_status.must_equal 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue