From: Andrew Schoen Date: Thu, 7 Mar 2019 16:01:40 +0000 (-0600) Subject: ceph-volume: adds unit tests for systemd.systemctl.get_running_osd_ids X-Git-Tag: v14.1.1~15^2~5 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7cb098b6899542c875d911d28771a4c450d0bb3a;p=ceph-ci.git ceph-volume: adds unit tests for systemd.systemctl.get_running_osd_ids Signed-off-by: Andrew Schoen --- 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 index 00000000000..76c8618a5bf --- /dev/null +++ b/src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py @@ -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']