64e3fbe035
v2-ci / build (push) Failing after 1m43s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>, <param>, <typeparam>, and <inheritdoc/> tags to public members surfaced by commentchecker — resolves 5,847 of 5,869 issues (99.6%) across three /fixdocs passes.
46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using Akka.Cluster;
|
|
using Shouldly;
|
|
using Xunit;
|
|
|
|
namespace ZB.MOM.WW.OtOpcUa.Host.IntegrationTests;
|
|
|
|
/// <summary>
|
|
/// Smoke test: verifies <see cref="TwoNodeClusterHarness"/> boots two nodes and they form
|
|
/// a 2-member cluster with the expected role topology. Failover + deploy scenarios layer
|
|
/// on top in Task 59.
|
|
/// </summary>
|
|
public sealed class ClusterFormationTests
|
|
{
|
|
/// <summary>Verifies that two nodes form a 2-member cluster.</summary>
|
|
[Fact]
|
|
public async Task Two_nodes_form_a_2_member_cluster()
|
|
{
|
|
await using var harness = await TwoNodeClusterHarness.StartAsync();
|
|
|
|
var aCluster = Akka.Cluster.Cluster.Get(harness.NodeASystem);
|
|
var bCluster = Akka.Cluster.Cluster.Get(harness.NodeBSystem);
|
|
|
|
aCluster.State.Members.Count(m => m.Status == MemberStatus.Up).ShouldBe(2);
|
|
bCluster.State.Members.Count(m => m.Status == MemberStatus.Up).ShouldBe(2);
|
|
|
|
var aRoles = aCluster.State.Members.SelectMany(m => m.Roles).Distinct().ToHashSet();
|
|
aRoles.ShouldContain("admin");
|
|
aRoles.ShouldContain("driver");
|
|
}
|
|
|
|
/// <summary>Verifies that both nodes see each other as role members.</summary>
|
|
[Fact]
|
|
public async Task Both_nodes_see_each_other_as_role_members()
|
|
{
|
|
await using var harness = await TwoNodeClusterHarness.StartAsync();
|
|
|
|
var aCluster = Akka.Cluster.Cluster.Get(harness.NodeASystem);
|
|
aCluster.State.Members
|
|
.Where(m => m.Roles.Contains("driver") && m.Status == MemberStatus.Up)
|
|
.Count().ShouldBe(2);
|
|
aCluster.State.Members
|
|
.Where(m => m.Roles.Contains("admin") && m.Status == MemberStatus.Up)
|
|
.Count().ShouldBe(2);
|
|
}
|
|
}
|