inspec 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +40 -2
  3. data/Gemfile +2 -3
  4. data/README.md +2 -0
  5. data/Rakefile +8 -0
  6. data/bin/inspec +1 -157
  7. data/docs/resources.rst +79 -78
  8. data/examples/profile/controls/example.rb +3 -1
  9. data/lib/fetchers/mock.rb +27 -0
  10. data/lib/fetchers/tar.rb +3 -2
  11. data/lib/fetchers/zip.rb +3 -1
  12. data/lib/inspec/cli.rb +164 -0
  13. data/lib/inspec/plugins/resource.rb +6 -2
  14. data/lib/inspec/profile.rb +28 -17
  15. data/lib/inspec/resource.rb +5 -1
  16. data/lib/inspec/rspec_json_formatter.rb +42 -0
  17. data/lib/inspec/rule.rb +24 -1
  18. data/lib/inspec/runner.rb +15 -7
  19. data/lib/inspec/runner_mock.rb +6 -1
  20. data/lib/inspec/runner_rspec.rb +29 -1
  21. data/lib/inspec/version.rb +1 -1
  22. data/lib/resources/{script.rb → powershell.rb} +19 -5
  23. data/lib/resources/registry_key.rb +1 -1
  24. data/test/{integration/cookbooks → cookbooks}/os_prepare/files/empty.iso +0 -0
  25. data/test/{integration/cookbooks → cookbooks}/os_prepare/files/example.csv +0 -0
  26. data/test/{integration/cookbooks → cookbooks}/os_prepare/files/example.ini +0 -0
  27. data/test/{integration/cookbooks → cookbooks}/os_prepare/files/example.json +0 -0
  28. data/test/{integration/cookbooks → cookbooks}/os_prepare/files/example.yml +0 -0
  29. data/test/{integration/cookbooks → cookbooks}/os_prepare/metadata.rb +0 -0
  30. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/_runit_service_centos.rb +0 -0
  31. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/_upstart_service_centos.rb +0 -0
  32. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/apache.rb +0 -0
  33. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/apt.rb +0 -0
  34. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/auditctl.rb +0 -0
  35. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/default.rb +0 -0
  36. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/file.rb +0 -0
  37. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/iptables.rb +0 -0
  38. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/json_yaml_csv_ini.rb +0 -0
  39. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/mount.rb +2 -2
  40. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/package.rb +0 -0
  41. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/postgres.rb +6 -0
  42. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/registry_key.rb +0 -0
  43. data/test/{integration/cookbooks → cookbooks}/os_prepare/recipes/service.rb +0 -0
  44. data/test/{integration/cookbooks → cookbooks}/os_prepare/templates/default/sv-default-svlog-run.erb +0 -0
  45. data/test/functional/command_test.rb +390 -0
  46. data/test/helper.rb +6 -0
  47. data/test/integration/{test/integration/default → default}/_debug_spec.rb +0 -0
  48. data/test/integration/{test/integration/default → default}/apache_conf_spec.rb +0 -0
  49. data/test/integration/{test/integration/default → default}/apt_spec.rb +0 -0
  50. data/test/integration/{test/integration/default → default}/auditd_rules_spec.rb +0 -0
  51. data/test/integration/{test/integration/default → default}/compare_matcher_spec.rb +0 -0
  52. data/test/integration/{test/integration/default → default}/csv_spec.rb +0 -0
  53. data/test/integration/{test/integration/default → default}/etc_group_spec.rb +0 -0
  54. data/test/integration/{test/integration/default → default}/file_spec.rb +3 -2
  55. data/test/integration/{test/integration/default → default}/group_spec.rb +0 -0
  56. data/test/integration/{test/integration/default → default}/ini_spec.rb +0 -0
  57. data/test/integration/{test/integration/default → default}/iptables_spec.rb +0 -0
  58. data/test/integration/{test/integration/default → default}/json_spec.rb +0 -0
  59. data/test/integration/{test/integration/default → default}/kernel_module_spec.rb +0 -0
  60. data/test/integration/{test/integration/default → default}/kernel_parameter_spec.rb +0 -0
  61. data/test/integration/{test/integration/default → default}/mount_spec.rb +1 -1
  62. data/test/integration/{test/integration/default → default}/os_spec.rb +0 -0
  63. data/test/integration/{test/integration/default → default}/package_spec.rb +0 -0
  64. data/test/integration/{test/integration/default → default}/port_spec.rb +0 -0
  65. data/test/integration/{test/integration/default → default}/postgres_session_spec.rb +0 -0
  66. data/test/integration/default/powershell_spec.rb +13 -0
  67. data/test/integration/{test/integration/default → default}/registry_key_spec.rb +0 -0
  68. data/test/integration/{test/integration/default → default}/secpol_spec.rb +0 -0
  69. data/test/integration/{test/integration/default → default}/service_spec.rb +0 -0
  70. data/test/integration/{test/integration/default → default}/user_spec.rb +0 -0
  71. data/test/integration/{test/integration/default → default}/yaml_spec.rb +0 -0
  72. data/test/unit/control_test.rb +58 -0
  73. data/test/unit/fetchers/mock_test.rb +43 -0
  74. data/test/unit/plugins/resource_test.rb +60 -0
  75. data/test/unit/resources/{script_test.rb → powershell_test.rb} +10 -1
  76. metadata +107 -101
  77. data/test/integration/.kitchen.ec2.yml +0 -75
  78. data/test/integration/.kitchen.yml +0 -45
  79. data/test/integration/Berksfile +0 -5
