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:
- 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(timeout)[source]
Send abort command to the DUT.
Warning
if the DUT doesn’t acknowledge to the abort command the auxiliary is restarted, a brand new connection is established
- Parameters:
timeout (
int
) – how long to wait for an acknowledgement from the DUT (seconds)- Returns:
True if the command is acknowledged otherwise False
- send_fixture_command(command, timeout)[source]
Send command related to test execution (test case setup, test case run…) to the DUT.
- Parameters:
command (
Message
) – command to execute on DUT sidetimeout (
int
) – how long to wait for an acknowledgement from the DUT (seconds)
- Return type:
bool
- Returns:
True if the command is acknowledged otherwise False
- send_ping_command(timeout)[source]
Send ping command to the DUT.
- Parameters:
timeout (
int
) – how long to wait for an acknowledgement from the DUT (seconds)- Return type:
bool
- Returns:
True if the command is 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 immediatelytimeout_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