Exemple #1
0
 def test_when_os_found_pids_but_edenDir_not_in_cmdline(self) -> None:
     process_finder = self.make_process_finder()
     process_finder.add_process(1614248, ["edenfs"])
     process_finder.add_process(1639164, ["edenfs"])
     fixer, out = self.run_check(process_finder, dry_run=False)
     self.assertEqual("", out)
     self.assert_results(fixer, num_problems=0)
 def test_when_os_found_pids_but_edenDir_not_in_cmdline(self) -> None:
     process_finder = self.make_process_finder()
     process_finder.add_process(1614248, ["edenfs"])
     process_finder.add_process(1639164, ["edenfs"])
     fixer, out = self.run_check(process_finder, dry_run=False)
     self.assertEqual("", out)
     self.assert_results(fixer, num_problems=0)
Exemple #3
0
    def test_when_other_processes_with_similar_names_running(self) -> None:
        process_finder = self.make_process_finder()
        process_finder.add_edenfs(475203, "/home/user/.eden")
        process_finder.add_process(
            475204,
            ["/foobar/fooedenfs", "--edenDir", "/home/user/.eden", "--edenfs"])
        process_finder.add_process(
            475205,
            ["/foobar/edenfsbar", "--edenDir", "/home/user/.eden", "--edenfs"])
        process_finder.add_process(
            475206,
            ["/foobar/edenfs", "--edenDir", "/home/user/.eden", "--edenfs"])

        fixer, out = self.run_check(process_finder, dry_run=False)
        self.assertEqual(
            f"""\
<yellow>- Found problem:<reset>
Many edenfs processes are running. Please keep only one for each config directory.
kill -9 475206

""",
            out,
        )
        self.assert_results(fixer, num_problems=1, num_manual_fixes=1)
    def test_when_other_processes_with_similar_names_running(self) -> None:
        process_finder = self.make_process_finder()
        process_finder.add_edenfs(475203, "/home/user/.eden")
        process_finder.add_process(
            475204, ["/foobar/fooedenfs", "--edenDir", "/home/user/.eden", "--edenfs"]
        )
        process_finder.add_process(
            475205, ["/foobar/edenfsbar", "--edenDir", "/home/user/.eden", "--edenfs"]
        )
        process_finder.add_process(
            475206, ["/foobar/edenfs", "--edenDir", "/home/user/.eden", "--edenfs"]
        )

        fixer, out = self.run_check(process_finder, dry_run=False)
        self.assertEqual(
            f"""\
<yellow>- Found problem:<reset>
Many edenfs processes are running. Please keep only one for each config directory.
kill -9 475206

""",
            out,
        )
        self.assert_results(fixer, num_problems=1, num_manual_fixes=1)