Commit graph

4110 commits

Author SHA1 Message Date
Patrick Münch
95f825aec2 correct syntax of first describe example and correct style of further examples (#2324)
* remove second end in first describe example, because of wrong syntax

Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>

* correct style of the examples

Signed-off-by: Patrick Münch <patrick.muench1111@gmail.com>
2017-11-27 11:15:51 -05:00
Chef Expeditor
0fef0feea7 Bump version to 1.45.14 by Expeditor 2017-11-27 16:13:11 +00:00
Adam Leff
6c3ab70dd1
json resource (et. al.): allow inspec check to succeed when using command (#2317)
* json resource (et. al.): allow inspec check to succeed when using command

When using the `json` resource (or any of the resources that subclass
JsonConfig), `inspec check` would fail if the content was supplied with
the `command` option. This is because the `command` resource is mocked
and an empty string would be returned for `stdout`. That content would
be blindly passed to the `parse` method would which raise an exception
and cause `inspec check` to fail.

This change refactors JsonConfig to be a bit cleaner and use some helper
methods. Additionally, we use the new Exceptions to properly raise errors
which are naturally caught by Inspec::Profile, etc.

Signed-off-by: Adam Leff <adam@leff.co>

* Make `resource_base_name` method private

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-27 11:13:02 -05:00
eramoto
65046f915f Fix issue template link in CONTRIBUTING.md (#2321)
In the CONTRIBUTING.md doc, corrects the link to the issue template used
in the description of issues/PRs.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2017-11-27 10:26:39 -05:00
Chef Expeditor
560a7df3a1 Update CHANGELOG.md to reflect the promotion of 1.45.13 to stable 2017-11-21 19:11:33 +00:00
Chef Expeditor
b402742cad Bump version to 1.45.13 by Expeditor 2017-11-21 19:04:32 +00:00
Adam Leff
46a3ca6eea
Bump train to 0.29.2 (#2327)
Train 0.29.1 includes a few regressions from 0.28 dealing with files.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-21 14:04:23 -05:00
Chef Expeditor
3a99baaf31 Bump version to 1.45.12 by Expeditor 2017-11-21 07:49:51 +00:00
Adam Leff
4b9acb4800 Bump Rubocop to 0.49.1 (#2323)
* Bump Rubocop to 0.49.1

This change bumps Rubocop to 0.49.1. There have been a lot of changes
since 0.39.0 and this PR is hopefully a nice compromise of turning off
certain cops and updating our codebase to take advantage of new Ruby
2.3 methods and operators.

Signed-off-by: Adam Leff <adam@leff.co>

* Set end-of-line format to line-feed only, avoid Windows-related CRLF issues

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-21 08:49:41 +01:00
Chef Expeditor
b9b502a48d Bump version to 1.45.11 by Expeditor 2017-11-20 18:11:52 +00:00
Adam Leff
935c56394f Remove bundler install during Appveyor tests (#2322)
It appears that the Appveyor images changed recently and the Ruby
installs for all version (2.2, 2.3, and 2.4) already include Bundler
installed. Attempting to install it will hang the tests at an
interactive prompt asking if you want to override the install, and
--force'ing the install causes path issues and Rubygems won't be able
to activate the gem.

Removing the bundler install appears to solve the problem nicely.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-20 19:11:43 +01:00
Adam Leff
0e8eccfa9b Add clarification to INI resource re: settings in sections (#2320)
Signed-off-by: Adam Leff <adam@leff.co>
2017-11-20 13:08:51 +01:00
dragon788
a1672dac28 Fix minor typo (#2319)
Amazingly doesn't appear anywhere else in the codebase from a brief search.

Obvious fix.
2017-11-17 16:47:45 -05:00
Chef Expeditor
03099d51dc Bump version to 1.45.10 by Expeditor 2017-11-17 20:56:44 +00:00
eramoto
a948900f88 Remove meaningless stdout message (#2313)
Stops to output the meaningless message to standard output when testing.
Obvious fix.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2017-11-17 15:56:36 -05:00
Chef Expeditor
65df85b24e Update CHANGELOG.md to reflect the promotion of 1.45.9 to stable 2017-11-16 17:25:19 +00:00
Chef Expeditor
77fe944f23 Bump version to 1.45.9 by Expeditor 2017-11-16 17:17:17 +00:00
Seth Chisamore
396752ba26 Add basic param handling to remote HTTP worker (#2286)
http resource: Add basic param handling to remote HTTP worker
2017-11-16 12:16:23 -05:00
Adam Leff
6ccc8aad26
Update expeditor version-update script (#2312)
PR #2311 updated the Rubocop engine to use Ruby 2.3 to evaluate, and
the default behavior is to no longer require `.freeze` to be added
to string literals that are treated like constants. This caused the
pattern match used in the Expeditor version update script to no longer
work.

Also manually fixing the `lib/inspec/version.rb` file to be correct.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-16 11:59:00 -05:00
Chef Expeditor
e40bf36bad Bump version to 1.45.8 by Expeditor 2017-11-16 16:26:36 +00:00
Adam Leff
dde4a116d6
Update Rubocop to TargetRubyVersion 2.3 (#2311)
Bumps the Rubocop engine to use 2.3 and addresses the big changes
between 2.0 and 2.3.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-16 11:26:19 -05:00
Chef Expeditor
832c66087a Bump version to 1.45.7 by Expeditor 2017-11-16 15:02:47 +00:00
Adam Leff
f05e22ad33 Require Ruby 2.3 and later (#2293)
* Require Ruby 2.3 and later

Ruby 2.1 is EOL, and Ruby 2.2 is on security fixes only. This moves
InSpec to support the current "normal maintenance" versions of Ruby
like Chef does and also bumps the versions used in Travis tests.

Signed-off-by: Adam Leff <adam@leff.co>

* Remove Ruby 2.2 from appveyor

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-16 22:02:35 +07:00
Chef Expeditor
e4ef2dbf11 Bump version to 1.45.6 by Expeditor 2017-11-15 20:56:50 +00:00
eramoto
986c8818d3 xinetd_conf resource: fix false positives with config file or directory doesn't exist (#2302)
xinetd_conf resource: fix false positives when config file or directory doesn't exist
2017-11-15 15:56:39 -05:00
Chef Expeditor
e403dd6e9f Bump version to 1.45.5 by Expeditor 2017-11-15 20:49:24 +00:00
malovdm1
923e4abf21 sqlplus credentials could contain special symbols and need to be escaped (#2308)
Signed-off-by: Dmytro Malovany <dmytro.malovannyy@gmail.com>
2017-11-15 21:49:09 +01:00
Chef Expeditor
c5130621f3 Bump version to 1.45.4 by Expeditor 2017-11-14 04:05:43 +00:00
Adam Leff
c91553c6f8 Allow resource skip exceptions outside initialize methods (#2307)
PR #2235 allowed for resources to raise skip and fail exceptions and
the RSpec formatters would do the right thing. These work inside
initialize methods but not in any other method in the resource.

This change modifies the formatter to honor the ResourceSkipped
exception properly. The ResourceFailed exception needs no additional
handling as RSpec properly handles any exception thrown.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-14 05:05:31 +01:00
Chef Expeditor
377797023e Bump version to 1.45.3 by Expeditor 2017-11-14 04:04:02 +00:00
eramoto
f9ee7596f5 Fix gid filtering for etc_group resource (#2297)
'etc_group' resource stores 'gid' as integer but the 'where' method
compares 'gid' as string.
By this fix, the 'where' method always converts the stored data to string
when comparing. And it can also look for groups without members.

Signed-off-by: ERAMOTO Masaya <eramoto.masaya@jp.fujitsu.com>
2017-11-14 05:03:50 +01:00
Chef Expeditor
99f1631d9e Bump version to 1.45.2 by Expeditor 2017-11-14 04:02:03 +00:00
Adam Leff
01b65db6c7 Habitat build works for all versions, eliminates rake (#2301)
The Habitat plan has been modified to support building from the repo
rather than relying on a gem being pushed to RubyGems. This allows
us to build current packages at every merge rather than only pushing to
Habitat Builder when we promote to stable.

This change also enables Expeditor to perform builds for us and removes
the dependency on the rake task as it is no longer needed.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-14 05:01:51 +01:00
Chef Expeditor
4f1e9eced6 Bump version to 1.45.1 by Expeditor 2017-11-14 03:41:49 +00:00
Adam Leff
6875e80bd8
Fix classname in JUnit formatter (#2283)
* Fix classname in JUnit formatter

The JUnit formatter currently incorrectly uses `class` instead of
`classname` as an attribute.

Signed-off-by: Adam Leff <adam@leff.co>

* Prefixing classname with profile name, fix functional tests

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-13 22:41:37 -05:00
Chef Expeditor
4840eb087e Bump version to 1.45.0 by Expeditor 2017-11-13 21:02:41 +00:00
Adam Leff
18faaa42de
Bumping train to 0.29.1 (#2306)
* Bumping train to 0.29

Train 0.29 includes some bug fixes and a refactor of the File classes

Signed-off-by: Adam Leff <adam@leff.co>

* Correct unit test for undefined platform

Train requires that a hash is supplied when mocking an OS. Because
an OS of "unsupported" rather than "undefined" was chosen in a unit
test, a nil was passed to train and it caused a failure.

Signed-off-by: Adam Leff <adam@leff.co>

* Ensure 0.29.1 or later gets picked up, but 0.30 is also acceptable

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-13 16:02:27 -05:00
Chef Expeditor
d8aea65849 Bump version to 1.44.9 by Expeditor 2017-11-13 17:06:14 +00:00
Wei He
f20748c88f fix port resource (parse_ss_line) (#2305)
Signed-off-by: Wing924 <weihe924stephen@gmail.com>
2017-11-13 18:06:01 +01:00
Chef Expeditor
dceb21ed8c Update CHANGELOG.md to reflect the promotion of 1.44.8 to stable 2017-11-09 17:39:12 +00:00
Chef Expeditor
7e6c4128c5 Bump version to 1.44.8 by Expeditor 2017-11-09 11:33:08 +00:00
Clinton Wolfe
656423d7f2 Issue warning during check if profile name contains slash (#2231)
* Add failing unit test for deprecation warning on profiles with slashes in their name

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Issue warning during validation if name contains a slash

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Slug profile names generated from target paths to prevent breaking unit tests

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Update functional test watching for default profile name

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Make deprecation warning more descriptive

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Set title with original test path if no profile name or title provided

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>

* Rubocop whinges

Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2017-11-09 12:32:54 +01:00
Chef Expeditor
2c75f048e4 Bump version to 1.44.7 by Expeditor 2017-11-09 11:29:53 +00:00
Adam Leff
86079ca3c7 Properly compare profile version strings as SemVer (#2280)
When configuring a profile dependency, if the dependent profile had a
hyphen in it, it would not properly match the default version constraint
of `>= 0`. This is because a hyphen indicates the version is a pre-release
version and proper version matching would require the constraint to also
be listed with a pre-release version string.

The proper solution is to use the `+` character instead which indicates
a build number, which is what the hyphen was meant to convey. In the
meantime, this change properly compares version strings as SemVer and
also adds tests.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-09 12:29:41 +01:00
Chef Expeditor
8d555bd160 Bump version to 1.44.6 by Expeditor 2017-11-09 11:25:20 +00:00
Adam Leff
afd23444c9 Eliminate deprecation warnings on resource skipped messages (#2296)
PR #2216 introduced some new tests that use the old syntax that was
deprecated in #2235. This gets them in line and eliminates the
deprecation warnings.

Signed-off-by: Adam Leff <adam@leff.co>
2017-11-09 12:25:11 +01:00
Chef Expeditor
6a01aa0038 Bump version to 1.44.5 by Expeditor 2017-11-09 10:11:29 +00:00
Brett Delle Grazie
0bb318c2dc http resource: supply max-time option using read_timeout and open_timeout (#2289)
Curl doesn't distinguish between them so need to use the sum of both as
the overall timeout.

fixes #2288

Signed-off-by: Brett Delle Grazie <brett.dellegrazie@gmail.com>
2017-11-09 11:11:19 +01:00
Chef Expeditor
3b143633aa Bump version to 1.44.4 by Expeditor 2017-11-09 10:10:07 +00:00
Adam Leff
06a3a6e95b Bump Omnibus ruby to 2.4.2 (#2294)
Signed-off-by: Adam Leff <adam@leff.co>
2017-11-09 11:09:54 +01:00