acceptance/lib/pxp-agent/bolt_pxp_module_helper.rb
def ensure_failed(broker, targets, response_dataset, max_retries: 30, query_interval: 1)
  transaction_ids = response_dataset.map { |data| data['transaction_id'] }
  agent_identities(targets).zip(transaction_ids).map do |identity, transaction_id|
    check_non_blocking_response(broker, identity, transaction_id, max_retries, query_interval) do |result|
      assert_equal('failure', result['status'], 'Action was expected to fail')
      assert_equal(nil, result['stdout'], 'Successful action expected to have no output on stdout')
      assert_equal(1, result['exitcode'], "Successful action expected to have exit code #{exit_code}")
      yield result['stderr'] if block_given?
    end
  end
end
# Checks that a non-blocking request finished unsuccessfully without erroring.
# Block is executed on the stderr string.
Checks that a non-blocking request finished unsuccessfully without erroring.
Block is executed on the stderr string.
Checks that a non - blocking request finished unsuccessfully without erroring . Block is executed on the stderr string .
def ensure_failed(broker, targets, response_dataset, max_retries: 30, query_interval: 1)
  transaction_ids = response_dataset.map { |data| data['transaction_id'] }
  agent_identities(targets).zip(transaction_ids).map do |identity, transaction_id|
    check_non_blocking_response(broker, identity, transaction_id, max_retries, query_interval) do |result|
      assert_equal('failure', result['status'], 'Action was expected to fail')
      assert_equal(nil, result['stdout'], 'Successful action expected to have no output on stdout')
      assert_equal(1, result['exitcode'], "Successful action expected to have exit code #{exit_code}")
      yield result['stderr'] if block_given?
    end
  end
end
def ensure_failed ( broker , targets , response_dataset , max_retries : 30 , query_interval : 1 ) transaction_ids = response_dataset . map { | data | data [ 'transaction_id' ] } agent_identities ( targets ) . zip ( transaction_ids ) . map do | identity , transaction_id | check_non_blocking_response ( broker , identity , transaction_id , max_retries , query_interval ) do | result | assert_equal ( 'failure' , result [ 'status' ] , 'Action was expected to fail' ) assert_equal ( nil , result [ 'stdout' ] , 'Successful action expected to have no output on stdout' ) assert_equal ( 1 , result [ 'exitcode' ] , "Successful action expected to have exit code #{exit_code}" ) yield result [ 'stderr' ] if block_given? end end end
Checks that a non-blocking request finished unsuccessfully without erroring.
Checks that a non - blocking request finished unsuccessfully without erroring .
broker
targets
response_dataset
max_retries
query_interval