mirror of
https://github.com/inspec/inspec
synced 2024-11-14 17:07:09 +00:00
d33d189d93
* Add more windows functional tests and create some appvayor workers. * Fix uuid test for automate Signed-off-by: Jared Quick <jquick@chef.io>
37 lines
947 B
Ruby
37 lines
947 B
Ruby
# encoding: utf-8
|
|
|
|
require 'functional/helper'
|
|
require 'tempfile'
|
|
|
|
describe 'inspec exec automate' do
|
|
include FunctionalHelper
|
|
|
|
let(:json_file) do
|
|
file = Tempfile.new('json.conf')
|
|
json = <<~EOF
|
|
{
|
|
"reporter": {
|
|
"automate" : {
|
|
"stdout" : false,
|
|
"url" : "https://fake_url_a2.com/data-collector/v0/",
|
|
"token" : "faketoken123",
|
|
"insecure" : true,
|
|
"node_uuid" : "test123"
|
|
}
|
|
}
|
|
}
|
|
EOF
|
|
|
|
file.write(json)
|
|
file.close
|
|
file.path
|
|
end
|
|
|
|
it 'fails when trying to send a report to a fake url' do
|
|
out = inspec('exec ' + example_profile + ' --no-create-lockfile --json-config ' + json_file)
|
|
out.stderr.must_equal "Error generating reporter 'automate'\n"
|
|
out.exit_status.must_equal 1
|
|
stdout = out.stdout.force_encoding(Encoding::UTF_8)
|
|
stdout.must_include "ERROR: send_report: POST to /data-collector/v0/"
|
|
end
|
|
end
|