impemented mock testing
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user