data/test/helper.rb CHANGED
@@ -21,6 +21,7 @@ require 'tmpdir'
21
21
  require 'zip'
22
22
 
23
23
  require 'utils/base_cli'
24
+ require 'inspec/version'
24
25
  require 'inspec/fetcher'
25
26
  require 'inspec/source_reader'
26
27
  require 'inspec/resource'
@@ -28,6 +29,11 @@ require 'inspec/backend'
28
29
  require 'inspec/profile'
29
30
  require 'inspec/runner'
30
31
  require 'inspec/runner_mock'
32
+ require 'fetchers/mock'
33
+
34
+ require 'train'
35
+ CMD = Train.create('local').connection
36
+ TMP_CACHE = {}
31
37
 
32
38
  class MockLoader
33
39
  # collects emulation operating systems
@@ -125,6 +125,7 @@ if os.unix?
125
125
  end
126
126
  end
127
127
 
128
+ # check file mount on linux
128
129
  if os.linux?
129
130
  # for server spec compatibility
130
131
  # Do not use `.with` or `.only_with`, this syntax is deprecated and will be removed
@@ -133,7 +134,7 @@ if os.linux?
133
134
  it { should be_mounted }
134
135
  it { should be_mounted.with( :type => 'iso9660' ) }
135
136
  it { should be_mounted.with( :type => 'iso9660', :options => { :ro => true } ) }
136
- it { should be_mounted.with( :type => 'iso9660', :device => '/root/empty.iso' ) }
137
+ it { should be_mounted.with( :type => 'iso9660', :device => '/tmp/empty.iso' ) }
137
138
  it { should_not be_mounted.with( :type => 'ext4' ) }
138
139
  it { should_not be_mounted.with( :type => 'xfs' ) }
139
140
  end
@@ -142,7 +143,7 @@ if os.linux?
142
143
  # also see mount_spec.rb
143
144
  describe file('/mnt/iso-disk') do
