packer-provisioner-inspec icon indicating copy to clipboard operation
packer-provisioner-inspec copied to clipboard

Add support for providing a list of 'valid exit codes' for the Inspec

Open fatmcgav opened this issue 6 years ago • 2 comments

Inspec can exit with a non-zero exit code but still pass...

If all tests passed (no fails, no skips) exit code 0 is returned. If some tests skipped but none failed, exit code 101 is returned. If at least one test failed, exit code 100 is returned. If inspec failed for any other reason, exit code 1 is returned.

Source: https://www.inspec.io/docs/reference/cli/#exec

fatmcgav avatar Nov 13 '18 20:11 fatmcgav

Yep, InSpec also provides the --no-distinct-exit to simply return 0 or 1 on test success and failure instead of the additional error codes. Might need to add a note about this to the README to avoid further issues (ie. #6 )

jrbeilke avatar Nov 13 '18 22:11 jrbeilke

Ah, I totally missed that argument... ;)

Either option is valid I guess :)

fatmcgav avatar Nov 13 '18 22:11 fatmcgav