test(grpc-data): A2a smoke — address the UNS export root by EquipmentId + subject; publish tools and set the scenario deadline

This commit is contained in:
Joseph Doherty
2026-11-24 13:05:40 -05:00
parent 45a3eee9c8
commit d3a4e70f6f
2 changed files with 8 additions and 1 deletions
@@ -19,10 +19,15 @@ def main(argv=None):
parser.add_argument("--settle-seconds", type=int, default=8)
arguments = parser.parse_args(argv)
runner = scenarios.ScenarioRunner(arguments.run_id)
runner.active, runner.deadline = "A2a", time.monotonic() + 600
runner.publish()
runner.device("set", address=20, value=150)
time.sleep(arguments.settle_seconds)
output = runner.folder / "A2a-conditions-wire.json"
result = runner.process(["dotnet", str(runner.probe_dll), "--manifest", str(runner.manifest_path), "--scenario", "conditions",
# The UNS export root is the equipment, addressed by its catalog identifier (the EquipmentId).
"--equipment", runner.manifest["fixture"]["browse_roots"]["uns"],
"--subject", runner.manifest["fixture"]["browse_subjects"]["uns"],
"--output", str(output)], "A2a-conditions-wire", timeout=240)
wire = scenarios.restricted_json(output) if output.exists() else {"passed": False, "stderr": result.stderr[-4000:]}
runner.device("set", address=20, value=0)
@@ -256,7 +256,9 @@ try
// A2a smoke (opt-in conditions fixture): a root-scoped condition item on each SOURCE listener's UNS equipment root.
failurePhase = ProbeFailurePhase.WireOperation;
var unsUri = root.GetProperty("fixture").GetProperty("namespace_uris").GetProperty("uns").GetString()!;
// The UNS export root: the equipment's catalog identifier (EquipmentId) and its subject (the area/line/equipment path).
var equipmentPath = arguments.GetValueOrDefault("--equipment", "area/line/plc");
var equipmentSubject = arguments.GetValueOrDefault("--subject", equipmentPath);
var deviceUrl = endpoints.GetProperty("device.control").GetProperty("url").GetString()!;
using var http = new HttpClient();
async Task SetScalar(int value)
@@ -266,7 +268,7 @@ try
response.EnsureSuccessStatusCode();
}
var equipmentView = new W.View { Address = new() { OriginClusterId = "SOURCE", NamespaceUri = unsUri, IdentifierKind = "string",
Identifier = equipmentPath }, Realm = (int)DataRealm.Uns, Subject = equipmentPath };
Identifier = equipmentPath }, Realm = (int)DataRealm.Uns, Subject = equipmentSubject };
static object Record(W.ConditionState r) => new
{
key = r.ConditionKey, r.Version, r.Removed, r.StateKnown, r.Active, r.Acknowledged, r.Severity, r.Message,