diff options
Diffstat (limited to 'tests/unittests/distros/test_manage_service.py')
-rw-r--r-- | tests/unittests/distros/test_manage_service.py | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/tests/unittests/distros/test_manage_service.py b/tests/unittests/distros/test_manage_service.py index 98823770..d7637d38 100644 --- a/tests/unittests/distros/test_manage_service.py +++ b/tests/unittests/distros/test_manage_service.py @@ -13,13 +13,13 @@ class TestManageService(CiTestCase): super(TestManageService, self).setUp() self.dist = MockDistro() - @mock.patch.object(MockDistro, "uses_systemd", return_value=False) + @mock.patch.object(MockDistro, "uses_systemd", return_value=True) @mock.patch("cloudinit.distros.subp.subp") def test_manage_service_systemctl_initcmd(self, m_subp, m_sysd): self.dist.init_cmd = ["systemctl"] self.dist.manage_service("start", "myssh") m_subp.assert_called_with( - ["systemctl", "start", "myssh"], capture=True + ["systemctl", "start", "myssh"], capture=True, rcs=None ) @mock.patch.object(MockDistro, "uses_systemd", return_value=False) @@ -27,7 +27,9 @@ class TestManageService(CiTestCase): def test_manage_service_service_initcmd(self, m_subp, m_sysd): self.dist.init_cmd = ["service"] self.dist.manage_service("start", "myssh") - m_subp.assert_called_with(["service", "myssh", "start"], capture=True) + m_subp.assert_called_with( + ["service", "myssh", "start"], capture=True, rcs=None + ) @mock.patch.object(MockDistro, "uses_systemd", return_value=False) @mock.patch("cloudinit.distros.subp.subp") @@ -36,7 +38,9 @@ class TestManageService(CiTestCase): dist.init_cmd = ["rc-service", "--nocolor"] dist.manage_service("start", "myssh") m_subp.assert_called_with( - ["rc-service", "--nocolor", "myssh", "start"], capture=True + ["rc-service", "--nocolor", "myssh", "start"], + capture=True, + rcs=None, ) @mock.patch("cloudinit.distros.subp.subp") @@ -45,7 +49,7 @@ class TestManageService(CiTestCase): dist.update_cmd = ["rc-update", "--nocolor"] dist.manage_service("enable", "myssh") m_subp.assert_called_with( - ["rc-update", "--nocolor", "add", "myssh"], capture=True + ["rc-update", "--nocolor", "add", "myssh"], capture=True, rcs=None ) @mock.patch("cloudinit.distros.subp.subp") @@ -53,14 +57,18 @@ class TestManageService(CiTestCase): dist = _get_distro("openbsd") dist.init_cmd = ["rcctl"] dist.manage_service("start", "myssh") - m_subp.assert_called_with(["rcctl", "start", "myssh"], capture=True) + m_subp.assert_called_with( + ["rcctl", "start", "myssh"], capture=True, rcs=None + ) @mock.patch("cloudinit.distros.subp.subp") def test_manage_service_fbsd_service_initcmd(self, m_subp): dist = _get_distro("freebsd") dist.init_cmd = ["service"] dist.manage_service("enable", "myssh") - m_subp.assert_called_with(["service", "myssh", "enable"], capture=True) + m_subp.assert_called_with( + ["service", "myssh", "enable"], capture=True, rcs=None + ) @mock.patch.object(MockDistro, "uses_systemd", return_value=True) @mock.patch("cloudinit.distros.subp.subp") @@ -68,7 +76,7 @@ class TestManageService(CiTestCase): self.dist.init_cmd = ["ignore"] self.dist.manage_service("start", "myssh") m_subp.assert_called_with( - ["systemctl", "start", "myssh"], capture=True + ["systemctl", "start", "myssh"], capture=True, rcs=None ) @mock.patch.object(MockDistro, "uses_systemd", return_value=True) @@ -77,5 +85,5 @@ class TestManageService(CiTestCase): self.dist.init_cmd = ["ignore"] self.dist.manage_service("disable", "myssh") m_subp.assert_called_with( - ["systemctl", "disable", "myssh"], capture=True + ["systemctl", "disable", "myssh"], capture=True, rcs=None ) |