diff mbox series

[v4,4/7] tests: iotests: drop some stderr line

Message ID 20180619053426.13065-5-peterx@redhat.com
State New
Headers show
Series monitor: enable OOB by default | expand

Commit Message

Peter Xu June 19, 2018, 5:34 a.m. UTC
In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
manually changed due to line width requirement):

060 5s ... - output mismatch (see 060.out.bad)

Comments

Markus Armbruster June 19, 2018, 1:57 p.m. UTC | #1
Peter Xu <peterx@redhat.com> writes:

> In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
> manually changed due to line width requirement):
>
> 060 5s ... - output mismatch (see 060.out.bad)
> --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
> +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
> @@ -427,8 +427,8 @@
>  QMP_VERSION
>  {"return": {}}
>  qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
>   index: 0); further non-fatal corruption events will be suppressed
> -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> - "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> - table offset 0x2a2a2a0
> 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
>  read failed: Input/output error
> +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> + "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> + table offset 0x2a2a2a0
> 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
>  {"return": ""}
>  {"return": {}}
>  {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
>   "event": "SHUTDOWN", "data": {"guest": false}}

Please indent this diff; I'd expect git-am to choke on it.

>
> The order of the event and the in/out error line is swapped.  I didn't
> dig up the reason, but AFAIU what we want to verify is the event rather
> than stderr.  Let's drop the stderr line directly for this test.
>
> Signed-off-by: Peter Xu <peterx@redhat.com>
Peter Xu June 20, 2018, 3:06 a.m. UTC | #2
On Tue, Jun 19, 2018 at 03:57:07PM +0200, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
> > manually changed due to line width requirement):
> >
> > 060 5s ... - output mismatch (see 060.out.bad)
> > --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
> > +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
> > @@ -427,8 +427,8 @@
> >  QMP_VERSION
> >  {"return": {}}
> >  qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
> >   index: 0); further non-fatal corruption events will be suppressed
> > -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> > - "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> > - table offset 0x2a2a2a0
> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
> >  read failed: Input/output error
> > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> > + "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> > + table offset 0x2a2a2a0
> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
> >  {"return": ""}
> >  {"return": {}}
> >  {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> >   "event": "SHUTDOWN", "data": {"guest": false}}
> 
> Please indent this diff; I'd expect git-am to choke on it.

Do you mean something like pretty-JSON?

How about I remove this chunk too?  What do you prefer?

> 
> >
> > The order of the event and the in/out error line is swapped.  I didn't
> > dig up the reason, but AFAIU what we want to verify is the event rather
> > than stderr.  Let's drop the stderr line directly for this test.
> >
> > Signed-off-by: Peter Xu <peterx@redhat.com>

Regards,
Markus Armbruster June 20, 2018, 7:12 a.m. UTC | #3
Peter Xu <peterx@redhat.com> writes:

> On Tue, Jun 19, 2018 at 03:57:07PM +0200, Markus Armbruster wrote:
>> Peter Xu <peterx@redhat.com> writes:
>> 
>> > In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
>> > manually changed due to line width requirement):
>> >
>> > 060 5s ... - output mismatch (see 060.out.bad)
>> > --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
>> > +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
>> > @@ -427,8 +427,8 @@
>> >  QMP_VERSION
>> >  {"return": {}}
>> >  qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
>> >   index: 0); further non-fatal corruption events will be suppressed
>> > -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
>> > - "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
>> > - table offset 0x2a2a2a0
>> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
>> >  read failed: Input/output error
>> > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
>> > + "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
>> > + table offset 0x2a2a2a0
>> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
>> >  {"return": ""}
>> >  {"return": {}}
>> >  {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
>> >   "event": "SHUTDOWN", "data": {"guest": false}}
>> 
>> Please indent this diff; I'd expect git-am to choke on it.
>
> Do you mean something like pretty-JSON?

Instead of

    In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
    manually changed due to line width requirement):
    
    060 5s ... - output mismatch (see 060.out.bad)
    --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
    +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
    @@ -427,8 +427,8 @@
     QMP_VERSION
     {"return": {}}

write

    In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
    manually changed due to line width requirement):
    
        060 5s ... - output mismatch (see 060.out.bad)
        --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
        +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
        @@ -427,8 +427,8 @@
         QMP_VERSION
         {"return": {}}

The former confuses git-am.

In other words, quote diff output verbatim, but indent your quote.
    
> How about I remove this chunk too?  What do you prefer?

I rather like having the test failure details in the commit message.

