Automation and testing
Write scenarios and assertions
A scenario uses schemaVersion 1, a descriptive name, a decimal-string seed, a positive durationMs, an actions array, and an assertions array. Each action needs a unique id, atMs within the scenario duration, a supported kind, and at least one valid agent ID. Equal-time actions retain document order; agents selected by an action execute in sorted ID order.
Action kind | Additional fields |
start or stop | agentIds |
applyOverrides | values; optional dataContextId |
clearOverrides | Optional dataContextId |
applyFault | fault object |
clearFault | faultId |
sendTrap | trapName |
A failed action fails the run and stops its agents. Pause and resume are external lifecycle controls, not scenario action kinds. Reset ends the scenario. Before starting another scenario, leave the lab stopped; every scenario starts from a reset baseline.
Assertions select an agentId and count matching events during [fromMs,toMs): the start time is included and the end time is excluded. min sets the minimum count; optional max sets the maximum. Omit the time fields to cover the run. Specify dataContextId when you need to distinguish recordings.
Assertion kind | What it measures |
requestCount | Authorized, decoded requests; optional oid, numeric pduType, and context filters. |
outagePacketCount | Packets discarded during an outage, including discovery traffic. OID and PDU filters do not apply to undecoded packets. |
setValue | Incoming SET requests matching an expected typed value. Does not prove that the SET was applied. |
responseErrorCount | Transmitted responses; optional errorStatus filter. |
trapAttemptCount | Notification attempts. |
trapSentCount | Local UDP notification transmissions. Does not establish receiver delivery. |
informAckCount | Successful INFORM responses. |
For setValue, provide expected using the same oid/type/value encoding as an override. For a successful read-value check, use your SNMP manager or test client to verify the returned value; requestCount checks traffic, not returned object values.