Class: Kitchen::Driver::Proxy
- Inherits:
-
SSHBase
- Object
- Plugin::Base
- SSHBase
- Kitchen::Driver::Proxy
- 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.
Instance Attribute Summary
Attributes included from Configurable
Instance Method Summary collapse
-
#create(state) ⇒ Object
Creates an instance.
-
#destroy(state) ⇒ Object
Destroys an instance.
Methods inherited from SSHBase
#cache_directory, #converge, #initialize, #legacy_state, #login_command, #package, #remote_command, #setup, #ssh, #verify, #verify_dependencies
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?
Methods included from ShellOut
Methods inherited from Plugin::Base
Constructor Details
This class inherits a constructor from Kitchen::Driver::SSHBase
Instance Method Details
#create(state) ⇒ Object
Creates an instance.
41 42 43 44 45 |
# 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) ⇒ Object
Destroys an instance.
48 49 50 51 52 53 |
# File 'lib/kitchen/driver/proxy.rb', line 48 def destroy(state) return if state[:hostname].nil? reset_instance(state) state.delete(:hostname) end |