iotests: Only create BB if necessary

Tests 071 and 081 test giving references in blockdev-add. It is not
necessary to create a BlockBackend here, so omit it.

While at it, fix up some blockdev-add invocations in the vicinity
(s/raw/$IMGFMT/ in 081, drop the format BDS for blkverify's raw child in
071).

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Max Reitz 2015-10-19 17:53:10 +02:00 committed by Kevin Wolf
parent be4b67bc7d
commit 8e9e653038
4 changed files with 71 additions and 18 deletions

View File

@ -104,8 +104,17 @@ echo
echo "=== Testing blkdebug on existing block device ==="
echo
run_qemu -drive "file=$TEST_IMG,format=raw,if=none,id=drive0" <<EOF
run_qemu <<EOF
{ "execute": "qmp_capabilities" }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"node-name": "drive0",
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
@ -133,8 +142,20 @@ echo
echo "=== Testing blkverify on existing block device ==="
echo
run_qemu -drive "file=$TEST_IMG,format=$IMGFMT,if=none,id=drive0" <<EOF
run_qemu <<EOF
{ "execute": "qmp_capabilities" }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"node-name": "drive0",
"driver": "$IMGFMT",
"file": {
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
@ -142,11 +163,8 @@ run_qemu -drive "file=$TEST_IMG,format=$IMGFMT,if=none,id=drive0" <<EOF
"id": "drive0-verify",
"test": "drive0",
"raw": {
"driver": "raw",
"file": {
"driver": "file",
"filename": "$TEST_IMG.base"
}
"driver": "file",
"filename": "$TEST_IMG.base"
}
}
}
@ -163,8 +181,17 @@ echo
echo "=== Testing blkverify on existing raw block device ==="
echo
run_qemu -drive "file=$TEST_IMG.base,format=raw,if=none,id=drive0" <<EOF
run_qemu <<EOF
{ "execute": "qmp_capabilities" }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"node-name": "drive0",
"driver": "file",
"filename": "$TEST_IMG.base"
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
@ -193,8 +220,17 @@ echo
echo "=== Testing blkdebug's set-state through QMP ==="
echo
run_qemu -drive "file=$TEST_IMG,format=raw,if=none,id=drive0" <<EOF
run_qemu <<EOF
{ "execute": "qmp_capabilities" }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"node-name": "drive0",
"driver": "file",
"filename": "$TEST_IMG"
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {

View File

@ -42,10 +42,11 @@ read failed: Input/output error
=== Testing blkdebug on existing block device ===
Testing: -drive file=TEST_DIR/t.IMGFMT,format=raw,if=none,id=drive0
Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
read failed: Input/output error
{"return": ""}
{"return": {}}
@ -56,28 +57,31 @@ QEMU_PROG: Failed to flush the refcount block cache: Input/output error
=== Testing blkverify on existing block device ===
Testing: -drive file=TEST_DIR/t.IMGFMT,format=IMGFMT,if=none,id=drive0
Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
=== Testing blkverify on existing raw block device ===
Testing: -drive file=TEST_DIR/t.IMGFMT.base,format=raw,if=none,id=drive0
Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
blkverify: read sector_num=0 nb_sectors=1 contents mismatch in sector 0
=== Testing blkdebug's set-state through QMP ===
Testing: -drive file=TEST_DIR/t.IMGFMT,format=raw,if=none,id=drive0
Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
{"return": {}}
read 512/512 bytes at offset 0
512 bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
{"return": ""}

View File

@ -102,8 +102,20 @@ $QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu_io
echo
echo "== checking mixed reference/option specification =="
run_qemu -drive "file=$TEST_DIR/2.raw,format=$IMGFMT,if=none,id=drive2" <<EOF
run_qemu <<EOF
{ "execute": "qmp_capabilities" }
{ "execute": "blockdev-add",
"arguments": {
"options": {
"node-name": "drive2",
"driver": "$IMGFMT",
"file": {
"driver": "file",
"filename": "$TEST_DIR/2.raw"
}
}
}
}
{ "execute": "blockdev-add",
"arguments": {
"options": {
@ -112,7 +124,7 @@ run_qemu -drive "file=$TEST_DIR/2.raw,format=$IMGFMT,if=none,id=drive2" <<EOF
"vote-threshold": 2,
"children": [
{
"driver": "raw",
"driver": "$IMGFMT",
"file": {
"driver": "file",
"filename": "$TEST_DIR/1.raw"
@ -120,7 +132,7 @@ run_qemu -drive "file=$TEST_DIR/2.raw,format=$IMGFMT,if=none,id=drive2" <<EOF
},
"drive2",
{
"driver": "raw",
"driver": "$IMGFMT",
"file": {
"driver": "file",
"filename": "$TEST_DIR/3.raw"

View File

@ -26,11 +26,12 @@ read 10485760/10485760 bytes at offset 0
10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
== checking mixed reference/option specification ==
Testing: -drive file=TEST_DIR/2.IMGFMT,format=IMGFMT,if=none,id=drive2
Testing:
QMP_VERSION
{"return": {}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "QUORUM_REPORT_BAD", "data": {"node-name": "NODE_NAME", "sectors-count": 20480, "sector-num": 0}}
{"return": {}}
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "QUORUM_REPORT_BAD", "data": {"node-name": "drive2", "sectors-count": 20480, "sector-num": 0}}
read 10485760/10485760 bytes at offset 0
10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
{"return": ""}