[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 27/27] tests: qmp-test: add oob test
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [RFC v3 27/27] tests: qmp-test: add oob test |
Date: |
Wed, 15 Nov 2017 10:21:16 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Mon, Nov 06, 2017 at 05:46:43PM +0800, Peter Xu wrote:
> + /*
> + * Try a time-consuming command, following by a OOB command, make
> + * sure we get OOB command before the time-consuming one (which is
> + * run in the parser).
> + *
> + * When writting up this test script, the only command that
> + * support OOB is migrate-incoming. It's not the best command to
> + * test OOB but we don't really have a choice here. We will check
> + * arriving order but not command errors, which does not really
> + * matter to us.
> + */
> + qmp_async("{ 'execute': 'dump-guest-memory',"
> + " 'arguments': { 'paging': true, "
> + " 'protocol': 'file:/dev/null' }, "
> + " 'id': 'time-consuming-cmd'}");
> + qmp_async("{ 'execute': 'migrate-incoming', "
> + " 'control': { 'run-oob': true }, "
> + " 'id': 'oob-cmd' }");
> +
> + /* Ignore all events. Wait for 2 acks */
> + while (acks < 2) {
> + resp = qmp_receive();
> + if (qdict_haskey(resp, "event")) {
> + /* Skip possible events */
> + continue;
> + }
> + cmd_id = qdict_get_str(resp, "id");
> + if (acks == 0) {
> + /* Need to receive OOB response first */
> + g_assert_cmpstr(cmd_id, ==, "oob-cmd");
> + } else if (acks == 1) {
> + g_assert_cmpstr(cmd_id, ==, "time-consuming-cmd");
> + }
> + acks++;
> + }
This test is non-deterministic. The dump-guest-memory command could
complete first on a fast machine.
On a slow machine this test might take a long time...
Please introduce a test command that is deterministic. For example,
when 'x-oob-test' is invoked without 'run-oob': true it waits until
invoked again, this time with 'run-oob': true.
We have similar interfaces in the block layer for controlling the order
in which parallel I/O requests are processed. This allows test cases to
deterministically take specific code paths.
signature.asc
Description: PGP signature
- [Qemu-devel] [RFC v3 21/27] qmp: support out-of-band (oob) execution, (continued)
- [Qemu-devel] [RFC v3 24/27] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2017/11/06
- [Qemu-devel] [RFC v3 25/27] docs: update QMP documents for OOB commands, Peter Xu, 2017/11/06
- [Qemu-devel] [RFC v3 26/27] tests: qmp-test: verify command batching, Peter Xu, 2017/11/06
- [Qemu-devel] [RFC v3 27/27] tests: qmp-test: add oob test, Peter Xu, 2017/11/06
- Re: [Qemu-devel] [RFC v3 27/27] tests: qmp-test: add oob test,
Stefan Hajnoczi <=
- Re: [Qemu-devel] [RFC v3 00/27] QMP: out-of-band (OOB) execution support, no-reply, 2017/11/10