From c717dacd8d95270a80d2870a3b5631203f4f18d4 Mon Sep 17 00:00:00 2001 From: 3hhh Date: Tue, 17 Nov 2020 17:39:41 +0100 Subject: [PATCH] tests/lvm: re-introduce POOL_CONF It's still needed by the lvm integration tests. If possible, it should be avoided inside lvm unit tests though as using it will break compatibility with callback unit tests. --- qubes/tests/storage_lvm.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qubes/tests/storage_lvm.py b/qubes/tests/storage_lvm.py index bffeea23..9f2dea06 100644 --- a/qubes/tests/storage_lvm.py +++ b/qubes/tests/storage_lvm.py @@ -58,6 +58,13 @@ def skipUnlessLvmPoolExists(test_item): # pylint: disable=invalid-name msg = 'LVM thin pool {!r} does not exist'.format(DEFAULT_LVM_POOL) return unittest.skipUnless(result, msg)(test_item) + +POOL_CONF = {'name': 'test-lvm', + 'driver': 'lvm_thin', + 'volume_group': DEFAULT_LVM_POOL.split('/')[0], + 'thin_pool': DEFAULT_LVM_POOL.split('/')[1]} + + class ThinPoolBase(qubes.tests.QubesTestCase): ''' Sanity tests for :py:class:`qubes.storage.lvm.ThinPool` ''' @@ -71,10 +78,7 @@ class ThinPoolBase(qubes.tests.QubesTestCase): ''' Other test classes (e.g. callback) may use this to test their own config. ''' conf = pool_conf if not conf: - conf = {'name': 'test-lvm', - 'driver': 'lvm_thin', - 'volume_group': DEFAULT_LVM_POOL.split('/')[0], - 'thin_pool': DEFAULT_LVM_POOL.split('/')[1]} + conf = POOL_CONF cls.pool_class = pool_class cls.volume_class = volume_class