mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-09-25 17:23:35 +00:00
Add per-profile TX routing and bridge filtering
Persist Companion TX preferences per contact and channel. Default repeater, room, and sensor replies to both active TX profiles, with a reply-only force option for an RX-only secondary profile. Track both reply copies before a temporary-radio handoff and account for OTA copies under queue backpressure. Add bridge/crossover filter modes and the third built-in wardriving filter, plus compact filter CLI syntax, documentation, and CI coverage. Fix quoted target names being interpreted as slot/key selectors, partial recovery of invalid saved reply settings, filter suspension during tempradio2, and unnecessary packet allocation while OTA traffic is throttled. Validation: 1,477 native tests, 52 Python integration tests, 29 filter UI tests, and five firmware builds covering ESP32, nRF52, and STM32 passed.
This commit is contained in:
@@ -367,4 +367,27 @@ test("flags remote-login reach, future-type, spoofing, and policy-stop risks", (
|
||||
assert.ok(tool.ruleWarnings(sender).some((warning) => /spoofable/.test(warning)));
|
||||
});
|
||||
|
||||
test("factory has three rules with independent radio and transport decisions", () => {
|
||||
const rules = tool.EXAMPLES.factory;
|
||||
assert.strictEqual(rules.length, 3);
|
||||
for (const via of ["radio", "bridge", "cross"]) {
|
||||
for (const hops of [0, 4, 5, 63]) {
|
||||
const facts = packet({ channel: "#wardriving", via, hops });
|
||||
assert.strictEqual(tool.simulatePolicy(rules, facts).decision.drop,
|
||||
via !== "radio" || hops >= 5);
|
||||
assert.strictEqual(tool.simulatePolicy(rules,
|
||||
{ ...facts, channel: "#other", tempRadio: true }).decision.drop, false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
test("combined transport selector survives readable and bundle round trips", () => {
|
||||
const rule = tool.EXAMPLES.factory[2];
|
||||
const definition = tool.buildDefinition(rule);
|
||||
assert.ok(definition.includes("via=bridge,cross"));
|
||||
assert.strictEqual(tool.parseDefinition(definition).via, "bridge,cross");
|
||||
assert.strictEqual(tool.decodeBundle(tool.encodeBundle([rule]))[0].via, "bridge,cross");
|
||||
assert.strictEqual(tool.normalizeRule({ ...rule, via: "cross,bridge" }).via, "bridge,cross");
|
||||
});
|
||||
|
||||
process.stdout.write(`# ${passed} filter-policy playground tests passed\n`);
|
||||
|
||||
Reference in New Issue
Block a user