INNER CODE UNIT · Rust
compare_files
openebs/mayastor · io-engine-tests/src/lib.rs:333
pub fn compare_files(a: &str, b: &str) {
let output = Command::new("cmp")
.args([a, b])
.output()
.expect("failed to execute \"cmp\"");
io::stdout().write_all(&output.stderr).unwrap();
io::stdout().write_all(&output.stdout).unwrap();
assert!(output.status.success(), "{:#?}", output);
}
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