def test_reload_ntp_defaults(self, mock_util): """Test service is restarted/reloaded (defaults)""" service = 'ntp' cmd = ['service', service, 'restart'] cc_ntp.reload_ntp(service) mock_util.subp.assert_called_with(cmd, capture=True)
def test_reload_ntp_systemd_timesycnd(self, mock_util): """Test service is restarted/reloaded (systemd/timesyncd)""" service = 'systemd-timesycnd' cmd = ['systemctl', 'reload-or-restart', service] cc_ntp.reload_ntp(service, systemd=True) mock_util.subp.assert_called_with(cmd, capture=True)
def test_reload_ntp_systemd(self, mock_util): """Test service is restarted/reloaded (systemd)""" service = 'ntp_service_name' cc_ntp.reload_ntp(service, systemd=True) cmd = ['systemctl', 'reload-or-restart', service] mock_util.subp.assert_called_with(cmd, capture=True)