feat(quirks): add MS-7D70 (X670E CARBON WIFI) DMI profile

This commit is contained in:
2026-08-05 14:45:39 +03:00
parent ec09b7d990
commit dc2fda2a89
@@ -927,22 +927,33 @@ mod tests {
fn dmi_toml_ms_7d70_from_real_quirks_file_matches_and_lg_does_not() {
// Load the real 50-system.toml from the redbear-quirks recipe.
let path = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../../../../recipes/system/redbear-quirks/source/quirks.d/50-system.toml")
.canonicalize()
.expect("canonicalize 50-system.toml path");
let content = std::fs::read_to_string(&path).expect("read 50-system.toml");
let doc = content
.parse::<toml::Value>()
.expect("parse 50-system.toml");
.join("../../../../recipes/system/redbear-quirks/source/quirks.d/50-system.toml");
let canonical = path.canonicalize();
assert!(
canonical.is_ok(),
"canonicalize 50-system.toml path: {:?}",
canonical.err()
);
let canonical = canonical.unwrap();
let content = std::fs::read_to_string(&canonical);
assert!(content.is_ok(), "read 50-system.toml: {:?}", content.err());
let content = content.unwrap();
let doc = content.parse::<toml::Value>();
assert!(doc.is_ok(), "parse 50-system.toml: {:?}", doc.err());
let doc = doc.unwrap();
let (rules, _system_rules) = parse_both(&doc);
let ms_7d70 = rules
.iter()
.find(|r| {
r.dmi_match.sys_vendor.as_deref() == Some("Micro-Star International Co., Ltd.")
&& r.dmi_match.board_name.as_deref() == Some("MS-7D70")
})
.expect("MS-7D70 dmi_system_quirk entry present in 50-system.toml");
let ms_7d70 = rules.iter().find(|r| {
r.dmi_match.sys_vendor.as_deref() == Some("Micro-Star International Co., Ltd.")
&& r.dmi_match.board_name.as_deref() == Some("MS-7D70")
});
assert!(
ms_7d70.is_some(),
"MS-7D70 dmi_system_quirk entry present in 50-system.toml"
);
let ms_7d70 = ms_7d70.unwrap();
assert!(ms_7d70.flags.is_empty());
assert_eq!(ms_7d70.vendor, PCI_QUIRK_ANY_ID);
assert_eq!(ms_7d70.device, PCI_QUIRK_ANY_ID);