Commit graph

76 commits

Author SHA1 Message Date
Ryan Davis
18ce4850f0 Initial pass to clean up functional testing wrt exit codes and output.
This should get windows tests running again? Hopefully? They're
running SO slowly on my vagrant box that I'm just pushing for now.
They're clean on the mac side.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-07-24 18:06:25 -07:00
Clinton Wolfe
46624396c7 Bulk edit of test files to use input() in DSL
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-06-12 12:17:19 -04:00
Miah Johnson
e46018a517 chefstyle -a cleanup
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-06-11 18:52:38 -07:00
Ryan Davis
a5309ea392 blindly applied chefstyle -a
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-06-11 18:52:03 -07:00
Miah Johnson
2a1b1d8e88 Remove all leading newlines.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-31 11:43:44 -07:00
Miah Johnson
6c19e81a06 Remove authors tags from source files.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-28 12:47:39 -07:00
Ryan Davis
eead889325 Fix test framework contention.
RSpec is used internally. Minitest is used for our tests. They don't
really like each other. This fixes that and gets our tests
consistently running the correct number of tests (they were load-order
dependent before and each platform had its own different number of
tests it would run).

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-15 00:33:53 -07:00
Ryan Davis
6adf1d2560 Remove all byebug requires in code.
Please don't leave debugging remnants in the code.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-14 23:24:14 -07:00
Miah Johnson
f7575cca00 Remove more magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-09 13:24:25 -07:00
Miah Johnson
11b8da3283
Merge branch 'master' into mj/encoding 2019-05-08 12:59:55 -07:00
Miah Johnson
659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00
Ryan Davis
476c6878b3 Modernize use of Minitest.
+ Turn off verbosity in Rakefile by default. Use `rake V=1` to turn back on.
+ MiniTest -> Minitest everywhere.
+ MiniTest::Unit::TestCase -> Minitest::Test everywhere.
+ Updated minitest doco urls to official and up-to-date site.
+ Normalize requires. Only needs "minitest/autorun" and "minitest/pride".

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-03 15:01:57 -07:00
Tim Smith
097e2deedc Don't include the apt recipe over and over again in the recipes
We run apt_update once with chef and we already update the cache directly on the container at start. We don't need to try to do the same thing 3 other times.

