8. simulated_auxiliary
8.1. Virtual DUT simulation package
- module
simulated_auxiliary
- synopsis
provide a simple interface to simulate a device under test
This auxiliary can be used as a simulated version of a device under test.
The intention is to set up a pair of CChannels like a pipe, for example a
CCUdpServer
and a CCUdp
bound to the same address.
One side of this pipe is then connected to this virtual auxiliary,
the other one to a real auxiliary.
The SimulatedAuxiliary
will then receive messages
from the real auxiliary just like a proper TestApp on a DUT would and answer them according to a predefined
playbook.
Each predefined playbooks are linked with real auxiliary received messages, using test case and test suite ids
(see simulation
).
A so called playbook, is a basic list of different Message
instances where the content
is adapted to the current context under test (simulate a communication lost, a test case run failure…).
(see scenario
).
In order to increase playbook configuration flexibility, predefined and reusable responses are located
into response_templates
.
|
Simulated Auxiliary |
Simulation |
|
Scenario |
|
|
ResponseTemplates |
8.1.1. Simulated Auxiliary
- module
simulated_auxiliary
- synopsis
auxiliary used to simulate a virtual Device Under Test(DUT)
8.1.2. Simulation
- module
simulation
- synopsis
map virtual DUT behavior with test case/suite id
Warning
Still under test
- class pykiso.lib.auxiliaries.simulated_auxiliary.simulation.Simulation[source]
Simulate a virtual DUT, by playing pre-defined scenario depending on test case and test suite id.
Initialize attributes and mapping.
- get_scenario(test_suite_id, test_case_id)[source]
Return the selected scenario mapped with the received test case and test suite id.
- Parameters
test_suite_id (
int
) – current test suite idtest_case_id (
int
) – current test case id
- Return type
- Returns
scenario instance containing all steps
8.1.3. Scenario
- module
scenario
- synopsis
base object used to create pre-defined virtual DUT scenario.
Warning
Still under test
- class pykiso.lib.auxiliaries.simulated_auxiliary.scenario.Scenario(initlist=None)[source]
Container used to create pre-defined virtual DUT scenario.
- class pykiso.lib.auxiliaries.simulated_auxiliary.scenario.TestScenario[source]
Encapsulate all possible test’s scenarios.
- class VirtualTestCase[source]
Used to gather all virtual DUT test case scenarios based on their fixture level (setup, run, teardown).
- class Run[source]
Used to gather all possible scenarios linked to a test case run execution.
- classmethod handle_failed_report_run()[source]
Return a scenario to handle a complete test case with failed report at run phase.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_failed_report_run_with_log()[source]
Return a scenario to handle a complete test case with failed log and report at run phase.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_run_ack()[source]
Return a scenario to handle a complete test case with lost of communication during ACK to run Command.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_run_report()[source]
Return a scenario to handle a complete test case with lost of communication during report to run Command.
- Return type
- Returns
Scenario instance containing all steps
- class Setup[source]
Used to gather all possible scenarios linked to a test case setup execution.
- classmethod handle_failed_report_setup()[source]
Return a scenario to handle a complete test case with failed report at setup phase.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_setup_ack()[source]
Return a scenario to handle a complete test case with lost of communication during ACK to setup Command.
- Return type
- Returns
Scenario instance containing all steps
- class Teardown[source]
Used to gather all possible scenarios linked to a test case teardown execution.
- classmethod handle_failed_report_teardown()[source]
Return a scenario to handle a complete test case with failed report at teardown phase.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_teardown_ack()[source]
Return a scenario to handle a complete test case with lost of communication during ACK to teardown Command.
- Return type
- Returns
Scenario instance containing all steps
- class VirtualTestSuite[source]
Used to gather all virtual DUT test suite scenarios based on their fixture level (setup, teardown).
- class Setup[source]
Used to gather all possible scenarios linked to a test suite setup execution.
- classmethod handle_failed_report_setup()[source]
Return a scenario to handle a test suite setup with report failed.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_setup_ack()[source]
Return a scenario to handle a lost of communication during ACK to setup command.
- Return type
- Returns
Scenario instance containing all steps
- class Teardown[source]
Used to gather all possible scenarios linked to a test suite teardown execution.
- classmethod handle_failed_report_teardown()[source]
Return a scenario to handle a test suite teardown with report failed.
- Return type
- Returns
Scenario instance containing all steps
- classmethod handle_lost_communication_during_teardown_ack()[source]
Return a scenario to handle a lost of communication during ACK to teardown command.
- Return type
- Returns
Scenario instance containing all steps
8.1.4. ResponseTemplates
- module
response_templates
- synopsis
Used to create a set of predefined messages
Warning
Still under test
- class pykiso.lib.auxiliaries.simulated_auxiliary.response_templates.ResponseTemplates[source]
Used to create a set of predefined messages (ACK, NACK, REPORT …).
- classmethod ack_with_logs_and_report_nok(msg)[source]
Return an acknowledge message and log messages and report message with verdict failed + tlv part with failure reason.
- param msg
current received message
- return
list of Message
- Return type
List
[Message
]
- classmethod ack_with_logs_and_report_ok(msg)[source]
Return an acknowledge message and log messages and report message with verdict pass.
- param msg
current received message
- return
list of Message
- Return type
List
[Message
]
- classmethod ack_with_report_nok(msg)[source]
Return an acknowledgment message and a report message with verdict failed + tlv part with failure reason.
- classmethod ack_with_report_not_implemented(msg)[source]
Return an acknowledge message and a report message with verdict test not implemented.
- classmethod ack_with_report_ok(msg)[source]
Return an acknowledgment message and a report message with verdict pass.
- classmethod default(msg)[source]
handle default response, if not test case/suite run just return ACK message otherwise ACK + REPORT.