test_downlinkHandling

Unit tests for downlinkHandling.

Coverage: - Formula parity against the Python-equivalent BER/PER/ARQ model. - Zero-throughput behavior when link quality inputs are invalid. - Retry-cap effects on storage drawdown and packet drop probability. - Removal-policy behavior (attempted removal vs delivered-only removal). - Storage-limited operation and remaining-data estimate behavior. - Automatic receiver-path selection from linkBudget antenna states/CNR values.

Debug toggle: - Default is off. - Set BSK_DOWNLINK_TEST_DEBUG=1 to print case setup and actual-vs-expected metrics. - Or run this file directly with --debug.

Verify duplicate partition names across linked storage units force removal rate to zero.

Verify auto receiver selection chooses a valid RX path with nonzero CNR.

Verify disabling the node zeroes downlink diagnostics instead of republishing stale values.

Verify duplicate storage message registration is rejected by the module.

Verify that forcing an unavailable receiver path yields no selected receiver and zero throughput.

Verify invalid link inputs produce zero link-active flag and zero throughput.

Verify C++ module outputs match the Python-equivalent BER/PER/ARQ model.

Verify selected partitions without explicit names do not publish removal commands.

Verify actual storage removal is blocked when more than one storage unit is linked.

Verify re-enabling after several disabled ticks does not collapse off-time into one large downlink step.

Verify delivered-only removal mode keeps dropped/undelivered bits onboard.

Verify higher retry caps reduce storage draw while preserving expected delivered-rate level.

Verify storage selection uses the largest partition across all linked storage status inputs.

Check that module setters reject invalid values and preserve prior valid configuration.

Verify storage-limited operation caps removal rate and drains remaining data correctly.