[roads] QA F-05 and F-06: classic custom blocks, and roads across address families
F-05: plan.custom took classic from the road only, so a raw block on a classic device without classic: true was labelled post-quantum. The device's flag now counts too, as it already did for peers. F-06: a device has one mesh address, so a can-reach road from IPv4 devices to an IPv6 place compiled to rules that could never match, silently. Those devices now get nothing for that road, and the road is reported inactive (road.family) naming them.
This commit is contained in:
@@ -42,6 +42,7 @@ fn inactive_code(code: &str) -> bool {
|
||||
rules::ROAD_SELF,
|
||||
rules::EXIT_CONFLICT,
|
||||
rules::DIRECT_KILL_SWITCH,
|
||||
rules::ROAD_FAMILY,
|
||||
]
|
||||
.contains(&code)
|
||||
}
|
||||
@@ -242,6 +243,29 @@ fn generated(baseline: &[u8]) -> BTreeSet<String> {
|
||||
);
|
||||
}
|
||||
hit.insert(rules::STORE_ROADS.into());
|
||||
// road.family: an IPv4 subject to an IPv6 subnet needs an IPv6 route in devices.json (QA F-06).
|
||||
let v6 = Parts::home()
|
||||
.edit_devices(|d| {
|
||||
d.replace(
|
||||
r#""routes": ["192.168.100.0/24"]"#,
|
||||
r#""routes": ["192.168.100.0/24", "fd00:1::/64"]"#,
|
||||
)
|
||||
})
|
||||
.with_road(
|
||||
"b00004-mark-v6.md",
|
||||
"---\nid: b00004\nsubject: person:mark\nverb: can-reach\nobject: subnet:fd00:1::/64\ncreated: 2026-11-25T10:00:00Z\n---\n",
|
||||
);
|
||||
let c = v6.compile();
|
||||
let hit_family = c
|
||||
.problems
|
||||
.iter()
|
||||
.find(|p| p.path == "roads/b00004-mark-v6.md" && p.code == rules::ROAD_FAMILY);
|
||||
assert!(
|
||||
hit_family.is_some_and(|p| !p.is_error() && p.field.as_deref() == Some("object")),
|
||||
"{:?}",
|
||||
c.problems
|
||||
);
|
||||
hit.insert(rules::ROAD_FAMILY.into());
|
||||
hit
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user