/staf:test-runnerfrom staf
Executes STAF tests via sap_automation_qa.sh for SAP systems. Supports direct Ansible execution and API mode for running HA tests, configuration checks, and test jobs.
Ships in staf. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Executes STAF tests via the framework's sap_automation_qa.sh CLI. Supports two modes: direct
Ansible execution and API-driven job management.
This skill requires a trusted STAF checkout — a working tree the
operator has verified out-of-band as either the official upstream
(https://github.com/Azure/sap-automation-qa.git) or a fork of it, at a
specific revision, with the framework marker ./scripts/sap_automation_qa.sh
present. The operator must have verified both the source (upstream URL or
fork URL) and the revision through a trusted out-of-band channel before
running this skill, and must have cd-ed into that directory. If that
state is not confirmed, stop and use the setup-guide skill first; it owns
the setup workflow. Do not resume this skill until setup-guide (or the
operator directly) confirms the checkout is trusted.
⚠️ This skill is guidance only. Do NOT modify any source code, scripts, or framework files. Only help the user by running test commands and interpreting output.
| Trigger | Action |
|---|---|
run test / execute ha test | Run specific HA test cases |
run configuration check | Run config validation |
start test / test my system | Determine and run appropriate tests |
trigger test job | Create API job |
list running tests | Check job status via API |
schedule test | Create cron schedule |
Run tests directly via Ansible (no API server required).
./scripts/sap_automation_qa.sh --test-groups=<GROUP> [--test-cases=[case1,case2]] [FLAGS]
| Group | Description |
|---|---|
HA_DB_HANA | HANA Database HA tests (15 cases) |
HA_SCS | SAP Central Services HA tests (13 cases) |
BACKUP_DB_HANA | Azure Backup for HANA (5 cases) |
| Flag | Description |
|---|---|
-v / -vv / -vvv | Verbosity level |
--offline | Run offline validation (no live cluster) |
--extra-vars='{...}' | Pass extra variables as JSON |
| Flag | Description |
|---|---|
--test-type=TYPE | SAPFunctionalTests or ConfigurationChecks |
--system-config=NAME | System configuration name |
--functional-test-type=TYPE | e.g., DatabaseHighAvailability |
--auth-type=TYPE | SSHKEY or VMPASSWORD |
--workspaces-dir=DIR | Workspaces directory (default: WORKSPACES) |
--telemetry-destination=DEST | azureloganalytics or azuredataexplorer |
--identity-client-id=ID | User-assigned managed identity client ID |
# Run all HANA HA tests
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA
# Run specific test cases
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config,primary-node-crash]
# Run SCS tests
./scripts/sap_automation_qa.sh --test-groups=HA_SCS
# Run Azure Backup tests
./scripts/sap_automation_qa.sh --test-groups=BACKUP_DB_HANA
# Run configuration checks (via CLI flag, no vars.yaml change needed)
./scripts/sap_automation_qa.sh --test-type=ConfigurationChecks --system-config=DEV-WEEU-SAP01-X00 --auth-type=SSHKEY
# Run specific config check type
./scripts/sap_automation_qa.sh --test-type=ConfigurationChecks --system-config=DEV-WEEU-SAP01-X00 --extra-vars='{"configuration_test_type":"Database"}'
# Offline HA validation (no cluster interaction)
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config-offline] --offline
# Verbose output
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config] -vv
Create a directory for ad-hoc log captures:
mkdir -p logs/
Capture stdout and stderr to a timestamped file while still printing to the terminal:
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA --test-cases=[ha-config] 2>&1 | tee logs/run_$(date +%Y%m%d_%H%M%S).log
Redirect all output silently to a file:
./scripts/sap_automation_qa.sh --test-groups=HA_DB_HANA 2>&1 > logs/run_$(date +%Y%m%d_%H%M%S).log
The framework writes logs automatically during every execution:
| Log Type | Path |
|---|---|
| Structured results (JSON lines) | WORKSPACES/SYSTEM/{name}/logs/{invocation_id}.log |
| Raw Ansible output | WORKSPACES/SYSTEM/{name}/logs/execution_{timestamp}.log |
For API-driven runs, stream logs and events in real time:
# Tail the job log
./scripts/sap_automation_qa.sh job log --id <JOB_ID>
# Stream SSE events
./scripts/sap_automation_qa.sh job events --id <JOB_ID>
When running configuration checks, use --test-type=ConfigurationChecks CLI flag or set TEST_TYPE=ConfigurationChecks in vars.yaml. Use --extra-vars to select a specific check type:
| Type | Description |
|---|---|
all | Run all configuration checks |
Database | Database instance checks |
CentralServiceInstances | SCS/ERS checks |
ApplicationInstances | PAS/APP checks |
WebDispatcherInstances | Web Dispatcher checks |
ObserverInstances | Observer checks |
Requires the FastAPI server running (Docker or local uvicorn).
./scripts/sap_automation_qa.sh health
# List all workspaces
./scripts/sap_automation_qa.sh workspace
# Get specific workspace
./scripts/sap_automation_qa.sh workspace --id <WORKSPACE_ID>
# Create a job
./scripts/sap_automation_qa.sh job create --workspace <WS> --test-group <GROUP> [--test-ids id1,id2]
# List jobs
./scripts/sap_automation_qa.sh job list [--workspace <WS>] [--status running] [--active]
# Get job details
./scripts/sap_automation_qa.sh job get --id <JOB_ID>
# Get job log
./scripts/sap_automation_qa.sh job log --id <JOB_ID> [--tail N]
# Stream job events (SSE)
./scripts/sap_automation_qa.sh job events --id <JOB_ID>
# Cancel a job
./scripts/sap_automation_qa.sh job cancel --id <JOB_ID> [--reason "text"]
API test group names:
DatabaseHighAvailability (maps to HA_DB_HANA)CentralServicesHighAvailability (maps to HA_SCS)AzureBackupDatabase (maps to BACKUP_DB_HANA)# Create schedule
./scripts/sap_automation_qa.sh schedule create --name "Nightly HA" --cron "0 2 * * *" --workspaces WS1[,WS2]
# List schedules
./scripts/sap_automation_qa.sh schedule list
# Get schedule details
./scripts/sap_automation_qa.sh schedule get --id <SCHEDULE_ID>
# Update schedule
./scripts/sap_automation_qa.sh schedule update --id <SCHEDULE_ID> [--cron "..."] [--enabled true]
# Delete schedule
./scripts/sap_automation_qa.sh schedule delete --id <SCHEDULE_ID>
# Trigger immediately
./scripts/sap_automation_qa.sh schedule trigger --id <SCHEDULE_ID>
# View schedule job history
./scripts/sap_automation_qa.sh schedule jobs --id <SCHEDULE_ID> [--limit N]
Full test case reference: references/test-catalog.md
Result file paths (JSON lines log, Ansible execution log, HTML report) are
canonical in the test-result-analyzer skill; see its ## Result File Locations section.
| Error | Cause | Fix |
|---|---|---|
Workspace not found | Invalid SYSTEM_CONFIG_NAME in vars.yaml | Check workspace exists |
SSH connection failed | Auth or network issue | Validate SSH key, check connectivity |
vars.yaml not found | Missing config | Create vars.yaml at project root or use CLI flags |
API not reachable | Server not running | Stop this skill and invoke setup-guide to start or restore the API/container. setup-guide owns the setup workflow; do not run setup.sh, docker compose, or any container-start command from this skill. Resume this skill only after setup-guide (or the operator directly) confirms the API is reachable. |
Job already running | Workspace locked | Wait for completion or cancel existing job |
Test case not found | Invalid test-case name | Check test-catalog.md for valid names |
Before reporting test execution complete:
| Need to... | Use skill |
|---|---|
| Set up environment first | setup-guide |
| Create a workspace | workspace-creator |
| Validate workspace before running | workspace-validator |
| Analyze test results | test-result-analyzer |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/setup-guideGuide for setting up the SAP Testing Automation Framework itself on a management server — Python venv, Docker, vars.yaml, Copilot integration. Use for framework installation, not for creating a workspace for a specific SAP system (see workspace-creator). Use when asked about installation, setup, Docker deployment, or Copilot integration. Triggered by "setup environment", "install staf", "how to get started", "container start", "setup.sh", "configure vars.yaml", "setup help", or "docker deployment".
/test-result-analyzerAnalyze STAF test results and identify root causes. Use when asked about test failures, what went wrong, or to interpret test output. Triggered by "analyze results", "why did test fail", "test output", "check test status", "read test log", "interpret report", or "what happened in test".
/npx claudepluginhub azure/sap-automation-qa --plugin stafOther plugins' skills for the same job