reflink: make error reporting consistent when simulating EIO

When we're using dm-error to simulate failed devices, we don't really
know if the write or the fdatasync is going to receive the EIO.  For
tests that make a single (failed) write attempt and never retry, it's
sufficient to check that the file md5 doesn't change after recovery.
For tests that /do/ retry the write, we should capture the entire output
and just look for the word error instead of enshrining the exact perror
message (filename/function call and everything) in the golden output.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Darrick J. Wong
2017-01-04 17:05:08 -08:00
committed by Eryu Guan
parent eaa652fbb2
commit c4288aec3c
22 changed files with 33 additions and 29 deletions
+1 -2
View File
@@ -80,8 +80,7 @@ md5sum $testdir/file2 | _filter_scratch
echo "CoW and unmount"
sync
_dmerror_load_error_table
urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1)
cat $TEST_DIR/mwrite.out | tee -a $seqres.full
$XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" $testdir/file2 >> $seqres.full 2>&1
_dmerror_load_working_table
rm -rf $testdir/file2 >> $seqres.full 2>&1
_dmerror_unmount