Class: Kitchen::Driver::Proxy

Inherits:
SSHBase show all
Defined in:
lib/kitchen/driver/proxy.rb

Overview

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:

Instance Attribute Summary

Attributes included from Configurable

#instance

Instance Method Summary collapse

Methods inherited from SSHBase

#converge, #login_command, #remote_command, #setup, #ssh, #verify

Methods inherited from Base

#converge, #initialize, #login_command, #name, no_parallel_for, #setup, #verify, #verify_dependencies

Methods included from Logging

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

Methods included from Configurable

#[], #calculate_path, #config_keys, #diagnose, #finalize_config!, included

Methods included from ShellOut

#run_command

Constructor Details

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

Instance Method Details

#create(state) ⇒ Object

Creates an instance.

Parameters:

  • state (Hash)

    mutable instance and driver state

Raises:



42
43
44
45
# File 'lib/kitchen/driver/proxy.rb', line 42

def create(state)
  state[:hostname] = config[:host]
  reset_instance(state)
end

#destroy(state) ⇒ Object

Destroys an instance.

Parameters:

  • state (Hash)

    mutable instance and driver state

Raises:



48
49
50
51
52
# File 'lib/kitchen/driver/proxy.rb', line 48

def destroy(state)
  return if state[:hostname].nil?
  reset_instance(state)
  state.delete(:hostname)
end