qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap migration te


From: Fam Zheng
Subject: Re: [Qemu-devel] [PATCH v9 12/13] iotests: add dirty bitmap migration test
Date: Thu, 28 Dec 2017 14:28:10 +0800
User-agent: Mutt/1.9.1 (2017-09-22)

On Wed, 12/20 18:49, Vladimir Sementsov-Ogievskiy wrote:
> +def inject_test_case(klass, name, method, *args, **kwargs):
> +    mc = operator.methodcaller(method, *args, **kwargs)
> +    setattr(klass, 'test_' + name, new.instancemethod(mc, None, klass))
> +
> +
> +for cmb in list(itertools.product((True, False), repeat=4)):
> +    name = ('_' if cmb[0] else '_not_') + 'persistent_'
> +    name += ('_' if cmb[1] else '_not_') + 'shared_'
> +    name += ('_' if cmb[2] else '_not_') + 'migbitmap_'
> +    name += '_online' if cmb[3] else '_offline'
> +
> +    inject_test_case(TestDirtyBitmapMigration, name, 'do_test_migration', 
> *cmb)

Personally I'd just spell out the 16 method names and call do_test_migration.
It's much easier to read and modify. Either way,

Reviewed-by: Fam Zheng <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]