[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration
From: |
Max Reitz |
Subject: |
Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration |
Date: |
Fri, 21 Aug 2020 10:09:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 |
On 20.08.20 17:49, Vladimir Sementsov-Ogievskiy wrote:
> # MYPYPATH=../../python/ mypy 300
> 300:154: error: Item "None" of "Optional[Match[Any]]" has no attribute
> "group"
> Found 1 error in 1 file (checked 1 source file)
:(
> - the only complain. Suggest a fix:
>
> diff --git a/tests/qemu-iotests/300 b/tests/qemu-iotests/300
> index c6d86b1dbc..0241903743 100755
> --- a/tests/qemu-iotests/300
> +++ b/tests/qemu-iotests/300
> @@ -148,11 +148,11 @@ class TestDirtyBitmapMigration(iotests.QMPTestCase):
> result = vm.qmp('human-monitor-command',
> command_line='info migrate_parameters')
>
> - hmp_mapping = re.search(r'^block-bitmap-mapping:\r?(\n
> .*)*\n',
> - result['return'], flags=re.MULTILINE)
> + m = re.search(r'^block-bitmap-mapping:\r?(\n .*)*\n',
> + result['return'], flags=re.MULTILINE)
> + hmp_mapping = m.group(0).replace('\r', '') if m else None
>
> - self.assertEqual(hmp_mapping.group(0).replace('\r', ''),
> - self.to_hmp_mapping(mapping))
> + self.assertEqual(hmp_mapping, self.to_hmp_mapping(mapping))
Looks good, thanks.
> else:
> self.assert_qmp(result, 'error/desc', error)
>
> ===
>
> # flake8 300
[...]
> - I post it just because ALE plugin in vim highlights all these things
> for me. Up to you, I don't ask you to fix it.
Thanks, I’ll run it from now on (unless I forget, like mypy above...).
> 18.08.2020 16:32, Max Reitz wrote:
>> Signed-off-by: Max Reitz <mreitz@redhat.com>
>> ---
>> tests/qemu-iotests/300 | 595 +++++++++++++++++++++++++++++++++++++
>> tests/qemu-iotests/300.out | 5 +
>> tests/qemu-iotests/group | 1 +
>> 3 files changed, 601 insertions(+)
>> create mode 100755 tests/qemu-iotests/300
>> create mode 100644 tests/qemu-iotests/300.out
>>
>
> [..]
>
>> + def test_alias_on_both_migration(self) -> None:
>> + src_map = self.mapping(self.src_node_name, 'node-alias',
>> + self.src_bmap_name, 'bmap-alias')
>> +
>> + dst_map = self.mapping(self.dst_node_name, 'node-alias',
>> + self.dst_bmap_name, 'bmap-alias')
>> +
>> + self.set_mapping(self.vm_a, src_map)
>> + self.set_mapping(self.vm_b, dst_map)
>> + self.migrate()
>> + self.verify_dest_error(None)
>
> Hmm, probably verify_dest_error() should be called from migrate(), as
> you call it (almost) always after migrate()
I don’t know, it shuts down the destination VM, so it would seem a bit
strange to do that as part of migrate().
>> + def test_unused_mapping_on_dst(self) -> None:
>> + # Let the source not send any bitmaps
>> + self.set_mapping(self.vm_a, [])
>> +
>> + # Establish some mapping on the destination
>> + self.set_mapping(self.vm_b, [])
>
> Seems, you wanted to specify non-empty mapping for vm_b, yes?
Oops. I don’t know how it could have happened that I forgot that.
> With any non-empty mapping here, just to better correspond to the comments:
> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>
> (or keep this case with both mappings empty, and add one similar with
> empty mapping only on src)
I’ll see in what shape this patch lands in master, and then I’ll
probably add that other case, yes.
Max
signature.asc
Description: OpenPGP digital signature
- Re: [PATCH v4 2/4] iotests.py: Add wait_for_runstate(), (continued)
Re: [PATCH v4 2/4] iotests.py: Add wait_for_runstate(), Vladimir Sementsov-Ogievskiy, 2020/08/20
[PATCH v4 4/4] iotests: Test node/bitmap aliases during migration, Max Reitz, 2020/08/18
Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration, Vladimir Sementsov-Ogievskiy, 2020/08/20
Re: [PATCH v4 4/4] iotests: Test node/bitmap aliases during migration,
Max Reitz <=