#![cfg(test)]
use luwen::pci::detect_chips;
mod tests {
use super::*;
#[test]
#[ignore = "Requires hardware with the ability to recover a broken SPI"]
fn blackhole_test_boardcfg_tag() {
let devices = detect_chips().unwrap();
let bh = devices[0].as_bh().unwrap();
let tag_read = bh.get_boot_fs_tables_spi_read("boardcfg").unwrap();
assert!(tag_read.is_some(), "boardcfg tag should be present");
let (_, fd) = tag_read.unwrap();
assert_eq!(fd.image_tag_str(), "boardcfg", "Tag name should match");
assert!(!fd.flags.invalid(), "Tag should not be marked as invalid");
}
#[test]
#[ignore = "Requires hardware with the ability to recover a broken SPI"]
fn blackhole_test_flshinfo_tag() {
let devices = detect_chips().unwrap();
let bh = devices[0].as_bh().unwrap();
let tag_read = bh.get_boot_fs_tables_spi_read("flshinfo").unwrap();
assert!(tag_read.is_some(), "flshinfo tag should be present");
let (_, fd) = tag_read.unwrap();
assert_eq!(fd.image_tag_str(), "flshinfo", "Tag name should match");
assert!(!fd.flags.invalid(), "Tag should not be marked as invalid");
}
#[test]
#[ignore = "Requires hardware with the ability to recover a broken SPI"]
fn blackhole_test_cmfwcfg_tag() {
let devices = detect_chips().unwrap();
let bh = devices[0].as_bh().unwrap();
let tag_read = bh.get_boot_fs_tables_spi_read("cmfwcfg").unwrap();
assert!(tag_read.is_some(), "cmfwcfg tag should be present");
let (_, fd) = tag_read.unwrap();
assert_eq!(fd.image_tag_str(), "cmfwcfg", "Tag name should match");
assert!(!fd.flags.invalid(), "Tag should not be marked as invalid");
}
#[test]
#[ignore = "Requires hardware with the ability to recover a broken SPI"]
fn blackhole_test_origcfg_tag() {
let devices = detect_chips().unwrap();
let bh = devices[0].as_bh().unwrap();
let tag_read = bh.get_boot_fs_tables_spi_read("origcfg").unwrap();
if tag_read.is_none() {
println!("SKIPPED: No origcfg tag");
return;
}
let (_, fd) = tag_read.unwrap();
assert_eq!(fd.image_tag_str(), "origcfg", "Tag name should match");
assert!(!fd.flags.invalid(), "Tag should not be marked as invalid");
}
}