qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iotests/qsd-jobs: Filter events in the first test
@ 2021-04-01 13:28 Max Reitz
  2021-04-01 14:37 ` Vladimir Sementsov-Ogievskiy
  2021-04-07 13:49 ` Kevin Wolf
  0 siblings, 2 replies; 6+ messages in thread
From: Max Reitz @ 2021-04-01 13:28 UTC (permalink / raw)
  To: qemu-block
  Cc: Kevin Wolf, Vladimir Sementsov-Ogievskiy, qemu-devel,
	Stefan Hajnoczi, Max Reitz

The job may or may not be ready before the 'quit' is issued.  Whether it
is is irrelevant; for the purpose of the test, it only needs to still be
there.  Filter the job status change and READY events from the output so
it becomes reliable.

Reported-by: Peter Maydell <peter.maydell@linaro.org>
Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
---
This is an alternative to "iotests/qsd-jobs: Use common.qemu for the
QSD".  I can't disagree with Vladimir that perhaps this test just should
not care about the job status events, because all that matters is that
the job is still running when 'quit' is issued (which we can see by the
(not filtered) COMPLETED event coming afterwards), but it seems strange
just not to care about what state the job is actually in when we quit
the QSD.
It’s definitely much simpler than the common.qemu variant.
---
 tests/qemu-iotests/tests/qsd-jobs     |  5 ++++-
 tests/qemu-iotests/tests/qsd-jobs.out | 10 ----------
 2 files changed, 4 insertions(+), 11 deletions(-)

diff --git a/tests/qemu-iotests/tests/qsd-jobs b/tests/qemu-iotests/tests/qsd-jobs
index 972b6b3898..510bf0a9dc 100755
--- a/tests/qemu-iotests/tests/qsd-jobs
+++ b/tests/qemu-iotests/tests/qsd-jobs
@@ -52,9 +52,12 @@ echo "=== Job still present at shutdown ==="
 echo
 
 # Just make sure that this doesn't crash
+# (Filter job status and READY events, because their order may differ
+# between runs, particularly around when 'quit' is issued)
 $QSD --chardev stdio,id=stdio --monitor chardev=stdio \
     --blockdev node-name=file0,driver=file,filename="$TEST_IMG" \
-    --blockdev node-name=fmt0,driver=qcow2,file=file0 <<EOF | _filter_qmp
+    --blockdev node-name=fmt0,driver=qcow2,file=file0 <<EOF \
+    | _filter_qmp | grep -v JOB_STATUS_CHANGE | grep -v BLOCK_JOB_READY
 {"execute":"qmp_capabilities"}
 {"execute": "block-commit", "arguments": {"device": "fmt0", "job-id": "job0"}}
 {"execute": "quit"}
