Commit 2b4717e
authored
* Refactor mock server to support distributed configuration loading
Refactors the mock server implementation to support loading configuration from
multiple JSON files, enabling flexible mocking of different services during
Matter device commissioning validation.
Key Changes:
- Restructured configuration loading to support directory-based routing configs
- Added dataclass-based type safety for configuration and route definitions
- Updated path handling to use pathlib.Path for better cross-platform support
- Modified server launch configuration to support routing config directory
- Added configurations for mocking multiple services:
* Distributed Compliance Ledger (DCL)
* Product Terms & Conditions server
Technical Improvements:
- Introduced strongly typed Route and Configuration classes
- Simplified route matching logic with dedicated matcher
- Improved error handling for configuration loading
- Updated unit tests to support new configuration structure
The changes enable quick iteration of mock service responses during preproduction
testing and PlugFest validation, particularly for testing new commissioning
flows that rely on DCL-based configuration with indirect product server
references.
Test Configuration:
- Added example configurations for VID:65521/65522, PID:32769
- Updated TC URL endpoints to use port 44538
- Included sample Terms & Conditions responses
* server: Add validation checks for SSL certificate and key files
Add input validation to verify that SSL certificate and key files exist
and are regular files before attempting to create the SSL context.
This provides clearer error messages to users when certificate files
are missing or invalid, following the same validation pattern used for
config files.
1 parent f654bba commit 2b4717e
File tree
22 files changed
+1379
-253
lines changed- .github
- .vscode
- examples/chip-tool/commands/dcl
- integrations/mock_server
- configurations
- fake_distributed_compliance_ledger
- fake_product_server
- unittest
- src
- tests
22 files changed
+1379
-253
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
| |||
1039 | 1040 | | |
1040 | 1041 | | |
1041 | 1042 | | |
| 1043 | + | |
1042 | 1044 | | |
1043 | 1045 | | |
1044 | 1046 | | |
| |||
1150 | 1152 | | |
1151 | 1153 | | |
1152 | 1154 | | |
| 1155 | + | |
1153 | 1156 | | |
1154 | 1157 | | |
1155 | 1158 | | |
| |||
1326 | 1329 | | |
1327 | 1330 | | |
1328 | 1331 | | |
| 1332 | + | |
1329 | 1333 | | |
1330 | 1334 | | |
1331 | 1335 | | |
| |||
1490 | 1494 | | |
1491 | 1495 | | |
1492 | 1496 | | |
| 1497 | + | |
1493 | 1498 | | |
1494 | 1499 | | |
1495 | 1500 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
7 | 21 | | |
8 | 22 | | |
9 | 23 | | |
10 | 24 | | |
11 | | - | |
12 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
13 | 38 | | |
14 | 39 | | |
15 | 40 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
0 commit comments