Add Flask REST API test server for External System Gateway and Inbound API testing

This commit is contained in:
Joseph Doherty
2026-03-16 14:28:03 -04:00
parent 40610271d6
commit 0513a104a9
8 changed files with 593 additions and 7 deletions

View File

@@ -8,7 +8,7 @@ Local Docker-based test services for ScadaLink development.
docker compose up -d
```
This starts four services:
This starts five services:
| Service | Port | Purpose |
|---------|------|---------|
@@ -16,6 +16,7 @@ This starts four services:
| LDAP (GLAuth) | 3893 | Lightweight LDAP with test users/groups matching ScadaLink roles |
| MS SQL 2022 | 1433 | Configuration and machine data databases |
| SMTP (Mailpit) | 1025 (SMTP), 8025 (web) | Email capture for notification testing |
| REST API (Flask) | 5200 | External REST API for Gateway and Inbound API testing |
## First-Time SQL Setup
@@ -38,7 +39,7 @@ docker compose down
**Stop a single service** (leave the others running):
```bash
docker compose stop opcua # or: ldap, mssql, smtp
docker compose stop opcua # or: ldap, mssql, smtp, restapi
docker compose start opcua # bring it back without recreating
```
@@ -71,12 +72,13 @@ pip install -r tools/requirements.txt
> The `.venv` directory is gitignored.
**Quick readiness check** (all four services, with venv active):
**Quick readiness check** (all five services, with venv active):
```bash
python tools/opcua_tool.py check
python tools/ldap_tool.py check
python tools/mssql_tool.py check
python tools/smtp_tool.py check
python tools/restapi_tool.py check
```
| Tool | Service | Key Commands |
@@ -85,6 +87,7 @@ python tools/smtp_tool.py check
| `tools/ldap_tool.py` | LDAP | `check`, `bind`, `search`, `users`, `groups` |
| `tools/mssql_tool.py` | MS SQL | `check`, `setup`, `query`, `tables` |
| `tools/smtp_tool.py` | SMTP (Mailpit) | `check`, `send`, `list`, `read`, `clear` |
| `tools/restapi_tool.py` | REST API (Flask) | `check`, `call`, `methods` |
Each tool supports `--help` for full usage. See the per-service docs below for detailed examples.
@@ -97,3 +100,4 @@ See the project root for per-service setup guides:
- [test_infra_ldap.md](../test_infra_ldap.md) — LDAP server details
- [test_infra_db.md](../test_infra_db.md) — MS SQL database details
- [test_infra_smtp.md](../test_infra_smtp.md) — SMTP server details (Mailpit)
- [test_infra_restapi.md](../test_infra_restapi.md) — REST API server details (Flask)