[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 46/73] qemu-iotests: 060: Filter the real disk size
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 46/73] qemu-iotests: 060: Filter the real disk size |
Date: |
Wed, 10 Dec 2014 11:34:12 +0100 |
The real on-disk size of an image depends on things like the host
filesystem. _img_info already filters it out, use the function in 060.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Michael Mueller <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
tests/qemu-iotests/060 | 2 +-
tests/qemu-iotests/060.out | 5 ++---
tests/qemu-iotests/common.rc | 11 ++++++++++-
3 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 9772d36..73863bf 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -77,7 +77,7 @@ $QEMU_IO -c "$OPEN_RW" -c "write -P 0x2a 0 512" |
_filter_qemu_io
$PYTHON qcow2.py "$TEST_IMG" dump-header | grep incompatible_features
# This information should be available through qemu-img info
-$QEMU_IMG info "$TEST_IMG" | _filter_testdir
+_img_info --format-specific
# Try to open the image R/W (which should fail)
$QEMU_IO -c "$OPEN_RW" -c "read 0 512" 2>&1 | _filter_qemu_io \
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index 9419da1..4cdf62b 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -11,10 +11,9 @@ incompatible_features 0x0
qcow2: Marking image as corrupt: Preventing invalid write on metadata
(overlaps with active L1 table); further corruption events will be suppressed
write failed: Input/output error
incompatible_features 0x2
-image: TEST_DIR/t.qcow2
-file format: qcow2
+image: TEST_DIR/t.IMGFMT
+file format: IMGFMT
virtual size: 64M (67108864 bytes)
-disk size: 196K
cluster_size: 65536
Format specific information:
compat: 1.1
diff --git a/tests/qemu-iotests/common.rc b/tests/qemu-iotests/common.rc
index 9c49deb..89cbc13 100644
--- a/tests/qemu-iotests/common.rc
+++ b/tests/qemu-iotests/common.rc
@@ -213,6 +213,13 @@ _check_test_img()
_img_info()
{
+ if [[ "$1" == "--format-specific" ]]; then
+ local format_specific=1
+ shift
+ else
+ local format_specific=0
+ fi
+
discard=0
regex_json_spec_start='^ *"format-specific": \{'
$QEMU_IMG info "$@" "$TEST_IMG" 2>&1 | \
@@ -222,7 +229,9 @@ _img_info()
-e "/^disk size:/ D" \
-e "/actual-size/ D" | \
while IFS='' read line; do
- if [[ $line == "Format specific information:" ]]; then
+ if [[ $format_specific == 1 ]]; then
+ discard=0
+ elif [[ $line == "Format specific information:" ]]; then
discard=1
elif [[ $line =~ $regex_json_spec_start ]]; then
discard=2
--
1.8.3.1
- [Qemu-devel] [PULL 34/73] block: Read only one sector for format probing, (continued)
- [Qemu-devel] [PULL 34/73] block: Read only one sector for format probing, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 37/73] qemu-iotests: Test writing non-raw image headers to raw image, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 36/73] qemu-iotests: Fix stderr handling in common.qemu, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 35/73] raw: Prohibit dangerous writes for probed images, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 40/73] blockdev: acquire AioContext in QMP 'transaction' actions, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 42/73] qcow2: Fix header extension size check, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 39/73] blockdev: drop unnecessary DriveBackupState field assignment, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 41/73] blockdev: check for BLOCK_OP_TYPE_INTERNAL_SNAPSHOT, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 38/73] blockdev: update outdated qmp_transaction() comments, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 44/73] block: Don't probe for unknown backing file format, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 46/73] qemu-iotests: 060: Filter the real disk size,
Kevin Wolf <=
- [Qemu-devel] [PULL 45/73] block: do not use get_clock(), Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 48/73] nvme: 64kB page size fixes, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 47/73] qemu-iotests: 082: Filter the real disk size, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 49/73] ide: Check validity of logical block size, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 52/73] block: Omit bdrv_find_format for essential drivers, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 50/73] iotests: Specify qcow2 format for qemu-io in 059, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 51/73] block: Make essential BlockDriver objects public, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 53/73] block/vvfat: qcow driver may not be found, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 54/73] block/nfs: Add create_opts, Kevin Wolf, 2014/12/10
- [Qemu-devel] [PULL 56/73] qemu-img: Check create_opts before image creation, Kevin Wolf, 2014/12/10