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": {