예제 #1
0
 def _run_gerrit(self):
     # create a copy of site dir
     shutil.copytree(self.gsite_dir, self.site_dir)
     self.addCleanup(shutil.rmtree, self.site_dir)
     # write config
     with open(self._dir('site', 'etc', 'gerrit.config'), 'w') as _conf:
         new_conf = utils.get_gerrit_conf(self.gerrit_port,
                                          self.gerrit_port + 10)
         _conf.write(new_conf)
     # start Gerrit
     gerrit_sh = self._dir('site', 'bin', 'gerrit.sh')
     utils.run_cmd(gerrit_sh, 'start')
     self.addCleanup(utils.run_cmd, gerrit_sh, 'stop')
예제 #2
0
 def _run_gerrit(self):
     # create a copy of site dir
     shutil.copytree(self.gsite_dir, self.site_dir)
     self.addCleanup(shutil.rmtree, self.site_dir)
     # write config
     with open(self._dir('site', 'etc', 'gerrit.config'), 'w') as _conf:
         new_conf = utils.get_gerrit_conf(self.gerrit_port,
                                          self.gerrit_port + 1000)
         _conf.write(new_conf)
     # start Gerrit
     gerrit_sh = self._dir('site', 'bin', 'gerrit.sh')
     utils.run_cmd(gerrit_sh, 'start')
     self.addCleanup(utils.run_cmd, gerrit_sh, 'stop')
예제 #3
0
    def _run_gerrit(self, ssh_addr, ssh_port, http_addr, http_port):
        # create a copy of site dir
        shutil.copytree(self.gsite_dir, self.site_dir)
        self.addCleanup(shutil.rmtree, self.site_dir)
        # write config
        with open(self._dir("site", "etc", "gerrit.config"), "w") as _conf:
            new_conf = utils.get_gerrit_conf(ssh_addr, ssh_port, http_addr, http_port)
            _conf.write(new_conf)

        # If test fails, attach Gerrit config and logs to the result
        self.attach_on_exception(self._dir("site", "etc", "gerrit.config"))
        for name in ["error_log", "sshd_log", "httpd_log"]:
            self.attach_on_exception(self._dir("site", "logs", name))

        # start Gerrit
        gerrit_sh = self._dir("site", "bin", "gerrit.sh")
        utils.run_cmd(gerrit_sh, "start")
        self.addCleanup(utils.run_cmd, gerrit_sh, "stop")
예제 #4
0
    def _run_gerrit(self, ssh_addr, ssh_port, http_addr, http_port):
        # create a copy of site dir
        shutil.copytree(self.gsite_dir, self.site_dir)
        self.addCleanup(shutil.rmtree, self.site_dir)
        # write config
        with open(self._dir('site', 'etc', 'gerrit.config'), 'w') as _conf:
            new_conf = utils.get_gerrit_conf(ssh_addr, ssh_port, http_addr,
                                             http_port)
            _conf.write(new_conf)

        # If test fails, attach Gerrit config and logs to the result
        self.attach_on_exception(self._dir('site', 'etc', 'gerrit.config'))
        for name in ['error_log', 'sshd_log', 'httpd_log']:
            self.attach_on_exception(self._dir('site', 'logs', name))

        # start Gerrit
        gerrit_sh = self._dir('site', 'bin', 'gerrit.sh')
        utils.run_cmd(gerrit_sh, 'start')
        self.addCleanup(utils.run_cmd, gerrit_sh, 'stop')
예제 #5
0
    def _run_gerrit(self, ssh_addr, ssh_port, http_addr, http_port):
        # create a copy of site dir
        shutil.copytree(self.gsite_dir, self.site_dir)
        self.addCleanup(shutil.rmtree, self.site_dir)
        # write config
        with open(self._dir('site', 'etc', 'gerrit.config'), 'w') as _conf:
            new_conf = utils.get_gerrit_conf(
                ssh_addr, ssh_port, http_addr, http_port)
            _conf.write(new_conf)

        # If test fails, attach Gerrit config and logs to the result
        self.attach_on_exception(self._dir('site', 'etc', 'gerrit.config'))
        for name in ['error_log', 'sshd_log', 'httpd_log']:
            self.attach_on_exception(self._dir('site', 'logs', name))

        # start Gerrit
        gerrit_sh = self._dir('site', 'bin', 'gerrit.sh')
        utils.run_cmd(gerrit_sh, 'start')
        self.addCleanup(utils.run_cmd, gerrit_sh, 'stop')