[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] iotests: add script_initialize
From: |
John Snow |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] iotests: add script_initialize |
Date: |
Mon, 29 Jul 2019 16:19:03 -0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 7/28/19 8:07 PM, Eduardo Habkost wrote:
> On Fri, Jul 26, 2019 at 06:52:00PM -0400, John Snow wrote:
>> Like script_main, but doesn't require a single point of entry.
>> Replace all existing initialization sections with this drop-in replacement.
>>
>> This brings debug support to all existing script-style iotests.
>>
>> Note: supported_oses=['linux'] was omitted, as it is a default argument.
>> Signed-off-by: John Snow <address@hidden>
> [...]
>
> Looks good overall, I just have one comment:
>
>
>> diff --git a/tests/qemu-iotests/iotests.py b/tests/qemu-iotests/iotests.py
>> index 727730422f..5e9b2989dd 100644
>> --- a/tests/qemu-iotests/iotests.py
>> +++ b/tests/qemu-iotests/iotests.py
>> @@ -891,9 +891,8 @@ def execute_unittest(output, verbosity, debug):
>> sys.stderr.write(re.sub(r'Ran (\d+) tests? in [\d.]+s',
>> r'Ran \1 tests', output.getvalue()))
>>
>> -def execute_test(test_function=None,
>> - supported_fmts=[], supported_oses=['linux'],
>> - supported_cache_modes=[], unsupported_fmts=[]):
>> +def execute_setup_common(supported_fmts=[], supported_oses=['linux'],
>> + supported_cache_modes=[], unsupported_fmts=[]):
>> """Run either unittest or script-style tests."""
>>
>> # We are using TEST_DIR and QEMU_DEFAULT_MACHINE as proxies to
>> @@ -925,16 +924,28 @@ def execute_test(test_function=None,
>> output = io.BytesIO()
>>
>> logging.basicConfig(level=(logging.DEBUG if debug else logging.WARN))
>> + return output, verbosity, debug
>
> Can't we make this simpler?
>
> What about just returning `debug`, and letting execute_unittest()
> take care of `verbosity` and `output`?
>
"yes," it turns out. v2 soon.