mirror of
https://github.com/OPCFoundation/UA-.NETStandard.git
synced 2026-10-17 05:11:13 +08:00
06ae192084
## Summary - stabilize the History, authentication lockout, Robotics, redundancy, and DI tests reported in #4301-#4305 - fix the closed-transport buffered-write completion deadlock that hung `ConnectMultipleSessionsAsync` - add macOS crash diagnostics for #4306 and retain evidence for root-cause analysis - run macOS tests and NativeAOT in GitHub Actions pull requests, using supported Intel and ARM64 runners, while keeping every Azure macOS definition disabled by default - move all remaining source-level `InternalsVisibleTo` declarations into project files so signed OpenUSD builds receive the repository public key ## Local validation - MCP PubSub: 29 passed - History focused tests: 3 passed - Sessions lockout: 3 passed - Sessions multiple-session regression: 3 passed - deterministic binary client channel tests: 22 passed - Robotics runtime: 34 passed - Redundancy focused tests: 4 passed - OpenUSD net10.0: 914 passed - affected OpenUSD projects build on net10.0 and net48 Refs #4299, #4300, #4306 Fixes #4301 Fixes #4302 Fixes #4303 Fixes #4304 Fixes #4305 --------- Copilot-Session: 7cb486de-8b4c-43c5-a900-e7d2e0ad04a8
70 lines
3.0 KiB
C#
70 lines
3.0 KiB
C#
/* ========================================================================
|
|
* Copyright (c) 2005-2026 The OPC Foundation, Inc. All rights reserved.
|
|
*
|
|
* OPC Foundation MIT License 1.00
|
|
*
|
|
* Permission is hereby granted, free of charge, to any person
|
|
* obtaining a copy of this software and associated documentation
|
|
* files (the "Software"), to deal in the Software without
|
|
* restriction, including without limitation the rights to use,
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
* copies of the Software, and to permit persons to whom the
|
|
* Software is furnished to do so, subject to the following
|
|
* conditions:
|
|
*
|
|
* The above copyright notice and this permission notice shall be
|
|
* included in all copies or substantial portions of the Software.
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
*
|
|
* The complete license agreement can be found here:
|
|
* http://opcfoundation.org/License/MIT/1.00/
|
|
* ======================================================================*/
|
|
|
|
using System.Collections.Generic;
|
|
using NUnit.Framework;
|
|
|
|
namespace Opc.Ua.Redundancy.Samples.Tests
|
|
{
|
|
[TestFixture]
|
|
[Category("Unit")]
|
|
internal sealed class SampleTestEnvironmentTests
|
|
{
|
|
[Test]
|
|
public void BuildFastDemoUsesLoopbackEndpointAndInsecureDemoKey()
|
|
{
|
|
IReadOnlyDictionary<string, string?> env = SampleTestEnvironment.BuildFastDemo();
|
|
Assert.Multiple(() =>
|
|
{
|
|
Assert.That(
|
|
env.TryGetValue("PUBSUB_ENDPOINT", out string? endpoint),
|
|
Is.True);
|
|
Assert.That(endpoint, Is.Not.Null.And.StartsWith("opc.udp://127.0.0.1:"),
|
|
"PUBSUB_ENDPOINT must use the loopback address with a dynamically allocated port.");
|
|
Assert.That(
|
|
env.TryGetValue("HA_INSECURE", out string? insecure),
|
|
Is.True);
|
|
Assert.That(insecure, Is.EqualTo("true"));
|
|
});
|
|
}
|
|
|
|
[Test]
|
|
public void BuildFastDemoAllocatesDistinctUdpPortsPerCall()
|
|
{
|
|
IReadOnlyDictionary<string, string?> envA = SampleTestEnvironment.BuildFastDemo();
|
|
IReadOnlyDictionary<string, string?> envB = SampleTestEnvironment.BuildFastDemo();
|
|
|
|
Assert.That(envA.TryGetValue("PUBSUB_ENDPOINT", out string? endpointA), Is.True);
|
|
Assert.That(envB.TryGetValue("PUBSUB_ENDPOINT", out string? endpointB), Is.True);
|
|
Assert.That(endpointA, Is.Not.EqualTo(endpointB),
|
|
"Each BuildFastDemo call must produce a unique endpoint so parallel children do not share a port.");
|
|
}
|
|
}
|
|
}
|