module Aruba::Api::Commands
def run_command_and_stop(cmd, opts = {})
(**opts)
-
:io_wait_timeout
(Numeric
) -- -
:exit_timeout
(Numeric
) -- -
:fail_on_error
(Boolean
) --
Parameters:
-
opts
(Hash
) -- -
cmd
(String
) --
def run_command_and_stop(cmd, opts = {}) fail_on_error = if opts.key?(:fail_on_error) opts.delete(:fail_on_error) == true else true end command = prepare_command(cmd, opts) start_command(command) command.stop return unless fail_on_error begin expect(command).to have_finished_in_time expect(command).to be_successfully_executed rescue ::RSpec::Expectations::ExpectationNotMetError => e aruba.announcer.activate(aruba.config.activate_announcer_on_command_failure) aruba.event_bus.notify Events::CommandStopped.new(command) raise e end end