INNER CODE UNIT · Rust

mount_umount

openebs/mayastor · io-engine-tests/src/lib.rs:344

pub fn mount_umount(device: &str) -> Result<String, String> {
    let (exit, stdout, stderr) = run_script::run(
        r#"
        mkdir -p /tmp/__test
        mount $1 /tmp/__test
        umount /tmp/__test
        exit 0
    "#,
        &vec![device.into()],
        &run_script::ScriptOptions::new(),
    )
    .unwrap();
    if exit == 0 {
        Ok(stdout)
    } else {
        Err(stderr)
    }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…