144
145
  it { should be_mounted.only_with( {
145
- :device=>"/root/empty.iso",
146
+ :device=>"/tmp/empty.iso",
146
147
  :type=>"iso9660",
147
148
  :options=>{
148
149
  :ro=>true}
@@ -5,7 +5,7 @@ if os.linux?
5
5
  describe mount '/mnt/iso-disk' do
6
6
  it { should be_mounted }
7
7
  its('count') { should eq 1 }
8
- its('device') { should eq '/root/empty.iso' }
8
+ its('device') { should eq '/tmp/empty.iso' }
9
9
  its('type') { should eq 'iso9660' }
10
10
  its('options') { should eq ['ro'] }
11
11
  end
@@ -0,0 +1,13 @@
1
+ # encoding: utf-8
2
+ script = <<-EOH
3
+ Write-Output 'hello'
4
+ EOH
5
+
6
+ describe powershell(script) do
7
+ its('stdout') { should eq 'hello' }
8
+ end
9
+
10
+ # legacy test
11
+ describe script(script) do
12
+ its('stdout') { should eq 'hello' }
13
+ end
@@ -0,0 +1,58 @@
1
+ # encoding: utf-8
2
+ # author: Christoph Hartmann
3
+ # author: Dominik Richter
4
+
5
+ require 'helper'
6
+
7
+ describe 'controls' do
8
+ def load(content)
9
+ data = {
10
+ 'inspec.yml' => "name: mock",
11
+ 'controls/mock.rb' => "control '1' do\n#{content}\nend\n",
12
+ }
13
+ opts = { test_collector: Inspec::RunnerMock.new }
14
+ Inspec::Profile.for_target(data, opts)
15
+ .params[:rules].values[0]['1']
16
+ end
17
+
18
+ it 'works with empty refs' do
19
+ load('ref')[:refs].must_be :empty?
20
+ end
21
+
22
+ it 'defines a simple ref' do
23
+ s = rand.to_s
24
+ load("ref #{s.inspect}")[:refs].must_equal [{:ref=>s}]
25
+ end
26
+
27
+ it 'defines a ref with url' do
28
+ s = rand.to_s
29
+ u = rand.to_s
30
+ load("ref #{s.inspect}, url: #{u.inspect}")[:refs].must_equal [{ref: s, url: u}]
31
+ end
32
+
33
+ it 'defines a ref without content but with url' do
34
+ u = rand.to_s
35
+ load("ref url: #{u.inspect}")[:refs].must_equal [{url: u}]
36
+ end
37
+
38
+ it 'works with empty tags' do
39
+ load('tag')[:tags].must_be :empty?
40
+ end
41
+
42
+ it 'defines a simple tag' do
43
+ s = rand.to_s
44
+ load("tag #{s.inspect}")[:tags].must_equal({ s => nil })
45
+ end
46
+
47
+ it 'define multiple tags' do
48
+ a, b, c = rand.to_s, rand.to_s, rand.to_s
49
+ load("tag #{a.inspect}, #{b.inspect}, #{c.inspect}")[:tags].must_equal(
50
+ { a => nil, b => nil, c => nil })
51
+ end
52
+
53
+ it 'tag by key=value' do
54
+ a, b = rand.to_s, rand.to_s
55
+ load("tag #{a.inspect} => #{b.inspect}")[:tags].must_equal(
56
+ { a => b })
57
+ end
58
+ end
@@ -0,0 +1,43 @@
1
+ # encoding: utf-8
2
+ # author: Dominik Richter
3
+ # author: Christoph Hartmann
4
+
5
+ require 'helper'
6
+
7
+ describe Fetchers::Mock do
8
+ let(:fetcher) { Fetchers::Mock }
9
+
10
+ it 'registers with the fetchers registry' do
11
+ reg = Inspec::Fetcher.registry
12
+ _(reg['mock']).must_equal fetcher
13
+ end
14
+
15
+ it 'wont load nil' do
16
+ fetcher.resolve(nil).must_be :nil?
17
+ end
18
+
19
+ it 'wont load a string' do
20
+ fetcher.resolve(rand.to_s).must_be :nil?
21
+ end
22
+
23
+ describe 'applied to a map' do
24
+ it 'must be resolved' do
25
+ fetcher.resolve({}).must_be_kind_of fetcher
26
+ end
27
+
28
+ it 'has no files on empty' do
29
+ fetcher.resolve({}).files.must_equal []
30
+ end
31
+
32
+ it 'has files' do
33
+ f = rand.to_s
34
+ fetcher.resolve({f => nil}).files.must_equal [f]
35
+ end
36
+
37
+ it 'can read a file' do
38
+ f = rand.to_s
39
+ s = rand.to_s
40
+ fetcher.resolve({f => s}).read(f).must_equal s
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,60 @@
1
+ require 'helper'
2
+
3
+ describe Inspec::Plugins::Resource do
4
+ let(:base) { Inspec::Plugins::Resource }
5
+
6
+ describe '#name' do
7
+ it "won't register a nil resource" do
8
+ Class.new(base) do name nil; end
9
+ Inspec::Resource.registry.keys.wont_include nil
10
+ Inspec::Resource.registry.keys.wont_include ''
11
+ end
12
+
13
+ it "will register a valid name" do
14
+ Class.new(base) do name 'hello'; end
15
+ Inspec::Resource.registry['hello'].wont_be :nil?
16
+ end
17
+
18
+ it "will create a good class name" do
19
+ Class.new(base) do name 'hello_world'; end
20
+ Inspec::Resource.registry['hello_world'].to_s
21
+ .must_equal 'Inspec::Resource::Registry::HelloWorld'
22
+ end
23
+ end
24
+
25
+ def create(&block)
26
+ random_name = (0...50).map { (65 + rand(26)).chr }.join
27
+ Class.new(base) do
28
+ name random_name
29
+ instance_eval &block
30
+ end
31
+ Inspec::Resource.registry[random_name]
32
+ end
33
+
34
+ describe '#desc' do
35
+ it "will register a description" do
36
+ expected = rand.to_s
37
+ create { desc expected }.desc.must_equal expected
38
+ end
39
+
40
+ it "can change the description" do
41
+ c = create { desc rand.to_s }
42
+ c.desc(x = rand.to_s)
43
+ c.desc.must_equal x
44
+ end
45
+ end
46
+
47
+ describe '#example' do
48
+ it "will register a description" do
49
+ expected = rand.to_s
50
+ create { example expected }.example.must_equal expected
51
+ end
52
+
53
+ it "can change the description" do
54
+ c = create { example rand.to_s }
55
+ c.example(x = rand.to_s)
56
+ c.example.must_equal x
57
+ end
58
+ end
59
+
60
+ end
@@ -12,7 +12,16 @@ describe 'Inspec::Resources::Script' do
12
12
  Get-Help Get-Command
13
13
  EOH
14
14
 
15
- it 'check if script for windows is properly generated ' do
15
+ it 'check if `powershell` for windows is properly generated ' do
16
+ resource = MockLoader.new(:windows).load_resource('powershell', ps1_script)
17
+ if Gem.loaded_specs['winrm'].version < Gem::Version.new('1.6.1')
18
+ _(resource.command).must_equal 'powershell -encodedCommand IAAgACAAIAAjACAAYwBhAGwAbAAgAGgAZQBsAHAAIABmAG8AcgAgAGcAZQB0ACAAYwBvAG0AbQBhAG4AZAAKACAAIAAgACAARwBlAHQALQBIAGUAbABwACAARwBlAHQALQBDAG8AbQBtAGEAbgBkAAoA'
19
+ else
20
+ _(resource.command).must_equal 'powershell -encodedCommand JABQAHIAbwBnAHIAZQBzAHMAUAByAGUAZgBlAHIAZQBuAGMAZQA9ACcAUwBpAGwAZQBuAHQAbAB5AEMAbwBuAHQAaQBuAHUAZQAnADsAIAAgACAAIAAjACAAYwBhAGwAbAAgAGgAZQBsAHAAIABmAG8AcgAgAGcAZQB0ACAAYwBvAG0AbQBhAG4AZAAKACAAIAAgACAARwBlAHQALQBIAGUAbABwACAARwBlAHQALQBDAG8AbQBtAGEAbgBkAAoA'
21
+ end
22
+ end
23
+
24
+ it 'check if legacy `script` for windows is properly generated ' do
16
25
  resource = MockLoader.new(:windows).load_resource('script', ps1_script)
17
26
  if Gem.loaded_specs['winrm'].version < Gem::Version.new('1.6.1')
18
27
  _(resource.command).must_equal 'powershell -encodedCommand IAAgACAAIAAjACAAYwBhAGwAbAAgAGgAZQBsAHAAIABmAG8AcgAgAGcAZQB0ACAAYwBvAG0AbQBhAG4AZAAKACAAIAAgACAARwBlAHQALQBIAGUAbABwACAARwBlAHQALQBDAG8AbQBtAGEAbgBkAAoA'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-09 00:00:00.000000000 Z
11
+ date: 2016-03-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: r-train
@@ -233,6 +233,7 @@ files:
233
233
  - lib/bundles/inspec-supermarket/cli.rb
234
234
  - lib/bundles/inspec-supermarket/target.rb
235
235
  - lib/fetchers/local.rb
236
+ - lib/fetchers/mock.rb
236
237
  - lib/fetchers/tar.rb
237
238
  - lib/fetchers/url.rb
238
239
  - lib/fetchers/zip.rb
@@ -240,6 +241,7 @@ files:
240
241
  - lib/inspec/archive/tar.rb
241
242
  - lib/inspec/archive/zip.rb
242
243
  - lib/inspec/backend.rb
244
+ - lib/inspec/cli.rb
243
245
  - lib/inspec/describe.rb
244
246
  - lib/inspec/dsl.rb
245
247
  - lib/inspec/expect.rb
@@ -305,9 +307,9 @@ files:
305
307
  - lib/resources/postgres.rb
306
308
  - lib/resources/postgres_conf.rb
307
309
  - lib/resources/postgres_session.rb
310
+ - lib/resources/powershell.rb
308
311
  - lib/resources/processes.rb
309
312
  - lib/resources/registry_key.rb
310
- - lib/resources/script.rb
311
313
  - lib/resources/security_policy.rb
312
314
  - lib/resources/service.rb
313
315
  - lib/resources/shadow.rb
@@ -331,57 +333,56 @@ files:
331
333
  - lib/utils/plugin_registry.rb
332
334
  - lib/utils/simpleconfig.rb
333
335
  - tasks/maintainers.rb
336
+ - test/cookbooks/os_prepare/files/empty.iso
337
+ - test/cookbooks/os_prepare/files/example.csv
338
+ - test/cookbooks/os_prepare/files/example.ini
339
+ - test/cookbooks/os_prepare/files/example.json
340
+ - test/cookbooks/os_prepare/files/example.yml
341
+ - test/cookbooks/os_prepare/metadata.rb
342
+ - test/cookbooks/os_prepare/recipes/_runit_service_centos.rb
343
+ - test/cookbooks/os_prepare/recipes/_upstart_service_centos.rb
344
+ - test/cookbooks/os_prepare/recipes/apache.rb
345
+ - test/cookbooks/os_prepare/recipes/apt.rb
346
+ - test/cookbooks/os_prepare/recipes/auditctl.rb
347
+ - test/cookbooks/os_prepare/recipes/default.rb
348
+ - test/cookbooks/os_prepare/recipes/file.rb
349
+ - test/cookbooks/os_prepare/recipes/iptables.rb
350
+ - test/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb
351
+ - test/cookbooks/os_prepare/recipes/mount.rb
352
+ - test/cookbooks/os_prepare/recipes/package.rb
353
+ - test/cookbooks/os_prepare/recipes/postgres.rb
354
+ - test/cookbooks/os_prepare/recipes/registry_key.rb
355
+ - test/cookbooks/os_prepare/recipes/service.rb
356
+ - test/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb
334
357
  - test/docker_run.rb
335
358
  - test/docker_test.rb
359
+ - test/functional/command_test.rb
336
360
  - test/helper.rb
337
- - test/integration/.kitchen.ec2.yml
338
- - test/integration/.kitchen.yml
339
- - test/integration/Berksfile
340
- - test/integration/cookbooks/os_prepare/files/empty.iso
341
- - test/integration/cookbooks/os_prepare/files/example.csv
342
- - test/integration/cookbooks/os_prepare/files/example.ini
343
- - test/integration/cookbooks/os_prepare/files/example.json
344
- - test/integration/cookbooks/os_prepare/files/example.yml
345
- - test/integration/cookbooks/os_prepare/metadata.rb
346
- - test/integration/cookbooks/os_prepare/recipes/_runit_service_centos.rb
347
- - test/integration/cookbooks/os_prepare/recipes/_upstart_service_centos.rb
348
- - test/integration/cookbooks/os_prepare/recipes/apache.rb
349
- - test/integration/cookbooks/os_prepare/recipes/apt.rb
350
- - test/integration/cookbooks/os_prepare/recipes/auditctl.rb
351
- - test/integration/cookbooks/os_prepare/recipes/default.rb
352
- - test/integration/cookbooks/os_prepare/recipes/file.rb
353
- - test/integration/cookbooks/os_prepare/recipes/iptables.rb
354
- - test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb
355
- - test/integration/cookbooks/os_prepare/recipes/mount.rb
356
- - test/integration/cookbooks/os_prepare/recipes/package.rb
357
- - test/integration/cookbooks/os_prepare/recipes/postgres.rb
358
- - test/integration/cookbooks/os_prepare/recipes/registry_key.rb
359
- - test/integration/cookbooks/os_prepare/recipes/service.rb
360
- - test/integration/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb
361
- - test/integration/test/integration/default/_debug_spec.rb
362
- - test/integration/test/integration/default/apache_conf_spec.rb
363
- - test/integration/test/integration/default/apt_spec.rb
364
- - test/integration/test/integration/default/auditd_rules_spec.rb
365
- - test/integration/test/integration/default/compare_matcher_spec.rb
366
- - test/integration/test/integration/default/csv_spec.rb
367
- - test/integration/test/integration/default/etc_group_spec.rb
368
- - test/integration/test/integration/default/file_spec.rb
369
- - test/integration/test/integration/default/group_spec.rb
370
- - test/integration/test/integration/default/ini_spec.rb
371
- - test/integration/test/integration/default/iptables_spec.rb
372
- - test/integration/test/integration/default/json_spec.rb
373
- - test/integration/test/integration/default/kernel_module_spec.rb
374
- - test/integration/test/integration/default/kernel_parameter_spec.rb
375
- - test/integration/test/integration/default/mount_spec.rb
376
- - test/integration/test/integration/default/os_spec.rb
377
- - test/integration/test/integration/default/package_spec.rb
378
- - test/integration/test/integration/default/port_spec.rb
379
- - test/integration/test/integration/default/postgres_session_spec.rb
380
- - test/integration/test/integration/default/registry_key_spec.rb
381
- - test/integration/test/integration/default/secpol_spec.rb
382
- - test/integration/test/integration/default/service_spec.rb
383
- - test/integration/test/integration/default/user_spec.rb
384
- - test/integration/test/integration/default/yaml_spec.rb
361
+ - test/integration/default/_debug_spec.rb
362
+ - test/integration/default/apache_conf_spec.rb
363
+ - test/integration/default/apt_spec.rb
364
+ - test/integration/default/auditd_rules_spec.rb
365
+ - test/integration/default/compare_matcher_spec.rb
366
+ - test/integration/default/csv_spec.rb
367
+ - test/integration/default/etc_group_spec.rb
368
+ - test/integration/default/file_spec.rb
369
+ - test/integration/default/group_spec.rb
370
+ - test/integration/default/ini_spec.rb
371
+ - test/integration/default/iptables_spec.rb
372
+ - test/integration/default/json_spec.rb
373
+ - test/integration/default/kernel_module_spec.rb
374
+ - test/integration/default/kernel_parameter_spec.rb
375
+ - test/integration/default/mount_spec.rb
376
+ - test/integration/default/os_spec.rb
377
+ - test/integration/default/package_spec.rb
378
+ - test/integration/default/port_spec.rb
379
+ - test/integration/default/postgres_session_spec.rb
380
+ - test/integration/default/powershell_spec.rb
381
+ - test/integration/default/registry_key_spec.rb
382
+ - test/integration/default/secpol_spec.rb
383
+ - test/integration/default/service_spec.rb
384
+ - test/integration/default/user_spec.rb
385
+ - test/integration/default/yaml_spec.rb
385
386
  - test/resource/command_test.rb
386
387
  - test/resource/dsl_test.rb
387
388
  - test/resource/file_test.rb
@@ -389,8 +390,10 @@ files:
389
390
  - test/resource/sshd_config.rb
390
391
  - test/test-extra.yaml
391
392
  - test/test.yaml
393
+ - test/unit/control_test.rb
392
394
  - test/unit/fetchers.rb
393
395
  - test/unit/fetchers/local_test.rb
396
+ - test/unit/fetchers/mock_test.rb
394
397
  - test/unit/fetchers/tar_test.rb
395
398
  - test/unit/fetchers/url_test.rb
396
399
  - test/unit/fetchers/zip_test.rb
@@ -501,6 +504,7 @@ files:
501
504
  - test/unit/mock/profiles/resource-tiny/libraries/resource.rb
502
505
  - test/unit/mock/profiles/simple-metadata/inspec.yml
503
506
  - test/unit/plugin_test.rb
507
+ - test/unit/plugins/resource_test.rb
504
508
  - test/unit/profile_context_test.rb
505
509
  - test/unit/profile_test.rb
506
510
  - test/unit/resources/apache_conf_test.rb
@@ -535,9 +539,9 @@ files:
535
539
  - test/unit/resources/passwd_test.rb
536
540
  - test/unit/resources/pip_test.rb
537
541
  - test/unit/resources/port_test.rb
542
+ - test/unit/resources/powershell_test.rb
538
543
  - test/unit/resources/processes_test.rb
539
544
  - test/unit/resources/registry_key_test.rb
540
- - test/unit/resources/script_test.rb
541
545
  - test/unit/resources/security_policy_test.rb
542
546
  - test/unit/resources/service_test.rb
543
547
  - test/unit/resources/shadow_test.rb
@@ -580,57 +584,56 @@ signing_key:
580
584
  specification_version: 4
581
585
  summary: Infrastructure and compliance testing.
582
586
  test_files:
587
+ - test/cookbooks/os_prepare/files/empty.iso
588
+ - test/cookbooks/os_prepare/files/example.csv
589
+ - test/cookbooks/os_prepare/files/example.ini
590
+ - test/cookbooks/os_prepare/files/example.json
591
+ - test/cookbooks/os_prepare/files/example.yml
592
+ - test/cookbooks/os_prepare/metadata.rb
593
+ - test/cookbooks/os_prepare/recipes/_runit_service_centos.rb
594
+ - test/cookbooks/os_prepare/recipes/_upstart_service_centos.rb
595
+ - test/cookbooks/os_prepare/recipes/apache.rb
596
+ - test/cookbooks/os_prepare/recipes/apt.rb
597
+ - test/cookbooks/os_prepare/recipes/auditctl.rb
598
+ - test/cookbooks/os_prepare/recipes/default.rb
599
+ - test/cookbooks/os_prepare/recipes/file.rb
600
+ - test/cookbooks/os_prepare/recipes/iptables.rb
601
+ - test/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb
602
+ - test/cookbooks/os_prepare/recipes/mount.rb
603
+ - test/cookbooks/os_prepare/recipes/package.rb
604
+ - test/cookbooks/os_prepare/recipes/postgres.rb
605
+ - test/cookbooks/os_prepare/recipes/registry_key.rb
606
+ - test/cookbooks/os_prepare/recipes/service.rb
607
+ - test/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb
583
608
  - test/docker_run.rb
584
609
  - test/docker_test.rb
610
+ - test/functional/command_test.rb
585
611
  - test/helper.rb
586
- - test/integration/.kitchen.ec2.yml
587
- - test/integration/.kitchen.yml
588
- - test/integration/Berksfile
589
- - test/integration/cookbooks/os_prepare/files/empty.iso
590
- - test/integration/cookbooks/os_prepare/files/example.csv
591
- - test/integration/cookbooks/os_prepare/files/example.ini
592
- - test/integration/cookbooks/os_prepare/files/example.json
593
- - test/integration/cookbooks/os_prepare/files/example.yml
594
- - test/integration/cookbooks/os_prepare/metadata.rb
595
- - test/integration/cookbooks/os_prepare/recipes/_runit_service_centos.rb
596
- - test/integration/cookbooks/os_prepare/recipes/_upstart_service_centos.rb
597
- - test/integration/cookbooks/os_prepare/recipes/apache.rb
598
- - test/integration/cookbooks/os_prepare/recipes/apt.rb
599
- - test/integration/cookbooks/os_prepare/recipes/auditctl.rb
600
- - test/integration/cookbooks/os_prepare/recipes/default.rb
601
- - test/integration/cookbooks/os_prepare/recipes/file.rb
602
- - test/integration/cookbooks/os_prepare/recipes/iptables.rb
603
- - test/integration/cookbooks/os_prepare/recipes/json_yaml_csv_ini.rb
604
- - test/integration/cookbooks/os_prepare/recipes/mount.rb
605
- - test/integration/cookbooks/os_prepare/recipes/package.rb
606
- - test/integration/cookbooks/os_prepare/recipes/postgres.rb
607
- - test/integration/cookbooks/os_prepare/recipes/registry_key.rb
608
- - test/integration/cookbooks/os_prepare/recipes/service.rb
609
- - test/integration/cookbooks/os_prepare/templates/default/sv-default-svlog-run.erb
610
- - test/integration/test/integration/default/_debug_spec.rb
611
- - test/integration/test/integration/default/apache_conf_spec.rb
612
- - test/integration/test/integration/default/apt_spec.rb
613
- - test/integration/test/integration/default/auditd_rules_spec.rb
614
- - test/integration/test/integration/default/compare_matcher_spec.rb
615
- - test/integration/test/integration/default/csv_spec.rb
616
- - test/integration/test/integration/default/etc_group_spec.rb
617
- - test/integration/test/integration/default/file_spec.rb
618
- - test/integration/test/integration/default/group_spec.rb
619
- - test/integration/test/integration/default/ini_spec.rb
620
- - test/integration/test/integration/default/iptables_spec.rb
621
- - test/integration/test/integration/default/json_spec.rb
622
- - test/integration/test/integration/default/kernel_module_spec.rb
623
- - test/integration/test/integration/default/kernel_parameter_spec.rb
624
- - test/integration/test/integration/default/mount_spec.rb
625
- - test/integration/test/integration/default/os_spec.rb
626
- - test/integration/test/integration/default/package_spec.rb
627
- - test/integration/test/integration/default/port_spec.rb
628
- - test/integration/test/integration/default/postgres_session_spec.rb
629
- - test/integration/test/integration/default/registry_key_spec.rb
630
- - test/integration/test/integration/default/secpol_spec.rb
631
- - test/integration/test/integration/default/service_spec.rb
632
- - test/integration/test/integration/default/user_spec.rb
633
- - test/integration/test/integration/default/yaml_spec.rb
612
+ - test/integration/default/_debug_spec.rb
613
+ - test/integration/default/apache_conf_spec.rb
614
+ - test/integration/default/apt_spec.rb
615
+ - test/integration/default/auditd_rules_spec.rb
616
+ - test/integration/default/compare_matcher_spec.rb
617
+ - test/integration/default/csv_spec.rb
618
+ - test/integration/default/etc_group_spec.rb
619
+ - test/integration/default/file_spec.rb
620
+ - test/integration/default/group_spec.rb
621
+ - test/integration/default/ini_spec.rb
622
+ - test/integration/default/iptables_spec.rb
623
+ - test/integration/default/json_spec.rb
624
+ - test/integration/default/kernel_module_spec.rb
625
+ - test/integration/default/kernel_parameter_spec.rb
626
+ - test/integration/default/mount_spec.rb
627
+ - test/integration/default/os_spec.rb
628
+ - test/integration/default/package_spec.rb
629
+ - test/integration/default/port_spec.rb
630
+ - test/integration/default/postgres_session_spec.rb
631
+ - test/integration/default/powershell_spec.rb
632
+ - test/integration/default/registry_key_spec.rb
633
+ - test/integration/default/secpol_spec.rb
634
+ - test/integration/default/service_spec.rb
635
+ - test/integration/default/user_spec.rb
636
+ - test/integration/default/yaml_spec.rb
634
637
  - test/resource/command_test.rb
635
638
  - test/resource/dsl_test.rb
636
639
  - test/resource/file_test.rb
@@ -638,8 +641,10 @@ test_files:
638
641
  - test/resource/sshd_config.rb
639
642
  - test/test-extra.yaml
640
643
  - test/test.yaml
644
+ - test/unit/control_test.rb
641
645
  - test/unit/fetchers.rb
642
646
  - test/unit/fetchers/local_test.rb
647
+ - test/unit/fetchers/mock_test.rb
643
648
  - test/unit/fetchers/tar_test.rb
644
649
  - test/unit/fetchers/url_test.rb
645
650
  - test/unit/fetchers/zip_test.rb
@@ -750,6 +755,7 @@ test_files:
750
755
  - test/unit/mock/profiles/resource-tiny/libraries/resource.rb
751
756
  - test/unit/mock/profiles/simple-metadata/inspec.yml
752
757
  - test/unit/plugin_test.rb
758
+ - test/unit/plugins/resource_test.rb
753
759
  - test/unit/profile_context_test.rb
754
760
  - test/unit/profile_test.rb
755
761
  - test/unit/resources/apache_conf_test.rb
@@ -784,9 +790,9 @@ test_files:
784
790
  - test/unit/resources/passwd_test.rb
785
791
  - test/unit/resources/pip_test.rb
786
792
  - test/unit/resources/port_test.rb
793
+ - test/unit/resources/powershell_test.rb
787
794
  - test/unit/resources/processes_test.rb
788
795
  - test/unit/resources/registry_key_test.rb
789
- - test/unit/resources/script_test.rb
790
796
  - test/unit/resources/security_policy_test.rb
791
797
  - test/unit/resources/service_test.rb
792
798
  - test/unit/resources/shadow_test.rb