From 7bb200491e80328c931a10935cde364a16c2e678 Mon Sep 17 00:00:00 2001 From: Walter Dolce Date: Sat, 21 Jul 2018 11:08:52 +0100 Subject: [PATCH 1/2] Exclude Jetbrain IDEs & rbenv files Signed-off-by: Walter Dolce --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitignore b/.gitignore index b1d59bb..aa18f3b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,9 @@ /tmp/ Berksfile.lock .kitchen + +# Jetbrains IDEs +.idea/ + +# Rbenv +.ruby-version \ No newline at end of file From 01bdfd6d66c42107cf42a19bd0eca60d5d65c2b8 Mon Sep 17 00:00:00 2001 From: Walter Dolce Date: Sat, 21 Jul 2018 11:40:37 +0100 Subject: [PATCH 2/2] Add ability to specify backend runner option Signed-off-by: Walter Dolce --- lib/kitchen/verifier/inspec.rb | 6 ++++++ spec/kitchen/verifier/inspec_spec.rb | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/lib/kitchen/verifier/inspec.rb b/lib/kitchen/verifier/inspec.rb index 759f333..687d213 100644 --- a/lib/kitchen/verifier/inspec.rb +++ b/lib/kitchen/verifier/inspec.rb @@ -214,6 +214,12 @@ def runner_options(transport, state = {}, platform = nil, suite = nil) # rubocop # default to false until we default to true in inspec runner_options[:backend_cache] = false end + + if config[:backend] + runner_options[:backend] = config[:backend] + else + runner_options[:backend] = 'ssh' + end end end diff --git a/spec/kitchen/verifier/inspec_spec.rb b/spec/kitchen/verifier/inspec_spec.rb index 2950b6e..94eb721 100644 --- a/spec/kitchen/verifier/inspec_spec.rb +++ b/spec/kitchen/verifier/inspec_spec.rb @@ -34,6 +34,7 @@ kitchen_root: kitchen_root, test_base_path: File.join(kitchen_root, "test", "integration"), backend_cache: true, + backend: 'gcp' } end let(:transport_config) { {} } @@ -113,6 +114,17 @@ config = verifier.send(:runner_options, transport) expect(config.to_hash).to include(backend_cache: true) end + + it 'backend option sets to gcp' do + config = verifier.send(:runner_options, transport) + expect(config.to_hash).to include(backend: 'gcp') + end + + it 'backend option defaults to ssh' do + config[:backend] = nil + config = verifier.send(:runner_options, transport) + expect(config.to_hash).to include(backend: 'ssh') + end end describe "#finalize_config!" do