Skip to Content
ReferenceAssertion Types

Assertion Types

Canonical reference for assertions executed inside a provisioned test VM. Unless noted, the target is primary. Each assertion also requires a human readable description.

Stable guest assertions

TypeRequired paramsOptional behavior
user_existsusernameRuns id
user_passwordusernameVerifies an unlocked password hash exists; it does not attempt an interactive login
user_in_groupusername, groupAccepts Vyatta administrative equivalents when checking sudo/admin
file_existspathAccepts a file or directory
file_containspath, pattern or contentUses grep; the value is a grep pattern, not a literal-only comparison
file_permissionspath, modeCompares the octal mode reported by stat
service_runningserviceChecks systemd active state; knows a small cross-distro alias set
service_enabledserviceChecks systemd enablement
package_installedpackageChecks the guest’s supported package-manager database
port_listeningportprotocol may be tcp or udp; default is TCP
command_succeedscommandExit code must be zero; timeout_seconds/timeout is clamped to 1–1,800 seconds
command_outputcommand plus a regex in expected_pattern, pattern, expected, or the assertion-level expectedMatches stdout with Python regular-expression semantics
network_reachablehostcount defaults to 3; uses ICMP ping
http_respondsurlstatus defaults to 200

Example:

{ "type": "command_output", "description": "Application reports the expected release", "params": { "command": "/opt/acme/bin/acme --version", "expected_pattern": "^acme 2\\.4\\.[0-9]+$" } }

The command and captured output can become test evidence. Do not embed secrets.

GUI assertions

GUI checks depend on a working display session and the runner’s screenshot or input helpers. They are more environment-sensitive than guest command checks.

TypePrincipal parametersWhat it checks
gui_application_opensapplication (canonical); handler also accepts launch-specific optionsStarts an application and looks for a window
gui_window_visiblewindow-title or matching parameters used by the handlerLooks for an existing window
gui_execute_commandcommandExecutes a desktop command; can capture a screenshot
gui_application_processprocess_nameLooks for the process as a headless fallback
gui_screenshot_matchesreference_id; optional threshold, crop/mask regionsCompares the current screenshot with a stored reference
gui_wallpaper_matcheswallpaper_path; optional thresholds and regionsChecks the configured wallpaper path and visual result
desktop_wallpaper_matcheswallpaper_pathRuns the stricter desktop-wallpaper provenance/configuration/visual check
gui_click_elementx, ySends coordinate-based pointer input
gui_form_fillfieldsFills coordinate-described form inputs
gui_text_visibletext, contains, or ocr_containsUses OCR on the screen or a selected region

The executor also accepts compatibility aliases for some OCR and wallpaper types. Prefer the canonical names above in new recipes. Coordinate tests are resolution-sensitive; use OCR or outcome checks where possible.

Benchmark checks are a separate format

cis_benchmark appears in the recipe’s historical assertion vocabulary, but the ordinary assertion dispatcher has no cis_benchmark handler. CIS and other benchmark checks are supplied as benchmark records with an audit_script and execute through the benchmark runner. Use the CIS benchmark workflow, not a custom assertion with type: "cis_benchmark".

Result interpretation

  • Missing required data yields error, or the planner may drop the assertion with a warning before execution.
  • An unavailable on_vm target yields skipped.
  • A non-matching result yields failed.
  • Only passed is affirmative evidence for that assertion.

See Custom assertions for authoring guidance.