class Kitchen::Driver::Proxy

Simple driver that proxies commands through to a test instance whose lifecycle is not managed by Test Kitchen. This driver is useful for long- lived non-ephemeral test instances that are simply “reset” between test runs. Think executing against devices like network switches–this is why the driver was created.

@author Seth Chisamore <schisamo@opscode.com>

Public Instance Methods

create(state) click to toggle source

(see Base#create)

# File lib/kitchen/driver/proxy.rb, line 41
def create(state)
  # TODO: Once this isn't using SSHBase, it should call `super` to support pre_create_command.
  state[:hostname] = config[:host]
  reset_instance(state)
end
destroy(state) click to toggle source

(see Base#destroy)

# File lib/kitchen/driver/proxy.rb, line 48
def destroy(state)
  return if state[:hostname].nil?

  reset_instance(state)
  state.delete(:hostname)
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/proxy.rb, line 62
def reset_instance(state)
  if (cmd = config[:reset_command])
    info("Resetting instance state with command: #{cmd}")
    ssh(build_ssh_args(state), cmd)
  end
end