impemented mock testing

This commit is contained in:
2026-02-26 17:11:42 +01:00
parent f76acd6256
commit 667d94af7a
21 changed files with 480 additions and 110 deletions

View File

@@ -2,6 +2,24 @@ use anyhow::Result;
use thiserror::Error;
use miette::Diagnostic;
use std::sync::Arc;
use std::path::PathBuf;
use crate::sys::SyscallRunner;
/// Context holding OS abstractions (filesystem base and syscall runner).
#[derive(Clone)]
pub struct EnvironmentCtx {
pub sysfs_base: PathBuf,
pub runner: Arc<dyn SyscallRunner>,
}
impl EnvironmentCtx {
pub fn production() -> Self {
Self {
sysfs_base: PathBuf::from("/"),
runner: Arc::new(crate::sys::RealSyscallRunner),
}
}
}
#[derive(Error, Diagnostic, Debug, Clone)]
pub enum AuditError {