ceph-volume: adds unit tests for systemd.systemctl.get_running_osd_ids

Signed-off-by: Andrew Schoen <aschoen@redhat.com>
This commit is contained in:
Andrew Schoen 2019-03-07 10:01:40 -06:00
parent 28e454ec30
commit 7cb098b689

View File

@ -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']