diff --git a/Gemfile b/Gemfile index ff92f73..9f43e6a 100644 --- a/Gemfile +++ b/Gemfile @@ -2,6 +2,8 @@ source "https://rubygems.org" gemspec +gem "chef-test-kitchen-enterprise", git: "https://github.com/chef/chef-test-kitchen-enterprise", branch: "main" + group :guard do gem "guard-rspec", require: nil gem "guard-rubocop", require: nil diff --git a/kitchen-inspec.gemspec b/kitchen-inspec.gemspec index c705d29..8e1db3a 100644 --- a/kitchen-inspec.gemspec +++ b/kitchen-inspec.gemspec @@ -14,10 +14,9 @@ Gem::Specification.new do |spec| spec.description = spec.summary spec.homepage = "https://github.com/inspec/kitchen-inspec" - spec.files = `git ls-files -z`.split("\x0").grep(/LICENSE|^lib/) + spec.files = `git ls-files -z`.split("\x0").grep(/LICENSE|Gemfile|kitchen-inspec.gemspec|^lib/) spec.require_paths = ["lib"] spec.required_ruby_version = ">= 2.3.0" - spec.add_dependency "inspec", ">= 2.2.64", "< 7.0" # 2.2.64 is required for plugin v2 support & InSpec 6 included - spec.add_dependency "test-kitchen", ">= 2.7", "< 4" # 2.7 introduced no_parallel_for for verifiers + spec.add_dependency "inspec", "~> 6.0" # for RC1 release 6.0 and the above has the licensing changes. spec.add_dependency "hashie", ">= 3.4", "<= 5.0" end diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index 126b018..8f7f95c 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -121,8 +121,13 @@ def call(state) def setup_chef_license_config(opts, config) # Pass chef_license_key to inspec if it is set # Pass chef_license_server to inspec if it is set - opts[:chef_license_key] = config[:chef_license_key] || ENV["CHEF_LICENSE_KEY"] - opts[:chef_license_server] = config[:chef_license_server] || ENV["CHEF_LICENSE_SERVER"] + p = instance.provisioner + opts[:chef_license_key] = config[:chef_license_key] || + ENV["CHEF_LICENSE_KEY"] || + (p.chef_license_key if p.respond_to?(:chef_license_key)) + opts[:chef_license_server] = config[:chef_license_server] || + ENV["CHEF_LICENSE_SERVER"] || + (p.chef_license_server if p.respond_to?(:chef_license_server)) end def setup_waivers(opts, config)