Commit graph

442 commits

Author SHA1 Message Date
Dominik Richter
fb54c4ea24 api: inspec.yml supports now adds tests w/o running
Instead of just removing all tests because of OS support, supports now acts by adding all tests to the execution context, but doesnt actually execute them. Instead tests are set to skip before they get to the actual execution context
2016-04-06 11:28:52 +02:00
Dominik Richter
c55fb0b587 prevent only_ifs from getting overwritten 2016-04-06 10:46:36 +02:00
Dominik Richter
a72fee6623 add only_if for controls 2016-04-06 10:46:36 +02:00
Dominik Richter
c73afd4c1c overhault rule/control internals
instead of keeping them as flat variables, prefix all internals with `__` to create consistency. Also add accessors on the class-level to expose these values in all rules. This way we keep all variable-names in one location and get some safety on access.
2016-04-06 10:46:36 +02:00
Dominik Richter
598e8be07f don't remove controls with only_if
instead mark them as skipped, but don't just remove them.

This also introduced a number of tests around only_if on the global level
2016-04-06 10:15:53 +02:00
Alex Pop
070c5bb0e9 update tests with 5 examples 2016-04-04 14:19:13 +01:00
Dominik Richter
2cad553de8 add advanced passwd filters (experimental) 2016-03-31 02:03:20 +02:00
Christoph Hartmann
bc3be2f302 fix functional tests 2016-03-28 01:15:48 +02:00
Christoph Hartmann
a0529075d3 add integration tests 2016-03-26 22:49:32 +01:00
Dominik Richter
ee170cc526 support --controls for json 2016-03-25 01:58:59 +01:00
Dominik Richter
17840e0299 split up functional tests 2016-03-25 01:32:03 +01:00
Christoph Hartmann
f4180780d1 document tags and refs 2016-03-25 00:58:27 +01:00
Alex Pop
53c7683ff7 update tests based on resource changes 2016-03-24 21:50:51 +01:00
Alex Pop
3c3d711dfd bugfix: fix rare inspec shell missing all resources
In some instances, when running inspec shell, you dont get any resources inside of it. i.e. `inspec shell` and then `os` will lead to

```ruby
NameError: undefined local variable or method `os' for
from (pry):1:in `add_content'
```

This is because of instance_eval loading withing the given source/line
information and not attaching to the profile context which actually has
all the resources. Fix it by making sure that inspec shell always
attaches to the profile context with resources by providing nil for
source and line information.
2016-03-24 20:37:46 +01:00
Christoph Hartmann
cd57b26bd0 wmi unit test 2016-03-20 11:53:56 +01:00
Christoph Hartmann
7e7196db77 add wmi integration tests 2016-03-20 11:53:56 +01:00
Christoph Hartmann
4c5a3ed412 add vbscript unit test 2016-03-19 19:04:31 +01:00
Christoph Hartmann
e8aa426846 add vbscript integration test 2016-03-19 19:04:31 +01:00
Christoph Hartmann
f50255486b add support for addresses in port resource 2016-03-19 11:48:14 +01:00
Dominik Richter
a9632d53d4 fix inspec shell and continuously test it 2016-03-19 09:13:23 +01:00
Christoph Hartmann
32a065239c update unit test, add integration test 2016-03-18 15:47:00 +01:00
Christoph Hartmann
1d043bfebc move kitchen integration tests to top-level 2016-03-18 11:30:54 +01:00
Christoph Hartmann
8433b55fc4 do not install postgres on ubuntu 15.10 2016-03-18 11:30:54 +01:00
Christoph Hartmann
ea085ef7c0 place empty iso in tmp directory 2016-03-18 11:30:54 +01:00
Dominik Richter
c78a7dfbde add functional tests for fulljson 2016-03-18 02:42:53 +01:00
Dominik Richter
76fe4483d4 feature: add tags and refs 2016-03-18 01:42:26 +01:00
Dominik Richter
9e6e2bd4f7 add inspec exec tests with json formatter 2016-03-18 00:29:10 +01:00
Dominik Richter
b7e438eabc add a mock fetcher 2016-03-17 23:37:09 +01:00
Dominik Richter
ca5f7b822b add tests for resource plugin 2016-03-17 15:58:20 +01:00
Dominik Richter
f7c2fa4392 functional tests for inspec detect + version + exec 2016-03-17 10:21:38 +01:00
Dominik Richter
6853284e31 validate inspec json generation 2016-03-17 10:21:38 +01:00
Dominik Richter
bfd88df27a verify that archive creates valid zip and tar files 2016-03-17 10:21:38 +01:00
Dominik Richter
0218f1f3ca feature: --output on archive 2016-03-17 10:21:38 +01:00
Dominik Richter
e3991a2025 bugfix: inspec archive with profile path for inheritance 2016-03-16 20:32:02 +01:00
Dominik Richter
26c34c3487 WIP profile check on inheritance profiles 2016-03-16 20:32:02 +01:00
Dominik Richter
89d7f0b593 give them hell!
parallelize minitest runs for functional tests
2016-03-16 08:28:09 +01:00
Dominik Richter
0a4567d49f add simple command tests for inspec check 2016-03-16 08:23:47 +01:00
Dominik Richter
387415859e rename internal File -> FileResource 2016-03-09 10:48:48 +01:00
Adam Leff
577688a3a0 Placing all resources in the Inspec::Resources namespace
Many of the resources are named as a top-level class with a fairly generic class name, such as "OS". This causes an issue specifically with kitchen-google which depends on a gem which depends on the "os" gem which itself defines an OS class with a different superclass. This prevents users from using TK, Google Compute, and Inspec without this fix.

Some mocked commands had their digest changed as well due to the new indentation, specifically in the User and RegistryKey classes.

I strongly recommend viewing this diff with `git diff --ignore-space-change`
to see the *real* changes. :)
2016-03-08 13:40:16 -05:00
Dominik Richter
ccf2694940 bugfix: inheritance of local profiles 2016-03-08 14:59:14 +01:00
Dominik Richter
e617f74bcd filter xinetd fields by regex 2016-02-26 14:46:51 +01:00
Dominik Richter
4a39275fc0 add xinetd_conf resource 2016-02-26 13:19:16 +01:00
Dominik Richter
e9ffc85b53 test for empty global describe block 2016-02-25 14:30:27 +01:00
Dominik Richter
3ae50adae9 feature: conditional OR via describe.one
```
describe.one do
  describe command("uname -r").stdout do
    it { should_not match /x86_64/ }
  end
  describe test_sth_for_x64_processors do
    ...
  end
end
```
2016-02-25 14:30:23 +01:00
Dominik Richter
2fc0994f4c add cmp int->string tests 2016-02-23 22:31:10 +01:00
Christoph Hartmann
ee7adc24ec add unit tests 2016-02-22 18:24:16 +01:00
Stephan Renatus
2da97df5f0 test: read mock-archives in binary mode
this doesn't hurt in *nix, but makes tests pass on windows.
2016-02-22 13:47:33 +01:00
Stephan Renatus
c891686d72 tests: create a temporary name, not a Tempfile
rubyzip also does use Tempfile under the hood, this causes trouble.
2016-02-22 13:41:12 +01:00
Stephan Renatus
c24a504cb6 tests: clarify kind_of's 2016-02-22 12:06:42 +01:00
Stephan Renatus
8d572934eb tests: make this work on non-linux 2016-02-22 12:06:42 +01:00