fix(grpc-data): X0 node-side re-validation tolerates only the reserved bits; runtime logger via init property

P02 GrpcDataArtifactReadTests pins an arbitrary bit (1<<30) as a malformed row that fails closed; keep that and
tolerate only DataOperationSets.Reserved. P07 GrpcDataHotRouteContinuityTests reflects over the runtime constructor
shape, so the logger moves from a ctor parameter to an init property.
This commit is contained in:
Joseph Doherty
2026-11-23 17:52:54 -05:00
parent a5ef7ea6d8
commit 75cf5eb8f7
4 changed files with 31 additions and 11 deletions
@@ -13,7 +13,7 @@ namespace ZB.MOM.WW.OtOpcUa.Configuration.Tests.DataConnections;
[Trait("Category", "Unit"), Trait("Feature", "GrpcData"), Trait("Phase", "X0")]
public sealed class GrpcDataReservedOperationAuthoringTests
{
public static TheoryData<int> ReservedBits => new(32, 64, 128, 256, 512, 1 << 20);
public static TheoryData<int> ReservedBits => new(32, 64, 128, 256, 512);
[Theory]
[MemberData(nameof(ReservedBits))]
@@ -47,6 +47,21 @@ public sealed class GrpcDataReservedOperationAuthoringTests
DataConnectionValidator.ValidateDeployed(wider).ShouldContain(x => x.Code == "DataMappingOperationsInvalid");
}
[Theory]
[InlineData(1 << 10)]
[InlineData(1 << 30)]
public void A_bit_outside_v1_and_the_reservation_is_malformed_in_both_modes(int bit)
{
// Nothing can author it (no release reserves it), so node-side it stays a malformed row, as before X0
// (GrpcDataArtifactReadTests pins 1 << 30 failing closed).
foreach (var errors in new[] { DataConnectionValidator.Validate(Snapshot(DataOperations.Read | (DataOperations)bit)),
DataConnectionValidator.ValidateDeployed(Snapshot(DataOperations.Read | (DataOperations)bit)) })
{
errors.ShouldContain(x => x.Code == "DataConnectionOperationsInvalid");
errors.ShouldContain(x => x.Code == "DataExportOperationsInvalid");
}
}
private static DraftSnapshot Snapshot(DataOperations operations) => new()
{
GenerationId = 1, ClusterId = "local",