Class: Kitchen::Verifier::Shell

Inherits:
Base
  • Object
show all
Defined in:
lib/kitchen/verifier/shell.rb

Overview

Shell verifier for Kitchen. This verifier just execute shell command from local.

Author:

Instance Attribute Summary

Attributes included from Configurable

#instance

Instance Method Summary collapse

Methods inherited from Base

#cleanup_sandbox, #create_sandbox, #doctor, #init_command, #initialize, #install_command, kitchen_verifier_api_version, #prepare_command, #sandbox_path

Methods included from Logging

#banner, #debug, #error, #fatal, #info, #warn

Methods included from Configurable

#[], #bourne_shell?, #calculate_path, #config_keys, #diagnose, #diagnose_plugin, #finalize_config!, included, #name, #powershell_shell?, #remote_path_join, #unix_os?, #verify_dependencies, #windows_os?

Constructor Details

This class inherits a constructor from Kitchen::Verifier::Base

Instance Method Details

#call(state) ⇒ Object

Runs the verifier on the instance.

Parameters:

  • state (Hash)

    mutable instance state

Raises:


39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/kitchen/verifier/shell.rb', line 39

def call(state)
  info("[#{name}] Verify on instance #{instance.name} with state=#{state}")
  sleep_if_set
  merge_state_to_env(state)
  if config[:remote_exec]
    instance.transport.connection(state) do |conn|
      conn.execute(config[:command])
    end
  else
    shellout
  end
  debug("[#{name}] Verify completed.")
end

#run_commandObject

for legacy drivers.


54
55
56
57
58
59
60
61
# File 'lib/kitchen/verifier/shell.rb', line 54

def run_command
  if config[:remote_exec]
    config[:command]
  else
    shellout
    nil
  end
end