]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume: adds unit tests for systemd.systemctl.get_running_osd_ids
authorAndrew Schoen <aschoen@redhat.com>
Thu, 7 Mar 2019 16:01:40 +0000 (10:01 -0600)
committerJan Fajerski <jfajerski@suse.com>
Tue, 13 Aug 2019 07:22:55 +0000 (09:22 +0200)
Signed-off-by: Andrew Schoen <aschoen@redhat.com>
(cherry picked from commit 7cb098b6899542c875d911d28771a4c450d0bb3a)

src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py [new file with mode: 0644]

diff --git a/src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py b/src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py
new file mode 100644 (file)
index 0000000..76c8618
--- /dev/null
@@ -0,0 +1,9 @@
+from ceph_volume.systemd import systemctl
+
+class TestSystemctl(object):
+
+    def test_get_running_osd_ids(self, stub_call):
+        stdout = ['Id=ceph-osd@1.service', '', 'Id=ceph-osd@2.service']
+        stub_call((stdout, [], 0))
+        osd_ids = systemctl.get_running_osd_ids()
+        assert osd_ids == ['1', '2']