forked from inspec/inspec
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test kitchen setup to test detection of audit-cookbook
Signed-off-by: Clinton Wolfe <[email protected]>
- Loading branch information
1 parent
43a5fd7
commit d5be4c2
Showing
4 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
test/integration/run-context-after-audit/controls/after-audit.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
|
||
# run-context-during-audit should have left a file with a JSON | ||
# representation of the stack as experienced by the audit cookbook. | ||
|
||
raw_data = JSON.parse(file("/tmp/audit_stack.json").content) | ||
# These aren't really stack frames, so we do some duck typing | ||
Frame = Struct.new(:absolute_path, :label) | ||
reconstructed_stack = raw_data.map{ |f| Frame.new(f["absolute_path"], f["label"]) } | ||
|
||
require "inspec/utils/telemetry/run_context_probe" | ||
|
||
control "run-context" do | ||
describe Inspec::Telemetry::RunContextProbe.guess_run_context(reconstructed_stack) do | ||
it { should eq "audit-cookbook" } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: run-context-after-audit | ||
title: InSpec Profile | ||
maintainer: InSpec Engineering | ||
copyright: Chef Software, Inc. | ||
copyright_email: [email protected] | ||
license: Apache-2.0 | ||
summary: An InSpec Compliance Profile to test inspec run context detection under audit-cookbook | ||
version: 0.1.0 | ||
supports: | ||
platform: os |