qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: jsnow@redhat.com, qemu-devel@nongnu.org, qemu-block@nongnu.org,
	mreitz@redhat.com
Subject: Re: [PATCH v8 07/17] qemu-iotests, qtest: rewrite test 067 as a qtest
Date: Fri, 9 Oct 2020 11:48:46 +0200	[thread overview]
Message-ID: <20201009094846.GB5109@linux.fritz.box> (raw)
In-Reply-To: <20201007115700.707938-8-pbonzini@redhat.com>

Am 07.10.2020 um 13:56 hat Paolo Bonzini geschrieben:
> Test 067 from qemu-iotests is executing QMP commands to hotplug
> and hot-unplug disks, devices and blockdevs.  Because the power
> of the text-based test harness is limited, it is actually limiting
> the checks that it does, for example by skipping DEVICE_DELETED
> events.
> 
> tests/qtest already has a similar test, drive_del-test.c.
> We can merge them, and even reuse some of the existing code in
> drive_del-test.c, and improve the quality of the test by
> covering DEVICE_DELETED events.  The only difference is that
> the new test will always use null-co:// for the medium
> rather than qcow2 or raw, but this should be irrelevant
> for what the test is covering.  For example there are
> no "qemu-img check" runs in 067 that would check that
> the file is properly closed.
> 
> The new tests requires PCI hot-plug support, so drive_del-test
> is moved from qemu-system-ppc to qemu-system-ppc64.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

As discussed on IRC, I'm not a big fan of moving QMP tests that don't
make use of the qtest protocol at all to C unit tests (nothing in
drive_del_test makes use of the qtest protocol, neither before nor after
this patch). It's generally harder to write this kind of tests in C than
in Python, and assertion based tests are harder to debug than reference
output based ones.

There is one argument why this should be a qtest, which is that qtests
are run for multitple guest architectures while iotests run only for the
first architecture we found. I'm not sure if it's a good argument, but I
can't completely dismiss it.

The commit message should mention this argument, though.

In the future, I think iotests should be extended to provide the
necessary infrastructure to run tests on several architectures, and then
this should be converted to a Python iotest.

> diff --git a/tests/qemu-iotests/group b/tests/qemu-iotests/group
> index 9e4f7c0153..0d31fda111 100644
> --- a/tests/qemu-iotests/group
> +++ b/tests/qemu-iotests/group
> @@ -88,7 +88,6 @@
>  064 rw quick
>  065 rw quick
>  066 rw auto quick
> -067 rw quick
>  068 rw quick
>  069 rw auto quick
>  070 rw quick

Please keep a comment that 067 shouldn't be reused, like we do for some
other cases. (It only causes merge conflicts for downstreams.)

> +static void test_empty_device_del(void)
> +{
> +    QTestState *qts;
> +
> +    /* device_del with no drive plugged.  */
> +    qts = qtest_initf("-device virtio-scsi-%s -device scsi-cd,id=dev0",
> +                      qvirtio_get_dev_type());
> +
> +    device_del(qts, false);
> +    qtest_quit(qts);
> +}

067 tested reset and query-block after this. Is the removal intentional?

Other than these, the conversion looks correct. I'm not convinced that
doing it is a step in the right direction, but with these two things
fixed, you can add:

Reviewed-by: Kevin Wolf <kwolf@redhat.com>



  reply	other threads:[~2020-10-09  9:49 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 11:56 [PATCH v8 00/17] Fix scsi devices plug/unplug races w.r.t virtio-scsi iothread Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 01/17] qtest: rename qtest_qmp_receive to qtest_qmp_receive_dict Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 02/17] qtest: Reintroduce qtest_qmp_receive Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 03/17] qtest: remove qtest_qmp_receive_success Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 04/17] device-plug-test: use qtest_qmp to send the device_del command Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 05/17] qtest: switch users back to qtest_qmp_receive Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 06/17] qtest: check that drives are really appearing and disappearing Paolo Bonzini
2020-10-09  9:09   ` Kevin Wolf
2020-10-07 11:56 ` [PATCH v8 07/17] qemu-iotests, qtest: rewrite test 067 as a qtest Paolo Bonzini
2020-10-09  9:48   ` Kevin Wolf [this message]
2020-10-09 12:15     ` Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 08/17] qdev: add "check if address free" callback for buses Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 09/17] scsi/scsi_bus: switch search direction in scsi_device_find Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 10/17] device_core: use drain_call_rcu in in qmp_device_add Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 11/17] device-core: use RCU for list of children of a bus Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 12/17] scsi: switch to bus->check_address Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 13/17] device-core: use atomic_set on .realized property Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 14/17] scsi/scsi-bus: scsi_device_find: don't return unrealized devices Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 15/17] scsi/scsi_bus: Add scsi_device_get Paolo Bonzini
2020-10-07 11:56 ` [PATCH v8 16/17] virtio-scsi: use scsi_device_get Paolo Bonzini
2020-10-07 11:57 ` [PATCH v8 17/17] scsi/scsi_bus: fix races in REPORT LUNS Paolo Bonzini
2020-10-07 12:18 ` [PATCH v8 00/17] Fix scsi devices plug/unplug races w.r.t virtio-scsi iothread no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201009094846.GB5109@linux.fritz.box \
    --to=kwolf@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).