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>
45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
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);
|
|
}
|
|
}
|
|
}
|