Add configurable non-transparent OPC UA server redundancy

Separates ApplicationUri from namespace identity so each instance in a
redundant pair has a unique server URI while sharing the same Galaxy
namespace. Exposes RedundancySupport, ServerUriArray, and dynamic
ServiceLevel through the standard OPC UA server object. ServiceLevel
is computed from role (Primary/Secondary) and runtime health (MXAccess
and DB connectivity). Adds CLI redundancy command, second deployed
service instance, and 31 new tests including paired-server integration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-03-28 13:32:17 -04:00
parent a3c2d9b243
commit a55153d7d5
27 changed files with 1475 additions and 248 deletions

View File

@@ -0,0 +1,44 @@
using Shouldly;
using Xunit;
using ZB.MOM.WW.LmxOpcUa.Host.Configuration;
namespace ZB.MOM.WW.LmxOpcUa.Tests.Redundancy
{
public class RedundancyConfigurationTests
{
[Fact]
public void DefaultConfig_Disabled()
{
var config = new RedundancyConfiguration();
config.Enabled.ShouldBe(false);
}
[Fact]
public void DefaultConfig_ModeWarm()
{
var config = new RedundancyConfiguration();
config.Mode.ShouldBe("Warm");
}
[Fact]
public void DefaultConfig_RolePrimary()
{
var config = new RedundancyConfiguration();
config.Role.ShouldBe("Primary");
}
[Fact]
public void DefaultConfig_EmptyServerUris()
{
var config = new RedundancyConfiguration();
config.ServerUris.ShouldBeEmpty();
}
[Fact]
public void DefaultConfig_ServiceLevelBase200()
{
var config = new RedundancyConfiguration();
config.ServiceLevelBase.ShouldBe(200);
}
}
}