Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename + Update #2

Merged
merged 2 commits into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions lib/kitchen/verifier/audit.rb → lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -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 <fnichol@chef.io>
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)
Expand Down Expand Up @@ -88,13 +89,12 @@ 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],
"port" => opts[:port],
"user" => opts[:username],
"key_file" => opts[:keys]
"key_files" => opts[:keys]
}
end
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -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
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- encoding: utf-8 -*-
#
# Author:: Fletcher Nichol (<fnichol@chef.io>)
# Author:: Christoph Hartmann (<chartmann@chef.io>)
#
# Copyright (C) 2015, Chef Software Inc.
#
Expand All @@ -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) }
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -119,7 +120,7 @@
"host" => "boogie",
"port" => 123,
"user" => "dance",
"key_file" => ["/backstage/pass"]
"key_files" => ["/backstage/pass"]
)).
and_return(runner)

Expand Down