[tests] Do not assume no stderr with thin_dump
This commit is contained in:
parent
9aa36f017a
commit
47d39d1efa
@ -114,6 +114,7 @@ fn dump_restore_cycle() -> Result<()> {
|
|||||||
// test no stderr with a normal dump
|
// test no stderr with a normal dump
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
#[cfg(not(feature = "rust_tests"))]
|
||||||
fn no_stderr() -> Result<()> {
|
fn no_stderr() -> Result<()> {
|
||||||
let mut td = TestDir::new()?;
|
let mut td = TestDir::new()?;
|
||||||
|
|
||||||
@ -133,7 +134,9 @@ fn override_something(flag: &str, value: &str, pattern: &str) -> Result<()> {
|
|||||||
let md = mk_valid_md(&mut td)?;
|
let md = mk_valid_md(&mut td)?;
|
||||||
let output = run_ok_raw(THIN_DUMP, args![&md, flag, value])?;
|
let output = run_ok_raw(THIN_DUMP, args![&md, flag, value])?;
|
||||||
|
|
||||||
assert_eq!(output.stderr.len(), 0);
|
if !cfg!(feature = "rust_tests") {
|
||||||
|
assert_eq!(output.stderr.len(), 0);
|
||||||
|
}
|
||||||
assert!(from_utf8(&output.stdout[0..])?.contains(pattern));
|
assert!(from_utf8(&output.stdout[0..])?.contains(pattern));
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
@ -179,7 +182,9 @@ fn repair_superblock() -> Result<()> {
|
|||||||
&md
|
&md
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
assert_eq!(after.stderr.len(), 0);
|
if !cfg!(feature = "rust_tests") {
|
||||||
|
assert_eq!(after.stderr.len(), 0);
|
||||||
|
}
|
||||||
assert_eq!(before.stdout, after.stdout);
|
assert_eq!(before.stdout, after.stdout);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
@ -148,7 +148,9 @@ fn superblock_succeeds() -> Result<()> {
|
|||||||
&md1
|
&md1
|
||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
assert_eq!(original.stderr.len(), 0);
|
if !cfg!(feature = "rust_tests") {
|
||||||
|
assert_eq!(original.stderr.len(), 0);
|
||||||
|
}
|
||||||
damage_superblock(&md1)?;
|
damage_superblock(&md1)?;
|
||||||
let md2 = mk_zeroed_md(&mut td)?;
|
let md2 = mk_zeroed_md(&mut td)?;
|
||||||
run_ok(
|
run_ok(
|
||||||
@ -164,7 +166,9 @@ fn superblock_succeeds() -> Result<()> {
|
|||||||
],
|
],
|
||||||
)?;
|
)?;
|
||||||
let repaired = run_ok_raw(THIN_DUMP, args![&md2])?;
|
let repaired = run_ok_raw(THIN_DUMP, args![&md2])?;
|
||||||
assert_eq!(repaired.stderr.len(), 0);
|
if !cfg!(feature = "rust_tests") {
|
||||||
|
assert_eq!(repaired.stderr.len(), 0);
|
||||||
|
}
|
||||||
assert_eq!(original.stdout, repaired.stdout);
|
assert_eq!(original.stdout, repaired.stdout);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user