Child pages
  • Simulation Mode

This is the documentation of the latest development version of automaIT. The documentation of the latest stable release can be found at AUTOMAIT.

Skip to end of metadata
Go to start of metadata

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.

Modes

In the web interface and CLI the following modes are available:

  • 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.

Working Principle

Process Executions

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".

<execNative>
  <assignOutput varName="varOutput" />
  <assignStatus varName="varStatus" />
  <exec cmd="myCommand" />
  <successCriteria status="42" />
</execNative>
<echo message="output=:[varOutput] status=:[varStatus]" />

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.

ForEach Loops

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.

  • No labels