test(opcuaclient,mtconnect): live-fixture cases for the lane G1 fixes
Against opc-plc (opc.tcp://10.100.0.35:50000): a shutdown with three live subscriptions is bounded and the same instance re-initialises and reads (O-9 + lifecycle generation through the real SDK); a server-refused write (BadTypeMismatch) passes through and keeps the driver Healthy with its stamp advanced (health contract); the browse side-panel reports a live variable's type, shape and access (O-5). Against the MTConnect fixture Agent: the headers-only ping reaches it and fails on a dead port (T-7); a delivering /sample stream serves reads and reports its lag and effective count on the diagnostics bag (T-4/T-5). Refs #743 Claude-Session: https://claude.ai/code/session_01Ub9hGmYLQvn9XETzw7CMsT
This commit is contained in:
+24
-3
@@ -63,10 +63,10 @@ public sealed class OpcUaClientBrowseSessionTests
|
||||
children.ShouldNotBeNull();
|
||||
}
|
||||
|
||||
/// <summary>The OPC UA picker treats variables as terminal leaves, so
|
||||
/// AttributesAsync must always be empty for this driver.</summary>
|
||||
/// <summary>Review 2026-10-21 O-5: an Object (folder) has no value attributes, so AttributesAsync is empty for
|
||||
/// it. (It used to be empty for EVERYTHING — the side-panel was a stub; see the variable test below.)</summary>
|
||||
[Fact]
|
||||
public async Task AttributesAsync_is_empty_for_opcuaclient()
|
||||
public async Task AttributesAsync_is_empty_for_an_object_node()
|
||||
{
|
||||
OpcPlcProbe.SkipUnlessReachable();
|
||||
var ct = TestContext.Current.CancellationToken;
|
||||
@@ -75,4 +75,25 @@ public sealed class OpcUaClientBrowseSessionTests
|
||||
var attrs = await session.AttributesAsync("nsu=http://opcfoundation.org/UA/;i=85", ct);
|
||||
attrs.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Review 2026-10-21 O-5 against the live server: a standard variable (Server/ServerStatus/CurrentTime — a
|
||||
/// read-only scalar UtcTime every server exposes) reports its mapped type, shape and access.
|
||||
/// </summary>
|
||||
[Fact]
|
||||
public async Task AttributesAsync_reports_a_live_variables_type_shape_and_access()
|
||||
{
|
||||
OpcPlcProbe.SkipUnlessReachable();
|
||||
var ct = TestContext.Current.CancellationToken;
|
||||
var browser = new OpcUaClientDriverBrowser();
|
||||
await using var session = await browser.OpenAsync(ConfigJson, ct);
|
||||
|
||||
var attrs = await session.AttributesAsync("nsu=http://opcfoundation.org/UA/;i=2258", ct);
|
||||
|
||||
var a = attrs.ShouldHaveSingleItem();
|
||||
a.Name.ShouldBe("CurrentTime");
|
||||
a.DriverDataType.ShouldBe("DateTime");
|
||||
a.IsArray.ShouldBeFalse();
|
||||
a.SecurityClass.ShouldBe("ViewOnly");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user