use std::fs;
use std::path::{Path, PathBuf};
use super::metadata::{KernelMetadata, KernelSource};
pub(crate) fn test_metadata(version: &str) -> KernelMetadata {
KernelMetadata {
version: Some(version.to_string()),
source: KernelSource::Tarball,
arch: "x86_64".to_string(),
image_name: "bzImage".to_string(),
config_hash: Some("abc123".to_string()),
built_at: "2026-04-12T10:00:00Z".to_string(),
ktstr_kconfig_hash: Some("def456".to_string()),
extra_kconfig_hash: None,
has_vmlinux: false,
vmlinux_stripped: false,
source_vmlinux_size: None,
source_vmlinux_mtime_secs: None,
}
}
pub(crate) fn create_fake_image(dir: &Path) -> PathBuf {
let image = dir.join("bzImage");
fs::write(&image, b"fake kernel image").unwrap();
image
}