auxiliary
Auxiliary common Interface Definition
- module
auxiliary
- synopsis
base auxiliary interface
- class pykiso.auxiliary.AuxiliaryCommon[source]
Class use to encapsulate all common methods/attributes for both multiprocessing and thread auxiliary interface.
Auxiliary common attributes initialization.
- abort_command(blocking=True, timeout_in_s=25)[source]
Force test to abort.
- Parameters
blocking (
bool
) – If you want the command request to be blocking or nottimeout_in_s (
float
) – Number of time (in s) you want to wait for an answer
- Return type
bool
- Returns
True - Abort was a success / False - if not
- create_copy(*args, **config)[source]
Create a copy of the actual auxiliary instance with the new desired configuration.
Note
only named arguments have to be used
Warning
the call of create_copy will automatically suspend the current auxiliary until the it copy is destroyed
- Parameters
config (
dict
) – new desired auxiliary configuration- Return type
- Returns
a brand new auxiliary instance
- Raises
Exception – if positional parameters is given or unknown named parameters are given
- destroy_copy()[source]
Stop the current auxiliary copy and resume the original.
Warning
stop the copy auxiliary will automatically start the base/original one
- Return type
None
- lock_it(timeout_in_s)[source]
Lock to ensure exclusivity.
- Parameters
timeout_in_s (
float
) – How many second you want to wait for the lock- Return type
bool
- Returns
True - Lock done / False - Lock failed
- run_command(cmd_message, cmd_data=None, blocking=True, timeout_in_s=0)[source]
Send a test request.
- Parameters
cmd_message (
Union
[Message
,bytes
,str
]) – command request to the auxiliarycmd_data (
Optional
[Any
]) – data you would like to populate the command withblocking (
bool
) – If you want the command request to be blocking or nottimeout_in_s (
int
) – Number of time (in s) you want to wait for an answer
- Return type
bool
- Returns
True - Successfully sent / False - Failed by sending / None
- wait_and_get_report(blocking=False, timeout_in_s=0)[source]
Wait for the report of the previous sent test request.
- 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
Union
[Message
,bytes
,str
]- Returns
a message.Message() - Message received / None - nothing received