Skip redundant modulation writes during owned fast RX retunes when the last acknowledged SF/BW/CR/LDRO tuple matches. Invalidate that cache after ordinary setters, failed writes, and lifecycle changes. Include the remaining scan, preamble, settling, and memory-soak experiments, their collectors, validation notes, and original capture records. Preserve capture bytes across checkouts and keep private soak credentials local. Run lab collector and compiled contract tests in CI. Update the expectation, profile mapping, and result-buffer tests for the extended lab tools, and make the private WiFi override header optional for ordinary soak diagnostics. Validation: 145 host tests passed from the staged source snapshot. Clean heltec_v4_repeater and Xiao_S3_WIO_companion_radio_usb builds passed their RAM/flash gates. All 229 staged capture files retain their original bytes; all 75 local documentation links resolve in the clean snapshot.
47 lines
1.8 KiB
Python
47 lines
1.8 KiB
Python
"""Stationary baseline payload integrity and separation from the hop scheduler."""
|
|
from pathlib import Path
|
|
import unittest
|
|
from test_radio_receive_contract import method
|
|
import test_sx1262_batched_modulation as compiler
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
|
|
|
|
class StationaryBaselineTests(unittest.TestCase):
|
|
compile_run = compiler.BatchedModulationTests.compile_run
|
|
|
|
def test_complete_payload_identity(self):
|
|
source = (ROOT / 'tools/hil/profile_stationary_baseline.h').read_text()
|
|
self.compile_run(r'''
|
|
#include <cassert>
|
|
#include <cstdint>
|
|
#include <cstring>
|
|
@METHOD@
|
|
int main() {
|
|
uint8_t bytes[16]; uint32_t seq=123;
|
|
memcpy(bytes,"CHS1",4);memcpy(bytes+4,&seq,4);bytes[8]=3;
|
|
for(unsigned i=9;i<16;++i) bytes[i]=uint8_t(i^seq);
|
|
assert(stationaryPayloadMatches(bytes,16,123,3));
|
|
assert(!stationaryPayloadMatches(bytes,15,123,3));
|
|
assert(!stationaryPayloadMatches(bytes,16,124,3));
|
|
assert(!stationaryPayloadMatches(bytes,16,123,2));
|
|
for(unsigned i=0;i<16;++i) {
|
|
bytes[i]^=1;assert(!stationaryPayloadMatches(bytes,16,123,3));bytes[i]^=1;
|
|
}
|
|
}
|
|
'''.replace('@METHOD@', method(source, 'bool stationaryPayloadMatches(')))
|
|
|
|
def test_no_retuning_or_rf_transmission_after_setup(self):
|
|
source = (ROOT / 'tools/hil/profile_stationary_baseline.h').read_text()
|
|
self.assertNotIn('transmit(', source)
|
|
for signature in ('void expectStationaryPacket(', 'void serviceStationaryBaseline('):
|
|
body = method(source, signature)
|
|
for forbidden in ('setFrequency(', 'std_init(', 'prepareDiagnosticRadio(', 'driver.hop('):
|
|
self.assertNotIn(forbidden, body)
|
|
self.assertIn('stationaryBaseline.rfStart=channelTrace.rfWrites', source)
|
|
self.assertIn('millis()+600000', source)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|