chore: organize solution into module folders (Core/Server/Drivers/Client/Tooling)

Group all 69 projects into category subfolders under src/ and tests/ so the
Rider Solution Explorer mirrors the module structure. Folders: Core, Server,
Drivers (with a nested Driver CLIs subfolder), Client, Tooling.

- Move every project folder on disk with git mv (history preserved as renames).
- Recompute relative paths in 57 .csproj files: cross-category ProjectReferences,
  the lib/ HintPath+None refs in Driver.Historian.Wonderware, and the external
  mxaccessgw refs in Driver.Galaxy and its test project.
- Rebuild ZB.MOM.WW.OtOpcUa.slnx with nested solution folders.
- Re-prefix project paths in functional scripts (e2e, compliance, smoke SQL,
  integration, install).

Build green (0 errors); unit tests pass. Docs left for a separate pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-17 01:55:28 -04:00
parent 69f02fed7f
commit a25593a9c6
1044 changed files with 365 additions and 343 deletions

View File

@@ -0,0 +1,103 @@
# opc-plc Docker fixture
[Microsoft Industrial IoT's opc-plc](https://github.com/Azure-Samples/iot-edge-opc-plc)
— pinned Docker image that stands up an OPC UA server at
`opc.tcp://localhost:50000` with step-up counters, random nodes, alarm
simulation, and other canonical simulated shapes. Replaces the PowerShell
launcher pattern used by the Modbus / S7 fixtures — Docker is the launcher
here since opc-plc ships pre-containerized.
| File | Purpose |
|---|---|
| [`docker-compose.yml`](docker-compose.yml) | Service definition for `otopcua-opc-plc` — image pin, port map, command flags. |
| (this file) | How to run it. |
## Install
Docker Desktop (Windows) or the docker CLI + daemon (Linux/macOS). Per
`CLAUDE.md` Phase 1 decision #134 the dev box already has Docker Desktop
configured with the WSL 2 backend — nothing new to install.
## Run
From the repo root:
```powershell
docker compose -f tests\ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.IntegrationTests\Docker\docker-compose.yml up
```
Or from this folder:
```powershell
docker compose up
```
First run pulls the image (~250 MB). Startup takes ~5-10 seconds; the
healthcheck in the compose file surfaces ready state in `docker ps`.
To run detached (CI pattern):
```powershell
docker compose up -d
```
Stop with `docker compose down` (removes the container) or `docker compose stop`
(keeps it for fast restart).
## Endpoint
- Default: `opc.tcp://localhost:50000`
- Override by setting `OPCUA_SIM_ENDPOINT` before `dotnet test` — e.g. point
at a real OPC UA server in the lab, or at a different Docker host.
## What opc-plc advertises
Command flags in `docker-compose.yml` enable:
- `--pn=50000` — OPC UA endpoint on port 50000
- `--ut` — unsecured transport endpoint advertised (SecurityPolicy=None).
Secured policies are still on the endpoint list; `--ut` just adds an
unsecured option.
- `--aa` — auto-accept client certs (opc-plc's cert trust store lives
inside the container + resets each spin-up, so without this the driver's
first contact would be rejected).
- `--alm` — alarm simulation enabled; opc-plc publishes
`TripAlarmType`, `ExclusiveDeviationAlarmType`,
`NonExclusiveLevelAlarmType`, and `DialogConditionType` events.
Not turned on (but available via compose-file tweaks):
- `--daa` — disable anonymous auth; forces username or cert tokens. Flip
on when username-auth / cert-auth smoke tests land.
- `--fn` / `--fr` / `--ft` — fast-node variants (100 / 1 000 / 10 000 Hz
update rates) for subscription-stress coverage. Not needed for smoke.
- `--sn` / `--sr` — slow-node / special-shape coverage.
## Run the integration tests
In a separate shell, with the simulator running:
```powershell
cd C:\Users\dohertj2\Desktop\lmxopcua
dotnet test tests\ZB.MOM.WW.OtOpcUa.Driver.OpcUaClient.IntegrationTests
```
Tests auto-skip with a clear `SkipReason` when `localhost:50000` isn't
reachable within 2 seconds (`OpcPlcFixture`).
## Known limitations
opc-plc uses the OPCFoundation.NetStandard stack internally — same as
our driver. That means bugs common to the stack itself are **not** caught
by this fixture; the follow-up to add `open62541/open62541` as a second
independent-stack image (task tracked in #215's follow-ups) would close
that.
See [`docs/drivers/OpcUaClient-Test-Fixture.md`](../../../docs/drivers/OpcUaClient-Test-Fixture.md)
for the full coverage map + what's still trusted from field deployments.
## References
- [opc-plc GitHub](https://github.com/Azure-Samples/iot-edge-opc-plc)
- [mcr.microsoft.com/iotedge/opc-plc tags](https://mcr.microsoft.com/v2/iotedge/opc-plc/tags/list)
- [`docs/drivers/OpcUaClient-Test-Fixture.md`](../../../docs/drivers/OpcUaClient-Test-Fixture.md)

View File

@@ -0,0 +1,45 @@
# opc-plc — OPC UA PLC simulator from Microsoft Industrial IoT.
# https://github.com/Azure-Samples/iot-edge-opc-plc
#
# Why pinned: MCR tags only go forward; keeping the suite reproducible means
# we test against a known feature surface. Bump deliberately alongside a
# driver-side change that needs the newer image.
services:
opc-plc:
image: mcr.microsoft.com/iotedge/opc-plc:2.14.10
container_name: otopcua-opc-plc
restart: "no"
ports:
- "50000:50000"
command:
# --pn: Bind port 50000 (opc-plc default; matches fixture default)
# --ut: Advertise an Unsecured transport endpoint (SecurityPolicy=None).
# Tests that need signed/encrypted endpoints pick those off the
# negotiated endpoint list separately — opc-plc always advertises
# the secure policies even with --ut on.
# --aa: Auto-accept client certs. Tests wouldn't otherwise survive the
# first contact because opc-plc's cert trust store lives inside
# the container + resets each spin-up.
# --daa: Disable anonymous auth — forces the driver to go through the
# Anonymous user-token policy negotiation rather than opc-plc's
# "no auth required" short-circuit. Would flip to username/cert
# if we needed that coverage.
# Commented out for first-pass smoke; flip on when the cert-auth
# and username-auth smoke tests land.
# --alm: Turn on alarm simulation (TripAlarm / ExclusiveDeviation /
# NonExclusiveLevel / DialogCondition). Closes the IAlarmSource
# gap the OpcUaClient-Test-Fixture doc calls out.
- "--pn=50000"
- "--ut"
- "--aa"
- "--alm"
# - "--daa"
healthcheck:
# opc-plc doesn't expose an HTTP health endpoint by default; use a TCP
# probe via a shell the base image ships with. The fixture does its own
# TCP probe but healthcheck surfaces status in `docker ps` for humans.
test: ["CMD-SHELL", "netstat -an | grep -q ':50000.*LISTEN' || exit 1"]
interval: 5s
timeout: 2s
retries: 10
start_period: 10s