HiveBrain v1.2.0
Get Started
← Back to all entries
snippetMinor

How do I run the InSpec using a wrapper profile?

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
theinspecprofilewrapperusinghowrun

Problem

This blog post describes wrapper profiles in detail:

https://blog.chef.io/2017/07/06/understanding-inspec-profile-inheritance/

At the very end of the post, it references a Git repo that contains an example of using a wrapper profile:

https://github.com/adamleff/inspec-profile-wrapper-example

When I clone the repo, cd to the controls folder, and attempt to run these tests:

inspec exec controls_from_other_profiles.rb


I get the following error message:


Cannot load linux-baseline since it is not listed as a dependency of
tests from controls_from_other_profiles.rb.


Dependencies available from this context are:

The dependencies are defined in inspec.yml.

How do I correctly run these tests?

Solution

I stumbled across the answer. From within the profile directory, run this command:

inspec exec .


Don't forget to set the depends key in inspec.yml.

Code Snippets

inspec exec .

Context

StackExchange DevOps Q#4425, answer score: 2

Revisions (0)

No revisions yet.