diff --git a/CHANGELOG.md b/CHANGELOG.md index f43e7b1..e50a30a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Updated to CAS BACnet Stack 6.x `83e04a2d` (6.1.2, 2026-12-02). + +### Fixed + +- On Windows, `tests/run_wire_tests.py` reports the three broadcast-capture Wire + Tests as SKIP (they need Linux or macOS) instead of FAILED, and still exits 0 + when every test that can run passes. + ## [1.2.1] - 2026-11-02 Built on CAS BACnet Stack 6.x (`1e7dffe2b`). diff --git a/README.md b/README.md index 12ea122..303361b 100644 --- a/README.md +++ b/README.md @@ -255,8 +255,8 @@ through your firewall. ## Verify **Automated, on the wire** - [`tests/`](tests/README.md) (Python 3 standard -library only; Linux/macOS - on Windows only `discovery_test.py`, `routing_table_test.py` -and `list_element_test.py` run, the others capture broadcasts). One command runs every Wire Test against the router +library only). On Windows the three scripts that capture the router's broadcasts are +reported as `SKIP`; run them on Linux or macOS. One command runs every Wire Test against the router you built; the device behind port 2 is simulated in Python by the tests: ```bash diff --git a/submodules/cas-bacnet-stack b/submodules/cas-bacnet-stack index 1e7dffe..83e04a2 160000 --- a/submodules/cas-bacnet-stack +++ b/submodules/cas-bacnet-stack @@ -1 +1 @@ -Subproject commit 1e7dffe2b8f4c2e74463e78749653abe2d4c85da +Subproject commit 83e04a2d9bbc8ec944c2474eac906f65e8a08a66 diff --git a/tests/README.md b/tests/README.md index 49cee78..d2b25a3 100644 --- a/tests/README.md +++ b/tests/README.md @@ -24,9 +24,11 @@ runs on its own with the same `--exe` / `--port` options. `--port` (default second socket on the router's own UDP port (and the Peer in `broadcast_forwarding_test.py` listens the same way). POSIX `SO_REUSEADDR` allows that; on Windows `common/` binds with `SO_EXCLUSIVEADDRUSE` on purpose, which refuses it, so -`routing_test.py`, `router_discovery_test.py` and `broadcast_forwarding_test.py` stop -at their first bind there. `discovery_test.py`, `routing_table_test.py` and -`list_element_test.py` run on Windows too. +`routing_test.py`, `router_discovery_test.py` and `broadcast_forwarding_test.py` cannot +run there: on Windows `run_wire_tests.py` reports them as `SKIP` and ends with +`ALL WIRE TESTS PASSED (3 skipped on this platform)`. `discovery_test.py`, +`configuration_test.py`, `routing_table_test.py` and `list_element_test.py` run on +Windows too. A `[KNOWN GAP]` line is a requirement the router does not meet yet because of a defect outside this example (the stack or `common/`). It is reported on every diff --git a/tests/run_wire_tests.py b/tests/run_wire_tests.py index 3ba604a..9e6d68e 100644 --- a/tests/run_wire_tests.py +++ b/tests/run_wire_tests.py @@ -6,8 +6,9 @@ python3 tests/run_wire_tests.py [--exe build/BACnetExampleBRTR] [--port 47880] Exit code 0 = every check in every script passed. [KNOWN GAP] lines are reported -but do not fail the run (TODO.md). Linux/macOS: three scripts capture the router's -broadcasts on its own UDP ports, which needs POSIX SO_REUSEADDR. +but do not fail the run (TODO.md). Three scripts capture the router's broadcasts +on its own UDP ports, which needs POSIX SO_REUSEADDR: on Windows they are +reported as SKIP (tests/README.md "Linux/macOS") and do not fail the run. """ import subprocess import sys @@ -18,13 +19,21 @@ TESTS = Path(__file__).resolve().parent SCRIPTS = ["discovery_test.py", "configuration_test.py", "routing_test.py", "router_discovery_test.py", "broadcast_forwarding_test.py", "routing_table_test.py", "list_element_test.py"] +# These bind a second socket on the router's own UDP port to see what it broadcasts. +# Windows refuses that (common/ binds with SO_EXCLUSIVEADDRUSE), so run them on Linux/macOS. +NEEDS_POSIX = {"routing_test.py", "router_discovery_test.py", "broadcast_forwarding_test.py"} def main(): args = setup.parser(__doc__).parse_args() outcomes = [] + skipped = [] for script in SCRIPTS: print(f"\n===== {script} =====", flush=True) + if sys.platform == "win32" and script in NEEDS_POSIX: + print("SKIP: captures the router's broadcasts, which needs Linux/macOS (tests/README.md)") + skipped.append(script) + continue run = subprocess.run([sys.executable, "-B", str(TESTS / script), "--exe", args.exe, "--port", str(args.port)], stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True) print(run.stdout, end="", flush=True) @@ -34,8 +43,11 @@ def main(): print("\n===== summary =====") for script, returncode, totals in outcomes: print(f"{'PASS' if returncode == 0 else 'FAIL'} {script:28} {totals}") + for script in skipped: + print(f"SKIP {script:28} needs Linux/macOS") failed = [script for script, returncode, _ in outcomes if returncode != 0] - print("ALL WIRE TESTS PASSED" if not failed else f"FAILED: {', '.join(failed)}") + passed = "ALL WIRE TESTS PASSED" + (f" ({len(skipped)} skipped on this platform)" if skipped else "") + print(passed if not failed else f"FAILED: {', '.join(failed)}") return 1 if failed else 0