Commit graph

3649 commits

Author SHA1 Message Date
Adam Leff
8a63e9d12c Merge pull request #1591 from chef/adamleff/www-fixup
Fixing www/docs rake tasks
2017-03-22 13:39:06 -04:00
Adam Leff
65c95d243e Fixing www/docs rake tasks
This is a follow-up to #1585. The website-related Rake tasks have been
moved to a www-specific Rakefile which can be found in the www/
directory. Any web-release-related gems have been moved to the www
Gemfile as well.

This also included modifying the docs rake tasks to be path-
independent as they currently expect that Rake is being run from the
root of the repo.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-22 12:21:03 -04:00
Christoph Hartmann
9de56d25f7 Merge pull request #1589 from mr-exz/yaml-bug-file-name
Support YAML attributes files ending in .yaml
2017-03-22 14:36:26 +01:00
Adam Leff
730de65e36 Merge pull request #1567 from chef/chris-rock/x509
x509_certificate and key_rsa resource
2017-03-22 07:30:19 -04:00
Christoph Hartmann
a96059a3eb x509 integration tests
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-03-22 11:44:33 +01:00
Christoph Hartmann
d2f000e435 refactor x509 resources and rsa key
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-03-22 11:44:32 +01:00
Richard Nixon
f66f0b3a18 Initial support for x509_certificate and rsa_key
* Includes unit tests
* Includes 2 new resources
* Includes documentation

Signed-off-by: Richard Nixon <richard.nixon@btinternet.com>
2017-03-22 10:00:48 +01:00
Christoph Hartmann
2d9d7aa106 Merge pull request #1564 from chef/dr/schema
implement JSON schema for `inspec exec` json outputs
2017-03-22 09:52:47 +01:00
Dominik Richter
738bae0db8 add inspec json schema validation to functional tests
Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
2017-03-22 09:42:36 +01:00
Dominik Richter
c620cbf69e add inspec min json generator 2017-03-22 09:42:36 +01:00
Dominik Richter
55daa24cbc add json schema and generator 2017-03-22 09:42:36 +01:00
Christoph Hartmann
57c6b39612 Merge pull request #1587 from chef/adamleff/fix-nokogiri-for-habitat
Fix Habitat plan for nokogiri support
2017-03-22 09:40:59 +01:00
mr.exz
38c9648eb4 add fix
Signed-off-by: mr.exz <root@exzec.ru>
2017-03-22 08:17:18 +03:00
Adam Leff
4dae0bead8 Fix Habitat plan for nokogiri support
Nokogiri is failing to build in the habitat artifact due to the lack
of libxml2 and libxslt. This brings them in as dependencies and also
properly configures bundler to use them.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-21 17:51:59 -04:00
Adam Leff
12bd580199 Merge pull request #1585 from chef/adamleff/move-simulator-to-www-gemfile
Move simulator gems to www
2017-03-21 16:50:18 -04:00
Adam Leff
199cb160ea Move simulator gems to www
The simulator gems are not necessary for building InSpec, only the website.
This is currently causing issues in the Jenkins infrastructure due to
a downstream dependency of github-markup.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-21 16:11:56 -04:00
Adam Leff
ddc0036f40 Merge pull request #1583 from chef/adamleff/1.17.0
release 1.17.0
2017-03-21 15:11:34 -04:00
Adam Leff
66095722c8 release 1.17.0
Signed-off-by: Adam Leff <adam@leff.co>
2017-03-21 15:00:26 -04:00
Christoph Hartmann
b0702dd587 Merge pull request #1579 from chef/adamleff/fix-s3-cache
Fix omnibus configuration
2017-03-20 23:19:26 +01:00
Adam Leff
a49467e779 Fix omnibus configuration
The latest omnibus master expects certain settings to be enabled for
S3 caching to work, and our omnibus.rb wasn't set up properly. Also
aligning some of our settings to chef/chef's settings which we know
to work properly.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-20 17:50:16 -04:00
Christoph Hartmann
c11e4d2944 Merge pull request #1576 from jkerry/fixing_nokogiri
moving the nokogiri reference into the gemspec file
2017-03-20 13:39:32 +01:00
John Kerry
d4a0ae4549 removing an unnecessary require of the rspec junit formatter
Signed-off-by: John Kerry <john@kerryhouse.net>
2017-03-19 22:07:19 -04:00
John Kerry
dd9ec61199 moving the nokogiri reference into the gemspec file
Signed-off-by: John Kerry <john@kerryhouse.net>
2017-03-19 21:56:14 -04:00
mr.exz
4647664d56 solve #1569 2017-03-19 00:00:49 +03:00
Adam Leff
ea7c0c493e Provide a method-based accessor for SimpleConfig hashes
When SimpleConfig parses a config file that has sections, such as a mysqld
config file, the values within that section are returned via a Hash. However,
we do not provide an easy way to write tests for those deep hash values:

