From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwjB-0005AX-Tz for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:29:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGwj5-00015b-Ug for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:29:45 -0500 Received: from lnantes-156-75-100-125.w80-12.abo.wanadoo.fr ([80.12.84.125]:58633 helo=paradis.irqsave.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGwj5-00015Q-LP for qemu-devel@nongnu.org; Fri, 21 Feb 2014 15:29:39 -0500 Date: Fri, 21 Feb 2014 21:29:38 +0100 From: =?iso-8859-1?Q?Beno=EEt?= Canet Message-ID: <20140221202938.GA24686@irqsave.net> References: <1393011848-18742-1-git-send-email-mreitz@redhat.com> <1393011848-18742-3-git-send-email-mreitz@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1393011848-18742-3-git-send-email-mreitz@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/2] iotests: Mixed quorum child device specifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Max Reitz Cc: Kevin Wolf , qemu-devel@nongnu.org, Stefan Hajnoczi The Friday 21 Feb 2014 =E0 20:44:08 (+0100), Max Reitz wrote : > Add a test case to test 081 for mixing full option dicts and reference > strings of specifying the quorum child block devices through QMP. >=20 > Signed-off-by: Max Reitz > --- > tests/qemu-iotests/081 | 52 ++++++++++++++++++++++++++++++++++++++= ++++++++ > tests/qemu-iotests/081.out | 15 +++++++++++++ > 2 files changed, 67 insertions(+) >=20 > diff --git a/tests/qemu-iotests/081 b/tests/qemu-iotests/081 > index be34544..421c7cc 100755 > --- a/tests/qemu-iotests/081 > +++ b/tests/qemu-iotests/081 > @@ -44,6 +44,19 @@ _supported_fmt raw > _supported_proto generic > _supported_os Linux > =20 > +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_qe= mu_io | \ > + sed -e 's/"sector-num": [0-9]*/"sector-num": X/' > +} > + > quorum=3D"file.driver=3Dquorum,file.children.0.file.filename=3D$TEST_D= IR/1.raw" > quorum=3D"$quorum,file.children.1.file.filename=3D$TEST_DIR/2.raw" > quorum=3D"$quorum,file.children.2.file.filename=3D$TEST_DIR/3.raw,file= .vote-threshold=3D2" > @@ -80,6 +93,45 @@ echo "=3D=3D checking quorum correction =3D=3D" > $QEMU_IO -c "open -o $quorum" -c "read -P 0x32 0 $size" | _filter_qemu= _io > =20 > echo > +echo "=3D=3D checking mixed reference/option specification =3D=3D" > + > +run_qemu -drive "file=3D$TEST_DIR/2.raw,format=3D$IMGFMT,if=3Dnone,id=3D= drive2" < +{ "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 "=3D=3D breaking quorum =3D=3D" > =20 > $QEMU_IO -c "write -P 0x41 0 $size" "$TEST_DIR/1.raw" | _filter_qemu_i= o > diff --git a/tests/qemu-iotests/081.out b/tests/qemu-iotests/081.out > index b5b55ab..3bf882b 100644 > --- a/tests/qemu-iotests/081.out > +++ b/tests/qemu-iotests/081.out > @@ -25,6 +25,21 @@ wrote 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) > =20 > +=3D=3D checking mixed reference/option specification =3D=3D > +Testing: -drive file=3DTEST_DIR/2.IMGFMT,format=3DIMGFMT,if=3Dnone,id=3D= drive2 > +QMP_VERSION > +{"return": {}} > +{"return": {}} > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "ev= ent": "QUORUM_REPORT_BAD", "data": {"node-name": "%s", "ret": false, "sec= tors-count": false, "sector-num": X}} I think I wrote something wrong with the QMP events since you got "node-name": "%s". Will check that. Best regards Beno=EEt > +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}, "ev= ent": "SHUTDOWN"} > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "ev= ent": "DEVICE_TRAY_MOVED", "data": {"device": "ide1-cd0", "tray-open": tr= ue}} > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP}, "ev= ent": "DEVICE_TRAY_MOVED", "data": {"device": "floppy0", "tray-open": tru= e}} > + > + > =3D=3D breaking quorum =3D=3D > wrote 10485760/10485760 bytes at offset 0 > 10 MiB, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec) > --=20 > 1.9.0 >=20 >=20