Commit graph

2798 commits

Author SHA1 Message Date
Christoph Hartmann
92d3702043 add integration test for windows file and directory 2016-08-10 21:41:32 +02:00
Christoph Hartmann
18079f5fc8 Merge pull request #901 from chef/ssd/pgconf-location
Improve detection of postgresql conf dir and data dir
2016-08-10 19:04:50 +02:00
Steven Danna
c71f5cdb30 Improve detection of postgresql conf dir and data dir
Redhat conf_dir detection was regressed in 57d7275 which inadvertently
removed the setting of @conf_dir. Any attempt to use the postgres
resource on RHEL would rain an exception:

    inspec> postgres.data_dir
    TypeError: no implicit conversion of nil into String

Further, the redhat detection code appears to assume that RHEL always
uses versioned data directories. This however, does not appear to be the
case:

    $ cat /etc/redhat-release
    CentOS release 6.7 (Final)
    $ sudo ls /var/lib/pgsql/
    backups  data  pgstartup.log

The code now can handle both versioned and un-versioned directory
formats on RHEL. Further, it provides diagnostic warnings about
uncertainty in the discovered data directories and configuration
directories.

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-10 18:44:15 +02:00
Christoph Hartmann
9138c7d04e Merge pull request #904 from chef/chris-rock/temporary-disable-travis-tests
move test suites to allowed failures until travis is fixed
2016-08-10 18:07:37 +02:00
Christoph Hartmann
96968171f2 allowed failures for unit/functional tests until travis is fixed 2016-08-10 17:00:50 +02:00
Christoph Hartmann
c1e6478a94 Merge pull request #900 from chef/ssd/shell-readline
Add readline ignore markers to color escape codes in the shell
2016-08-10 16:25:15 +02:00
Steven Danna
b4b6792878 Add readline ignore markers to color escape codes in the shell
Previously, if you typed more than 20 characters at the prompt and
attempted pressed Ctrl+a (readline's "Move to start of line" command),
your prompt would appear at the ~11th character from the start of the
line, unable to go further back.

This was a result readline counting the terminal escape sequences we use
for color output as part of the line.

Wrapping these sequences in \001 and \002 instructs readline to ignore
them when doing calculations regarding line-length, resolving the
problem.
2016-08-10 14:26:56 +02:00
Christoph Hartmann
0fc2a07ce6 Merge pull request #902 from chef/ssd/lower-concurrency-test
travis experiment: lower docker concurrency
2016-08-10 14:25:43 +02:00
Steven Danna
9346f5dd34
travis experiment: lower docker concurrency
Signed-off-by: Steven Danna <steve@chef.io>
2016-08-10 12:52:21 +01:00
Steven Danna
e073a63565 Merge pull request #896 from chef/ssd/tab-complete
Add `inspec env` command to configure shell tab-completion
2016-08-10 10:52:41 +01:00
Steven Danna
afddebaf3f
Add inspec env command to configure shell tab-completion
This adds a new subcommand:

   inspec env [SHELL]

which outputs a shell-appropriate completion script that the user can
source into their shell:

   eval "$(inspec env SHELL)"

Currently, we provide completions for ZSH and Bash. The completion
scripts are generated from the data Thor collects.

If the user doesn't provide SHELL we attempt to detect what the user's
shell may be using a number of methods.

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-10 02:07:53 +01:00
Steven Danna
776adc1b22 Merge pull request #658 from chef/chris-rock/omnibus
Add omnibus for inspec
2016-08-08 14:58:06 +01:00
Steven Danna
07f7485423 [omnibus] Appbundle inspec and cleanup style issues
- Removes resource files which matched the default implementations
  contained in omnibus.

- Removes software definition for train which will be installed via the
  gem dependecies in the inspec defintion.

- Appbundle inspec to match our other ruby-based projects

- Update rubocop style violations

- Update copyright notices

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-08 13:34:33 +02:00
Christoph Hartmann
5a8ee8c896 add omnibus for inspec 2016-08-08 13:34:33 +02:00
Christoph Hartmann
85bba1a809 0.29.0 2016-08-08 13:32:36 +02:00
Christoph Hartmann
aafd0095c9 Merge pull request #881 from chef/chris-rock/train-0.16
Require train 0.16
2016-08-08 13:29:03 +02:00
Christoph Hartmann
da3d6f0f2d require train 0.16
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2016-08-08 13:19:28 +02:00
Christoph Hartmann
ae3827e457 Merge pull request #887 from chef/dr/json-restructure
revert control_summary field in output
2016-08-08 12:38:10 +02:00
Dominik Richter
16bd6a14d5 revert control_summary field in output
(1) The field is not yet optimal, the calculations are great!
(2) Changing this field should go together with all other breaking json changes, especially if https://github.com/chef/inspec/pull/811 results in a change.
2016-08-08 11:54:27 +02:00
Steven Danna
0e3b661200 Merge pull request #883 from chef/ssd/a-test-too-far
Remove some platforms from travis config
2016-08-05 18:48:04 +01:00
Kartik Null Cating-Subramanian
470b7bb7d2 Merge pull request #860 from chef/vj/inspec-controls-count
Count controls in the summary output. Fix #852
2016-08-05 13:47:45 -04:00
Kartik Null Cating-Subramanian
8094add5b3 Test summary JSON schema 2016-08-05 13:27:30 -04:00
Steven Danna
b979579e5f
Remove some platforms from travis config
We can run these platforms before the release, but running them on every
commit means we wait a long time for travis builders.
2016-08-05 18:16:55 +01:00
Steven Danna
9baf01cfb0 Merge pull request #882 from chef/ssd/autofail
Explicitly require docker transport to avoid autoload bug
2016-08-05 18:16:28 +01:00
Steven Danna
dea19846a3
Explicitly require docker transport to avoid autoload bug
Ruby's autoload feature is not threadsafe.  We are hoping requiring the
docker plugin early will fix odd failures we have been seeing.

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-05 17:58:20 +01:00
Victoria Jeffrey
6c91183995 count controls in the summary output. Fix #852 2016-08-05 11:43:29 -04:00
Kartik Null Cating-Subramanian
31a7d58473 Merge pull request #879 from chef/ksubrama/json_fix
Generate test labels for multi-test controls
2016-08-05 10:11:15 -04:00
Kartik Null Cating-Subramanian
0f572df4be Fix integration test 2016-08-05 10:01:29 -04:00
Kartik Null Cating-Subramanian
c5556e65f8 Cleanup to fix some formatting. Fix #872 2016-08-05 09:41:47 -04:00
Kartik Null Cating-Subramanian
742037c29d Generate test labels for multi-test controls: Fix #812 2016-08-05 09:41:47 -04:00
Steven Danna
84d8e2d987 Merge pull request #878 from chef/ssd/issue-867
Allow port to be specified as a string
2016-08-05 13:39:46 +01:00
Steven Danna
13ebea48e1 Allow port to be specified as a string
This allows the user to write:

   describe port(22) do
     it { should be_listening }
   end

as well as

   describe port('22') do
     it { should be_listening }
   end

without hitting an error.

Fixes #867

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-05 14:01:08 +02:00
Steven Danna
2ca3f4a464 Merge pull request #877 from chef/chris-rock/parseconfig-codestyle
improve code style for parse_config thanks @stevendanna
2016-08-05 12:24:13 +01:00
Christoph Hartmann
b3652bf85d improve code style for parse_config thanks @stevendanna
Signed-off-by: Christoph Hartmann <chris@lollyrock.com>
2016-08-05 12:29:34 +02:00
Christoph Hartmann
61eb9cfbd6 Merge pull request #876 from chef/chris-rock/parseconfig-improvement
add params and content method to parse_config
2016-08-05 12:20:00 +02:00
Christoph Hartmann
d9a1a500d0 add params and content method to parse_config 2016-08-05 12:13:56 +02:00
Steven Danna
6d8d5561fc Merge pull request #869 from chef/chris-rock/update-integration-tests
Activate centos, debian and oracle linux in our travis tests
2016-08-05 10:11:36 +01:00
Christoph Hartmann
5d78324059 add fedora 23 & 24 to kitchen integration tests 2016-08-05 10:52:03 +02:00
Christoph Hartmann
93a068b8fa update kitchen container, activate all in travis 2016-08-05 10:52:03 +02:00
Christoph Hartmann
1c9d998afd do not run runit and upstart in docker since chef run fails 2016-08-05 10:52:03 +02:00
Christoph Hartmann
bb5fb617d5 harmonize cookbooks for integration tests, update docs, remove i386 in vagrant 2016-08-05 10:52:03 +02:00
Christoph Hartmann
03807be315 Merge pull request #873 from Anirudh-Gupta/master
remote target supported OS also includes hp-ux
2016-08-05 09:50:40 +02:00
Anirudh Gupta
f9e5b2a4ca remote target supported OS also includes hp-ux 2016-08-05 12:59:36 +05:30
Christoph Hartmann
a8ea1c31e3 Merge pull request #865 from chef/ssd/issue-855
Update inspec for os[:family] change in Train
2016-08-04 14:46:26 +02:00
Steven Danna
185787fa74
Set environment variables via Travis config
Using the `env` feature of the matrix builds is a little hack so that
one can quickly see what tests failed when looking at the build summary
page.

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-04 13:32:35 +01:00
Steven Danna
57d7275857
Update inspec for os[:family] change in Train
Signed-off-by: Steven Danna <steve@chef.io>
2016-08-04 13:32:35 +01:00
Christoph Hartmann
b16ea5f89f Merge pull request #864 from chef/ssd/noisy-todo
Be a bit louder when skipping an entire integration suite
2016-08-04 14:21:35 +02:00
Steven Danna
f76bc6b7b4
Be a bit louder when skipping an entire integration suite 2016-08-03 16:41:27 +01:00
Christoph Hartmann
e6f73ff373 Merge pull request #863 from chef/ssd/issue-749
Use systemctl's helper command to determine enabled & active status
2016-08-03 15:22:29 +02:00
Steven Danna
28946f5fde
Use systemctl's helper command to determine enabled & active status
The output of `systemctl show SERVICENAME` can be misleading in the
case of non-native services (i.e. services configured via an init script
and integrated with systemd via a shim) or for more sophisticated unit
types.

For example, the UnitFileState of ntp is "bad":

    > systemctl show ntp | grep UnitFileState
    UnitFileState=bad

despite systemd reporting it as enabled:

   > systemctl is-enabled ntp
   ntp.service is not a native service, redirecting to
   systemd-sysv-install
   Executing /lib/systemd/systemd-sysv-install is-enabled ntp
   enabled

Further, the old parsing code would have missed unit files in the
following states that are technically enabled:

   enabled-runtime, indirect, generated, and transient

Using the `is-enabled` commands ensures that we report the same enabled
status that systemd reports, without having to update our own parsing in
the event that new unit states are added. Additionally, as shown above,
it handles the sysv compatibility helper.

Similarly, the is-active helper command ensures that we always report
the same active/not-active status as systemd would natively. For
instance, a quick reading of `src/systemctl/systemctl.c` in the systemd
source shows that systemctl reports units as active if they are in the
state `UNIT_ACTIVE` or `UNIT_RELOADING`.

Fixes #749

Signed-off-by: Steven Danna <steve@chef.io>
2016-08-03 13:31:09 +01:00