test(grpc-data): X0 v1 gate pins Write without a write grant (per-item RejectedBeforeDispatch bytes, recorded on the pre-X0 service)
This commit is contained in:
+14
@@ -133,6 +133,20 @@ public sealed class GrpcDataV1CompatibilityTests
|
||||
failure.Trailers.ShouldBeEmpty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// v1 Write without a write grant is not an RpcException: each item is answered RejectedBeforeDispatch in the body
|
||||
/// (after a serving re-check). Those bytes are pinned like the other goldens, with and without the header.
|
||||
/// </summary>
|
||||
[Theory]
|
||||
[InlineData("")]
|
||||
[InlineData("history,conditions")]
|
||||
public async Task Write_without_a_write_grant_rejects_each_item_before_dispatch_with_the_v1_bytes(string header)
|
||||
{
|
||||
var headers = header.Length == 0 ? new Metadata() : new Metadata { { "x-otopcua-data-features", header } };
|
||||
var actual = await V1CompatibilityHarness.DriveAsync("Write", headers, DataOperationSets.V1 & ~DataOperations.Write);
|
||||
actual.ShouldBe(GrpcDataV1Goldens.Responses["Write/no-write-grant"]);
|
||||
}
|
||||
|
||||
internal static string Hex(byte[] bytes) => Convert.ToHexString(bytes);
|
||||
|
||||
/// <summary>X0: no field varies. Add explicit, listed normalisations here only if a later phase needs one.</summary>
|
||||
|
||||
@@ -25,5 +25,7 @@ internal static class GrpcDataV1Goldens
|
||||
["Read"] = "0A480A0272311001180120809F492A3A0A04080518541A0608C0D590D806220B08C0D590D8061080E59A772A1B0A046E6F64651204626F6F741A075072696D61727920012801300130070A110A02723210021803320744656E6965642E121B0A046E6F64651204626F6F741A075072696D617279200128013001",
|
||||
["Write"] = "0A060A02773110020A1B0A0277321001188080D08108220D556E6B6E6F776E206E6F64652E121B0A046E6F64651204626F6F741A075072696D617279200128013001",
|
||||
["Subscribe"] = "0A057375622D311001180122310A066F70656E2D3112270A066974656D2D3110011A0D0A057375622D31100118012001220C08C096B1021080ADE2041802421B0A046E6F64651204626F6F741A075072696D617279200128013001|0A057375622D31100118022A0A08011202100318012001421B0A046E6F64651204626F6F741A075072696D617279200128013001|0A057375622D311001180332530801124F0A0D0A057375622D31100118012001123A0A04080518541A0608C0D590D806220B08C0D590D8061080E59A772A1B0A046E6F64651204626F6F741A075072696D617279200128013001300718002001421B0A046E6F64651204626F6F741A075072696D617279200128013001|0A057375622D31100118042A10080212021003180120012A04646F6E65421B0A046E6F64651204626F6F741A075072696D617279200128013001",
|
||||
// Write with the origin lacking the Write grant (recorded on pre-X0 DataConnectionGrpcService).
|
||||
["Write/no-write-grant"] = "0A300A0277311001188080C481082222577269746520756E617661696C61626C65206265666F72652064697370617463682E0A300A0277321001188080C481082222577269746520756E617661696C61626C65206265666F72652064697370617463682E121B0A046E6F64651204626F6F741A075072696D617279200128013001",
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user