Ejemplo n.º 1
0
    def test_execute_success(self):

        job = Job()
        job._siteSet = {'DIRAC.someSite.ch'}

        job.setName("helloWorld-test")
        job.setExecutable(self.helloWorld,
                          logFile="aLogFileForTest.txt",
                          parameters=[('executable', 'string', '',
                                       "Executable Script"),
                                      ('arguments', 'string', '',
                                       'Arguments for executable Script'),
                                      ('applicationLog', 'string', '',
                                       "Log file name"),
                                      ('someCustomOne', 'string', '', "boh")],
                          paramValues=[('someCustomOne', 'aCustomValue')])
        job.setBannedSites(['LCG.SiteA.com', 'DIRAC.SiteB.org'])
        job.setOwner('ownerName')
        job.setOwnerGroup('ownerGroup')
        job.setName('jobName')
        job.setJobGroup('jobGroup')
        job.setType('jobType')
        job.setDestination('DIRAC.someSite.ch')
        job.setCPUTime(12345)
        job.setLogLevel('DEBUG')

        res = job.runLocal(self.d)
        self.assertTrue(res['OK'])
Ejemplo n.º 2
0
  def test_execute_success(self):

    job = Job()
    job._siteSet = {'DIRAC.someSite.ch'}

    job.setName("helloWorld-test")
    job.setExecutable(self.helloWorld,
                      logFile="aLogFileForTest.txt",
                      parameters=[('executable', 'string', '', "Executable Script"),
                                  ('arguments', 'string', '', 'Arguments for executable Script'),
                                  ('applicationLog', 'string', '', "Log file name"),
                                  ('someCustomOne', 'string', '', "boh")],
                      paramValues=[('someCustomOne', 'aCustomValue')])
    job.setBannedSites(['LCG.SiteA.com', 'DIRAC.SiteB.org'])
    job.setOwner('ownerName')
    job.setOwnerGroup('ownerGroup')
    job.setName('jobName')
    job.setJobGroup('jobGroup')
    job.setType('jobType')
    job.setDestination('DIRAC.someSite.ch')
    job.setCPUTime(12345)
    job.setLogLevel('DEBUG')

    res = job.runLocal(self.d)
    self.assertTrue(res['OK'])
Ejemplo n.º 3
0
    def test_execute(self):

        job = Job()
        job._siteSet = {"DIRAC.someSite.ch"}

        job.setName("helloWorld-test")
        job.setExecutable(
            self.helloWorld,
            arguments="This is an argument",
            logFile="aLogFileForTest.txt",
            parameters=[
                ("executable", "string", "", "Executable Script"),
                ("arguments", "string", "", "Arguments for executable Script"),
                ("applicationLog", "string", "", "Log file name"),
                ("someCustomOne", "string", "", "boh"),
            ],
            paramValues=[("someCustomOne", "aCustomValue")],
        )
        job.setBannedSites(["LCG.SiteA.com", "DIRAC.SiteB.org"])
        job.setOwner("ownerName")
        job.setOwnerGroup("ownerGroup")
        job.setName("jobName")
        job.setJobGroup("jobGroup")
        job.setType("jobType")
        job.setDestination("DIRAC.someSite.ch")
        job.setCPUTime(12345)
        job.setLogLevel("DEBUG")
        try:
            # This is the standard location in Jenkins
            job.setInputSandbox(
                find_all("pilot.cfg",
                         os.environ["WORKSPACE"] + "/PilotInstallDIR")[0])
        except (IndexError, KeyError):
            job.setInputSandbox(find_all("pilot.cfg", rootPath)[0])
        job.setConfigArgs("pilot.cfg")

        res = job.runLocal(self.d)
        self.assertTrue(res["OK"])
Ejemplo n.º 4
0
    def test_execute(self):

        job = Job()
        job._siteSet = {'DIRAC.someSite.ch'}

        job.setName("helloWorld-test")
        job.setExecutable(self.helloWorld,
                          arguments="This is an argument",
                          logFile="aLogFileForTest.txt",
                          parameters=[('executable', 'string', '',
                                       "Executable Script"),
                                      ('arguments', 'string', '',
                                       'Arguments for executable Script'),
                                      ('applicationLog', 'string', '',
                                       "Log file name"),
                                      ('someCustomOne', 'string', '', "boh")],
                          paramValues=[('someCustomOne', 'aCustomValue')])
        job.setBannedSites(['LCG.SiteA.com', 'DIRAC.SiteB.org'])
        job.setOwner('ownerName')
        job.setOwnerGroup('ownerGroup')
        job.setName('jobName')
        job.setJobGroup('jobGroup')
        job.setType('jobType')
        job.setDestination('DIRAC.someSite.ch')
        job.setCPUTime(12345)
        job.setLogLevel('DEBUG')
        try:
            # This is the standard location in Jenkins
            job.setInputSandbox(
                find_all('pilot.cfg',
                         os.environ['WORKSPACE'] + '/PilotInstallDIR')[0])
        except (IndexError, KeyError):
            job.setInputSandbox(find_all('pilot.cfg', rootPath)[0])
        job.setConfigArgs('pilot.cfg')

        res = job.runLocal(self.d)
        self.assertTrue(res['OK'])