* Move compliance pluging to v2 system.
* Update kitchen-inspec to test.
* Add legacy require patsh.
* Fix unit test
Signed-off-by: Jared Quick <jquick@chef.io>
For larger processes, Busybox's ps displays the vsz and rss columns in
megabytes or gigabytes, with no option I've found to override the behavior.
This change updates the process regex to account for that and converts
the values to kilobytes so they can still be cast as integers.
Signed-off-by: Jonathan Hartman <j@hartman.io>
The description for `distinct_exit` had the exit codes backwards.
From the long desc
> If some tests skipped but none failed, exit code 101 is returned. If at least one test failed, exit code 100 is returned.
Signed-off-by: Will Fisher <wfisher@chef.io>
This modifies the output of failed test when using the `cmp` matcher by
calling `.inspect` on the actual value passed.
This makes it easier to diagnose failed matches due to characters such
as `\n` not being visible.
Current behavior:
```
inspec> describe command('echo demo') do
inspec> its('stdout') { should cmp 'demo' }
inspec> end
Profile: inspec-shell
Version: (not specified)
Command: `echo demo`
× stdout should cmp == "demo"
expected: "demo"
got: demo
(compared using `cmp` matcher)
Test Summary: 0 successful, 1 failure, 0 skipped
```
New behavior:
```
inspec> describe command('echo demo') do
inspec> its('stdout') { should cmp 'demo' }
inspec> end
Profile: inspec-shell
Version: (not specified)
Command: `echo demo`
× stdout should cmp == "demo"
expected: "demo"
got: "demo\n"
(compared using `cmp` matcher)
Test Summary: 0 successful, 1 failure, 0 skipped
```
Many thanks to @jazaval for discovering this!
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Unit tests passing for loading Train plugins
* detect works with a train test fixture
* Update fixture install of train-fixture-plugin
* Add functional tests for detect and shell when talking to a train plugin backend
* Update docs to reflect availability of Train plugins
* Functional test for install train plugin from path
* Working install train plugin from path, more tests for installing from odd locations
* PR Feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* 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>
* 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>
* Functional test for usage messaging
* Activate v2 commands on empty CLI invocation for usage messaging
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Sketch out in comments the unit and functional tests for the installer
* Make a test fixture gem, v0.1.0
* Add a 0.2.0 version of the test fixture gem, this one with a dependency
* Add a fixture with a pre-installed gem
* Correct test-fixture 0.1.0 gem
* Moockup of installed inspec-test-fixture gems
* Uggh add gemspec files to mock installs
* Update gem fixtures, and add a script that does it for me
* Able to load from and list privately managed gems
# Conflicts:
# lib/inspec/plugin/v2/loader.rb
* Expanded tests, starting on implementation of installer
# Conflicts:
# test/unit/plugin/v2/loader_test.rb
* Install plugin from local gem file works
* Writes the plugins.json file; needs refactor
* Gem install works; no version pinning
* Install with pinned version works
* Install from path works
* update works
* Validation for uninstall
* Uninstall from path works
* Uninstaller works on gems
* Add search to installer API.
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Move inspec init to v2 plugins.
* Revert inspec run command env change.
* Allow prefix and env for run_inspec_process.
* Update unit tests to use new functionality.
Signed-off-by: Jared Quick <jquick@chef.io>
This is useful when you have multiple versions of the same gem installed. It can be leveraged like so:
```
describe gem('rest-client') do
its('versions') { should include /1.8\.\d+/ }
its('versions') { should include /2.0\.\d+/ }
its('versions.count') { should_be eq 2 }
end
```
Signed-off-by: Ben Abrams <me@benabrams.it>