From: Sebastian Wagner Date: Thu, 16 Dec 2021 15:40:08 +0000 (+0100) Subject: mgr/cephadm: Fix test_facts X-Git-Tag: v16.2.8~267^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5587742271fe4f57ac726d2fe2a0575ff19889d8;p=ceph.git mgr/cephadm: Fix test_facts Wasn't executed before Signed-off-by: Sebastian Wagner (cherry picked from commit a03a34a01a70ce4d4ac8927a37d27e9853e46f8a) --- diff --git a/src/pybind/mgr/cephadm/tests/test_facts.py b/src/pybind/mgr/cephadm/tests/test_facts.py index 79e6db00ce83c..6c33f5368aba8 100644 --- a/src/pybind/mgr/cephadm/tests/test_facts.py +++ b/src/pybind/mgr/cephadm/tests/test_facts.py @@ -1,12 +1,10 @@ -import pytest - -from ..inventory import HostCache from ..import CephadmOrchestrator +from .fixtures import wait + -@pytest.fixture() -def test_facts(): - facts = {'node-1.ceph.com', {'bios_version': 'F2', 'cpu_cores': 16}} - HostCache.facts = facts - ret_facts = CephadmOrchestrator.get_facts('node-1.ceph.com') - assert ret_facts == [{'bios_version': 'F2', 'cpu_cores': 16}] +def test_facts(cephadm_module: CephadmOrchestrator): + facts = {'node-1.ceph.com': {'bios_version': 'F2', 'cpu_cores': 16}} + cephadm_module.cache.facts = facts + ret_facts = cephadm_module.get_facts('node-1.ceph.com') + assert wait(cephadm_module, ret_facts) == [{'bios_version': 'F2', 'cpu_cores': 16}]