```
describe mysql_conf('/tmp/my.cnf') do
  its('mysqld.expire_logs_days') { should cmp 10 }
end

  MySQL Configuration
     ∅  undefined method `expire_logs_days' for #<Hash:0x007fe463795a00>
```

This change provides a method-based accessor for Hashes that are built via
SimpleConfig.

```
describe mysql_conf('/tmp/my.cnf') do
  its('mysqld.expire_logs_days') { should cmp 10 }
end

  MySQL Configuration
     ✔  mysqld.expire_logs_days should cmp == 10
```

Fixes #1541 by changing the way the attributes are fetched.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-15 14:49:16 -05:00
Adam Leff
bf36c0a7a7 Merge pull request #1555 from nvtkaszpir/patch-1
Update file.md with example how to test symlinked files
2017-03-15 09:00:32 -05:00
Christoph Hartmann
56986d1bdb Merge pull request #1561 from chef/adamleff/fix-object-traverser-for-arrays
Fix ObjectTraverser when accessing array values
2017-03-15 11:41:27 +01:00
Adam Leff
4f2b66302d Fix ObjectTraverser when accessing array values
When attempting to access array values via the `json` resource:

```
describe json('/tmp/test.json') do
      its(['array',0]) { should eq "zero" }
end
```

... the resulting data would be an array of the size of the original array
with all the values replaced with nils:

```
     expected: "zero"
          got: [nil, nil, nil]
