Files
Lucas RayanandClaude Sonnet 5 6328220c60
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
chore(i18n): finish translating code comments and scripts to English
Completes the English-only standardization for code, comments, scripts
and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en,
untouched). Covers the remaining crates/, apps/gui/ui/ and
apps/gui/src-tauri/ comments, .gitea/ workflow and template comments,
.githooks/ hooks, and the scripts/ source comments for the files
already renamed in a prior commit (check.sh, generate-logo.py,
install-hooks.sh).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-30 20:43:02 -03:00

33 lines
1.3 KiB
Rust

//! LVM2: real image from the `dfvfs` test suite (`target/testdata/dfvfs/lvm.raw`).
use guara_core::lvm;
use guara_core::partition::detect_fs;
use guara_core::source::{FileSource, Source};
use std::sync::Arc;
#[test]
fn assembles_real_lvm_image() {
let p = std::path::PathBuf::from(env!("CARGO_MANIFEST_DIR"))
.join("../../target/testdata/dfvfs/lvm.raw");
if !p.exists() {
eprintln!("SKIP: execute scripts/fetch-testdata.sh");
return;
}
let src: Arc<dyn Source> = Arc::new(FileSource::open(&p).unwrap());
let pv = lvm::read_pv(src.as_ref()).expect("PV");
assert_eq!(pv.vg_name, "test_volume_group");
let vgs = lvm::assemble_vgs(vec![(src, pv)]);
assert_eq!(vgs.len(), 1);
let vg = &vgs[0];
assert!(vg.warnings.is_empty(), "{:?}", vg.warnings);
let names: Vec<&str> = vg.lvs.iter().map(|(n, _)| n.as_str()).collect();
assert_eq!(names, ["test_logical_volume1", "test_logical_volume2"]);
for (n, lv) in &vg.lvs {
assert_eq!(lv.size(), 4 << 20, "{n}");
let fs = detect_fs(lv.as_ref(), 0);
eprintln!("{n}: {fs:?}");
// The second logical volume (`test_volume_2`) in the reference image is unformatted.
assert_eq!(fs.is_some(), n == "test_logical_volume1", "{n}");
}
}