예제 #1
0
 def submitSlaveJob(self, cmdArgs, slaveEnv, logDir, submissionRules, jobType):
     outputFile, errorsFile = submissionRules.getJobFiles()
     try:
         process = subprocess.Popen(cmdArgs, 
                                    stdout=open(os.path.join(logDir, outputFile), "w"), 
                                    stderr=open(os.path.join(logDir, errorsFile), "w"),
                                    cwd=logDir, env=self.getSlaveEnvironment(slaveEnv), 
                                    startupinfo=plugins.getHideStartUpInfo())
         errorMessage = None
     except OSError, e:
         errorMessage = "Failed to start slave process : " + str(e)
예제 #2
0
 def submitSlaveJob(self, cmdArgs, slaveEnv, logDir, submissionRules, jobType):
     try:
         process = subprocess.Popen(cmdArgs, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                                    cwd=logDir, env=self.getSlaveEnvironment(slaveEnv), 
                                    startupinfo=plugins.getHideStartUpInfo())
         stdout, stderr = process.communicate()
         errorMessage = self.findErrorMessage(stderr, cmdArgs, jobType)
     except OSError:
         errorMessage = self.getFullSubmitError("local machine is not a submit host: running '" + cmdArgs[0] + "' failed.", cmdArgs, jobType)
     if errorMessage:
         return None, errorMessage
     else:
         return self.findJobId(stdout), None
예제 #3
0
 def submitSlaveJob(self, cmdArgs, slaveEnv, logDir, submissionRules, jobType):
     outputFile, errorsFile = submissionRules.getJobFiles()
     stdout = open(os.path.join(logDir, outputFile), "w")
     stderr = open(os.path.join(logDir, errorsFile), "w")
     createflags = subprocess.CREATE_NEW_PROCESS_GROUP if os.name == "nt" else 0
     try:
         process = subprocess.Popen(cmdArgs, stdout=stdout, stderr=stderr,
                                    cwd=logDir, env=self.getSlaveEnvironment(slaveEnv),
                                    startupinfo=plugins.getHideStartUpInfo(),
                                    creationflags=createflags)
         errorMessage = None
     except OSError as e:
         stdout.close()
         stderr.close()
         errorMessage = "Failed to start slave process : " + str(e)
     if errorMessage:
         return None, self.getFullSubmitError(errorMessage, cmdArgs, jobType)
     else:
         jobId = str(process.pid)
         self.processes[jobId] = process
         return jobId, None
예제 #4
0
파일: runtest.py 프로젝트: scutse/texttest
 def getProcessStartUpInfo(self, test):
     # Used for hiding the windows if we're on Windows!
     if os.name == "nt" and test.getConfigValue("virtual_display_hide_windows") == "true" and \
         not test.app.isRecording() and not test.app.isActionReplay():
         return plugins.getHideStartUpInfo()
예제 #5
0
 def runTaskKill(self, proc, extraArgs=[]):
     return subprocess.call([ "taskkill" ] + extraArgs + [ "/PID", str(proc.pid) ], stdout=open(os.devnull, "w"), stderr=subprocess.STDOUT, startupinfo=plugins.getHideStartUpInfo()) == 0