Class: Specinfra::Backend::BeakerBase

Inherits:
Base
  • Object
show all
Defined in:
lib/beaker-rspec/helpers/serverspec.rb

Direct Known Subclasses

BeakerCygwin, BeakerDispatch, BeakerExec

Instance Method Summary collapse

Instance Method Details

#exampleObject

Example accessor


180
181
182
# File 'lib/beaker-rspec/helpers/serverspec.rb', line 180

def example
  @example
end

#ssh_exec!(node, command) ⇒ Hash

Execute the provided ssh command

Parameters:

  • command (String)

    The command to be executed

Returns:

  • (Hash)

    Returns a hash containing :exit_status, :stdout and :stderr


187
188
189
190
191
192
193
194
# File 'lib/beaker-rspec/helpers/serverspec.rb', line 187

def ssh_exec!(node, command)
  r = on node, command, { :acceptable_exit_codes => (0..127) }
  {
    :exit_status => r.exit_code,
    :stdout      => r.stdout,
    :stderr      => r.stderr
  }
end