Commit graph

80 commits

Author SHA1 Message Date
Collin McNeese
88f6d99be3
updates test fixutres for cloud profiles to use inputs instead of attributes
Signed-off-by: Collin McNeese <cmcneese@chef.io>
2021-03-17 11:39:42 -05:00
Vasu1105
216306a219 removed unwanted README files from test fixtures and fixed some minor copy paste test
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-05 16:29:30 +05:30
Vasu1105
7dba4fa641 Fixes #5373 : Add option to filter empty profiles from report
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2021-03-04 22:09:48 +05:30
Clinton Wolfe
b425f1d6b9
Merge pull request #5414 from inspec/cw/ssh_conf_first_value 2021-02-23 12:05:44 -05:00
Clinton Wolfe
d22a1bd931 Failing unit test for multiple values in ssh_config
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-02-21 15:06:18 -05:00
Clinton Wolfe
b07b85f582 Failing test case for deep skip_control issue 5300
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2021-02-16 17:59:14 -05:00
David Marshall
874ee77791 add test for when run is not specified in waiver
The existing documentation explicitly claims that not specifying “run” in a waiver is equivalent to specifying “run: false.” It turns out to be the case that the claim is completely false. This commit includes a test for a new control 18_waivered_no_expiry_default_run that behaves exactly like the control 04_waivered_no_expiry_ran_fails. That is, not specifying run in a waiver is the same as specifying “run: true.”

Signed-off-by: David Marshall <dmarshall@gmail.com>
2020-12-28 16:26:19 -08:00
Clinton Wolfe
cdfb325ca3 Apply chefstyle -a, and manually remove duplicate requires
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-12-21 13:25:04 -05:00
Nick Schwaderer
acf2b2bbab Reverts without bug
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-11-23 15:49:52 +00:00
Nick Schwaderer
0860e631a7 Revert "Supply resource name, params to code_desc"
This reverts commit 345a832eb1.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-11-23 15:46:19 +00:00
Nick Schwaderer
345a832eb1 Supply resource name, params to code_desc
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-11-19 09:59:53 +00:00
IanMadd
6a592a6db2 Update various readmes and docs
Signed-off-by: IanMadd <imaddaus@chef.io>
2020-09-14 14:09:23 -07:00
Nick Schwaderer
94224e0695
Merge pull request #5210 from Udyrfrykte/master
Improve handling of bracketed options in deb source
2020-09-14 15:56:25 +01:00
Nick Schwaderer
6a60b456ba
Merge pull request #5054 from inspec/cw/run-data-filters
RunData Filters; sensitive inputs; suppress diff; sorted output
2020-08-27 11:15:57 +01:00
Udyrfrykte
fe74f4fd5b Improve apt.rb's read_debs
Make it better at handling whitespace in bracketed options

Signed-off-by: Benoît Gastinne <Udyrfrykte@users.noreply.github.com>
2020-08-17 11:38:40 +02:00
Tim Smith
303f530850 Update to Chefstyle 1.2.1
Update a few cop names
Remove redundant returns

Signed-off-by: Tim Smith <tsmith@chef.io>
2020-08-12 13:12:26 -07:00
Clinton Wolfe
a839d4602c Add ability to sort results in reporting phase
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:32:08 -04:00
Clinton Wolfe
3aca12d622 Add option to suppress diff output
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:31:28 -04:00
Clinton Wolfe
ceca77e118 Mark inputs as sensitive
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-08-10 14:30:11 -04:00
Felipe Zipitria
d2ae7a7fbf
fix(osfamily): use corresponding family or name for bsd/freebsd
Signed-off-by: Felipe Zipitria <fzipitria@perceptyx.com>
2020-07-22 08:43:25 -03:00
Nick Schwaderer
2744ff43e5
Merge pull request #5128 from james-stocks/js/report_bad_profiles
Report faulty profiles instead of crashing
2020-07-15 13:28:17 +01:00
Nick Schwaderer
934aa8d49a
Merge pull request #5138 from jrbeilke/bug-apt-cdrom
skip apt-cdrom repos in apt resource when parsing lists
2020-07-14 11:49:21 +01:00
Nick Schwaderer
6d340b323c Allow ‘=‘ character in CLI inputs
Fixes #5131

Due to the use of `#split(‘=‘)` against inputs supplied via the CLI we had an edge case where inputs with `’=‘` in the value would cause a breakage.

