-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(inspec): expand unit tests for archives
- Loading branch information
1 parent
0b05c5d
commit 27bc326
Showing
18 changed files
with
211 additions
and
33 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
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
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 |
---|---|---|
|
@@ -26,4 +26,3 @@ grafana-config-clean-file-absent: | |
- sls: {{ sls_alternatives_clean }} | ||
{%- endif %} | ||
~ |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=jinja | ||
# | ||
# Collection of common macros | ||
|
||
{%- macro format_kwargs(kwarg) -%} | ||
{%- filter indent(4) %} | ||
{%- for k, v in kwarg|dictsort() %} | ||
- {{ k }}: {{ v }} | ||
{%- endfor %} | ||
{%- endfilter %} | ||
{%- endmacro %} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
# | ||
# Setup variables using grains['osarch'] based logic. | ||
# You just need to add the key:values for an `osarch` that differ | ||
# from `defaults.yaml` + `os_family.yaml`. | ||
# Only add an `osarch` which is/will be supported by the formula | ||
# | ||
# If you do not need to provide defaults via the `osarch` grain, | ||
# you will need to provide at least an empty dict in this file, e.g. | ||
# osarch: {} | ||
--- | ||
amd64: | ||
arch: amd64 | ||
|
||
x86_64: | ||
arch: amd64 | ||
|
||
386: | ||
arch: 386 | ||
|
||
arm64: | ||
arch: arm64 | ||
|
||
armv6l: | ||
arch: armv6l | ||
|
||
armv7l: | ||
arch: armv6l | ||
|
||
ppc64le: | ||
arch: ppc64le | ||
|
||
s390x: | ||
arch: s390x |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Default InSpec Profile | ||
|
||
This shows the implementation of the Default InSpec [profile](https://github.com/inspec/inspec/blob/master/docs/profiles.md). | ||
|
||
## Verify a profile | ||
|
||
InSpec ships with built-in features to verify a profile structure. | ||
|
||
```bash | ||
$ inspec check default | ||
Summary | ||
------- | ||
Location: default | ||
Profile: profile | ||
Controls: 4 | ||
Timestamp: 2019-06-24T23:09:01+00:00 | ||
Valid: true | ||
|
||
Errors | ||
------ | ||
|
||
Warnings | ||
-------- | ||
``` | ||
|
||
## Execute a profile | ||
|
||
To run all **supported** controls on a local machine use `inspec exec /path/to/profile`. | ||
|
||
```bash | ||
$ inspec exec default | ||
.. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
8 examples, 0 failures | ||
``` | ||
|
||
## Execute a specific control from a profile | ||
|
||
To run one control from the profile use `inspec exec /path/to/profile --controls name`. | ||
|
||
```bash | ||
$ inspec exec default --controls package | ||
. | ||
|
||
Finished in 0.0025 seconds (files took 0.12449 seconds to load) | ||
1 examples, 0 failures | ||
``` | ||
|
||
See an [example control here](https://github.com/inspec/inspec/blob/master/examples/profile/controls/example.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,12 @@ | ||
control 'grafana configuration environment' do | ||
title 'should match desired lines' | ||
|
||
describe file('/etc/default/grafana.sh') do | ||
it { should be_file } | ||
it { should be_owned_by 'root' } | ||
it { should be_grouped_into 'root' } | ||
its('mode') { should cmp '0644' } | ||
its('content') { should include 'Your changes may be overwritten' } | ||
its('content') { should include 'export PATH=${PATH}:/opt/grafana-2.10.0.linux-amd64/bin' } | ||
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
Oops, something went wrong.