test(abcip): differential stops on first connection failure, paces + caps requests, reserves array/UDT slots, fails vacuous template parity; write tests opt-in (Task 18 review r1)
This commit is contained in:
+26
@@ -0,0 +1,26 @@
|
||||
using Xunit;
|
||||
|
||||
namespace ZB.MOM.WW.OtOpcUa.Driver.AbLegacy.IntegrationTests;
|
||||
|
||||
/// <summary>
|
||||
/// Opt-in gate for every integration test that WRITES to the endpoint under test. A write test runs only
|
||||
/// when <c>AB_SERVER_ALLOW_WRITES=1</c>, in addition to its own reachability / profile conditions, so
|
||||
/// pointing an endpoint variable at a real controller (a production press in Task 21) can never write to
|
||||
/// it by accident. It also refuses while <c>AB_DIFF_ENDPOINT</c> is set, because that variable means a
|
||||
/// read-only differential run is in progress. The ab_server / simulator runs set the opt-in explicitly.
|
||||
/// </summary>
|
||||
public static class IntegrationWriteGate
|
||||
{
|
||||
public const string AllowWritesVar = "AB_SERVER_ALLOW_WRITES";
|
||||
public const string DifferentialEndpointVar = "AB_DIFF_ENDPOINT";
|
||||
|
||||
/// <summary>Skips the calling test unless writes are explicitly allowed for this run.</summary>
|
||||
public static void SkipUnlessWritesAllowed()
|
||||
{
|
||||
if (Environment.GetEnvironmentVariable(DifferentialEndpointVar) is { Length: > 0 })
|
||||
Assert.Skip($"Write test refused: {DifferentialEndpointVar} is set, so a read-only differential run is in progress.");
|
||||
if (Environment.GetEnvironmentVariable(AllowWritesVar) != "1")
|
||||
Assert.Skip($"Write test: set {AllowWritesVar}=1 to allow writes to the endpoint under test " +
|
||||
"(simulator runs only — never a production controller).");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user