This PR supplies a test for the regression and fixes the bug with a regex solution.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-07-09 12:50:21 +01:00
Jon Beilke
bedef776a6 skip apt-cdrom repos in apt resource when parsing lists
Signed-off-by: Jon Beilke <Jonathan.Beilke@windlogics.com>
2020-07-08 14:19:09 -05:00
James Stocks
41087c5ec6 Set profiles that fail to load as failed
Signed-off-by: James Stocks <jstocks@chef.io>
2020-07-02 13:33:07 +01:00
Clinton Wolfe
d9007588a6 Add an heuristic-based IP lookup property
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
52468e470e Barebones plural interfaces resource
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
Clinton Wolfe
a4000d6912 Adds support for interface on BSD and MacOS
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-18 15:37:19 -04:00
James Stocks
070823122d
Merge pull request #5062 from inspec/cw/reporter-plugin-jsonmin
Make the JSON-min Reporter into Plugin
2020-06-11 12:30:18 +01:00
Clinton Wolfe
09bbc7e2e7 Remove a ruby expression-based test
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-05 17:40:49 -04:00
Clinton Wolfe
925363766e Document and test to verify that it skips resources in describe blocks
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-05 17:40:49 -04:00
Clinton Wolfe
f39cf8c904 Tests to exercise only_if functionality
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-05 17:39:54 -04:00
Nick Schwaderer
fb1aeb0655
Merge pull request #5011 from inspec/cw/complex-cli-inputs
Boolean, Numeric, and Structured CLI inputs
2020-06-05 04:23:48 -07:00
Clinton Wolfe
26e5ae3410 Update run_data fixture to include correct statistics structure
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-06-02 21:34:42 -04:00
Clinton Wolfe
dcc70bc541 Trim log message, make boolean check case insensitive
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-23 00:25:08 -04:00
James Stocks
32fa14f1b0
Merge pull request #5039 from james-stocks/js/issue_5037
Allow for waiver time as well as date
2020-05-22 16:52:23 +01:00
James Stocks
23ed9bcf06
Merge pull request #5007 from inspec/cw/reporters-as-plugins
Reporters as Plugins
2020-05-22 16:10:29 +01:00
Clinton Wolfe
3184d5ca9e Add an object model for run_data
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-20 13:27:20 -04:00
James Stocks
350c0bfe8f Handle waiver expiration dates being YAML strings
This is technically incorrect YAML, but if you transcode YAML between several tools you may end up with a date/time value being an explicit string.
It would be helpful if InSpec supported any string value that easily translates to a Time.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-05-20 15:00:43 +01:00
James Stocks
35e36ad40a Allow for waiver time as well as date
Fixes #5037

The YAML parser may parse a waiver timestamp as a Time rather than a Date. Even when the user doesn't care about time, they may be using a tool that outputs YAML with trailing zeroes for hour, minutes, seconds etc.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-05-20 14:59:07 +01:00
James Stocks
2103b52dbe
Merge pull request #4994 from james-stocks/js/json
Reporter options to truncate message and suppress stacktrace
2020-05-07 12:54:34 +01:00
Clinton Wolfe
786e3728d7 Failing tests for #4799
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 18:09:11 -04:00
Clinton Wolfe
970f583764 Tighten up tests
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 17:59:50 -04:00
Clinton Wolfe
c683c4d64d Failing test cases for 4963
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 17:37:23 -04:00
Clinton Wolfe
824018efa3 Failing test cases for #4977
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 17:37:23 -04:00
Clinton Wolfe
5accb27224 Linting, and a thinko
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 16:51:31 +01:00
Clinton Wolfe
5a7a48bb62 Basics of a working reporter plugin system
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-05-05 16:51:31 +01:00
Nick Schwaderer
a1129f9efc Allows input and control to have the same name
In https://github.com/inspec/inspec/issues/4936 the issue was reported that naming an input the same as a control caused an unexpected failure.

In that particular case, the naming was a result of a pre-waivers workaround which is no longer necessary, but ultimately a breakage of that name clash is an unexpected occurrance.

Due to how inputs are named and registered, `__apply_waivers` thinks that an object is a waiver that is not a waiver and tries to process it. On the micro level, it breaks when trying to pass a variable to a string as if it were a Hash.

It is imperative that we preserve 100% of the current featureset, pass our tests, and fix this edge case along with new test coverage for the failure.

This PR updates the code to do a slightly more elegant and small ‘waiver check’ to stop the namespace clash from breaking our code.

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-05-05 10:00:19 +01:00
James Stocks
ae66aee2b2 (WIP) Reporter options to truncate message and suppress stacktrace
TODO: Option names are not JSON specific but only json reporter has been implemented.

Signed-off-by: James Stocks <jstocks@chef.io>
2020-05-04 15:24:50 +01:00
Clinton Wolfe
58e8bc5167 Divide tests into undeclared and required groups
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2020-04-24 16:38:11 -04:00