```

This was due to a bug in the ObjectTraverser mixin that mapped array values
back through `extract_value` rather than properly handling the passed-in
key(s). This worked fine for the specific data format created by the `csv`
resource but did not work `json` or any other resource that subclassed the
`JsonConfig` resource.

This change fixes the logic when dealing with an array when it's encountered,
and fixes up the `csv` resource with its own `value` method.

This change also adds tests for ObjectTraverser.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-15 11:35:55 +01:00
Michał Sochoń
7a935a204e Update file.md with example how to test symlinked files.
Added detailed example why and how.
Updated with suggestions from Adam Leff.

Signed-off-by: Michał Sochoń <kaszpir@gmail.com>
2017-03-15 07:53:14 +01:00
Adam Leff
3d551f977f Merge pull request #1559 from chef/adamleff/add-crontab-example
Add additional example for matching crontab commands
2017-03-14 23:39:07 -05:00
Adam Leff
8155357d0a Add additional example for matching crontab commands
As raised in #1526, adding an additional example showing how
a user can use the `where` accessor to find commands matching
a pattern and write a test using the results.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-14 22:16:39 +01:00
Adam Leff
ab9e258112 Merge pull request #1563 from chef/HM-HideCancelledEvent
Hide Event Feature on Homepage
2017-03-14 15:24:19 -05:00
hannah-radish
1f49a9c21e Hide Event Feature on Homepage
Darn that snowstorm. Event is cancelled!

Signed-off-by: hannah-radish <hmaddy@chef.io>
2017-03-14 13:22:24 -07:00
Carl Johnston
30b4152dd2 Add integration tests for symlinked apache configuration.
Remove httpd helper cookbook and write out simple configuration by hand.

Signed-off-by: Carl Johnston <carldjohnston@gmail.com>
2017-03-14 14:48:19 +11:00
Adam Leff
546486ff6a Merge pull request #1550 from chef/chris-rock/upstart-fallback
try to use sysv fallback if is not producing proper output
2017-03-09 17:25:29 -05:00
Adam Leff
1c87db9e7a Merge pull request #1552 from chef/adamleff/better-inspec-yml-errors
Provide better error message when inspec.yml is invalid
2017-03-09 12:34:18 -05:00
Adam Leff
dfce561276 Provide better error message when inspec.yml is invalid
Currently, if the inspec.yml for a profile is invalid (such as including
an improperly-defined multi-line string), InSpec will throw an exception
from the YAML parser that does not given a clear indication that the
issue was encountered while parsing the inspec.yml file.

This change introduces a better exception message to clue the user into
where the problem actually lies.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-09 18:03:01 +01:00
Adam Leff
7667c9cb0a Merge pull request #1525 from spiffytech/patch-1
windows_task docs: Correct syntax error and misspelled word
2017-03-08 15:03:15 -07:00
Adam Leff
8d21366e41 Merge pull request #1536 from tescalada/patch-1
Fixing a typo
2017-03-08 15:02:28 -07:00
Christoph Hartmann
8b1619b60e try to use sysv fallback if is not producing proper output
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-03-08 21:52:52 +01:00
Adam Leff
71ee19ad3b Merge pull request #1548 from chef/chris-rock/installation
update readme for install scripts
2017-03-07 11:32:41 -07:00
Christoph Hartmann
7437a2b00f update readme for install scripts
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2017-03-07 19:25:25 +01:00
Christoph Hartmann
6f2ec9b821 Merge pull request #1547 from chef/adamleff/fix-ipv4-address-as-tcp6-entries
Fixing port check with v4 IPs in a v6 netstat line
2017-03-07 10:08:43 +01:00
Adam Leff
037f08beb2 Fixing port check with v4 IPs in a v6 netstat line
On Linux, netstat may show a tcp6/udp6 protocol line but include a
v4 address. This happens with AF_INET6 sockets that can accept
both v4 and v6 traffic. The port check was not properly handling
this situation and trying to pass a v4 address to URI bracketed as
if it was a v6 address.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-06 22:03:41 -07:00
Christoph Hartmann
ff91244186 Merge pull request #1540 from chef/1.16.1
releasing 1.16.1 with a bug fix and omnibus fix
2017-03-06 19:58:12 +01:00
Adam Leff
45f242e122 releasing 1.16.1 with a bug fix and omnibus fix
Signed-off-by: Adam Leff <adam@leff.co>
2017-03-06 11:58:00 -07:00
Christoph Hartmann
ef775e61c4 Merge pull request #1539 from chef/adamleff/omnibus-build-fix
Fix omnibus build after new JUnit formatter
2017-03-06 19:32:43 +01:00
Adam Leff
9581fda2d8 Fix omnibus build after new JUnit formatter
The new JUnit formatter requires nokogiri, so we need
to build nokogiri via omnibus to ensure liblzma, etc.
is built as part of the omnibus package instead of
`gem` picking up a system liblzma, such as on Mac OS X.

Also bumping ruby to 2.3.1 to match ChefDK.

Signed-off-by: Adam Leff <adam@leff.co>
2017-03-06 11:25:20 -07:00
Makoto Nozaki
f913b56ffc Avoid connection timeout of "inspec version" (#1538)
* Add open_timeout to NET::HTTP.start call
Signed-off-by: Makoto Nozaki <makoto.nozaki@twosigma.com>

* Code cleanup based on the discussion at #1538
Signed-off-by: Makoto Nozaki <makoto.nozaki@twosigma.com>
2017-03-06 09:23:42 -07:00
Adam Leff
66dce387ee Merge pull request #1512 from chef/HM-BugFixesWeb-022317
Ready for review - inspec.io bug fixes, #1440, #1420, #1465, #1421, #1437,#1226, #1494, #1495
2017-03-05 18:27:02 -05:00