kitchen-inspec 0.9.0 → 0.9.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +65 -0
- data/CHANGELOG.md +42 -0
- data/Gemfile +8 -4
- data/Guardfile +6 -6
- data/README.md +6 -2
- data/Rakefile +97 -13
- data/bin/console +5 -4
- data/bin/setup +1 -0
- data/kitchen-inspec.gemspec +22 -26
- data/lib/kitchen/verifier/inspec.rb +52 -41
- data/lib/kitchen/verifier/inspec_version.rb +2 -4
- metadata +4 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4c18ac055dae9420b0cdaa319a2f397ba7245d7
|
4
|
+
data.tar.gz: 19fc3c7c0256b53f7f4f0d5645d7aa53d6d37094
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ffaf4a6bea0c27f6113b4d201a8989495d6e0f7c53296a4dd8f707482d9c1d2b74ecfc40a566c896861992d96381c84327202f061bc064aa99c1094fd71b882
|
7
|
+
data.tar.gz: c05933e1204f24d0cf127eff17418fdd9a926c318c77cae6c11e8cfc1398be72b32931edec8b4d792ca77de9a327b69b7f9e793f40da3824c7beb5e1d058d378
|
data/.rubocop.yml
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
---
|
2
|
+
AllCops:
|
3
|
+
Exclude:
|
4
|
+
- Gemfile
|
5
|
+
- Rakefile
|
6
|
+
- 'test/**/*'
|
7
|
+
- 'examples/**/*'
|
8
|
+
- 'vendor/**/*'
|
9
|
+
Documentation:
|
10
|
+
Enabled: false
|
11
|
+
AlignParameters:
|
12
|
+
Enabled: true
|
13
|
+
Encoding:
|
14
|
+
Enabled: true
|
15
|
+
HashSyntax:
|
16
|
+
Enabled: true
|
17
|
+
LineLength:
|
18
|
+
Enabled: false
|
19
|
+
EmptyLinesAroundBlockBody:
|
20
|
+
Enabled: false
|
21
|
+
MethodLength:
|
22
|
+
Max: 40
|
23
|
+
NumericLiterals:
|
24
|
+
MinDigits: 10
|
25
|
+
Metrics/CyclomaticComplexity:
|
26
|
+
Max: 10
|
27
|
+
Metrics/PerceivedComplexity:
|
28
|
+
Max: 10
|
29
|
+
Metrics/AbcSize:
|
30
|
+
Max: 33
|
31
|
+
Style/PercentLiteralDelimiters:
|
32
|
+
PreferredDelimiters:
|
33
|
+
'%': '{}'
|
34
|
+
'%i': ()
|
35
|
+
'%q': '{}'
|
36
|
+
'%Q': ()
|
37
|
+
'%r': '{}'
|
38
|
+
'%s': ()
|
39
|
+
'%w': '{}'
|
40
|
+
'%W': ()
|
41
|
+
'%x': ()
|
42
|
+
Style/AlignHash:
|
43
|
+
Enabled: false
|
44
|
+
Style/PredicateName:
|
45
|
+
Enabled: false
|
46
|
+
Style/ClassAndModuleChildren:
|
47
|
+
Enabled: false
|
48
|
+
Style/BracesAroundHashParameters:
|
49
|
+
Enabled: false
|
50
|
+
Style/AndOr:
|
51
|
+
Enabled: false
|
52
|
+
Style/Not:
|
53
|
+
Enabled: false
|
54
|
+
Style/TrailingComma:
|
55
|
+
EnforcedStyleForMultiline: comma
|
56
|
+
Style/NegatedIf:
|
57
|
+
Enabled: false
|
58
|
+
Style/UnlessElse:
|
59
|
+
Enabled: false
|
60
|
+
BlockDelimiters:
|
61
|
+
Enabled: false
|
62
|
+
Style/SpaceAroundOperators:
|
63
|
+
Enabled: false
|
64
|
+
Style/IfUnlessModifier:
|
65
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# Change Log
|
2
|
+
|
3
|
+
## [0.9.6](https://github.com/chef/kitchen-inspec/tree/0.9.6) (2015-12-11)
|
4
|
+
[Full Changelog](https://github.com/chef/kitchen-inspec/compare/v0.9.0...0.9.6)
|
5
|
+
|
6
|
+
**Implemented enhancements:**
|
7
|
+
|
8
|
+
- add changelog [\#18](https://github.com/chef/kitchen-inspec/pull/18) ([chris-rock](https://github.com/chris-rock))
|
9
|
+
- support test suite helpers [\#12](https://github.com/chef/kitchen-inspec/pull/12) ([schisamo](https://github.com/schisamo))
|
10
|
+
- Fix typo in README [\#8](https://github.com/chef/kitchen-inspec/pull/8) ([englishm](https://github.com/englishm))
|
11
|
+
- Gem [\#7](https://github.com/chef/kitchen-inspec/pull/7) ([chris-rock](https://github.com/chris-rock))
|
12
|
+
|
13
|
+
**Fixed bugs:**
|
14
|
+
|
15
|
+
- tests fail with inspec 0.9.5 [\#19](https://github.com/chef/kitchen-inspec/issues/19)
|
16
|
+
- Fix tests and activate linting for CI [\#20](https://github.com/chef/kitchen-inspec/pull/20) ([srenatus](https://github.com/srenatus))
|
17
|
+
- raise ActionFailed when inspec returns other than 0. [\#13](https://github.com/chef/kitchen-inspec/pull/13) ([sawanoboly](https://github.com/sawanoboly))
|
18
|
+
|
19
|
+
**Closed issues:**
|
20
|
+
|
21
|
+
- ReadMe 'example here' dead link / 404 [\#21](https://github.com/chef/kitchen-inspec/issues/21)
|
22
|
+
|
23
|
+
**Merged pull requests:**
|
24
|
+
|
25
|
+
- fix readme [\#22](https://github.com/chef/kitchen-inspec/pull/22) ([srenatus](https://github.com/srenatus))
|
26
|
+
|
27
|
+
## [v0.9.0](https://github.com/chef/kitchen-inspec/tree/v0.9.0) (2015-11-03)
|
28
|
+
**Implemented enhancements:**
|
29
|
+
|
30
|
+
- Update README.md [\#6](https://github.com/chef/kitchen-inspec/pull/6) ([chris-rock](https://github.com/chris-rock))
|
31
|
+
- Support all Kitchen/SSH as Train/SSH tunables. [\#4](https://github.com/chef/kitchen-inspec/pull/4) ([fnichol](https://github.com/fnichol))
|
32
|
+
- use new inspec as gem source [\#3](https://github.com/chef/kitchen-inspec/pull/3) ([chris-rock](https://github.com/chris-rock))
|
33
|
+
- Rename + Update [\#2](https://github.com/chef/kitchen-inspec/pull/2) ([chris-rock](https://github.com/chris-rock))
|
34
|
+
- add usage instructions [\#1](https://github.com/chef/kitchen-inspec/pull/1) ([chris-rock](https://github.com/chris-rock))
|
35
|
+
|
36
|
+
**Fixed bugs:**
|
37
|
+
|
38
|
+
- Add WinRM support to Verifier \(pending full support in Train\). [\#5](https://github.com/chef/kitchen-inspec/pull/5) ([fnichol](https://github.com/fnichol))
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
data/Gemfile
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
source
|
2
|
+
source 'https://rubygems.org'
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :guard do
|
6
|
-
gem
|
7
|
-
gem
|
6
|
+
gem 'guard-rspec', :require => nil
|
7
|
+
gem 'guard-rubocop', :require => nil
|
8
8
|
end
|
9
9
|
|
10
10
|
group :test do
|
11
|
-
gem
|
11
|
+
gem 'codeclimate-test-reporter', :require => nil
|
12
|
+
end
|
13
|
+
|
14
|
+
group :tools do
|
15
|
+
gem 'github_changelog_generator', '~> 1'
|
12
16
|
end
|
data/Guardfile
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
ignore %r{^\.gem/}
|
3
3
|
|
4
4
|
def rspec_opts
|
5
|
-
{ :
|
5
|
+
{ cmd: 'bundle exec rspec' }
|
6
6
|
end
|
7
7
|
|
8
8
|
def rubocop_opts
|
9
|
-
{ :
|
9
|
+
{ all_on_start: false, keep_failed: false, cli: '-r finstyle' }
|
10
10
|
end
|
11
11
|
|
12
|
-
group :red_green_refactor, :
|
12
|
+
group :red_green_refactor, halt_on_fail: true do
|
13
13
|
guard :rspec, rspec_opts do
|
14
14
|
watch(%r{^spec/(.*)_spec\.rb})
|
15
15
|
watch(%r{^lib/(.*)([^/]+)\.rb}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
16
|
-
watch(%r{^spec/spec_helper\.rb}) {
|
16
|
+
watch(%r{^spec/spec_helper\.rb}) { 'spec' }
|
17
17
|
end
|
18
18
|
|
19
19
|
guard :rubocop, rubocop_opts do
|
20
|
-
watch(
|
20
|
+
watch(/.+\.rb$/)
|
21
21
|
watch(%r{(?:.+/)?\.rubocop\.yml$}) { |m| File.dirname(m[0]) }
|
22
22
|
end
|
23
23
|
end
|
data/README.md
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
# Kitchen::InSpec - A Test Kitchen Verifier for InSpec
|
2
2
|
|
3
|
-
This is the kitchen driver for [InSpec](https://github.com/chef/inspec).
|
3
|
+
This is the kitchen driver for [InSpec](https://github.com/chef/inspec). To see the project in action, we have the following test-kitchen examples available:
|
4
|
+
|
5
|
+
- [Chef and InSpec](https://github.com/chef/inspec/tree/master/examples/kitchen-chef)
|
6
|
+
- [Puppet and InSpec](https://github.com/chef/inspec/tree/master/examples/kitchen-puppet)
|
7
|
+
- [Ansible and InSpec](https://github.com/chef/inspec/tree/master/examples/kitchen-ansible)
|
4
8
|
|
5
9
|
## Installation
|
6
10
|
|
@@ -34,7 +38,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
34
38
|
|
35
39
|
## Contributing
|
36
40
|
|
37
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
41
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/chef/kitchen-inspec.
|
38
42
|
|
39
43
|
## License
|
40
44
|
|
data/Rakefile
CHANGED
@@ -1,26 +1,24 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
require "bundler/gem_tasks"
|
4
|
-
|
5
4
|
require "rspec/core/rake_task"
|
5
|
+
require 'rubocop/rake_task'
|
6
|
+
|
7
|
+
# Specs
|
6
8
|
RSpec::Core::RakeTask.new(:spec)
|
7
9
|
|
8
10
|
desc "Run all test suites"
|
9
11
|
task :test => [:spec]
|
10
12
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Cane::RakeTask.new do |cane|
|
16
|
-
cane.canefile = "./.cane"
|
13
|
+
# Rubocop
|
14
|
+
desc 'Run Rubocop lint checks'
|
15
|
+
task :rubocop do
|
16
|
+
RuboCop::RakeTask.new
|
17
17
|
end
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
task.options << "--display-cop-names"
|
23
|
-
end
|
19
|
+
# lint the project
|
20
|
+
desc 'Run robocop linter'
|
21
|
+
task lint: [:rubocop]
|
24
22
|
|
25
23
|
desc "Display LOC stats"
|
26
24
|
task :stats do
|
@@ -31,6 +29,92 @@ task :stats do
|
|
31
29
|
end
|
32
30
|
|
33
31
|
desc "Run all quality tasks"
|
34
|
-
task :quality => [:
|
32
|
+
task :quality => [:lint, :stats]
|
35
33
|
|
36
34
|
task :default => [:test, :quality]
|
35
|
+
|
36
|
+
# Automatically generate a changelog for this project. Only loaded if
|
37
|
+
# the necessary gem is installed.
|
38
|
+
begin
|
39
|
+
require 'github_changelog_generator/task'
|
40
|
+
GitHubChangelogGenerator::RakeTask.new :changelog
|
41
|
+
rescue LoadError
|
42
|
+
puts '>>>>> GitHub Changelog Generator not loaded, omitting tasks'
|
43
|
+
end
|
44
|
+
|
45
|
+
# Print the current version of this gem or update it.
|
46
|
+
#
|
47
|
+
# @param [Type] target the new version you want to set, or nil if you only want to show
|
48
|
+
def kitchen_inspec_version(target = nil)
|
49
|
+
path = 'lib/kitchen/verifier/inspec_version.rb'
|
50
|
+
require_relative path.sub(/.rb$/, '')
|
51
|
+
|
52
|
+
nu_version = target.nil? ? '' : " -> #{target}"
|
53
|
+
puts "Kitchen-inspec: #{Kitchen::Verifier::INSPEC_VERSION}#{nu_version}"
|
54
|
+
|
55
|
+
unless target.nil?
|
56
|
+
raw = File.read(path)
|
57
|
+
nu = raw.sub(/INSPEC_VERSION.*/, "INSPEC_VERSION = '#{target}'")
|
58
|
+
File.write(path, nu)
|
59
|
+
load(path)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Check if a command is available
|
64
|
+
#
|
65
|
+
# @param [Type] x the command you are interested in
|
66
|
+
# @param [Type] msg the message to display if the command is missing
|
67
|
+
def require_command(x, msg = nil)
|
68
|
+
return if system("command -v #{x} || exit 1")
|
69
|
+
msg ||= 'Please install it first!'
|
70
|
+
puts "\033[31;1mCan't find command #{x.inspect}. #{msg}\033[0m"
|
71
|
+
exit 1
|
72
|
+
end
|
73
|
+
|
74
|
+
# Check if a required environment variable has been set
|
75
|
+
#
|
76
|
+
# @param [String] x the variable you are interested in
|
77
|
+
# @param [String] msg the message you want to display if the variable is missing
|
78
|
+
def require_env(x, msg = nil)
|
79
|
+
exists = `env | grep "^#{x}="`
|
80
|
+
return unless exists.empty?
|
81
|
+
puts "\033[31;1mCan't find environment variable #{x.inspect}. #{msg}\033[0m"
|
82
|
+
exit 1
|
83
|
+
end
|
84
|
+
|
85
|
+
# Check the requirements for running an update of this repository.
|
86
|
+
def check_update_requirements
|
87
|
+
require_command 'git'
|
88
|
+
require_command 'github_changelog_generator', "\n"\
|
89
|
+
"For more information on how to install it see:\n"\
|
90
|
+
" https://github.com/skywinder/github-changelog-generator\n"
|
91
|
+
require_env 'CHANGELOG_GITHUB_TOKEN', "\n"\
|
92
|
+
"Please configure this token to make sure you can run all commands\n"\
|
93
|
+
"against GitHub.\n\n"\
|
94
|
+
"See github_changelog_generator homepage for more information:\n"\
|
95
|
+
" https://github.com/skywinder/github-changelog-generator\n"
|
96
|
+
end
|
97
|
+
|
98
|
+
# Show the current version of this gem.
|
99
|
+
desc 'Show the version of this gem'
|
100
|
+
task :version do
|
101
|
+
kitchen_inspec_version
|
102
|
+
end
|
103
|
+
|
104
|
+
desc 'Generate the changelog'
|
105
|
+
task :changelog do
|
106
|
+
require_relative 'lib/kitchen/verifier/inspec_version'
|
107
|
+
system "github_changelog_generator -u chef -p kitchen-inspec --future-release #{Kitchen::Verifier::INSPEC_VERSION}"
|
108
|
+
end
|
109
|
+
|
110
|
+
# Update the version of this gem and create an updated
|
111
|
+
# changelog. It covers everything short of actually releasing
|
112
|
+
# the gem.
|
113
|
+
desc 'Bump the version of this gem'
|
114
|
+
task :bump_version, [:version] do |_, args|
|
115
|
+
v = args[:version] || ENV['to']
|
116
|
+
fail "You must specify a target version! rake release[1.2.3]" if v.empty?
|
117
|
+
check_update_requirements
|
118
|
+
kitchen_inspec_version(v)
|
119
|
+
Rake::Task['changelog'].invoke
|
120
|
+
end
|
data/bin/console
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# encoding: utf-8
|
2
3
|
|
3
|
-
require
|
4
|
-
require
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'kitchen/inspec'
|
5
6
|
|
6
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
7
8
|
# with your gem easier. You can also use a different console, if you like.
|
8
9
|
|
9
10
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require
|
11
|
+
# require 'pry'
|
11
12
|
# Pry.start
|
12
13
|
|
13
|
-
require
|
14
|
+
require 'irb'
|
14
15
|
IRB.start
|
data/bin/setup
CHANGED
data/kitchen-inspec.gemspec
CHANGED
@@ -1,38 +1,34 @@
|
|
1
|
-
#
|
2
|
-
lib = File.expand_path(
|
1
|
+
# encoding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
3
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
-
require
|
5
|
-
require
|
4
|
+
require 'kitchen/verifier/inspec_version'
|
5
|
+
require 'English'
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name =
|
8
|
+
spec.name = 'kitchen-inspec'
|
9
9
|
spec.version = Kitchen::Verifier::INSPEC_VERSION
|
10
|
-
spec.license =
|
11
|
-
spec.authors = [
|
12
|
-
spec.email = [
|
10
|
+
spec.license = 'Apache 2.0'
|
11
|
+
spec.authors = ['Fletcher Nichol']
|
12
|
+
spec.email = ['fnichol@chef.io']
|
13
13
|
|
14
|
-
spec.summary =
|
14
|
+
spec.summary = 'A Test Kitchen Verifier for InSpec'
|
15
15
|
spec.description = spec.summary
|
16
|
-
spec.homepage =
|
16
|
+
spec.homepage = 'http://github.com/chef/kitchen-inspec'
|
17
17
|
|
18
|
-
spec.files = `git ls-files -z`.split("\x0")
|
19
|
-
reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
-
spec.bindir =
|
18
|
+
spec.files = `git ls-files -z`.split("\x0")
|
19
|
+
.reject { |f| f.match(%r{^(test|spec|features)/}) }
|
20
|
+
spec.bindir = 'exe'
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
-
spec.require_paths = [
|
23
|
-
|
24
|
-
spec.add_dependency
|
25
|
-
spec.
|
26
|
-
|
27
|
-
spec.add_development_dependency
|
28
|
-
spec.add_development_dependency
|
29
|
-
spec.add_development_dependency
|
30
|
-
spec.add_development_dependency "rspec"
|
31
|
-
spec.add_development_dependency "simplecov", "~> 0.10"
|
32
|
-
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
spec.add_dependency 'test-kitchen', '~> 1.4'
|
24
|
+
spec.add_dependency 'inspec', '~> 0.9'
|
25
|
+
spec.add_development_dependency 'countloc', '~> 0.4'
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
+
spec.add_development_dependency 'rspec'
|
29
|
+
spec.add_development_dependency 'simplecov', '~> 0.10'
|
33
30
|
# style and complexity libraries are tightly version pinned as newer releases
|
34
31
|
# may introduce new and undesireable style choices which would be immediately
|
35
32
|
# enforced in CI
|
36
|
-
spec.add_development_dependency
|
37
|
-
spec.add_development_dependency "cane", "2.6.2"
|
33
|
+
spec.add_development_dependency 'finstyle', '1.5.0'
|
38
34
|
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
#
|
3
3
|
# Author:: Fletcher Nichol (<fnichol@chef.io>)
|
4
4
|
# Author:: Christoph Hartmann (<chartmann@chef.io>)
|
@@ -17,22 +17,18 @@
|
|
17
17
|
# See the License for the specific language governing permissions and
|
18
18
|
# limitations under the License.
|
19
19
|
|
20
|
-
require
|
21
|
-
require
|
20
|
+
require 'kitchen/verifier/inspec_version'
|
21
|
+
require 'kitchen/verifier/base'
|
22
22
|
|
23
|
-
require
|
23
|
+
require 'uri'
|
24
24
|
|
25
25
|
module Kitchen
|
26
|
-
|
27
26
|
module Verifier
|
28
|
-
|
29
27
|
# InSpec verifier for Kitchen.
|
30
28
|
#
|
31
29
|
# @author Fletcher Nichol <fnichol@chef.io>
|
32
30
|
class Inspec < Kitchen::Verifier::Base
|
33
|
-
|
34
31
|
kitchen_verifier_api_version 1
|
35
|
-
|
36
32
|
plugin_version Kitchen::Verifier::INSPEC_VERSION
|
37
33
|
|
38
34
|
# (see Base#call)
|
@@ -40,20 +36,25 @@ module Kitchen
|
|
40
36
|
transport_data = instance.transport.diagnose.merge(state)
|
41
37
|
|
42
38
|
runner_options = case (name = instance.transport.name.downcase)
|
43
|
-
when
|
39
|
+
when 'ssh'
|
44
40
|
runner_options_for_ssh(transport_data)
|
45
|
-
when
|
41
|
+
when 'winrm'
|
46
42
|
runner_options_for_winrm(transport_data)
|
47
43
|
else
|
48
|
-
|
49
|
-
|
44
|
+
fail(
|
45
|
+
Kitchen::UserError,
|
46
|
+
"Verifier #{name}",
|
47
|
+
" does not support the #{name} Transport",
|
48
|
+
)
|
50
49
|
end
|
51
|
-
tests = local_suite_files
|
50
|
+
tests = helper_files + local_suite_files
|
52
51
|
|
53
52
|
runner = ::Inspec::Runner.new(runner_options)
|
54
53
|
runner.add_tests(tests)
|
55
54
|
debug("Running specs from: #{tests.inspect}")
|
56
|
-
runner.run
|
55
|
+
exit_code = runner.run
|
56
|
+
return if exit_code == 0
|
57
|
+
fail ActionFailed, "Inspec Runner returns #{exit_code}"
|
57
58
|
end
|
58
59
|
|
59
60
|
private
|
@@ -70,7 +71,17 @@ module Kitchen
|
|
70
71
|
|
71
72
|
# (see Base#load_needed_dependencies!)
|
72
73
|
def load_needed_dependencies!
|
73
|
-
require
|
74
|
+
require 'inspec'
|
75
|
+
end
|
76
|
+
|
77
|
+
# Returns an Array of common helper filenames currently residing on the
|
78
|
+
# local workstation.
|
79
|
+
#
|
80
|
+
# @return [Array<String>] array of helper files
|
81
|
+
# @api private
|
82
|
+
def helper_files
|
83
|
+
glob = File.join(config[:test_base_path], 'helpers', '*/**/*')
|
84
|
+
Dir.glob(glob).reject { |f| File.directory?(f) }
|
74
85
|
end
|
75
86
|
|
76
87
|
# Returns an Array of test suite filenames for the related suite currently
|
@@ -81,7 +92,7 @@ module Kitchen
|
|
81
92
|
# @api private
|
82
93
|
def local_suite_files
|
83
94
|
base = File.join(config[:test_base_path], config[:suite_name])
|
84
|
-
glob = File.join(base,
|
95
|
+
glob = File.join(base, '**/*_spec.rb')
|
85
96
|
Dir.glob(glob).reject do |f|
|
86
97
|
chef_data_dir?(base, f) || File.directory?(f)
|
87
98
|
end
|
@@ -95,24 +106,24 @@ module Kitchen
|
|
95
106
|
kitchen = instance.transport.send(:connection_options, config_data).dup
|
96
107
|
|
97
108
|
opts = {
|
98
|
-
|
99
|
-
|
109
|
+
'backend' => 'ssh',
|
110
|
+
'logger' => logger,
|
100
111
|
# pass-in sudo config from kitchen verifier
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
112
|
+
'sudo' => config[:sudo],
|
113
|
+
'host' => kitchen[:hostname],
|
114
|
+
'port' => kitchen[:port],
|
115
|
+
'user' => kitchen[:username],
|
116
|
+
'keepalive' => kitchen[:keepalive],
|
117
|
+
'keepalive_interval' => kitchen[:keepalive_interval],
|
118
|
+
'connection_timeout' => kitchen[:timeout],
|
119
|
+
'connection_retries' => kitchen[:connection_retries],
|
120
|
+
'connection_retry_sleep' => kitchen[:connection_retry_sleep],
|
121
|
+
'max_wait_until_ready' => kitchen[:max_wait_until_ready],
|
122
|
+
'compression' => kitchen[:compression],
|
123
|
+
'compression_level' => kitchen[:compression_level],
|
113
124
|
}
|
114
|
-
opts[
|
115
|
-
opts[
|
125
|
+
opts['key_files'] = kitchen[:keys] unless kitchen[:keys].nil?
|
126
|
+
opts['password'] = kitchen[:password] unless kitchen[:password].nil?
|
116
127
|
|
117
128
|
opts
|
118
129
|
end
|
@@ -125,15 +136,15 @@ module Kitchen
|
|
125
136
|
kitchen = instance.transport.send(:connection_options, config_data).dup
|
126
137
|
|
127
138
|
opts = {
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
139
|
+
'backend' => 'winrm',
|
140
|
+
'logger' => logger,
|
141
|
+
'host' => URI(kitchen[:endpoint]).hostname,
|
142
|
+
'port' => URI(kitchen[:endpoint]).port,
|
143
|
+
'user' => kitchen[:user],
|
144
|
+
'password' => kitchen[:pass],
|
145
|
+
'connection_retries' => kitchen[:connection_retries],
|
146
|
+
'connection_retry_sleep' => kitchen[:connection_retry_sleep],
|
147
|
+
'max_wait_until_ready' => kitchen[:max_wait_until_ready],
|
137
148
|
}
|
138
149
|
|
139
150
|
opts
|
@@ -1,4 +1,4 @@
|
|
1
|
-
#
|
1
|
+
# encoding: utf-8
|
2
2
|
#
|
3
3
|
# Author:: Fletcher Nichol (<fnichol@chef.io>)
|
4
4
|
# Author:: Christoph Hartmann (<chartmann@chef.io>)
|
@@ -18,10 +18,8 @@
|
|
18
18
|
# limitations under the License.
|
19
19
|
|
20
20
|
module Kitchen
|
21
|
-
|
22
21
|
module Verifier
|
23
|
-
|
24
22
|
# Version string for InSpec Kitchen verifier
|
25
|
-
INSPEC_VERSION =
|
23
|
+
INSPEC_VERSION = '0.9.6'
|
26
24
|
end
|
27
25
|
end
|
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.9.
|
4
|
+
version: 0.9.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fletcher Nichol
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: test-kitchen
|
@@ -122,20 +122,6 @@ dependencies:
|
|
122
122
|
- - '='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 1.5.0
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: cane
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - '='
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: 2.6.2
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - '='
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: 2.6.2
|
139
125
|
description: A Test Kitchen Verifier for InSpec
|
140
126
|
email:
|
141
127
|
- fnichol@chef.io
|
@@ -145,7 +131,9 @@ extra_rdoc_files: []
|
|
145
131
|
files:
|
146
132
|
- ".gitignore"
|
147
133
|
- ".rspec"
|
134
|
+
- ".rubocop.yml"
|
148
135
|
- ".travis.yml"
|
136
|
+
- CHANGELOG.md
|
149
137
|
- Gemfile
|
150
138
|
- Guardfile
|
151
139
|
- LICENSE
|
@@ -181,4 +169,3 @@ signing_key:
|
|
181
169
|
specification_version: 4
|
182
170
|
summary: A Test Kitchen Verifier for InSpec
|
183
171
|
test_files: []
|
184
|
-
has_rdoc:
|