The simulation mode checks for possible errors quickly by assuming execution paths per host. This allows finding errors before actually executing jobs which might be long running and will always fail because of these errors. The simulation does not modify any environments.
- Simulation and Execution (Standard): both will be executed in sequence. If an error occurs during simulation, the execution will not be started on this host.
- Simulation only: Only the simulation will be executed.
- Execution only: Only the execution will be executed.
These modes are available for:
- plan execution
- component installation
- instance method execution
- instance deinstallation
Additionally, host initialization will always simulate before execution.
During simulation the results of execNatives (stdout, stderr, status) are unknown. In simulation mode all process executions are assumed to be successful. Outputs are simulated by setting these to "<undefined>" and these are marked as "undefined".
If the expected status is given and the "inverse" attribute is not set, then the simulation will assume this status.
The following example will print "output=<undefined> status=42".
If-Then-Else Control Sequences
The execution path is unknown during simulation.
However, the following rules are applied:
- If undefined values are used in conditions of "if" the simulation will execute the "then" branch. If an error occurs during the execution of the "then" branch, then the "else" branch is executed as well.
- If at least one operand of an or-operator returns "true" then any undefined values are ignored because they are not relevant.
- If at least one operand of an and-operator returns "false" then any undefined values are ignored because they are not relevant.
Switch-Case Sontrol Sequences
If the switch value is known during simulation the content is evaluated exactly as during execution. If an undefined value is used as switch value the whole switch-case block is ignored during simulation.
As in switch-case blocks the forEach block will be exactly evaluated if the iteration elements are all known. However, if the elements contain an undefined value then the content of the forEach statement is ignored during simulation.
Host and Instance Locking
These locking modes are not supported during simulation.
By default the connect to a host is executed, but can be turned off by using the property simulation.locking.host.connect.