Class: Kitchen::Transport::Sftp

Inherits:
Ssh
  • Object
show all
Defined in:
lib/kitchen/transport/sftp.rb

Defined Under Namespace

Classes: Connection

Constant Summary collapse

CHECKSUMS_PATH =
File.expand_path('../../../kitchen-sync/checksums.rb', __FILE__)
CHECKSUMS_HASH =
Digest::SHA1.file(CHECKSUMS_PATH)
CHECKSUMS_REMOTE_PATH =

This won’t work on Windows targets

"/tmp/checksums-#{CHECKSUMS_HASH}.rb"
MAX_TRANSFERS =
64

Instance Method Summary collapse

Instance Method Details

#create_new_connection(options, &block) ⇒ Object

Copy-pasta from Ssh#create_new_connection because I need the SFTP connection class. Tracked in github.com/test-kitchen/test-kitchen/pull/726



50
51
52
53
54
55
56
57
58
# File 'lib/kitchen/transport/sftp.rb', line 50

def create_new_connection(options, &block)
  if @connection
    logger.debug("[SSH] shutting previous connection #{@connection}")
    @connection.close
  end

  @connection_options = options
  @connection = self.class::Connection.new(config, options, &block)
end

#finalize_config!(instance) ⇒ Object



37
38
39
40
41
42
43
44
45
# File 'lib/kitchen/transport/sftp.rb', line 37

def finalize_config!(instance)
  super.tap do
    if defined?(Kitchen::Verifier::Inspec) && instance.verifier.is_a?(Kitchen::Verifier::Inspec)
      instance.verifier.send(:define_singleton_method, :runner_options_for_sftp) do |config_data|
        runner_options_for_ssh(config_data)
      end
    end
  end
end