Signed-off-by: Tim Smith <tsmith@chef.io>
2019-02-13 17:19:55 -08:00
Clinton Wolfe
8760c48dbd Update docs
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-01-28 00:42:27 -05:00
Jerry Aldrich
0b0a0a4d48 Change Inspec to InSpec where appropriate (#3494)
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-10-15 12:09:46 -04:00
Clinton Wolfe
da0ae7bac9 Plugins: Example CLI Plugin, a Resource Lister (#3421)
* Plugin example, CLI resource lister
* Move example plugin into a directory to look like a regular project
* Skeleton of testing for example plugin
* Example plugin unit tests work
* Functional tests added, using core helper
* Add a global method to determine InSpec install root
* Add linter support to the example
* Adjust inspec project rubocop to run linter on example plugins
* Linter autocorrections
* Update readme

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2018-09-27 16:57:18 -04:00
Jerry Aldrich
20776b363d Add support for multiple descriptions for controls (#3424)
* Add support for multiple descriptions for controls

This adds the ability to specify multiple descriptions in controls.

Example:

```ruby
control 'my-control' do
  impact 1.0
  title 'My control'
  desc 'A default description'
  desc 'rational', 'I need an example'
  describe file('/tmp') do
    it { should be_directory }
  end
end
```

Many thanks to @jquick for helping me with the unit tests.
* Remove unused `descriptions` method
* Remove unused profile from test mocks
* Respond to feedback

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-09-26 13:28:57 -04:00
Jared Quick
1c12a544c7
Add string impact options for controls (#3359)
* Add impact class which contains all cvss scores.
* Add testing for impact changes.
* Change symbols to strings for impact.
* Update error messages to be more clear.
* Fix test with new sha

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-13 14:14:05 -04:00
Jared Quick
6445e2c6d5
Add windows functional tests (#3385)
* Add windows functional tests.
* Fix tests for 2012 server.
* Fix windows build script
* Add more functional tests for windows.
* Update comment with TODO.

Signed-off-by: Jared Quick <jquick@chef.io>
2018-09-12 18:04:16 -04:00
Jared Quick
06e1aa5379 Allow custom resources to access all other resources (#3108)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-06-06 11:56:51 -04:00
Shaun Mouton
d56a601a4d updating kitchen-puppet example for puppet 15 (#2972)
Signed-off-by: Shaun Mouton <smouton@chef.io>
2018-04-19 12:55:10 -04:00
Jerry Aldrich
4731d95abd docs: Update example resource (#2904)
* Change `skip_resource` to use raise
* Add `supports` lines to example resource
* Change to rescue `StandardError` vs `Exception`
* Change raise to use `e.message` vs `$!`
* Remove redundant returns
* Change `File.exists?` to `File.exist?`
* Update shasum in tests

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-04-05 08:50:49 -04:00
Jan Collijs
87f1f500de Fix: pointed concurrent-ruby to version 1.0 to fix dependencies (#2879)
Signed-off-by: Jan Collijs <github@visibilityspots.org>
2018-03-26 14:28:11 -04:00
eramoto
a687479e6c Fix typo in some docs (#2841)
Also includes fixes such as PostgreSQL, TCPMUX, and etc.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2018-03-20 08:43:30 -04:00
Jerry Aldrich
9616ebf19a Add example profiles for AWS/Azure (#2680)
* Add example AWS profile

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>

* Add example Azure profile

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2018-02-18 12:12:44 +01:00
Adam Leff
d77551baf1 Remove rubocop from example Gemfiles (#2341)
The pinned version of Rubocop in some of the TK examples' Gemfiles
was a very old version with known vulnerabilities. Since these are just
examples and have no Rake tasks that rely on them, I removed rubocop
outright from the example Gemfiles.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-27 19:05:52 +01:00
Kevin Formsma
94c2e8181c Add sensitive flag to resources to restrict logging output (#2017)
* Filter check output based on sensitive flag
-Updated check in formatters to filter check output during failures based on
sensitive metadata flag
-Added functional test of output filtering
-Updated documentation with blerb on usage
* Update output format for sensitive resources

Signed-off-by: Kevin Formsma <kevin.formsma@gmail.com>

* Update color output on new test

Update the color output to match the newly-expected non-color format if there are no tests that match.

Signed-off-by: Adam Leff <adam@leff.co>
2017-08-25 16:21:49 -04:00
Kimberly Garmoe
88ee548551 Fixes typo. (#2047)
Signed-off-by: kgarmoe <kgarmoe@chef.io>
2017-08-17 15:13:44 -04:00
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
Christoph Hartmann
a6ef98c896 verifies that inspec.yml uses licenses in SPDX format
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-05-31 00:21:05 -05:00
Dominik Richter
bac360475f bugfix: dev-sec/ssl-benchmark -> ssl-baseline
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-05-09 10:58:07 +02:00
Adam Leff
a1769cc01b
Update inspec.io references in docs/code
The website is now at https://www.inspec.io - updating all inspec.io
references accordingly. :)

Signed-off-by: Adam Leff <adam@leff.co>
2017-04-27 18:05:51 -04:00
Christoph Hartmann
c2d92d8e86 use new devsec baseline
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-01-25 20:22:38 +01:00
Christoph Hartmann
8808c57cae Extend functional tests for vending based on feedback from @alexpop
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2016-11-29 23:40:42 +01:00
Christoph Hartmann
fef4f9447b add functional tests
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2016-11-09 11:49:51 -06:00
Christoph Hartmann
1ff690b0cc update example, how to pass attributes for dependencies 2016-11-04 15:35:08 +01:00
Sean Walberg
d4c887704a Fix broken link in README.md
Link pointed to the right doc but the wrong extension.

Obvious fix.

Signed-off-by: Sean Walberg <sean@ertw.com>
2016-10-20 12:42:15 -04:00
Christoph Hartmann
9eeb5ba8a7 Remove pre-1.0 warning from meta-profile 2016-10-02 18:06:07 +02:00
Steven Danna
8f10ee53c5 Provide inspec.yml shortcut syntax
- Allow users to elide the `name` attributes
- Assume a default source of supermarket

Fixes #1048

Signed-off-by: Steven Danna <steve@chef.io>
2016-09-14 08:46:06 +02:00
Christoph Hartmann
a8a3053a48 rename example to meta-profile 2016-09-12 14:45:40 +02:00
Steven Danna
d8d53b36c1 Add example of corporate profile
This won't work until the git fetcher is merged. It likely also
exhibits other problems related to platform support handling.

Signed-off-by: Steven Danna <steve@chef.io>
2016-09-12 09:29:49 +02:00
Dominik Richter
7e569669aa introduce dependency resolution
This commit is the foundation of the dependency resolution as described in https://github.com/chef/inspec/issues/888 .

It currently only works with local dependencies, as seen in the example inheritance profile.

Tests and full resolution are coming next on the path to an MVP implementation.
2016-08-10 22:41:32 +02:00
Christoph Hartmann
f1faf47112 introduce secrets backend 2016-06-14 02:49:47 +02:00
Christoph Hartmann
c7a49056c4 feature: attribute handling 2016-06-14 02:49:03 +02:00
Alex Pop
9e1c9862bd extended gordon_config with more examples 2016-04-04 14:03:26 +01:00
Christoph Hartmann
7112ebbfec fix errors introduced in #593 2016-03-28 00:48:15 +02:00
Aaron Lippold
e846385866 Updated documentation and examples to include tags and references 2016-03-27 12:40:34 -04:00
Christoph Hartmann
f4180780d1 document tags and refs 2016-03-25 00:58:27 +01:00
Alex Pop
53c7683ff7 update tests based on resource changes 2016-03-24 21:50:51 +01:00
Alex Pop
825702014c update gordon with a bit of ruby and update README 2016-03-24 21:50:47 +01:00