diff options
author | Darrick J. Wong <darrick.wong@oracle.com> | 2017-01-04 17:05:08 -0800 |
---|---|---|
committer | Eryu Guan <eguan@redhat.com> | 2017-01-15 13:56:45 +0800 |
commit | c4288aec3c979d611230e2eb162be6a2efd356ed (patch) | |
tree | 7bd571105e27a6ebd6335de24cd43b78c4d06f50 | |
parent | eaa652fbb2934658452bf7a677c6082726513071 (diff) | |
download | xfstests-dev-c4288aec3c979d611230e2eb162be6a2efd356ed.tar.gz |
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>
-rwxr-xr-x | tests/generic/265 | 6 | ||||
-rw-r--r-- | tests/generic/265.out | 1 | ||||
-rwxr-xr-x | tests/generic/266 | 5 | ||||
-rw-r--r-- | tests/generic/266.out | 1 | ||||
-rwxr-xr-x | tests/generic/267 | 2 | ||||
-rwxr-xr-x | tests/generic/268 | 5 | ||||
-rw-r--r-- | tests/generic/268.out | 1 | ||||
-rwxr-xr-x | tests/generic/271 | 5 | ||||
-rw-r--r-- | tests/generic/271.out | 1 | ||||
-rwxr-xr-x | tests/generic/272 | 5 | ||||
-rw-r--r-- | tests/generic/272.out | 1 | ||||
-rwxr-xr-x | tests/generic/276 | 2 | ||||
-rw-r--r-- | tests/generic/276.out | 1 | ||||
-rwxr-xr-x | tests/generic/278 | 5 | ||||
-rw-r--r-- | tests/generic/278.out | 1 | ||||
-rwxr-xr-x | tests/generic/279 | 4 | ||||
-rw-r--r-- | tests/generic/279.out | 1 | ||||
-rwxr-xr-x | tests/generic/281 | 4 | ||||
-rw-r--r-- | tests/generic/281.out | 1 | ||||
-rwxr-xr-x | tests/generic/282 | 3 | ||||
-rwxr-xr-x | tests/generic/283 | 6 | ||||
-rw-r--r-- | tests/generic/283.out | 1 |
22 files changed, 33 insertions, 29 deletions
diff --git a/tests/generic/265 b/tests/generic/265 index 8e9d5bcb0f..ceddfbe715 100755 --- a/tests/generic/265 +++ b/tests/generic/265 @@ -80,7 +80,11 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ + -c "fdatasync" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "pwrite did not fail" + _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/265.out b/tests/generic/265.out index 1b67114dcc..31eb4e9453 100644 --- a/tests/generic/265.out +++ b/tests/generic/265.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file2 CoW and unmount -fdatasync: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-265/file1 Check for damage diff --git a/tests/generic/266 b/tests/generic/266 index 4f9816af64..09541c89be 100755 --- a/tests/generic/266 +++ b/tests/generic/266 @@ -80,7 +80,10 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ + -c "fdatasync" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "pwrite did not fail" echo "Clean up the mess" _dmerror_unmount diff --git a/tests/generic/266.out b/tests/generic/266.out index dd34ad3421..16416546d6 100644 --- a/tests/generic/266.out +++ b/tests/generic/266.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file2 CoW and unmount -fdatasync: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-266/file1 diff --git a/tests/generic/267 b/tests/generic/267 index e3a6b0c1c3..2ec6ad909d 100755 --- a/tests/generic/267 +++ b/tests/generic/267 @@ -80,7 +80,7 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full +$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmount diff --git a/tests/generic/268 b/tests/generic/268 index c7dcd57544..b7d16ab7ef 100755 --- a/tests/generic/268 +++ b/tests/generic/268 @@ -81,7 +81,10 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" -c "fdatasync" $testdir/file2 >> $seqres.full +urk=$($XFS_IO_PROG -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" \ + -c "fdatasync" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "pwrite did not fail" _dmerror_load_working_table echo "Rewrite" diff --git a/tests/generic/268.out b/tests/generic/268.out index 234e8bec88..1a3b39abbe 100644 --- a/tests/generic/268.out +++ b/tests/generic/268.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file2 CoW and unmount -fdatasync: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-268/file1 diff --git a/tests/generic/271 b/tests/generic/271 index ded88541ee..9439327a35 100755 --- a/tests/generic/271 +++ b/tests/generic/271 @@ -81,8 +81,9 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ - 2>&1 >> $seqres.full | _filter_xfs_io_error +urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail" _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/271.out b/tests/generic/271.out index 54d5b0dbf6..9b44ee7bb4 100644 --- a/tests/generic/271.out +++ b/tests/generic/271.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file2 CoW and unmount -pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-271/file1 Check for damage diff --git a/tests/generic/272 b/tests/generic/272 index 5bc5b39afe..243adf569c 100755 --- a/tests/generic/272 +++ b/tests/generic/272 @@ -81,8 +81,9 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ - 2>&1 >> $seqres.full | _filter_xfs_io_error +urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail" echo "Clean up the mess" _dmerror_unmount diff --git a/tests/generic/272.out b/tests/generic/272.out index 0b8bdca5d1..10ecda923f 100644 --- a/tests/generic/272.out +++ b/tests/generic/272.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file2 CoW and unmount -pwrite: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-272/file1 diff --git a/tests/generic/276 b/tests/generic/276 index 83b902e6c5..34b00291d3 100755 --- a/tests/generic/276 +++ b/tests/generic/276 @@ -82,7 +82,7 @@ echo "CoW and unmount" sync _dmerror_load_error_table $XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ - 2>&1 >> $seqres.full | _filter_xfs_io_error + >> $seqres.full 2>&1 _dmerror_load_working_table rm -rf $testdir/file2 >> $seqres.full 2>&1 _dmerror_unmount diff --git a/tests/generic/276.out b/tests/generic/276.out index 88a01623aa..a080dd0ea5 100644 --- a/tests/generic/276.out +++ b/tests/generic/276.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file2 CoW and unmount -pwrite: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-276/file1 Check for damage diff --git a/tests/generic/278 b/tests/generic/278 index 415742a08d..d751f01863 100755 --- a/tests/generic/278 +++ b/tests/generic/278 @@ -82,8 +82,9 @@ md5sum $testdir/file2 | _filter_scratch echo "CoW and unmount" sync _dmerror_load_error_table -$XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 \ - 2>&1 >> $seqres.full | _filter_xfs_io_error +urk=$($XFS_IO_PROG -d -f -c "pwrite -S 0x63 -b $bufsize 0 $filesize" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "dio pwrite did not fail" _dmerror_load_working_table echo "Rewrite" diff --git a/tests/generic/278.out b/tests/generic/278.out index 9ead4acf70..cd22fcd975 100644 --- a/tests/generic/278.out +++ b/tests/generic/278.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file2 CoW and unmount -pwrite: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-278/file1 diff --git a/tests/generic/279 b/tests/generic/279 index 2f1ec4f61c..4541de3e98 100755 --- a/tests/generic/279 +++ b/tests/generic/279 @@ -80,8 +80,8 @@ 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" -c "msync -s 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" \ + -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 _dmerror_load_working_table _dmerror_unmount _dmerror_mount diff --git a/tests/generic/279.out b/tests/generic/279.out index f34c2b2bbf..009f05eee0 100644 --- a/tests/generic/279.out +++ b/tests/generic/279.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file2 CoW and unmount -msync: Input/output error Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-279/file1 Check for damage diff --git a/tests/generic/281 b/tests/generic/281 index c95acf2995..e8e1661bca 100755 --- a/tests/generic/281 +++ b/tests/generic/281 @@ -80,8 +80,8 @@ 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" -c "msync -s 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" \ + -c "msync -s 0 $filesize" $testdir/file2 >> $seqres.full 2>&1 echo "Clean up the mess" _dmerror_unmount diff --git a/tests/generic/281.out b/tests/generic/281.out index a2d8e3f1c7..1bae187e96 100644 --- a/tests/generic/281.out +++ b/tests/generic/281.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file2 CoW and unmount -msync: Input/output error Clean up the mess Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-281/file1 diff --git a/tests/generic/282 b/tests/generic/282 index 6452025439..8a30811ef5 100755 --- a/tests/generic/282 +++ b/tests/generic/282 @@ -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 diff --git a/tests/generic/283 b/tests/generic/283 index 8d56ac34b3..7bfdb4d15c 100755 --- a/tests/generic/283 +++ b/tests/generic/283 @@ -81,8 +81,10 @@ 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" -c "msync -s 0 $filesize" $testdir/file2 > $TEST_DIR/mwrite.out 2>&1) -cat $TEST_DIR/mwrite.out | tee -a $seqres.full +urk=$($XFS_IO_PROG -f -c "mmap -rw 0 $filesize" -c "mwrite -S 0x63 0 $filesize" \ + -c "msync -s 0 $filesize" $testdir/file2 2>&1) +echo $urk >> $seqres.full +echo "$urk" | grep -q "error" || _fail "mwrite did not fail" _dmerror_load_working_table echo "Rewrite" diff --git a/tests/generic/283.out b/tests/generic/283.out index f9fd5c8e78..b475054756 100644 --- a/tests/generic/283.out +++ b/tests/generic/283.out @@ -5,7 +5,6 @@ Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file2 CoW and unmount -msync: Input/output error Rewrite Compare files 1886e67cf8783e89ce6ddc5bb09a3944 SCRATCH_MNT/test-283/file1 |