Class: Specinfra::Backend::BeakerBase

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

Direct Known Subclasses

BeakerCygwin, BeakerDispatch, BeakerExec

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#exampleObject (readonly)

Example accessor



167
168
169
# File 'lib/beaker-rspec/helpers/serverspec.rb', line 167

def example
  @example
end

Instance Method Details

#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



172
173
174
175
176
177
178
179
# File 'lib/beaker-rspec/helpers/serverspec.rb', line 172

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