Example #1
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     if check_for_daemon(limit=1):
         raise SkipTest("git-daemon was already running on port %s" % protocol.TCP_GIT_PORT)
     fd, self.pidfile = tempfile.mkstemp(prefix="dulwich-test-git-client", suffix=".pid")
     os.fdopen(fd).close()
     run_git_or_fail(
         [
             "daemon",
             "--verbose",
             "--export-all",
             "--pid-file=%s" % self.pidfile,
             "--base-path=%s" % self.gitroot,
             "--detach",
             "--reuseaddr",
             "--enable=receive-pack",
             "--enable=upload-archive",
             "--listen=localhost",
             self.gitroot,
         ],
         cwd=self.gitroot,
     )
     if not check_for_daemon():
         raise SkipTest("git-daemon failed to start")
Example #2
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     self._httpd = HTTPGitServer(("localhost", 0), self.gitroot)
     self.addCleanup(self._httpd.shutdown)
     threading.Thread(target=self._httpd.serve_forever).start()
     run_git_or_fail(["config", "http.uploadpack", "true"], cwd=self.dest)
     run_git_or_fail(["config", "http.receivepack", "true"], cwd=self.dest)
Example #3
0
 def tearDown(self):
     try:
         os.kill(int(open(self.pidfile).read().strip()), signal.SIGKILL)
         os.unlink(self.pidfile)
     except (OSError, IOError):
         pass
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
Example #4
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     if check_for_daemon(limit=1):
         raise SkipTest('git-daemon was already running on port %s' %
                           protocol.TCP_GIT_PORT)
     fd, self.pidfile = tempfile.mkstemp(prefix='dulwich-test-git-client',
                                         suffix=".pid")
     os.fdopen(fd).close()
     run_git_or_fail(
         ['daemon', '--verbose', '--export-all',
          '--pid-file=%s' % self.pidfile, '--base-path=%s' % self.gitroot,
          '--detach', '--reuseaddr', '--enable=receive-pack',
          '--listen=localhost', self.gitroot], cwd=self.gitroot)
     if not check_for_daemon():
         raise SkipTest('git-daemon failed to start')
Example #5
0
 def tearDown(self):
     with open(self.pidfile) as f:
         pid = int(f.read().strip())
     if sys.platform == "win32":
         PROCESS_TERMINATE = 1
         handle = ctypes.windll.kernel32.OpenProcess(PROCESS_TERMINATE, False, pid)
         ctypes.windll.kernel32.TerminateProcess(handle, -1)
         ctypes.windll.kernel32.CloseHandle(handle)
     else:
         try:
             os.kill(pid, signal.SIGKILL)
             os.unlink(self.pidfile)
         except (OSError, IOError):
             pass
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
Example #6
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     if check_for_daemon(limit=1):
         raise SkipTest('git-daemon was already running on port %s' %
                        protocol.TCP_GIT_PORT)
     fd, self.pidfile = tempfile.mkstemp(prefix='dulwich-test-git-client',
                                         suffix=".pid")
     os.fdopen(fd).close()
     args = [_DEFAULT_GIT, 'daemon', '--verbose', '--export-all',
             '--pid-file=%s' % self.pidfile,
             '--base-path=%s' % self.gitroot,
             '--enable=receive-pack', '--enable=upload-archive',
             '--listen=localhost', '--reuseaddr',
             self.gitroot]
     self.process = subprocess.Popen(
         args, cwd=self.gitroot,
         stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     if not check_for_daemon():
         raise SkipTest('git-daemon failed to start')
Example #7
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     if check_for_daemon(limit=1):
         raise SkipTest("git-daemon was already running on port %s" % protocol.TCP_GIT_PORT)
     env = get_safe_env()
     fd, self.pidfile = tempfile.mkstemp(prefix="dulwich-test-git-client", suffix=".pid")
     os.fdopen(fd).close()
     args = [
         _DEFAULT_GIT,
         "daemon",
         "--verbose",
         "--export-all",
         "--pid-file=%s" % self.pidfile,
         "--base-path=%s" % self.gitroot,
         "--enable=receive-pack",
         "--enable=upload-archive",
         "--listen=localhost",
         "--reuseaddr",
         self.gitroot,
     ]
     self.process = subprocess.Popen(args, env=env, cwd=self.gitroot, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
     if not check_for_daemon():
         raise SkipTest("git-daemon failed to start")
Example #8
0
 def tearDown(self):
     CompatTestCase.tearDown(self)
     tear_down_repo(self._repo)
Example #9
0
 def setUp(self):
     CompatTestCase.setUp(self)
     self._repo = import_repo('server_new.export')
Example #10
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
     self._httpd.shutdown()
     self._httpd.socket.close()
Example #11
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
Example #12
0
 def tearDown(self):
     ServerTests.tearDown(self)
     CompatTestCase.tearDown(self)
Example #13
0
 def setUp(self):
     ServerTests.setUp(self)
     CompatTestCase.setUp(self)
Example #14
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
Example #15
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
     client.get_ssh_vendor = self.real_vendor
Example #16
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     self.real_vendor = client.get_ssh_vendor
     client.get_ssh_vendor = TestSSHVendor
Example #17
0
 def setUp(self):
     WebTests.setUp(self)
     CompatTestCase.setUp(self)
Example #18
0
 def tearDown(self):
     WebTests.tearDown(self)
     CompatTestCase.tearDown(self)
Example #19
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
     client.get_ssh_vendor = self.real_vendor
Example #20
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     self.real_vendor = client.get_ssh_vendor
     client.get_ssh_vendor = TestSSHVendor
Example #21
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     self._httpd = HTTPGitServer(("localhost", 0), self.gitroot)
     self.addCleanup(self._httpd.shutdown)
     threading.Thread(target=self._httpd.serve_forever).start()
Example #22
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
Example #23
0
 def setUp(self):
     CompatTestCase.setUp(self)
     DulwichClientTestBase.setUp(self)
     self.makeSafeEnv()
Example #24
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)
     self._httpd.shutdown()
     self._httpd.socket.close()
Example #25
0
 def tearDown(self):
     DulwichClientTestBase.tearDown(self)
     CompatTestCase.tearDown(self)