iotests: Mixed quorum child device specifications
Add a test case to test 081 for mixing full option dicts and reference strings of specifying the quorum child block devices through QMP. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Benoit Canet <benoit@irqsave.net> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
8a87f3d722
commit
6141f3bd69
|
@ -44,6 +44,18 @@ _supported_fmt raw
|
||||||
_supported_proto generic
|
_supported_proto generic
|
||||||
_supported_os Linux
|
_supported_os Linux
|
||||||
|
|
||||||
|
function do_run_qemu()
|
||||||
|
{
|
||||||
|
echo Testing: "$@" | _filter_imgfmt
|
||||||
|
$QEMU -nographic -qmp stdio -serial none "$@"
|
||||||
|
echo
|
||||||
|
}
|
||||||
|
|
||||||
|
function run_qemu()
|
||||||
|
{
|
||||||
|
do_run_qemu "$@" 2>&1 | _filter_testdir | _filter_qmp | _filter_qemu_io
|
||||||
|
}
|
||||||
|
|
||||||
quorum="file.driver=quorum,file.children.0.file.filename=$TEST_DIR/1.raw"
|
quorum="file.driver=quorum,file.children.0.file.filename=$TEST_DIR/1.raw"
|
||||||
quorum="$quorum,file.children.1.file.filename=$TEST_DIR/2.raw"
|
quorum="$quorum,file.children.1.file.filename=$TEST_DIR/2.raw"
|
||||||
quorum="$quorum,file.children.2.file.filename=$TEST_DIR/3.raw,file.vote-threshold=2"
|
quorum="$quorum,file.children.2.file.filename=$TEST_DIR/3.raw,file.vote-threshold=2"
|
||||||
|
@ -79,6 +91,45 @@ echo "== checking quorum correction =="
|
||||||
|
|
||||||
$QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu_io
|
$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
|
||||||
|
{ "execute": "qmp_capabilities" }
|
||||||
|
{ "execute": "blockdev-add",
|
||||||
|
"arguments": {
|
||||||
|
"options": {
|
||||||
|
"driver": "quorum",
|
||||||
|
"id": "drive0-quorum",
|
||||||
|
"vote-threshold": 2,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"driver": "raw",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "$TEST_DIR/1.raw"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"drive2",
|
||||||
|
{
|
||||||
|
"driver": "raw",
|
||||||
|
"file": {
|
||||||
|
"driver": "file",
|
||||||
|
"filename": "$TEST_DIR/3.raw"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ "execute": "human-monitor-command",
|
||||||
|
"arguments": {
|
||||||
|
"command-line": 'qemu-io drive0-quorum "read -P 0x32 0 $size"'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{ "execute": "quit" }
|
||||||
|
EOF
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "== breaking quorum =="
|
echo "== breaking quorum =="
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,21 @@ wrote 10485760/10485760 bytes at offset 0
|
||||||
read 10485760/10485760 bytes at offset 0
|
read 10485760/10485760 bytes at offset 0
|
||||||
10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
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
|
||||||
|
QMP_VERSION
|
||||||
|
{"return": {}}
|
||||||
|
{"return": {}}
|
||||||
|
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "QUORUM_REPORT_BAD", "data": {"node-name": "", "ret": 0, "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": ""}
|
||||||
|
{"return": {}}
|
||||||
|
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "SHUTDOWN"}
|
||||||
|
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": true}}
|
||||||
|
{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "event": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": true}}
|
||||||
|
|
||||||
|
|
||||||
== breaking quorum ==
|
== breaking quorum ==
|
||||||
wrote 10485760/10485760 bytes at offset 0
|
wrote 10485760/10485760 bytes at offset 0
|
||||||
10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
|
||||||
|
|
Loading…
Reference in New Issue