INNER CODE UNIT · Rust

dd_urandom_file_size

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

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()],
        &run_script::ScriptOptions::new(),
    )
    .unwrap();
    assert_eq!(exit, 0);
    stdout
}

pub fn compare_nexus_device(nexus_device: &str, device: &str, expected_pass: bool) -> String {
    let (exit, stdout, _stderr) = run_script::run(
        r#"
        cmp -n `blockdev --getsize64 $1` $1 $2 0 5M
        test $? -eq $3

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…