diff --git a/tests/qemu-iotests/tests/qsd-jobs.out b/tests/qemu-iotests/tests/qsd-jobs.out
index 05e1165e80..5f41491e05 100644
--- a/tests/qemu-iotests/tests/qsd-jobs.out
+++ b/tests/qemu-iotests/tests/qsd-jobs.out
@@ -6,19 +6,9 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=134217728 backing_file=TEST_DIR/
 
 QMP_VERSION
 {"return": {}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "created", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "running", "id": "job0"}}
 {"return": {}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_READY", "data": {"device": "job0", "len": 0, "offset": 0, "speed": 0, "type": "commit"}}
 {"return": {}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "standby", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "ready", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "waiting", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "pending", "id": "job0"}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_JOB_COMPLETED", "data": {"device": "job0", "len": 0, "offset": 0, "speed": 0, "type": "commit"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "concluded", "id": "job0"}}
-{"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "JOB_STATUS_CHANGE", "data": {"status": "null", "id": "job0"}}
 
 === Streaming can't get permission on base node ===
 
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] iotests/qsd-jobs: Filter events in the first test
  2021-04-01 13:28 [PATCH] iotests/qsd-jobs: Filter events in the first test Max Reitz
@ 2021-04-01 14:37 ` Vladimir Sementsov-Ogievskiy
  2021-04-01 14:37   ` Vladimir Sementsov-Ogievskiy
  2021-04-07 13:49 ` Kevin Wolf
  1 sibling, 1 reply; 6+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-04-01 14:37 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: qemu-devel, Kevin Wolf, Stefan Hajnoczi

01.04.2021 16:28, Max Reitz wrote:
> The job may or may not be ready before the 'quit' is issued.  Whether it
> is is irrelevant; for the purpose of the test, it only needs to still be
> there.  Filter the job status change and READY events from the output so
> it becomes reliable.
> 
> Reported-by: Peter Maydell<peter.maydell@linaro.org>
> Suggested-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
> Signed-off-by: Max Reitz<mreitz@redhat.com>

Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iotests/qsd-jobs: Filter events in the first test
  2021-04-01 14:37 ` Vladimir Sementsov-Ogievskiy
@ 2021-04-01 14:37   ` Vladimir Sementsov-Ogievskiy
  2021-04-01 15:30     ` Max Reitz
  0 siblings, 1 reply; 6+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-04-01 14:37 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: qemu-devel, Kevin Wolf, Stefan Hajnoczi

01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote:
> 01.04.2021 16:28, Max Reitz wrote:
>> The job may or may not be ready before the 'quit' is issued.  Whether it
>> is is irrelevant; for the purpose of the test, it only needs to still be
>> there.  Filter the job status change and READY events from the output so
>> it becomes reliable.
>>
>> Reported-by: Peter Maydell<peter.maydell@linaro.org>
>> Suggested-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
>> Signed-off-by: Max Reitz<mreitz@redhat.com>
> 
> Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
> 

Hmm, in your mail (and in copypasted by r-b) there is no space between name and "<"..

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iotests/qsd-jobs: Filter events in the first test
  2021-04-01 14:37   ` Vladimir Sementsov-Ogievskiy
@ 2021-04-01 15:30     ` Max Reitz
  2021-04-01 16:14       ` Vladimir Sementsov-Ogievskiy
  0 siblings, 1 reply; 6+ messages in thread
From: Max Reitz @ 2021-04-01 15:30 UTC (permalink / raw)
  To: Vladimir Sementsov-Ogievskiy, qemu-block
  Cc: Kevin Wolf, qemu-devel, Stefan Hajnoczi

On 01.04.21 16:37, Vladimir Sementsov-Ogievskiy wrote:
> 01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote:
>> 01.04.2021 16:28, Max Reitz wrote:
>>> The job may or may not be ready before the 'quit' is issued.  Whether it
>>> is is irrelevant; for the purpose of the test, it only needs to still be
>>> there.  Filter the job status change and READY events from the output so
>>> it becomes reliable.
>>>
>>> Reported-by: Peter Maydell<peter.maydell@linaro.org>
>>> Suggested-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
>>> Signed-off-by: Max Reitz<mreitz@redhat.com>
>>
>> Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
>>
> 
> Hmm, in your mail (and in copypasted by r-b) there is no space between 
> name and "<"..

Are you sure?  I can see the spaces in my original mail, and on
https://lists.nongnu.org/archive/html/qemu-devel/2021-04/msg00182.html

But OTOH I don’t see a space between your name and the < in your R-b...

Max



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iotests/qsd-jobs: Filter events in the first test
  2021-04-01 15:30     ` Max Reitz
@ 2021-04-01 16:14       ` Vladimir Sementsov-Ogievskiy
  0 siblings, 0 replies; 6+ messages in thread
From: Vladimir Sementsov-Ogievskiy @ 2021-04-01 16:14 UTC (permalink / raw)
  To: Max Reitz, qemu-block; +Cc: qemu-devel, Kevin Wolf, Stefan Hajnoczi

01.04.2021 18:30, Max Reitz wrote:
> On 01.04.21 16:37, Vladimir Sementsov-Ogievskiy wrote:
>> 01.04.2021 17:37, Vladimir Sementsov-Ogievskiy wrote:
>>> 01.04.2021 16:28, Max Reitz wrote:
>>>> The job may or may not be ready before the 'quit' is issued.  Whether it
>>>> is is irrelevant; for the purpose of the test, it only needs to still be
>>>> there.  Filter the job status change and READY events from the output so
>>>> it becomes reliable.
>>>>
>>>> Reported-by: Peter Maydell<peter.maydell@linaro.org>
>>>> Suggested-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
>>>> Signed-off-by: Max Reitz<mreitz@redhat.com>
>>>
>>> Reviewed-by: Vladimir Sementsov-Ogievskiy<vsementsov@virtuozzo.com>
>>>
>>
>> Hmm, in your mail (and in copypasted by r-b) there is no space between name and "<"..
> 
> Are you sure?  I can see the spaces in my original mail, and on
> https://lists.nongnu.org/archive/html/qemu-devel/2021-04/msg00182.html
> 
> But OTOH I don’t see a space between your name and the < in your R-b...
> 
> Max
> 

Ah yes. It's someone (possibly my thunderbird) eats spaces. I see them in you original mail, but not in quote in my first answer

-- 
Best regards,
Vladimir


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] iotests/qsd-jobs: Filter events in the first test
  2021-04-01 13:28 [PATCH] iotests/qsd-jobs: Filter events in the first test Max Reitz
  2021-04-01 14:37 ` Vladimir Sementsov-Ogievskiy
@ 2021-04-07 13:49 ` Kevin Wolf
  1 sibling, 0 replies; 6+ messages in thread
From: Kevin Wolf @ 2021-04-07 13:49 UTC (permalink / raw)
  To: Max Reitz
  Cc: Vladimir Sementsov-Ogievskiy, Stefan Hajnoczi, qemu-devel, qemu-block

Am 01.04.2021 um 15:28 hat Max Reitz geschrieben:
> The job may or may not be ready before the 'quit' is issued.  Whether it
> is is irrelevant; for the purpose of the test, it only needs to still be
> there.  Filter the job status change and READY events from the output so
> it becomes reliable.
> 
> Reported-by: Peter Maydell <peter.maydell@linaro.org>
> Suggested-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> Signed-off-by: Max Reitz <mreitz@redhat.com>

Thanks, applied to the block branch.

Kevin



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-04-07 13:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-01 13:28 [PATCH] iotests/qsd-jobs: Filter events in the first test Max Reitz
2021-04-01 14:37 ` Vladimir Sementsov-Ogievskiy
2021-04-01 14:37   ` Vladimir Sementsov-Ogievskiy
2021-04-01 15:30     ` Max Reitz
2021-04-01 16:14       ` Vladimir Sementsov-Ogievskiy
2021-04-07 13:49 ` Kevin Wolf

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).