3. dut_auxiliary

3.1. Device Under Test Auxiliary

module

DUTAuxiliary

synopsis

The Device Under Test auxiliary allow to flash and run test on the target using the connector provided.

class pykiso.lib.auxiliaries.dut_auxiliary.DUTAuxiliary(com=None, flash=None, **kwargs)[source]

Device Under Test(DUT) auxiliary implementation.

Constructor.

Parameters
  • name – Alias of the auxiliary instance

  • com (Optional[CChannel]) – Communication connector

  • flash (Optional[Flasher]) – flash connector

create_instance()[source]

Create DUT auxiliary instance.

Overridden from base interface in order to use the TX and RX tasks, and not duplicate auxiliary method. Execute directly the ping-pong to initiate the communication with the DUT.

Return type

bool

Returns

True if the auxiliary is created and ping-pong successful otherwise False

Raises

AuxiliaryCreationError – if instance creation failed

evaluate_report(report_msg)[source]

Evaluate the report type and log the appropriated message.

Parameters

report_msg (Message) – reeceived report message

Return type

None

evaluate_response(response)[source]

Evaluate if the received message is knowned and type of report.

Note

if a log message type is received just log it

Parameters

response (Message) – reeceived response

Return type

bool

Returns

True if the response is a report otherwise False

send_abort_command(*arg: tuple, **kwargs: dict) bool[source]

Based on the run_command method return, force the auxiliary to create a brand new communication stream with the DUT (call of delete/create instance).

Parameters
  • self – aux instance

  • arg (tuple) – positional arguments

  • kwargs (dict) – named arguments

Return type

bool

Returns

True if the command was acknowledged otherwise False

send_fixture_command(*arg: tuple, **kwargs: dict) bool[source]

Check if an ACK message was received and if the token is valid.

Parameters
  • self – aux instance

  • arg (tuple) – positional arguments

  • kwargs (dict) – named arguments

Return type

bool

Returns

True if the command was acknowledged otherwise False

send_ping_command(*arg: tuple, **kwargs: dict) bool[source]

Check if an ACK message was received and if the token is valid.

Parameters
  • self – aux instance

  • arg (tuple) – positional arguments

  • kwargs (dict) – named arguments

Return type

bool

Returns

True if the command was acknowledged otherwise False

wait_and_get_report(blocking=False, timeout_in_s=0)[source]

Wait for the report coming from the DUT.

Parameters
  • blocking (bool) – True: wait for timeout to expire, False: return immediately

  • timeout_in_s (int) – if blocking, wait the defined time in seconds

Return type

Optional[Message]

Returns

if a report is received return it otherwise None

pykiso.lib.auxiliaries.dut_auxiliary.check_acknowledgement(func)[source]

Check ifthe DUT has acknowledge the previous sent command.

Parameters

func (Callable) – decorated method

Return type

Callable

Returns

decorator inner function

pykiso.lib.auxiliaries.dut_auxiliary.restart_aux(func)[source]

Force he auxiliary restart if the command is not acknowledge

Parameters

func (Callable) – decorated method

Return type

Callable

Returns

decorator inner function

pykiso.lib.auxiliaries.dut_auxiliary.retry_command(tries)[source]

Force to resend the command a define number of times in case of failure.

Parameters

tries (int) – maximum number of try to get the acknowledgement from the DUT

Return type

Callable

Returns

inner decorator function