]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Fix test_facts 44530/head
authorSebastian Wagner <sewagner@redhat.com>
Thu, 16 Dec 2021 15:40:08 +0000 (16:40 +0100)
committerSebastian Wagner <sewagner@redhat.com>
Tue, 11 Jan 2022 12:42:17 +0000 (13:42 +0100)
Wasn't executed before

Signed-off-by: Sebastian Wagner <sewagner@redhat.com>
(cherry picked from commit a03a34a01a70ce4d4ac8927a37d27e9853e46f8a)

src/pybind/mgr/cephadm/tests/test_facts.py

index 79e6db00ce83cf628f8ef62cf6d3b143c37f60cd..6c33f5368aba86f298f43ad2579d92d7f33b998c 100644 (file)
@@ -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}]