[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PULL 68/85] qemu-iotests: support per-format golden output
From: |
Max Reitz |
Subject: |
[Qemu-block] [PULL 68/85] qemu-iotests: support per-format golden output files |
Date: |
Tue, 11 Jul 2017 18:07:57 +0200 |
From: Stefan Hajnoczi <address@hidden>
Some tests produce format-dependent output. Either the difference is
filtered out and ignored, or the test case is format-specific so we
don't need to worry about per-format output differences.
There is a third case: the test script is the same for all image formats
and the format-dependent output is relevant. An ugly workaround is to
copy-paste the test into multiple per-format test cases. This
duplicates code and is not maintainable.
This patch allows test cases to add per-format golden output files so a
single test case can work correctly when format-dependent output must be
checked:
123.out.qcow2
123.out.raw
123.out.vmdk
...
This naming scheme is not composable with 123.out.nocache or 123.pc.out,
two other scenarios where output files are split. I don't think it
matters since few test cases need these features.
Signed-off-by: Stefan Hajnoczi <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
Message-id: address@hidden
Signed-off-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/check | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tests/qemu-iotests/check b/tests/qemu-iotests/check
index 9ded37c..2a55ec9 100755
--- a/tests/qemu-iotests/check
+++ b/tests/qemu-iotests/check
@@ -338,6 +338,11 @@ do
reference="$reference_machine"
fi
+ reference_format="$source_iotests/$seq.out.$IMGFMT"
+ if [ -f "$reference_format" ]; then
+ reference="$reference_format"
+ fi
+
if [ "$CACHEMODE" = "none" ]; then
[ -f "$source_iotests/$seq.out.nocache" ] &&
reference="$source_iotests/$seq.out.nocache"
fi
--
2.9.4
- [Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables, (continued)
- [Qemu-block] [PULL 58/85] iotests: Use absolute paths for executables, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 59/85] iotests: Add test for colon handling, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 60/85] tests: Avoid non-portable 'echo -ARG', Max Reitz, 2017/07/11
- [Qemu-block] [PULL 61/85] block: add bdrv_measure() API, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 62/85] raw-format: add bdrv_measure() support, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 57/85] iotests: chown LUKS device before qemu-io launches, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 63/85] qcow2: extract preallocation calculation function, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 64/85] qcow2: make refcount size calculation conservative, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 65/85] qcow2: extract image creation option parsing, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 66/85] qcow2: add bdrv_measure() support, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 68/85] qemu-iotests: support per-format golden output files,
Max Reitz <=
- [Qemu-block] [PULL 67/85] qemu-img: add measure subcommand, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 70/85] block: Add PreallocMode to BD.bdrv_truncate(), Max Reitz, 2017/07/11
- [Qemu-block] [PULL 69/85] iotests: add test 178 for qemu-img measure, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 71/85] block: Add PreallocMode to bdrv_truncate(), Max Reitz, 2017/07/11
- [Qemu-block] [PULL 72/85] block: Add PreallocMode to blk_truncate(), Max Reitz, 2017/07/11
- [Qemu-block] [PULL 73/85] qemu-img: Expose PreallocMode for resizing, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 74/85] block/file-posix: Small fixes in raw_create(), Max Reitz, 2017/07/11
- [Qemu-block] [PULL 75/85] block/file-posix: Extract raw_regular_truncate(), Max Reitz, 2017/07/11
- [Qemu-block] [PULL 76/85] block/file-posix: Generalize raw_regular_truncate, Max Reitz, 2017/07/11
- [Qemu-block] [PULL 77/85] block/file-posix: Preallocation for truncate, Max Reitz, 2017/07/11