qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: John Snow <jsnow@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
	qemu-block@nongnu.org, qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
	ehabkost@redhat.com, Max Reitz <mreitz@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3 4/4] iotests: use python logging for iotests.log()
Date: Thu, 29 Aug 2019 14:51:33 -0400	[thread overview]
Message-ID: <db682644-fcaf-a2df-5e86-83aea9cbe19f@redhat.com> (raw)
In-Reply-To: <0f7af7b1-cc53-a06b-5e53-bf091ec40683@redhat.com>



On 8/29/19 2:34 PM, Philippe Mathieu-Daudé wrote:
> On 8/21/19 1:52 AM, John Snow wrote:
>> We can turn logging on/off globally instead of per-function.
>>
>> Remove use_log from run_job, and use python logging to turn on
>> diffable output when we run through a script entry point.
>>
>> iotest 245 changes output order due to buffering reasons.
>> ---
>>  tests/qemu-iotests/030        |  4 +--
>>  tests/qemu-iotests/245        |  1 +
>>  tests/qemu-iotests/245.out    | 24 +++++++++---------
>>  tests/qemu-iotests/iotests.py | 47 +++++++++++++++++++++--------------
>>  4 files changed, 43 insertions(+), 33 deletions(-)
>>
>> diff --git a/tests/qemu-iotests/030 b/tests/qemu-iotests/030
>> index 1b69f318c6..a382cb430b 100755
>> --- a/tests/qemu-iotests/030
>> +++ b/tests/qemu-iotests/030
>> @@ -411,8 +411,8 @@ class TestParallelOps(iotests.QMPTestCase):
>>          result = self.vm.qmp('block-job-set-speed', device='drive0', speed=0)
>>          self.assert_qmp(result, 'return', {})
>>  
>> -        self.vm.run_job(job='drive0', auto_dismiss=True, use_log=False)
>> -        self.vm.run_job(job='node4', auto_dismiss=True, use_log=False)
>> +        self.vm.run_job(job='drive0', auto_dismiss=True)
>> +        self.vm.run_job(job='node4', auto_dismiss=True)
>>          self.assert_no_active_block_jobs()
>>  
>>      # Test a block-stream and a block-commit job in parallel
>> diff --git a/tests/qemu-iotests/245 b/tests/qemu-iotests/245
>> index bc1ceb9792..3bc29acb33 100644
>> --- a/tests/qemu-iotests/245
>> +++ b/tests/qemu-iotests/245
>> @@ -1000,4 +1000,5 @@ class TestBlockdevReopen(iotests.QMPTestCase):
>>          self.reopen(opts, {'backing': 'hd2'})
>>  
>>  if __name__ == '__main__':
>> +    iotests.activate_logging()
>>      iotests.main(supported_fmts=["qcow2"])
> 
> Why not use:
> 
>        iotests.script_main(iotests.main, supported_fmts=['qcow2')
> 

Well, that'd call iotests.execute_test twice and it'd perform setup
twice, too.

Usually, we want logging on for "script-style" tests, but we want
logging off for unittest-style ones. This test has opted to use both.

(Or more likely: just wanted to use run_job and just dealt with the
extramodal output.)

OK; we can turn on logging as we see fit.

--js



  reply	other threads:[~2019-08-29 18:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-20 23:52 [Qemu-devel] [PATCH v3 0/4] iotests: use python logging John Snow
2019-08-20 23:52 ` [Qemu-devel] [PATCH v3 1/4] iotests: add script_initialize John Snow
2019-08-29 18:27   ` Philippe Mathieu-Daudé
2019-08-29 18:43     ` John Snow
2019-08-29 18:58       ` Philippe Mathieu-Daudé
2019-08-29 19:36         ` John Snow
2019-08-20 23:52 ` [Qemu-devel] [PATCH v3 2/4] iotest 258: use script_main John Snow
2019-08-29 18:28   ` Philippe Mathieu-Daudé
2019-08-20 23:52 ` [Qemu-devel] [PATCH v3 3/4] iotests: add protocol support to initialization info John Snow
2019-08-29 18:30   ` Philippe Mathieu-Daudé
2019-08-20 23:52 ` [Qemu-devel] [PATCH v3 4/4] iotests: use python logging for iotests.log() John Snow
2019-08-29 18:34   ` Philippe Mathieu-Daudé
2019-08-29 18:51     ` John Snow [this message]
2019-08-21  0:10 ` [Qemu-devel] [PATCH v3 0/4] iotests: use python logging no-reply
2019-08-21 17:55   ` John Snow
2019-08-29  1:30 ` John Snow

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=db682644-fcaf-a2df-5e86-83aea9cbe19f@redhat.com \
    --to=jsnow@redhat.com \
    --cc=berto@igalia.com \
    --cc=ehabkost@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mreitz@redhat.com \
    --cc=philmd@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).