[...]
Peter Xu June 20, 2018, 7:21 a.m. UTC | #4
On Wed, Jun 20, 2018 at 09:12:57AM +0200, Markus Armbruster wrote:
> Peter Xu <peterx@redhat.com> writes:
> 
> > On Tue, Jun 19, 2018 at 03:57:07PM +0200, Markus Armbruster wrote:
> >> Peter Xu <peterx@redhat.com> writes:
> >> 
> >> > In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
> >> > manually changed due to line width requirement):
> >> >
> >> > 060 5s ... - output mismatch (see 060.out.bad)
> >> > --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
> >> > +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
> >> > @@ -427,8 +427,8 @@
> >> >  QMP_VERSION
> >> >  {"return": {}}
> >> >  qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
> >> >   index: 0); further non-fatal corruption events will be suppressed
> >> > -{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> >> > - "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> >> > - table offset 0x2a2a2a0
> >> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
> >> >  read failed: Input/output error
> >> > +{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> >> > + "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
> >> > + table offset 0x2a2a2a0
> >> > 0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
> >> >  {"return": ""}
> >> >  {"return": {}}
> >> >  {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
> >> >   "event": "SHUTDOWN", "data": {"guest": false}}
> >> 
> >> Please indent this diff; I'd expect git-am to choke on it.
> >
> > Do you mean something like pretty-JSON?
> 
> Instead of
> 
>     In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
>     manually changed due to line width requirement):
>     
>     060 5s ... - output mismatch (see 060.out.bad)
>     --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
>     +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
>     @@ -427,8 +427,8 @@
>      QMP_VERSION
>      {"return": {}}
> 
> write
> 
>     In my Out-Of-Band test, "check -qcow2 060" fail with this (the output is
>     manually changed due to line width requirement):
>     
>         060 5s ... - output mismatch (see 060.out.bad)
>         --- /home/peterx/git/qemu/tests/qemu-iotests/060.out
>         +++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
>         @@ -427,8 +427,8 @@
>          QMP_VERSION
>          {"return": {}}
> 
> The former confuses git-am.
> 
> In other words, quote diff output verbatim, but indent your quote.
>     
> > How about I remove this chunk too?  What do you prefer?
> 
> I rather like having the test failure details in the commit message.

Ah I see.  I'll keep them then.

Thanks,
diff mbox series

Patch

--- /home/peterx/git/qemu/tests/qemu-iotests/060.out
+++ /home/peterx/git/qemu/bin/tests/qemu-iotests/060.out.bad
@@ -427,8 +427,8 @@ 
 QMP_VERSION
 {"return": {}}
 qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1
  index: 0); further non-fatal corruption events will be suppressed
-{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
- "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
- table offset 0x2a2a2a0
0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
 read failed: Input/output error
+{"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
+ "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2
+ table offset 0x2a2a2a0
0 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
 {"return": ""}
 {"return": {}}
 {"timestamp": {"seconds": TIMESTAMP, "microseconds": TIMESTAMP},
  "event": "SHUTDOWN", "data": {"guest": false}}

The order of the event and the in/out error line is swapped.  I didn't
dig up the reason, but AFAIU what we want to verify is the event rather
than stderr.  Let's drop the stderr line directly for this test.

Signed-off-by: Peter Xu <peterx@redhat.com>

Signed-off-by: Peter Xu <peterx@redhat.com>
---
 tests/qemu-iotests/060     | 10 +++++++++-
 tests/qemu-iotests/060.out |  1 -
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/qemu-iotests/060 b/tests/qemu-iotests/060
index 7bdf609f3f..74ad371885 100755
--- a/tests/qemu-iotests/060
+++ b/tests/qemu-iotests/060
@@ -33,6 +33,14 @@  _cleanup()
 }
 trap "_cleanup; exit \$status" 0 1 2 3 15
 
+# Sometimes the error line might be dumped before/after an event
+# randomly.  Mask it out for specific test that may trigger this
+# uncertainty for current test for now.
+_filter_io_error()
+{
+    sed '/Input\/output error/d'
+}
+
 # get standard environment, filters and checks
 . ./common.rc
 . ./common.filter
@@ -464,7 +472,7 @@  echo "{'execute': 'qmp_capabilities'}
                         }}" \
             -incoming exec:'cat /dev/null' \
             2>&1 \
-    | _filter_qmp | _filter_qemu_io
+    | _filter_qmp | _filter_qemu_io | _filter_io_error
 
 echo
 # Image should not have been marked corrupt
diff --git a/tests/qemu-iotests/060.out b/tests/qemu-iotests/060.out
index bff023d889..d67c6234a4 100644
--- a/tests/qemu-iotests/060.out
+++ b/tests/qemu-iotests/060.out
@@ -428,7 +428,6 @@  QMP_VERSION
 {"return": {}}
 qcow2: Image is corrupt: L2 table offset 0x2a2a2a00 unaligned (L1 index: 0); further non-fatal corruption events will be suppressed
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "BLOCK_IMAGE_CORRUPTED", "data": {"device": "", "msg": "L2 table offset 0x2a2a2a00 unaligned (L1 index: 0)", "node-name": "drive", "fatal": false}}
-read failed: Input/output error
 {"return": ""}
 {"return": {}}
 {"timestamp": {"seconds":  TIMESTAMP, "microseconds":  TIMESTAMP}, "event": "SHUTDOWN", "data": {"guest": false}}