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.
- test_downlinkHandling.test_downlink_ambiguous_multi_storage_name_blocks_removal()[source]
Verify duplicate partition names across linked storage units force removal rate to zero.
- test_downlinkHandling.test_downlink_auto_receiver_selects_valid_rx_path()[source]
Verify auto receiver selection chooses a valid RX path with nonzero CNR.
- test_downlinkHandling.test_downlink_disabling_node_clears_diagnostics()[source]
Verify disabling the node zeroes downlink diagnostics instead of republishing stale values.
- test_downlinkHandling.test_downlink_duplicate_storage_message_is_rejected()[source]
Verify duplicate storage message registration is rejected by the module.
- test_downlinkHandling.test_downlink_forced_receiver_invalid_path_disables_link()[source]
Verify that forcing an unavailable receiver path yields no selected receiver and zero throughput.
- test_downlinkHandling.test_downlink_invalid_link_outputs_zero_flow()[source]
Verify invalid link inputs produce zero link-active flag and zero throughput.
- test_downlinkHandling.test_downlink_matches_python_equivalent()[source]
Verify C++ module outputs match the Python-equivalent BER/PER/ARQ model.
- test_downlinkHandling.test_downlink_missing_partition_name_blocks_removal()[source]
Verify selected partitions without explicit names do not publish removal commands.
- test_downlinkHandling.test_downlink_multi_storage_units_block_actual_removal_even_with_unique_names()[source]
Verify actual storage removal is blocked when more than one storage unit is linked.
- test_downlinkHandling.test_downlink_reenable_does_not_integrate_disabled_downtime()[source]
Verify re-enabling after several disabled ticks does not collapse off-time into one large downlink step.
- test_downlinkHandling.test_downlink_remove_delivered_only_retains_undelivered_bits()[source]
Verify delivered-only removal mode keeps dropped/undelivered bits onboard.
- test_downlinkHandling.test_downlink_retry_limit_changes_storage_draw_not_goodput()[source]
Verify higher retry caps reduce storage draw while preserving expected delivered-rate level.
- test_downlinkHandling.test_downlink_selects_largest_partition_across_storage_messages()[source]
Verify storage selection uses the largest partition across all linked storage status inputs.