From 7cb098b6899542c875d911d28771a4c450d0bb3a Mon Sep 17 00:00:00 2001 From: Andrew Schoen Date: Thu, 7 Mar 2019 10:01:40 -0600 Subject: [PATCH] ceph-volume: adds unit tests for systemd.systemctl.get_running_osd_ids Signed-off-by: Andrew Schoen --- .../ceph_volume/tests/systemd/test_systemctl.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/ceph-volume/ceph_volume/tests/systemd/test_systemctl.py 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']