Exemple #1
0
    def test_quobyte_is_systemd_ok(self, value, mock_execute, mock_proc):
        mock_execute.return_value = [value, "fake stderr"]

        self.assertTrue(quobyte.is_systemd())
        mock_execute.assert_called_once_with("systemctl",
                                             "is-system-running",
                                             check_exit_code=[0, 1])
        mock_proc.assert_called_once()
        self.assertTrue(quobyte.is_systemd())
    def test_quobyte_is_systemd_ok(self, value, mock_execute, mock_proc):
        mock_execute.return_value = [value, "fake stderr"]

        self.assertTrue(quobyte.is_systemd())
        mock_execute.assert_called_once_with("systemctl",
                                             "is-system-running",
                                             check_exit_code=[0, 1])
        mock_proc.assert_called_once()
        self.assertTrue(quobyte.is_systemd())
Exemple #3
0
    def test_quobyte_is_systemd_invalid_state(self, mock_exists, mock_execute,
                                              mock_proc):
        mock_execute.return_value = ["FAKE_UNACCEPTABLE_STATE", "fake stderr"]

        self.assertFalse(quobyte.is_systemd())

        mock_exists.assert_called_once_with(quobyte.SYSTEMCTL_CHECK_PATH)
        mock_execute.assert_called_once_with("systemctl",
                                             "is-system-running",
                                             check_exit_code=[0, 1])
        mock_proc.assert_called_once_with()
        self.assertFalse(quobyte.is_systemd())
    def test_quobyte_is_systemd_invalid_state(self, mock_exists, mock_execute,
                                              mock_proc):
        mock_execute.return_value = ["FAKE_UNACCEPTABLE_STATE", "fake stderr"]

        self.assertFalse(quobyte.is_systemd())

        mock_exists.assert_called_once_with(quobyte.SYSTEMCTL_CHECK_PATH)
        mock_execute.assert_called_once_with("systemctl",
                                             "is-system-running",
                                             check_exit_code=[0, 1])
        mock_proc.assert_called_once_with()
        self.assertFalse(quobyte.is_systemd())
Exemple #5
0
 def test_quobyte_is_systemd_not(self, mock_exists, mock_proc):
     self.assertFalse(quobyte.is_systemd())
     mock_exists.assert_called_once_with(quobyte.SYSTEMCTL_CHECK_PATH)
     mock_proc.assert_called_once_with()
     self.assertTrue(quobyte.sysd_checked)
     self.assertFalse(quobyte.found_sysd)
Exemple #6
0
 def test_quobyte_is_systemd_not(self, mock_exists, mock_proc):
     self.assertFalse(quobyte.is_systemd())
     mock_exists.assert_called_once_with(quobyte.SYSTEMCTL_CHECK_PATH)
     mock_proc.assert_called_once_with()
     self.assertFalse(quobyte.is_systemd())