Test-ZrLease
Runs a self-contained validation of Zaris lease behavior against the connected store, emitting a pass/fail record for each check plus a summary.
Syntax
Test-ZrLease [-ConnectionString <string>] [-StoreName <string>] [-Endpoints <string[]>] [-TimeoutSec <int>]
Description
Test-ZrLease exercises the full lease lifecycle against the connected Zaris store: it grants leases, binds keys to them, and verifies grant, expiry-driven key removal, keep-alive renewal, and revocation. Each check writes a result object (Test, Success), and a final summary object (Total, Passed, Failed, Success) is emitted at the end. Use it as a smoke test of lease semantics on a store.
The cmdlet takes no workload parameters. It requires an active connection (Connect-ZrStore) or a one-shot independent connection supplied through -StoreName and -Endpoints. Because it grants short-lived leases and waits for them to expire, a run takes several seconds.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
-ConnectionString | String | No | Connect via a Zaris connection string, e.g. zaris://host:7861/store; an alternative to -StoreName + -Endpoints for a one-shot connection. Ignored when a Connect-ZrStore session is active. |
-StoreName | String | No | Store to operate on for a one-shot independent connection instead of the active Connect-ZrStore context. Belongs to the Independent parameter set; use together with -Endpoints. |
-Endpoints | String[] | No | One or more store node endpoints (host:port) for an independent connection. Only the first endpoint is used as the seed. Ignored when a Connect-ZrStore session is active. |
-TimeoutSec | Int32 | No | Connection timeout, in seconds, for an independent connection. Range 1–120. Default 5. |
The individual checks emitted are GrantLease, KeyExistsBeforeExpiry, LeaseExpiryRemovesKey, GrantLease2, KeepAliveExtendsLease, GrantLease3, and RevokeRemovesKey.
Examples
Run the lease validation suite against the connected store:
Test-ZrLease
Run the suite against a store using a one-shot connection:
Test-ZrLease -ConnectionString "zaris://10.0.0.11:7861/orders"