def preProcess(self):
     EDTestCasePluginExecuteDistlSignalStrengthThinClientv1_1.preProcess(
         self)
     # Load the configuration file
     xsPluginItem = self.getPluginConfiguration()
     if xsPluginItem is not None:
         strServerPort = EDConfiguration.getStringParamValue(xsPluginItem, \
             EDPluginDistlSignalStrengthThinClientv1_1.CONF_DISTL_SIGNAL_STRENGTH_SERVER_PORT)
         if strServerPort is None:
             iServerPort = EDPluginDistlSignalStrengthThinClientv1_1.DEFAULT_SERVER_PORT
         else:
             iServerPort = int(strServerPort)
         strPathToServer = EDConfiguration.getStringParamValue(xsPluginItem, \
             EDPluginDistlSignalStrengthThinClientv1_1.CONF_PATH_TO_DISTL_SIGNAL_STRENGTH_SERVER)
         if (strPathToServer == None):
             strErrorMessage = "EDPluginLabelitv1_1.configure : Configuration parameter missing: " + \
                                 "distl.mp_spotfinder_server_read_file"
             self.error(strErrorMessage)
             self.addErrorMessage(strErrorMessage)
             self.setFailure()
         # Start the server using random port
         self.subprocess = EDUtilsPlatform.Popen(shlex.split(
             str(
                 EDUtilsPlatform.escape(strPathToServer +
                                        " distl.port=%d" % iServerPort))),
                                                 cwd=os.getcwd())
         self.iPID = self.subprocess.pid
         # Give the server some time to start up
         time.sleep(8)
예제 #2
0
 def process(self, _edObject=None):
     EDPluginExec.process(self)
     self.DEBUG("EDPluginExecPlotGlev1_1.process")
     for dictPlot in self.listPlot:
         if os.path.dirname(dictPlot["script"]) != self.getWorkingDirectory():
             shutil.copy(dictPlot["script"], self.getWorkingDirectory())
         listDataFiles = dictPlot["data"]
         for strDataFileFullPath in listDataFiles:
             strDataFile = os.path.basename(strDataFileFullPath)
             if not os.path.exists(os.path.join(self.getWorkingDirectory(), strDataFile)):
                 shutil.copy(strDataFileFullPath, self.getWorkingDirectory())
         if EDUtilsPath.isESRF():
             # Force PXSOFT version of gle
             strCommand = "/opt/pxsoft/bin/gle -verbosity 0 -r 150 -d jpg %s" % os.path.basename(dictPlot["script"])
         else:
             strCommand = "gle -verbosity 0 -r 150 -d jpg %s" % os.path.basename(dictPlot["script"])
         # Copied from EDPluginExecProcess
         self.DEBUG(self.getBaseName() + ": Processing")
         timer = threading.Timer(float(self.getTimeOut()), self.kill)
         timer.start()
         try:
             self.__subprocess = EDUtilsPlatform.Popen(shlex.split(str(EDUtilsPlatform.escape(strCommand))),
                                                cwd=self.getWorkingDirectory())
             self.__iPID = self.__subprocess.pid
             self.__strExecutionStatus = str(self.__subprocess.wait())
         except OSError as e:
             strErrorMessage = self.getPluginName() + " : required program gle not installed"
             self.error(strErrorMessage)
             self.setFailure()
         finally:
             timer.cancel()
예제 #3
0
 def process(self, _edObject = None):
     EDPluginExec.process(self)
     self.DEBUG("EDPluginExecPlotGlev1_0.process")
     for strPath in self.listPlot:
         strCommand = "gle -verbosity 0 -r 150 -d jpg %s.gle" % strPath
         # Copied from EDPluginExecProcess
         self.DEBUG(self.getBaseName() + ": Processing")
         timer = threading.Timer(float(self.getTimeOut()), self.kill)
         timer.start()
         self.__subprocess = EDUtilsPlatform.Popen(shlex.split(str(EDUtilsPlatform.escape(strCommand))),
                                                cwd=self.getWorkingDirectory())
         self.__iPID = self.__subprocess.pid
         self.__strExecutionStatus = str(self.__subprocess.wait())
         timer.cancel()            
예제 #4
0
 def process_locally(self, _edObject=None):
     """
     Sets the process up with the executable, command line and time out
     Launches the process, in case of error, an error message is added to the list, and the plugins fails
     """
     strCommand = self.getExecutable() + " " + self.getCommandline()
     EDVerbose.DEBUG("EDPluginExecProcess.process executing: " +
                     self.getExecutable())
     self.synchronizeOn()
     EDVerbose.screen(self.getBaseName() + ": Processing")
     timer = threading.Timer(float(self.getTimeOut()), self.kill)
     timer.start()
     self.__subprocess = EDUtilsPlatform.Popen(
         shlex.split(str(EDUtilsPlatform.escape(strCommand))),
         cwd=self.getWorkingDirectory())
     self.__iPID = self.__subprocess.pid
     self.__strExecutionStatus = str(self.__subprocess.wait())
     timer.cancel()
     EDVerbose.DEBUG("EDPluginExecProcess.process finished ")
     self.synchronizeOff()