using Shouldly; using Xunit; using ZB.MOM.WW.OtOpcUa.Driver.AbCip; namespace ZB.MOM.WW.OtOpcUa.Driver.AbCip.IntegrationTests; /// /// PR abcip-5.2 — integration scaffold for HSBY failover routing through /// . Skipped by default because the paired /// fixture (controllogix-secondary ab_server instance + hsby-mux /// sidecar that flips the role tag on demand) is not yet stable in the Docker /// compose layout. The scaffold lives here so: /// /// The trait is discoverable by dotnet test --filter "Category=Hsby". /// The companion E2E script (scripts/e2e/test-abcip-hsby.ps1) has a /// paired surface already wired in tests when an operator stands up the fixture /// manually. /// A future PR can flip the skip into a real assertion without restructuring /// the test layout. /// /// The unit-level coverage in AbCipHsbyFailoverTests (in the unit tests /// project) exercises the active-address-routing + cache-invalidation contract in /// full against the FakeAbCipTagFactory; this scaffold is just the wire-level shape. /// [Trait("Category", "Hsby")] [Trait("Requires", "AbServer")] public sealed class AbCipHsbyFailoverTests { [AbServerFact] public Task ResolveHost_routes_to_partner_after_role_flip_through_hsby_mux() { // The paired-fixture compose service (controllogix + controllogix-secondary + // hsby-mux sidecar at http://localhost:7080) is not yet wired. When it ships, // the test body will: // 1. POST {"active": "primary"} to hsby-mux → assert ResolveHost = primary // gateway via a CLI read. // 2. POST {"active": "partner"} → wait for the probe loop to catch up → // assert ResolveHost = partner gateway via a second CLI read. // 3. Assert AbCip.HsbyFailoverCount on the driver's diagnostics // ≥ 1 by reading the driver-diagnostics RPC through the OPC UA Admin // surface. Assert.Skip("HSBY paired fixture (controllogix-secondary + hsby-mux sidecar) " + "not yet promoted out of scaffold. Run scripts/e2e/test-abcip-hsby.ps1 against a " + "manually-stood-up paired fixture when verifying this PR end-to-end."); return Task.CompletedTask; } }