filter: Introduce filter to filter out offset for xfs_io

Some test cases (AFAIK, btrfs RAID recovery test cases) read out
certain location to verify its data.

Such read is mostly OK, but the golden output contains the on-disk
offset, which can differ due to underlying chunk change.  (This time
is mkfs chunk layout change for btrfs)

So introduce macro _filter_xfs_io_offset to filter out the offset part
wrote 65536/65536 bytes at offset 136708096
                       ^^^^^^^^^^^^^^^^^^^^
And offset from "pread -v"
08260000:  aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa  ................
^^^^^^^^^

Only btrfs/14[0-3] are affected.

Reported-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
This commit is contained in:
Qu Wenruo
2018-01-11 16:01:11 +08:00
committed by Eryu Guan
parent 8f20e80747
commit 3651c38e0b
9 changed files with 173 additions and 153 deletions
+9 -1
View File
@@ -226,6 +226,15 @@ _filter_xfs_io()
sed -e "s/[0-9/.]* [GMKiBbytes]*, [0-9]* ops\; [0-9/:. sec]* ([infa0-9/.]* [EPGMKiBbytes]*\/sec and [infa0-9/.]* ops\/sec)/XXX Bytes, X ops\; XX:XX:XX.X (XXX YYY\/sec and XXX ops\/sec)/"
}
# Also filter out the offset part of xfs_io output
# Some test cases may be affected by underlaying extent/chunk layout change,
# so wipe out this part to avoid golden output difference
_filter_xfs_io_offset()
{
# filter out " at offset XXX" and offset of "pread -v"
_filter_xfs_io | sed -e "s/ at offset [0-9]*$//" -e "s/^[0-9a-f]\+:/XXXXXXXX:/"
}
# stderr filter for xfs_io to handle change of error output format (e.g.
# pwrite64 -> pwrite).
_filter_xfs_io_error()
@@ -277,7 +286,6 @@ _filter_xfs_io_pages_modified()
_filter_xfs_io_units_modified "Page" $PAGE_SIZE
}
_filter_test_dir()
{
# TEST_DEV may be a prefix of TEST_DIR (e.g. /mnt, /mnt/ovl-mnt)