kitchen-inspec 0.12.2 → 0.12.3
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.
- checksums.yaml +4 -4
- data/.kitchen.yml +2 -3
- data/CHANGELOG.md +15 -2
- data/Gemfile +2 -3
- data/kitchen-inspec.gemspec +2 -1
- data/lib/kitchen/verifier/inspec.rb +37 -2
- data/lib/kitchen/verifier/inspec_version.rb +1 -1
- metadata +17 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53592f31d694833c8ec54b52da1b9edcedc434fb
|
|
4
|
+
data.tar.gz: 0a45afd98cb39ea8d8fcd0e76c9821417ed1baa4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2938df465da317ef4e510ff121e93dd2e51e128bcdb521c5ec5e9b4bf99307edb0bc45057bd3a32d7e2e622d288d4a31c386e8ba758e9a73bebddc51bd873bb2
|
|
7
|
+
data.tar.gz: af817b0781737a49dc941a7561e0580934bcef98d3db2670c936ee55e189bb5d6e3cd6d6464f7a42d4fc4062ca275d4cdb58c1e4886e292f7cf59afb208dee52
|
data/.kitchen.yml
CHANGED
|
@@ -21,12 +21,11 @@ suites:
|
|
|
21
21
|
- name: default
|
|
22
22
|
run_list:
|
|
23
23
|
- recipe[os_prepare]
|
|
24
|
-
attributes:
|
|
25
24
|
- name: profile
|
|
26
25
|
run_list:
|
|
27
26
|
- recipe[os_prepare]
|
|
28
|
-
attributes:
|
|
29
27
|
- name: contains_inspec
|
|
30
28
|
run_list:
|
|
31
29
|
- recipe[os_prepare]
|
|
32
|
-
|
|
30
|
+
inspec_tests:
|
|
31
|
+
- https://github.com/nathenharvey/tmp_compliance_profile
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## [0.12.
|
|
4
|
-
[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.12.
|
|
3
|
+
## [0.12.3](https://github.com/chef/kitchen-inspec/tree/0.12.3) (2016-03-01)
|
|
4
|
+
[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.12.2...0.12.3)
|
|
5
|
+
|
|
6
|
+
**Implemented enhancements:**
|
|
7
|
+
|
|
8
|
+
- fix gem build license warning [\#59](https://github.com/chef/kitchen-inspec/pull/59) ([chris-rock](https://github.com/chris-rock))
|
|
9
|
+
- Add support for remote profiles [\#51](https://github.com/chef/kitchen-inspec/pull/51) ([chris-rock](https://github.com/chris-rock))
|
|
10
|
+
|
|
11
|
+
**Merged pull requests:**
|
|
12
|
+
|
|
13
|
+
- add test-kitchen 1.6 as dependency [\#60](https://github.com/chef/kitchen-inspec/pull/60) ([chris-rock](https://github.com/chris-rock))
|
|
14
|
+
- Bump berks requirement to latest [\#58](https://github.com/chef/kitchen-inspec/pull/58) ([jkeiser](https://github.com/jkeiser))
|
|
15
|
+
|
|
16
|
+
## [v0.12.2](https://github.com/chef/kitchen-inspec/tree/v0.12.2) (2016-02-22)
|
|
17
|
+
[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.12.1...v0.12.2)
|
|
5
18
|
|
|
6
19
|
**Fixed bugs:**
|
|
7
20
|
|
data/Gemfile
CHANGED
|
@@ -14,7 +14,6 @@ group :test do
|
|
|
14
14
|
gem 'rubocop', '~> 0.32'
|
|
15
15
|
gem 'concurrent-ruby', '~> 0.9'
|
|
16
16
|
gem 'codeclimate-test-reporter', :require => nil
|
|
17
|
-
gem 'test-kitchen', git: 'https://github.com/test-kitchen/test-kitchen.git', branch: 'master'
|
|
18
17
|
end
|
|
19
18
|
|
|
20
19
|
# pin dependency for Ruby 1.9.3 since bundler is not
|
|
@@ -24,11 +23,11 @@ if Gem::Version.new(RUBY_VERSION) <= Gem::Version.new('1.9.3')
|
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
group :integration do
|
|
27
|
-
gem 'berkshelf'
|
|
26
|
+
gem 'berkshelf', '>= 4.2.3'
|
|
28
27
|
gem 'kitchen-dokken'
|
|
29
28
|
end
|
|
30
29
|
|
|
31
30
|
group :tools do
|
|
32
31
|
gem 'pry', '~> 0.10'
|
|
33
|
-
gem 'github_changelog_generator', '
|
|
32
|
+
gem 'github_changelog_generator', '1.11.3'
|
|
34
33
|
end
|
data/kitchen-inspec.gemspec
CHANGED
|
@@ -7,7 +7,7 @@ require 'English'
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
8
|
spec.name = 'kitchen-inspec'
|
|
9
9
|
spec.version = Kitchen::Verifier::INSPEC_VERSION
|
|
10
|
-
spec.license = 'Apache
|
|
10
|
+
spec.license = 'Apache-2.0'
|
|
11
11
|
spec.authors = ['Fletcher Nichol']
|
|
12
12
|
spec.email = ['fnichol@chef.io']
|
|
13
13
|
|
|
@@ -21,6 +21,7 @@ Gem::Specification.new do |spec|
|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
22
22
|
spec.require_paths = ['lib']
|
|
23
23
|
spec.add_dependency 'inspec', '~> 0.14.1'
|
|
24
|
+
spec.add_dependency 'test-kitchen', '~> 1.6'
|
|
24
25
|
spec.add_development_dependency 'countloc', '~> 0.4'
|
|
25
26
|
spec.add_development_dependency 'bundler', '~> 1.10'
|
|
26
27
|
spec.add_development_dependency 'rake', '~> 10.0'
|
|
@@ -26,6 +26,31 @@ require 'uri'
|
|
|
26
26
|
require 'pathname'
|
|
27
27
|
|
|
28
28
|
module Kitchen
|
|
29
|
+
# monkey patch test-kitchen to get the suite information within this verifier,
|
|
30
|
+
# since test-kitchen does not allow a proper hook
|
|
31
|
+
class DataMunger
|
|
32
|
+
# save reference to olf method
|
|
33
|
+
alias_method :original_verifier_data_for, :verifier_data_for
|
|
34
|
+
|
|
35
|
+
def verifier_data_for(suite, platform)
|
|
36
|
+
# filter current suite and extract `inspec_tests` and move it to verifier
|
|
37
|
+
data.fetch(:suites, []).select { |f| f[:name] == suite }.each do |suite_data|
|
|
38
|
+
move_data_to!(:verifier, suite_data, :inspec_tests)
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# run original behaviour
|
|
42
|
+
original_verifier_data_for(suite, platform)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# TODO: remove, once https://github.com/test-kitchen/test-kitchen/pull/955 is merged
|
|
46
|
+
def move_data_to!(to, root, key)
|
|
47
|
+
return unless root.key?(key)
|
|
48
|
+
pdata = root.fetch(to, {})
|
|
49
|
+
pdata = { name: pdata } if pdata.is_a?(String)
|
|
50
|
+
root[to] = pdata.rmerge(key => root.delete(key)) if !root.fetch(key, nil).nil?
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
|
|
29
54
|
module Verifier
|
|
30
55
|
# InSpec verifier for Kitchen.
|
|
31
56
|
#
|
|
@@ -34,9 +59,11 @@ module Kitchen
|
|
|
34
59
|
kitchen_verifier_api_version 1
|
|
35
60
|
plugin_version Kitchen::Verifier::INSPEC_VERSION
|
|
36
61
|
|
|
62
|
+
default_config :inspec_tests, []
|
|
63
|
+
|
|
37
64
|
# (see Base#call)
|
|
38
65
|
def call(state)
|
|
39
|
-
tests =
|
|
66
|
+
tests = collect_tests
|
|
40
67
|
|
|
41
68
|
opts = runner_options(instance.transport, state)
|
|
42
69
|
runner = ::Inspec::Runner.new(opts)
|
|
@@ -63,7 +90,7 @@ module Kitchen
|
|
|
63
90
|
# - test/integration
|
|
64
91
|
# - test/integration/inspec (prefered if used with other test environments)
|
|
65
92
|
#
|
|
66
|
-
# @return [Array<String>] array of suite
|
|
93
|
+
# @return [Array<String>] array of suite directories
|
|
67
94
|
# @api private
|
|
68
95
|
def local_suite_files
|
|
69
96
|
base = File.join(config[:test_base_path], config[:suite_name])
|
|
@@ -83,6 +110,14 @@ module Kitchen
|
|
|
83
110
|
[base]
|
|
84
111
|
end
|
|
85
112
|
|
|
113
|
+
# Returns an array of test profiles
|
|
114
|
+
# @return [Array<String>] array of suite directories or remote urls
|
|
115
|
+
# @api private
|
|
116
|
+
def collect_tests
|
|
117
|
+
# get local tests and get run list of profiles
|
|
118
|
+
(local_suite_files + config[:inspec_tests]).compact
|
|
119
|
+
end
|
|
120
|
+
|
|
86
121
|
# Returns a configuration Hash that can be passed to a `Inspec::Runner`.
|
|
87
122
|
#
|
|
88
123
|
# @return [Hash] a configuration hash of string-based keys
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-inspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.12.
|
|
4
|
+
version: 0.12.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fletcher Nichol
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-03-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: inspec
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 0.14.1
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: test-kitchen
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '1.6'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '1.6'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: countloc
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -134,7 +148,7 @@ files:
|
|
|
134
148
|
- lib/kitchen/verifier/inspec_version.rb
|
|
135
149
|
homepage: http://github.com/chef/kitchen-inspec
|
|
136
150
|
licenses:
|
|
137
|
-
- Apache
|
|
151
|
+
- Apache-2.0
|
|
138
152
|
metadata: {}
|
|
139
153
|
post_install_message:
|
|
140
154
|
rdoc_options: []
|