From a0e70670fb01090464997647d32ffed9fba2f715 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 20 Oct 2015 00:12:59 +0200 Subject: [PATCH 1/2] rename audit to inspec --- bin/console | 2 +- kitchen-audit.gemspec => kitchen-inspec.gemspec | 0 lib/kitchen/verifier/{audit.rb => inspec.rb} | 10 +++++----- .../verifier/{audit_version.rb => inspec_version.rb} | 5 +++-- .../verifier/{audit_spec.rb => inspec_spec.rb} | 11 ++++++----- 5 files changed, 15 insertions(+), 13 deletions(-) rename kitchen-audit.gemspec => kitchen-inspec.gemspec (100%) rename lib/kitchen/verifier/{audit.rb => inspec.rb} (93%) rename lib/kitchen/verifier/{audit_version.rb => inspec_version.rb} (84%) rename spec/kitchen/verifier/{audit_spec.rb => inspec_spec.rb} (92%) diff --git a/bin/console b/bin/console index f3a3658..71a3bb4 100755 --- a/bin/console +++ b/bin/console @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require "bundler/setup" -require "kitchen/audit" +require "kitchen/inspec" # You can add fixtures and/or initialization code here to make experimenting # with your gem easier. You can also use a different console, if you like. diff --git a/kitchen-audit.gemspec b/kitchen-inspec.gemspec similarity index 100% rename from kitchen-audit.gemspec rename to kitchen-inspec.gemspec diff --git a/lib/kitchen/verifier/audit.rb b/lib/kitchen/verifier/inspec.rb similarity index 93% rename from lib/kitchen/verifier/audit.rb rename to lib/kitchen/verifier/inspec.rb index a830ec3..ec3909d 100644 --- a/lib/kitchen/verifier/audit.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -1,6 +1,7 @@ # -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol () +# Author:: Christoph Hartmann () # # Copyright (C) 2015, Chef Software Inc. # @@ -16,21 +17,21 @@ # See the License for the specific language governing permissions and # limitations under the License. -require "kitchen/verifier/audit_version" +require "kitchen/verifier/inspec_version" require "kitchen/verifier/base" module Kitchen module Verifier - # Audit verifier for Kitchen. + # InSpec verifier for Kitchen. # # @author Fletcher Nichol - class Audit < Kitchen::Verifier::Base + class InSpec < Kitchen::Verifier::Base kitchen_verifier_api_version 1 - plugin_version Kitchen::Verifier::AUDIT_VERSION + plugin_version Kitchen::Verifier::INSPEC_VERSION # (see Base#call) def call(state) @@ -88,7 +89,6 @@ def local_suite_files # @api private def runner_options_for_ssh(config_data) opts = instance.transport.send(:connection_options, config_data).dup - { "backend" => "ssh", "host" => opts[:hostname], diff --git a/lib/kitchen/verifier/audit_version.rb b/lib/kitchen/verifier/inspec_version.rb similarity index 84% rename from lib/kitchen/verifier/audit_version.rb rename to lib/kitchen/verifier/inspec_version.rb index 15222d8..41f2fff 100644 --- a/lib/kitchen/verifier/audit_version.rb +++ b/lib/kitchen/verifier/inspec_version.rb @@ -1,6 +1,7 @@ # -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol () +# Author:: Christoph Hartmann () # # Copyright (C) 2015, Chef Software Inc. # @@ -20,7 +21,7 @@ module Kitchen module Verifier - # Version string for Audit Kitchen verifier - AUDIT_VERSION = "0.1.0" + # Version string for InSpec Kitchen verifier + INSPEC_VERSION = "0.1.0" end end diff --git a/spec/kitchen/verifier/audit_spec.rb b/spec/kitchen/verifier/inspec_spec.rb similarity index 92% rename from spec/kitchen/verifier/audit_spec.rb rename to spec/kitchen/verifier/inspec_spec.rb index 8462132..86f6aab 100644 --- a/spec/kitchen/verifier/audit_spec.rb +++ b/spec/kitchen/verifier/inspec_spec.rb @@ -1,6 +1,7 @@ # -*- encoding: utf-8 -*- # # Author:: Fletcher Nichol () +# Author:: Christoph Hartmann () # # Copyright (C) 2015, Chef Software Inc. # @@ -20,10 +21,10 @@ require "logger" -require "kitchen/verifier/audit" +require "kitchen/verifier/inspec" require "kitchen/transport/ssh" -describe Kitchen::Verifier::Audit do +describe Kitchen::Verifier::InSpec do let(:logged_output) { StringIO.new } let(:logger) { Logger.new(logged_output) } @@ -72,16 +73,16 @@ end let(:verifier) do - Kitchen::Verifier::Audit.new(config).finalize_config!(instance) + Kitchen::Verifier::InSpec.new(config).finalize_config!(instance) end it "verifier api_version is 1" do expect(verifier.diagnose_plugin[:api_version]).to eq(1) end - it "plugin_version is set to Kitchen::Verifier::AUDIT_VERSION" do + it "plugin_version is set to Kitchen::Verifier::INSPEC_VERSION" do expect(verifier.diagnose_plugin[:version]). - to eq(Kitchen::Verifier::AUDIT_VERSION) + to eq(Kitchen::Verifier::INSPEC_VERSION) end describe "configuration" do From 5e0240aa838159833071e74efd323f9970b03196 Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Tue, 20 Oct 2015 00:13:29 +0200 Subject: [PATCH 2/2] use new version of lib --- Gemfile | 1 + lib/kitchen/verifier/inspec.rb | 2 +- spec/kitchen/verifier/inspec_spec.rb | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index 840cb87..f80e1a4 100644 --- a/Gemfile +++ b/Gemfile @@ -12,3 +12,4 @@ group :test do end gem "vulcano", :git => "git@github.com:chef/vulcanosec.git" +gem 'train', git: 'git@github.com:chef/train.git' diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index ec3909d..18f4806 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -94,7 +94,7 @@ def runner_options_for_ssh(config_data) "host" => opts[:hostname], "port" => opts[:port], "user" => opts[:username], - "key_file" => opts[:keys] + "key_files" => opts[:keys] } end end diff --git a/spec/kitchen/verifier/inspec_spec.rb b/spec/kitchen/verifier/inspec_spec.rb index 86f6aab..4e6dcd9 100644 --- a/spec/kitchen/verifier/inspec_spec.rb +++ b/spec/kitchen/verifier/inspec_spec.rb @@ -120,7 +120,7 @@ "host" => "boogie", "port" => 123, "user" => "dance", - "key_file" => ["/backstage/pass"] + "key_files" => ["/backstage/pass"] )). and_return(runner)