fix(adminui): flip remaining ModbusTcp test seeds + doc comments to Modbus (review)

This commit is contained in:
Joseph Doherty
2026-06-16 19:51:56 -04:00
parent bec37848d5
commit a40c77de87
8 changed files with 11 additions and 11 deletions
@@ -21,7 +21,7 @@ public sealed class DriverInstance
/// <summary>Gets or sets the friendly name of this driver instance.</summary> /// <summary>Gets or sets the friendly name of this driver instance.</summary>
public required string Name { get; set; } public required string Name { get; set; }
/// <summary>Galaxy | ModbusTcp | AbCip | AbLegacy | S7 | TwinCat | Focas | OpcUaClient</summary> /// <summary>Galaxy | Modbus | AbCip | AbLegacy | S7 | TwinCat | Focas | OpcUaClient</summary>
public required string DriverType { get; set; } public required string DriverType { get; set; }
/// <summary>Gets or sets a value indicating whether this driver instance is enabled.</summary> /// <summary>Gets or sets a value indicating whether this driver instance is enabled.</summary>
@@ -17,7 +17,7 @@ public interface IDriver
/// <summary>Stable logical ID of this driver instance, sourced from the central config DB.</summary> /// <summary>Stable logical ID of this driver instance, sourced from the central config DB.</summary>
string DriverInstanceId { get; } string DriverInstanceId { get; }
/// <summary>Driver type name (e.g. "Galaxy", "ModbusTcp", "AbCip"). Matches <c>DriverInstance.DriverType</c>.</summary> /// <summary>Driver type name (e.g. "Galaxy", "Modbus", "AbCip"). Matches <c>DriverInstance.DriverType</c>.</summary>
string DriverType { get; } string DriverType { get; }
/// <summary>Initialize the driver from its <c>DriverConfig</c> JSON; open connections; prepare for first use.</summary> /// <summary>Initialize the driver from its <c>DriverConfig</c> JSON; open connections; prepare for first use.</summary>
@@ -18,7 +18,7 @@ namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions;
/// </remarks> /// </remarks>
public interface IDriverConfigEditor public interface IDriverConfigEditor
{ {
/// <summary>Driver type name this editor handles (e.g. "Galaxy", "ModbusTcp").</summary> /// <summary>Driver type name this editor handles (e.g. "Galaxy", "Modbus").</summary>
string DriverType { get; } string DriverType { get; }
/// <summary> /// <summary>
@@ -52,7 +52,7 @@ public sealed class DraftValidatorTests
{ {
GenerationId = 1, ClusterId = "c-A", GenerationId = 1, ClusterId = "c-A",
Namespaces = [new Namespace { NamespaceId = "ns-1", ClusterId = "c-B", NamespaceUri = "urn:x", Kind = NamespaceKind.Equipment }], Namespaces = [new Namespace { NamespaceId = "ns-1", ClusterId = "c-B", NamespaceUri = "urn:x", Kind = NamespaceKind.Equipment }],
DriverInstances = [new DriverInstance { DriverInstanceId = "d-1", ClusterId = "c-A", NamespaceId = "ns-1", Name = "drv", DriverType = "ModbusTcp", DriverConfig = "{}" }], DriverInstances = [new DriverInstance { DriverInstanceId = "d-1", ClusterId = "c-A", NamespaceId = "ns-1", Name = "drv", DriverType = "Modbus", DriverConfig = "{}" }],
}; };
var errors = DraftValidator.Validate(draft); var errors = DraftValidator.Validate(draft);
@@ -67,7 +67,7 @@ public sealed class DraftValidatorTests
{ {
GenerationId = 1, ClusterId = "c-A", GenerationId = 1, ClusterId = "c-A",
Namespaces = [new Namespace { NamespaceId = "ns-1", ClusterId = "c-A", NamespaceUri = "urn:x", Kind = NamespaceKind.Equipment }], Namespaces = [new Namespace { NamespaceId = "ns-1", ClusterId = "c-A", NamespaceUri = "urn:x", Kind = NamespaceKind.Equipment }],
DriverInstances = [new DriverInstance { DriverInstanceId = "d-1", ClusterId = "c-A", NamespaceId = "ns-1", Name = "drv", DriverType = "ModbusTcp", DriverConfig = "{}" }], DriverInstances = [new DriverInstance { DriverInstanceId = "d-1", ClusterId = "c-A", NamespaceId = "ns-1", Name = "drv", DriverType = "Modbus", DriverConfig = "{}" }],
}; };
DraftValidator.Validate(draft).ShouldNotContain(e => e.Code == "BadCrossClusterNamespaceBinding"); DraftValidator.Validate(draft).ShouldNotContain(e => e.Code == "BadCrossClusterNamespaceBinding");
@@ -277,7 +277,7 @@ public sealed class AdminOperationsActorTests : ControlPlaneActorTestBase
/// triggers <c>BadCrossClusterNamespaceBinding</c> and routes to the Rejected branch through /// triggers <c>BadCrossClusterNamespaceBinding</c> and routes to the Rejected branch through
/// the actor — no coordinator dispatch, no Deployment row. /// the actor — no coordinator dispatch, no Deployment row.
/// Seeded: Namespace in cluster "MAIN" + DriverInstance in cluster "SITE-A" referencing that /// Seeded: Namespace in cluster "MAIN" + DriverInstance in cluster "SITE-A" referencing that
/// namespace. NamespaceKind.Equipment + DriverType "ModbusTcp" satisfies the compat rule so /// namespace. NamespaceKind.Equipment + DriverType "Modbus" satisfies the compat rule so
/// only the cross-cluster rule fires.</summary> /// only the cross-cluster rule fires.</summary>
[Fact] [Fact]
public void StartDeployment_rejects_on_cross_cluster_namespace_binding() public void StartDeployment_rejects_on_cross_cluster_namespace_binding()
@@ -300,7 +300,7 @@ public sealed class AdminOperationsActorTests : ControlPlaneActorTestBase
ClusterId = "SITE-A", ClusterId = "SITE-A",
NamespaceId = nsId, // cross-cluster: drv is SITE-A, ns is MAIN NamespaceId = nsId, // cross-cluster: drv is SITE-A, ns is MAIN
Name = "site-a-modbus", Name = "site-a-modbus",
DriverType = "ModbusTcp", // compatible with Equipment ns — no compat error DriverType = "Modbus", // compatible with Equipment ns — no compat error
DriverConfig = "{}", DriverConfig = "{}",
}); });
db.SaveChanges(); db.SaveChanges();
@@ -21,7 +21,7 @@ public sealed class DriverProbeRegistrationTests
// src/Server/.../Components/Pages/Clusters/Drivers/*DriverPage.razor. // src/Server/.../Components/Pages/Clusters/Drivers/*DriverPage.razor.
private static readonly string[] AdminUiDriverTypeKeys = private static readonly string[] AdminUiDriverTypeKeys =
[ [
"ModbusTcp", "Modbus",
"AbCip", "AbCip",
"AbLegacy", "AbLegacy",
"S7", "S7",
@@ -58,7 +58,7 @@ public sealed class DriverTestConnectE2eTests
var configJson = $"{{\"Host\":\"{host}\",\"Port\":{port}}}"; var configJson = $"{{\"Host\":\"{host}\",\"Port\":{port}}}";
var correlationId = Guid.NewGuid(); var correlationId = Guid.NewGuid();
var msg = new TestDriverConnect("ModbusTcp", configJson, TimeoutSeconds: 10, correlationId); var msg = new TestDriverConnect("Modbus", configJson, TimeoutSeconds: 10, correlationId);
var result = await client.AskAsync<TestDriverConnectResult>(msg, Ct); var result = await client.AskAsync<TestDriverConnectResult>(msg, Ct);
@@ -89,7 +89,7 @@ public sealed class DriverTestConnectE2eTests
var configJson = $"{{\"Host\":\"{host}\",\"Port\":9999}}"; var configJson = $"{{\"Host\":\"{host}\",\"Port\":9999}}";
var correlationId = Guid.NewGuid(); var correlationId = Guid.NewGuid();
var msg = new TestDriverConnect("ModbusTcp", configJson, TimeoutSeconds: 5, correlationId); var msg = new TestDriverConnect("Modbus", configJson, TimeoutSeconds: 5, correlationId);
var result = await client.AskAsync<TestDriverConnectResult>(msg, Ct); var result = await client.AskAsync<TestDriverConnectResult>(msg, Ct);
@@ -169,7 +169,7 @@ public sealed class MultiClusterScopingTests
ClusterId = clusterId, ClusterId = clusterId,
NamespaceId = namespaceId, NamespaceId = namespaceId,
Name = driverInstanceId, Name = driverInstanceId,
DriverType = "ModbusTcp", DriverType = "Modbus",
Enabled = true, Enabled = true,
DriverConfig = "{}", DriverConfig = "{}",
}; };