INNER CODE UNIT · Rust

dd_urandom_blkdev

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

pub fn dd_urandom_blkdev(device: &str) -> i32 {
    let (exit, stdout, stderr) = run_script::run(
        r#"
        dd if=/dev/urandom of=$1 conv=fsync,nocreat,notrunc iflag=count_bytes count=`blockdev --getsize64 $1`
    "#,
    &vec![device.into()],
    &run_script::ScriptOptions::new(),
    )
    .unwrap();
    trace!("dd_urandom_blkdev:\nstdout: {}\nstderr: {}", stdout, stderr);
    exit
}
pub fn dd_urandom_file_size(device: &str, size: u64) -> String {
    let (exit, stdout, _stderr) = run_script::run(
        r#"
        dd if=/dev/urandom of=$1 conv=fsync,nocreat,notrunc iflag=count_bytes count=$2
    "#,
        &vec![device.into(), size.to_string()],

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…