Skip to Content
ReferenceТипи assertions

Типи assertions

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

Stable guest assertions

TypeRequired paramsOptional behavior
user_existsusernameRuns id
user_passwordusernameVerifies unlocked password hash exists; does not attempt interactive login
user_in_groupusername, groupAccepts Vyatta administrative equivalents when checking sudo/admin
file_existspathAccepts file or directory
file_containspath, pattern or contentUses grep; value is grep pattern, not literal-only comparison
file_permissionspath, modeCompares octal mode reported by stat
service_runningserviceChecks systemd active state; knows small cross-distro alias set
service_enabledserviceChecks systemd enablement
package_installedpackageChecks guest supported package-manager database
port_listeningportprotocol may be tcp or udp; default is TCP
command_succeedscommandExit code must be zero; timeout_seconds/timeout clamped to 1–1,800 seconds
command_outputcommand plus regex in expected_pattern, pattern, expected, or 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]+$" } }

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

GUI assertions

GUI checks depend on working display session and runner screenshot or input helpers. More environment-sensitive than guest command checks.

TypePrincipal parametersWhat it checks
gui_application_opensapplication (canonical); handler also accepts launch-specific optionsStarts application and looks for window
gui_window_visiblewindow-title or matching parameters used by handlerLooks for existing window
gui_execute_commandcommandExecutes desktop command; can capture screenshot
gui_application_processprocess_nameLooks for process as headless fallback
gui_screenshot_matchesreference_id; optional threshold, crop/mask regionsCompares current screenshot with stored reference
gui_wallpaper_matcheswallpaper_path; optional thresholds and regionsChecks configured wallpaper path and visual result
desktop_wallpaper_matcheswallpaper_pathRuns 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 screen or selected region

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

Benchmark checks are separate format

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

Result interpretation

  • Missing required data yields error, or planner may drop assertion with warning before execution.
  • Unavailable on_vm target yields skipped.
  • Non-matching result yields failed.
  • Only passed is affirmative evidence for that assertion.

See Custom assertions for authoring guidance.