<< back

  1. Description

  2. Usage

  3. Example

  4. Basic

  5. Advanced

Description

Compare the obtained result with the expected one. This comparation process is registered into final report.

Usage

target 'Exist user obiwan'
run 'cat /etc/passwd'
expect 'root'

Use expect keyword to check output (from previous execution).

Example

Let's see some examples:

target 'Exist user obiwan'
run 'id obiwan'
expect 'obiwan' # Expect previous command output contains obiwan text

Basic

Advanced

After every execution keyword (run, on or goto), command outputs is saved by result object. Use result to create more complex evaluations.

For example, if we have this execution

target 'Exist user vader'
run    'cat /etc/passwd'

Then we check result with:

Read result documentation.