Commit graph

1067 commits

Author SHA1 Message Date
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
Ryan Davis
82c9aa6ed6 Got the rest of the tests to pass.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -07:00
Ryan Davis
adaf2bc364 Removed aws resource requiring from test/helper and inspec/resource.
This speeds up parallel unit test runs from a very consistent 2:49 to
a very consistent 1:53, or a 33% reduction.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-05-29 17:58:02 -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
Miah Johnson
2215bb0570 Update all requires pointing to util/
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-28 11:30:16 -07:00
Miah Johnson
4172ae48fa Relocate resources to inspec/resources
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-08 13:09:54 -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
Miah Johnson
5c00a44d71 Update resource registry_key documentation example
ref: https://github.com/inspec/inspec/issues/4003

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-30 17:04:12 -07:00
Clinton Wolfe
00bcf91dac
When mssql response is parsed, header might be nil. (#3971)
When mssql response is parsed, header might be nil.
2019-04-25 11:09:52 -04:00
Clinton Wolfe
843ba7afa2
Improve ss parsing code for IPv6 addresses (#3962)
Improve ss parsing code for IPv6 addresses
2019-04-25 11:09:31 -04:00
Miah Johnson
7506ae4121 When mssql response is parsed, header might be nil.
Only set and downcase header if its not nil.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-23 14:45:34 -07:00
Miah Johnson
27935e9e51 Improve ss parsing code for IPv6 addresses
Some versions of `ss` wrap IPv6 addresses in brackets, eg:

```
[fe80::dc11:b9b6:514b:134]%eth0:123
[::]
```

This change removes all brackets during parsing.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-04-18 23:55:50 -07:00
Clinton Wolfe
3d0b8dff2e
Merge pull request #3956 from inspec/cw/use-deprecation-everywhere-4-port
Use deprecation facility everywhere - v4 port
2019-04-17 17:12:24 -04:00
Clinton Wolfe
7aeb1763a9
Merge pull request #3897 from mattlqx/interface-addresses
Support address matchers on interface resource
2019-04-17 11:57:29 -04:00
Clinton Wolfe
1552dc0210 Merge branch 'cw/use-deprecation-everywhere-3-port' of github.com:inspec/inspec into cw/use-deprecation-everywhere-4-port 2019-04-16 17:42:45 -04:00
Clinton Wolfe
0c884b1415
Merge pull request #3895 from mitre/al-mitre/more-permissive-than
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-04-16 14:41:43 -04:00
Matt Kulka
633cea6673 support address matchers on interface resource
Adds missing functionality to `interface`. Fixes #1830

```
describe interface("eth0") do
  its(ipv4_addresses) { should include 1.2.3.4 }
end
```

And so on... see diff/docs for additional matchers.

Signed-off-by: Matt Kulka <mkulka@parchment.com>
2019-04-12 08:24:13 -07:00
Clinton Wolfe
fc1bc75358 Adjust deprecations somewhat
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-04-12 10:55:36 -04:00
Jerry Aldrich
40031a9b83 Use deprecation facility throughout code
This converts all current deprecation warnings/TODOs to use the
`Inspec.deprecate()` deprecation facility.

This also modifies `Inspec.deprecate()` to only require 1 argument.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-04-11 19:15:01 -04:00
Miah Johnson
8435990722
Merge pull request #3899 from inspec/sp/crontab-path-update
crontab: Add validation for path param
2019-04-04 17:26:13 +00:00
Aaron Lippold
1e9f8fd018 Merge branch 'master' of https://github.com/inspec/inspec into al-mitre/more-permissive-than
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-28 15:50:16 -04:00
Aaron Lippold
e312b44563 Addressing review items.
Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-27 09:55:48 -04:00
Stuart Paterson
0c0e0aa016
Remove debugging lines.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-21 16:20:06 +00:00
Stuart Paterson
5accfa5391
Add protection for crontab resource path and document it.
Signed-off-by: Stuart Paterson <spaterson@chef.io>
2019-03-21 15:49:00 +00:00
Lynn Frank
6018a6959d Fixes indentation of kernal_module example
Signed-off-by: Franklin Webber <franklin.webber@gmail.com>
2019-03-19 12:05:15 -05:00
Lynn Frank
23eff3df24 Fixes rubocop violation on indention
Signed-off-by: Franklin Webber <franklin.webber@gmail.com>
2019-03-19 11:32:07 -05:00
Lynn Frank
2857d07151 Fixes resource examples
The opening and closing mechanic varied between all the various
resources. This changes them all to use a HEREDOC with a tilde
to remove leading whitespace. This removes the need for the
special method to trim the `#print_example` method from shell.

Signed-off-by: Franklin Webber <franklin.webber@gmail.com>
2019-03-19 11:25:41 -05:00
Aaron Lippold
a2a86860d6 This adds the more_permissive_than?(mode) matcher to the file resource.
Fixes #3893

Signed-off-by: Aaron Lippold <lippold@gmail.com>
2019-03-18 18:10:13 -04:00
Keith Walters
c2bd0616fe Allow http resource to follow redirects
By specifying a `max_redirects` attribute, the `http` resource worker
will follow any HTTP Redirect response (301, 302, etc...) up to the
limit defined by this attribute. For a local worker, exceeding that
limit will raise a `FaradayMiddleware::RedirectLimitReached` exception.
For a remote worker, the curl command will exit without populating the
`status` and `body` properties.

Signed-off-by: Keith Walters <keith.walters@cattywamp.us>
2019-03-16 20:54:52 -04:00
Clinton Wolfe
c580b695c7
Merge pull request #3842 from inspec/ja/fix-iis-app-pool-resource
iis_app_pool: Fix PowerShell JSON parsing error
2019-03-11 13:52:07 -04:00
Jerry Aldrich
22c20b7989 Add comment explaining -Compress
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-28 12:04:59 -08:00
Jerry Aldrich
66a343555b iis_app_pool: Fix PowerShell JSON parsing error
This works around a current bug in PowerShell where the output cannot be
parsed as JSON.

The `-Compress` flag does not affect the validity of the data but only
the appearance of the string.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-28 12:04:59 -08:00
Jerry Aldrich
af5d6e9285 http resource: Add fallback to #to_s
This prevents a stack trace from being shown to the user if the `http`
resource is used on an unsupported platform.

Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
2019-02-28 09:08:49 -05:00
Christoph Hartmann
afadc896f2 make rubocop happy
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2019-02-26 16:57:48 +01:00
Christoph Hartmann
15c03cf8fc detect postgres 10 on centos properly
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2019-02-25 13:39:17 +01:00
Clinton Wolfe
dd3d3cbd2f Add deprecation hook for size()
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:02:17 -05:00
Clinton Wolfe
02cb799ee6 Rename free to free_kb
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
Clinton Wolfe
5bbd4c16d6 Add size_kb, and correct Powershell code to return KB for both total size and free space, rather than total in GB and free space in bytes
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
Clinton Wolfe
fef637a6c6 Add percent_free property
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-02-06 14:01:04 -05:00
James Massardo
497035a65b missed rubocop error
Signed-off-by: James Massardo <jmassardo@chef.io>
2019-02-06 14:01:04 -05:00
James Massardo
49eccb09aa removed unneeded library
Signed-off-by: James Massardo <jmassardo@chef.io>
2019-02-06 14:01:04 -05:00
James Massardo
83c0c18fca Add free space and type to filesystem resource
Signed-off-by: James Massardo <jmassardo@chef.io>
2019-02-06 14:01:04 -05:00
David Alexander
d5dbae2efd Updates stub for IIS App Pool unit test
Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2019-01-22 15:08:25 -08:00
David Alexander
abd234dca6 Removes Rubocop disable rule (not needed anymore)
Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2019-01-22 15:08:25 -08:00
David Alexander
7c29bd81a1 Cleans up human-readable strings
Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2019-01-22 15:08:25 -08:00
David Alexander
396b05b020 Takes advantage of inspec 2.x supports resource framework
Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2019-01-22 15:08:25 -08:00
David Alexander
ddf024d250 Fixes #3418 ('iis_app_pool should not exist' error)
Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2019-01-22 15:08:25 -08:00
Clinton Wolfe
b5e91e7dbf
Support cran packages for non-utf8 locales (#3613)
Signed-off-by: Adam Ward <adamw@subdesigns.net>
2019-01-14 10:49:50 -08:00