kitchen-inspec 2.6.2 → 3.1.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.
- checksums.yaml +4 -4
- data/lib/kitchen/verifier/inspec.rb +19 -19
- data/lib/kitchen/verifier/inspec_version.rb +1 -2
- metadata +32 -18
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4bd522a4a21b9c8613c5ee2bb6dd527d34f3f47bef521c696f956a4601bfbfa8
|
|
4
|
+
data.tar.gz: e0b38cace2dd217e12e78c3c87d3e4e95d38062c28e05b37d55645d88d3a9610
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b5b90bf59c398b2f5eaffcc217a15a2cffd7d7b7085f7b814f9d97bf4f7562489170b79a20b10181d1bc4c948e9f567ed3d243e51c0218644b06bbd990c3fe18
|
|
7
|
+
data.tar.gz: a3b88ecd3f60a921842c88b0d60610a9ba2b09ae6055ef1835828d6ce0f8371dcc2cff6916072ec50fd3f3511a82452a3fcf320d133181c8cf741afe401b4a18
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@chef.io>)
|
|
4
3
|
# Author:: Christoph Hartmann (<chartmann@chef.io>)
|
|
@@ -22,8 +21,8 @@ require "kitchen/transport/winrm"
|
|
|
22
21
|
require "kitchen/verifier/inspec_version"
|
|
23
22
|
require "kitchen/verifier/base"
|
|
24
23
|
|
|
25
|
-
require "uri"
|
|
26
|
-
require "pathname"
|
|
24
|
+
require "uri" unless defined?(URI)
|
|
25
|
+
require "pathname" unless defined?(Pathname)
|
|
27
26
|
require "hashie"
|
|
28
27
|
|
|
29
28
|
require "inspec/plugin/v2"
|
|
@@ -83,6 +82,8 @@ module Kitchen
|
|
|
83
82
|
# add inputs and waivers
|
|
84
83
|
setup_inputs(opts, config)
|
|
85
84
|
setup_waivers(opts, config)
|
|
85
|
+
# Configure Chef License Key and URL through kitchen
|
|
86
|
+
setup_chef_license_config(opts, config)
|
|
86
87
|
|
|
87
88
|
# setup Inspec
|
|
88
89
|
::Inspec::Log.init(STDERR)
|
|
@@ -111,11 +112,19 @@ module Kitchen
|
|
|
111
112
|
exit_code = runner.run
|
|
112
113
|
# 101 is a success as well (exit with no fails but has skipped controls)
|
|
113
114
|
return if exit_code == 0 || exit_code == 101
|
|
115
|
+
|
|
114
116
|
raise ActionFailed, "InSpec Runner returns #{exit_code}"
|
|
115
117
|
end
|
|
116
118
|
|
|
117
119
|
private
|
|
118
120
|
|
|
121
|
+
def setup_chef_license_config(opts, config)
|
|
122
|
+
# Pass chef_license_key to inspec if it is set
|
|
123
|
+
# Pass chef_license_server to inspec if it is set
|
|
124
|
+
opts[:chef_license_key] = config[:chef_license_key] || ENV["CHEF_LICENSE_KEY"]
|
|
125
|
+
opts[:chef_license_server] = config[:chef_license_server] || ENV["CHEF_LICENSE_SERVER"]
|
|
126
|
+
end
|
|
127
|
+
|
|
119
128
|
def setup_waivers(opts, config)
|
|
120
129
|
# InSpec expects the singular inflection
|
|
121
130
|
opts[:waiver_file] = config[:waiver_files] || []
|
|
@@ -176,17 +185,8 @@ module Kitchen
|
|
|
176
185
|
# (see Base#load_needed_dependencies!)
|
|
177
186
|
def load_needed_dependencies!
|
|
178
187
|
require "inspec"
|
|
179
|
-
#
|
|
180
|
-
#
|
|
181
|
-
require "bundles/inspec-supermarket/api"
|
|
182
|
-
require "bundles/inspec-supermarket/target"
|
|
183
|
-
|
|
184
|
-
# load the compliance plugin
|
|
185
|
-
require "bundles/inspec-compliance/configuration"
|
|
186
|
-
require "bundles/inspec-compliance/support"
|
|
187
|
-
require "bundles/inspec-compliance/http"
|
|
188
|
-
require "bundles/inspec-compliance/api"
|
|
189
|
-
require "bundles/inspec-compliance/target"
|
|
188
|
+
# Plugins (supermarket, compliance, etc.) are loaded automatically
|
|
189
|
+
# via the Inspec::Plugin::V2::Loader system in the load_plugins method
|
|
190
190
|
end
|
|
191
191
|
|
|
192
192
|
# Returns an Array of test suite filenames for the related suite currently
|
|
@@ -231,8 +231,8 @@ module Kitchen
|
|
|
231
231
|
# foiled by extra stuff. However, if the only entry is a "name" key, then
|
|
232
232
|
# leave it alone so it can default to resolving to the Supermarket.
|
|
233
233
|
unless test_item.keys == [:name]
|
|
234
|
-
type_keys =
|
|
235
|
-
git_keys =
|
|
234
|
+
type_keys = %i{path url git compliance supermarket}
|
|
235
|
+
git_keys = %i{branch tag ref relative_path}
|
|
236
236
|
supermarket_keys = [:supermarket_url]
|
|
237
237
|
test_item.delete_if { |k, v| !(type_keys + git_keys + supermarket_keys).include?(k) }
|
|
238
238
|
end
|
|
@@ -271,7 +271,7 @@ module Kitchen
|
|
|
271
271
|
raise Kitchen::UserError, "Verifier #{name} does not support the #{transport.name} Transport"
|
|
272
272
|
end.tap do |runner_options|
|
|
273
273
|
# default color to true to match InSpec behavior
|
|
274
|
-
runner_options["color"] = (config[:color].nil?
|
|
274
|
+
runner_options["color"] = (config[:color].nil? || config[:color])
|
|
275
275
|
runner_options["format"] = config[:format] unless config[:format].nil?
|
|
276
276
|
runner_options["output"] = config[:output] % { platform: platform, suite: suite } unless config[:output].nil?
|
|
277
277
|
runner_options["profiles_path"] = config[:profiles_path] unless config[:profiles_path].nil?
|
|
@@ -363,7 +363,7 @@ module Kitchen
|
|
|
363
363
|
"connection_retry_sleep" => kitchen[:connection_retry_sleep],
|
|
364
364
|
"max_wait_until_ready" => kitchen[:max_wait_until_ready],
|
|
365
365
|
}
|
|
366
|
-
logger.debug "Connect to Container: #{opts[
|
|
366
|
+
logger.debug "Connect to Container: #{opts["host"]}"
|
|
367
367
|
opts
|
|
368
368
|
end
|
|
369
369
|
|
|
@@ -388,7 +388,7 @@ module Kitchen
|
|
|
388
388
|
"logger" => logger,
|
|
389
389
|
"host" => config_data[:container_id],
|
|
390
390
|
}
|
|
391
|
-
logger.debug "Connect to Container: #{opts[
|
|
391
|
+
logger.debug "Connect to Container: #{opts["host"]}"
|
|
392
392
|
opts
|
|
393
393
|
end
|
|
394
394
|
end
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
# encoding: utf-8
|
|
2
1
|
#
|
|
3
2
|
# Author:: Fletcher Nichol (<fnichol@chef.io>)
|
|
4
3
|
# Author:: Christoph Hartmann (<chartmann@chef.io>)
|
|
@@ -20,6 +19,6 @@
|
|
|
20
19
|
module Kitchen
|
|
21
20
|
module Verifier
|
|
22
21
|
# Version string for InSpec Kitchen verifier
|
|
23
|
-
INSPEC_VERSION = "
|
|
22
|
+
INSPEC_VERSION = "3.1.0".freeze
|
|
24
23
|
end
|
|
25
24
|
end
|
metadata
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kitchen-inspec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 3.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chef Software, Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-01-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
|
-
name: inspec
|
|
14
|
+
name: inspec-core
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
@@ -19,7 +19,7 @@ dependencies:
|
|
|
19
19
|
version: 2.2.64
|
|
20
20
|
- - "<"
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: '
|
|
22
|
+
version: '8.0'
|
|
23
23
|
type: :runtime
|
|
24
24
|
prerelease: false
|
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -29,47 +29,61 @@ dependencies:
|
|
|
29
29
|
version: 2.2.64
|
|
30
30
|
- - "<"
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
32
|
+
version: '8.0'
|
|
33
33
|
- !ruby/object:Gem::Dependency
|
|
34
|
-
name:
|
|
34
|
+
name: train
|
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
39
|
+
version: '0'
|
|
40
|
+
type: :runtime
|
|
41
|
+
prerelease: false
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: '0'
|
|
47
|
+
- !ruby/object:Gem::Dependency
|
|
48
|
+
name: hashie
|
|
49
|
+
requirement: !ruby/object:Gem::Requirement
|
|
50
|
+
requirements:
|
|
51
|
+
- - ">="
|
|
52
|
+
- !ruby/object:Gem::Version
|
|
53
|
+
version: '3.4'
|
|
40
54
|
- - "<"
|
|
41
55
|
- !ruby/object:Gem::Version
|
|
42
|
-
version: '
|
|
56
|
+
version: '6.0'
|
|
43
57
|
type: :runtime
|
|
44
58
|
prerelease: false
|
|
45
59
|
version_requirements: !ruby/object:Gem::Requirement
|
|
46
60
|
requirements:
|
|
47
61
|
- - ">="
|
|
48
62
|
- !ruby/object:Gem::Version
|
|
49
|
-
version: '
|
|
63
|
+
version: '3.4'
|
|
50
64
|
- - "<"
|
|
51
65
|
- !ruby/object:Gem::Version
|
|
52
|
-
version: '
|
|
66
|
+
version: '6.0'
|
|
53
67
|
- !ruby/object:Gem::Dependency
|
|
54
|
-
name:
|
|
68
|
+
name: test-kitchen
|
|
55
69
|
requirement: !ruby/object:Gem::Requirement
|
|
56
70
|
requirements:
|
|
57
71
|
- - ">="
|
|
58
72
|
- !ruby/object:Gem::Version
|
|
59
|
-
version: '
|
|
60
|
-
- - "
|
|
73
|
+
version: '2.7'
|
|
74
|
+
- - "<"
|
|
61
75
|
- !ruby/object:Gem::Version
|
|
62
|
-
version: '5
|
|
76
|
+
version: '5'
|
|
63
77
|
type: :runtime
|
|
64
78
|
prerelease: false
|
|
65
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
66
80
|
requirements:
|
|
67
81
|
- - ">="
|
|
68
82
|
- !ruby/object:Gem::Version
|
|
69
|
-
version: '
|
|
70
|
-
- - "
|
|
83
|
+
version: '2.7'
|
|
84
|
+
- - "<"
|
|
71
85
|
- !ruby/object:Gem::Version
|
|
72
|
-
version: '5
|
|
86
|
+
version: '5'
|
|
73
87
|
description: A Test Kitchen Verifier for InSpec
|
|
74
88
|
email:
|
|
75
89
|
- info@chef.io
|
|
@@ -99,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
99
113
|
- !ruby/object:Gem::Version
|
|
100
114
|
version: '0'
|
|
101
115
|
requirements: []
|
|
102
|
-
rubygems_version: 3.
|
|
116
|
+
rubygems_version: 3.3.27
|
|
103
117
|
signing_key:
|
|
104
118
|
specification_version: 4
|
|
105
119
|
summary: A Test Kitchen Verifier for InSpec
|