コード例 #1
0
    def _exec_run(self, tree, thing, result_dir):
        retcode = 0
        try:
            out, err = CMD.cmd_run(os.path.join(self.path, self.info["run"]),
                                   include_stderr=True)
        except core.cmd.CmdError as e:
            retcode = e.retcode
            out = e.stdout
            err = e.stderr

        return retcode, out, err
コード例 #2
0
    def _exec_run(self, tree, thing, result_dir):
        rfd, wfd = None, None
        retcode = 0
        try:
            rfd, wfd = os.pipe()

            out, err = CMD.cmd_run(os.path.join(self.path, self.info["run"]),
                                   include_stderr=True,
                                   cwd=tree.path,
                                   pass_fds=[wfd],
                                   add_env={"DESC_FD": str(wfd)})
        except core.cmd.CmdError as e:
            retcode = e.retcode
            out = e.stdout
            err = e.stderr

        desc = ""
        if rfd is not None:
            os.close(wfd)
            read_file = os.fdopen(rfd)
            desc = read_file.read()
            read_file.close()

        return retcode, out, err, desc
コード例 #3
0
 def git(self, cmd):
     return CMD.cmd_run("git " + cmd, cwd=self.path)
コード例 #4
0
 def prep(self):
     if "prep" not in self.info or self.is_disabled():
         return
     core.log_open_sec("Preparing for test %s" % (self.name, ))
     CMD.cmd_run(os.path.join(self.path, self.info["prep"]))
     core.log_end_sec()
コード例 #5
0
def git(cmd):
    return CMD.cmd_run("git " + cmd)