Commit graph

7116 commits

Author SHA1 Message Date
Ryan Davis
576370cf62
Merge pull request #4437 from inspec/zenspider/waivers/input
Rough draft on waiver input
2019-09-10 11:18:17 -07:00
Ryan Davis
7a718103c5 Minor cleanup in config.rb.
The logic involved was unnecessary and had a hard-coded string in it
that is now wrong.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-09 18:44:55 -07:00
Ryan Davis
ce80cf3cf9 First draft at waiver file processing.
1) Don't know how much filtering or rewriting we want at this level.
2) Don't know where to put the tests.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-09 18:44:55 -07:00
Chef Expeditor
29feee9b00
Bump version to 4.16.9 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-10 01:41:52 +00:00
Ryan Davis
dfce5e722f
Merge pull request #4427 from inspec/cw/waivers-overlay
waivers: functional test fixture and eval-time skipping
2019-09-09 18:41:37 -07:00
Chef Expeditor
69b583bd3d
Bump version to 4.16.8 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-10 01:02:22 +00:00
Ryan Davis
f5bbfe5fac
Merge pull request #4365 from inspec/zenspider/the-need-for-speed
Make inspec much faster for most commands.
2019-09-09 18:02:10 -07:00
Chef Expeditor
d1ecefc970
Bump version to 4.16.7 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-09 18:14:06 +00:00
Ryan Davis
79b9c3cbad
Merge pull request #4451 from inspec/zenspider/fix-tarball-decoding
Try to decode archive contents to UTF-8 to avoid encoding corruption.
2019-09-09 11:13:48 -07:00
Clinton Wolfe
5d94440823 Fix logic error for future expiring waivers
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
9fd0fb242c Store waiver information in control metadata and pass into report run_data
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
43bc7e0343 Modify @__skip_rule to distinguish only_if and waiver, and force waiver to win
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
aab45b507f Clarify input-waiver interaction
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
0db0a2bfdc Don't assume waiver_ prefix in waiver files
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
718e205cf2 Alter expiration_date behavior to match spec
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
ff209b4bae Refactor control_id lookup in waiver test file
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
6ec50efd22 Initial implementation of skipping a control by waivering it via input flagging
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
eb1ec437d7 Linting and test number corrections
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
6b618b6b83 Comments for clarity on skipping
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
5891c9aee9 A failing functional test to skip waivered controls
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Clinton Wolfe
77b4e45175 Test fixture profile and input file for waivers
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-09-09 11:29:26 -04:00
Chef Expeditor
b82158ba53
Bump version to 4.16.6 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-06 18:58:25 +00:00
Chef Expeditor
32d93b367d
Bump version to 4.16.5 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-06 18:57:54 +00:00
Miah Johnson
f11d6bcfba
Merge pull request #4443 from ramereth/fix-postfix_conf-other-file
Fix for postfix_conf when using a non-standard config location
2019-09-06 11:57:51 -07:00
Miah Johnson
d96b0a3281
Merge pull request #4446 from inspec/zenspider/activated_eh
Rework activator plugin to be more idiomatic.
2019-09-06 11:57:31 -07:00
Chef Expeditor
cb82159582
Update CHANGELOG.md with details from pull request #4447
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-06 18:57:07 +00:00
Miah Johnson
cd513424cf
Merge pull request #4447 from inspec/zenspider/replace-passgen
Clean up our use of SecureRandom in Rakefile.
2019-09-06 11:56:54 -07:00
Ryan Davis
d19d0bfd7c Refactor tests for TarProvider and ZipProvider a bit.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-06 00:42:36 -07:00
Ryan Davis
f93d0a2aee Make TarProvider much more efficient.
Read each file once at the start.
Extract should use that cache as well.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-06 00:42:36 -07:00
Ryan Davis
9849906198 Cleaned up TarProvider#initialize.
TarProvider still decompresses & reads N+1 times... that's next

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-05 17:33:08 -07:00
Ryan Davis
13301f30d1 Use ||= when possible, esp with lazy hashes.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-05 17:23:48 -07:00
Ryan Davis
e0a835a34d Added comments to the end of these classes to ease navigation.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-05 17:23:01 -07:00
Ryan Davis
fe4e687721 Try to decode archive contents to UTF-8 to avoid encoding corruption.
Fixes #4135.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-05 17:22:02 -07:00
Miah Johnson
1e1be43488
Merge pull request #4449 from inspec/snappj/build-only-if-version-bumped
Build omnibus and habitat packages only if version was bumped
2019-09-05 12:52:29 -07:00
Jeremiah Snapp
5aa2d0f609 Build omnibus and habitat packages only if version was bumped
Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
2019-09-05 15:30:37 -04:00
Chef Expeditor
4c1523ff88
Bump version to 4.16.4 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-05 13:30:39 +00:00
Clinton Wolfe
dffefc3f0b
Merge pull request #4435 from inspec/zenspider/apt/fix
Guard against nil in apt repo parser.
2019-09-05 09:30:22 -04:00
Chef Expeditor
eb9096f14c
Bump version to 4.16.3 by Chef Expeditor
Obvious fix; these changes are the result of automation not creative thinking.
2019-09-05 13:28:15 +00:00
Clinton Wolfe
aa1f99d959
Merge pull request #4436 from inspec/zenspider/fix-exec-usage
Fixed the formatting of `inspec exec -h` by not using long_desc.
2019-09-05 09:27:58 -04:00
Ryan Davis
8b0f6efb41 Fixed the formatting of inspec exec -h by not using long_desc.
long_desc does some really bad word wrapping stuff that totally breaks
our formatting of the output (like code blocks). So, don't use it. If
we like this, I will apply it to all of them.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 16:54:37 -07:00
Ryan Davis
6e821e787e Save off supports[:os] and restore it after each test.
This fixes some other tests that require supports[:os] to be correct.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
6296fdc688 Replace backticks in test descriptions with single-quotes.
Backticks means you can't selectively run one of these tests w/o
subshelling out to `brew`, or having to edit first.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
75ca4613c2 Extended to pick up our internal aws resources as well.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
4590fee51d Documented lib/inspec/resources.rb current usage.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
3b69967cc8 Fixed a bug in checking supports (strings vs symbols)
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
3f0f675364 Moved rspec/matchers require to somewhere more appropriate.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
2fc9ec3ec7 Refactor into Inspec::DSL.method_missing_resource
This way I can add aws lazy loading to only one place.

I don't actually care that this is in Inspec::DSL. There is probably a
better place for it. Suggestions welcome.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
ae88c3ddec Sped up inspec shell by avoiding pre-registering all reesources.
Now it tries to load a resource when `help xxx` is invoked or loads
all resources when `help resources` is invoked. Otherwise, it stays
lazy.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
e413cee6a4 I don't like this, but make chef shell require all resources.
I think there is probably a better way to do this, but my first
instinct was that I'd have to dig into hacking pry, and I don't want
to do that right now.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-09-04 15:44:26 -07:00
Ryan Davis
b6bfeffd9e Make inspec much faster for most commands.
Removes pre-loading and registration of resources by adding
method_missing to a couple key areas.

This still drops the ball in some areas, but it is a start.
2019-09-04 15:44:26 -07:00