inspec/examples/inheritance
Adam Leff a6582bea9b Remove any "All Rights Reserved" references (#1969)
* Remove any "All Rights Reserved" references

InSpec is licensed and released under the Apache 2.0 license. This
change removes all reference to legacy code files that still had
any Copyright or License lines referring to "All Rights Reserved".

Signed-off-by: Adam Leff <adam@leff.co>

* fix functional tests

Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-06-28 04:14:19 -07:00
..
controls Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
inspec.yml verifies that inspec.yml uses licenses in SPDX format 2017-05-31 00:21:05 -05:00
README.md update example, how to pass attributes for dependencies 2016-11-04 15:35:08 +01:00

Example InSpec Profile

This example shows the use of InSpec profile inheritance.

Verify a profile

InSpec ships with built-in features to verify a profile structure.

$ inspec check examples/inheritance

Execute a profile

To run a profile on a local machine use inspec exec /path/to/profile. All dependencies are automatically resolved.

$ inspec exec examples/inheritance

Set attributes for dependent profiles

Without setting attributes, an inspec exec would return the following:

$ inspec git:(master) ✗ b inspec exec examples/inheritance

Profile: InSpec example inheritance (inheritance)
Version: 1.0.0
Target:  local://


  ○  gordon-1.0: Verify the version number of Gordon (1 skipped)
     ○  Can't find file "/tmp/gordon/config.yaml"
     ✔  File  content should match nil
  ✔  ssh-1: Allow only SSH Protocol 2
     ✔  File /bin/sh should be owned by "root"

  File /tmp
     ✔  should be directory
  alice should
     ✖  eq "bob"

     expected: "bob"
          got: "alice"

     (compared using ==)

  should eq
     ✖  "secret"

     expected: "secret"
          got: nil

     (compared using ==)


Test Summary: 3 successful, 2 failures, 1 skipped

To pass in attributes, just call:

$ inspec exec examples/inheritance --attrs examples/profile-attribute.yml