Class: Kitchen::Transport::Dummy::Connection

Inherits:
Base::Connection show all
Defined in:
lib/kitchen/transport/dummy.rb

Overview

A connection that reports the actions it would have carried out rather than contacting any remote host.

Instance Method Summary collapse

Methods inherited from Base::Connection

#close, #execute_with_retry, #initialize, #login_command, #retry?, #wait_until_ready

Methods included from Logging

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

Constructor Details

This class inherits a constructor from Kitchen::Transport::Base::Connection

Instance Method Details

#download(remotes, local) ⇒ void

This method returns an undefined value.

Reports that the given files would have been downloaded.

Parameters:

  • remotes (Array<String>)

    remote paths that would be downloaded

  • local (String)

    the local destination path



70
71
72
# File 'lib/kitchen/transport/dummy.rb', line 70

def download(remotes, local)
  report(:download, "#{remotes.inspect} => #{local}")
end

#execute(command) ⇒ Object

Execute a command on the remote host.

Parameters:

  • command (String)

    command string to execute

Raises:

  • (TransportFailed)

    if the command does not exit successfully, which may vary by implementation



49
50
51
52
53
54
# File 'lib/kitchen/transport/dummy.rb', line 49

def execute(command)
  report(:execute, command)
  if options[:random_exit_code] != 0
    info("Dummy exited (#{exit_code}) for command: [#{command}]")
  end
end

#upload(locals, remote) ⇒ void

This method returns an undefined value.

Reports that the given files would have been uploaded.

Parameters:

  • locals (Array<String>)

    local paths that would be uploaded

  • remote (String)

    the remote destination path



61
62
63
# File 'lib/kitchen/transport/dummy.rb', line 61

def upload(locals, remote)
  report(:upload, "#{locals.inspect} => #{remote}")
end