reflink: make error reporting consistent when simulating EIO
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 5 Jan 2017 01:05:08 +0000 (17:05 -0800)
committerEryu Guan <eguan@redhat.com>
Sun, 15 Jan 2017 05:56:45 +0000 (13:56 +0800)
commitc4288aec3c979d611230e2eb162be6a2efd356ed
tree7bd571105e27a6ebd6335de24cd43b78c4d06f50
parenteaa652fbb2934658452bf7a677c6082726513071
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>
22 files changed:
tests/generic/265
tests/generic/265.out
tests/generic/266
tests/generic/266.out
tests/generic/267
tests/generic/268
tests/generic/268.out
tests/generic/271
tests/generic/271.out
tests/generic/272
tests/generic/272.out
tests/generic/276
tests/generic/276.out
tests/generic/278
tests/generic/278.out
tests/generic/279
tests/generic/279.out
tests/generic/281
tests/generic/281.out
tests/generic/282
tests/generic/283
tests/generic/283.out