class Kitchen::Driver::Exec

Simple driver that runs commands locally. As with the proxy driver, this has no isolation in general.

Public Instance Methods

create(state) click to toggle source

(see Base#create)

Calls superclass method Kitchen::Driver::Base#create
# File lib/kitchen/driver/exec.rb, line 45
def create(state)
  super
  reset_instance(state)
end
destroy(state) click to toggle source

(see Base#destroy)

# File lib/kitchen/driver/exec.rb, line 51
def destroy(state)
  reset_instance(state)
end
finalize_config!(instance) click to toggle source

Hack to force using the exec transport when using this driver. If someone comes up with a use case for using the driver with a different transport, please let us know.

@api private

Calls superclass method Kitchen::Configurable#finalize_config!
# File lib/kitchen/driver/exec.rb, line 38
def finalize_config!(instance)
  super.tap do
    instance.transport = Kitchen::Transport::Exec.new
  end
end

Private Instance Methods

reset_instance(state) click to toggle source

Resets the non-Kitchen managed instance using by issuing a command over SSH.

@param state [Hash] the state hash @api private

# File lib/kitchen/driver/exec.rb, line 62
def reset_instance(state)
  if (cmd = config[:reset_command])
    info("Resetting instance state with command: #{cmd}")
    run_command(cmd)
  end
end