Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c10db178 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Do not start edit monitor under cog workspace" into main

parents 49db50cf 05e28fa8
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -70,6 +70,10 @@ class DaemonManager:
      logging.warning("Block sign found, exiting...")
      return

    if self.binary_path.startswith('/google/cog/'):
      logging.warning("Edit monitor for cog is not supported, exiting...")
      return

    self._stop_any_existing_instance()
    self._write_pid_to_pidfile()
    self._start_daemon_process()
+7 −0
Original line number Diff line number Diff line
@@ -131,6 +131,13 @@ class DaemonManagerTest(unittest.TestCase):
    # Verify no daemon process is started.
    self.assertIsNone(dm.daemon_process)

  def test_start_return_directly_if_in_cog_env(self):
    dm = daemon_manager.DaemonManager(
        '/google/cog/cloud/user/workspace/edit_monitor')
    dm.start()
    # Verify no daemon process is started.
    self.assertIsNone(dm.daemon_process)

  @mock.patch('os.kill')
  def test_start_failed_to_kill_existing_instance(self, mock_kill):
    mock_kill.side_effect = OSError('Unknown OSError')