def test_min2(self): """this tests executes a job that requires at least 2 processors""" j = Job() j.setName("MP-test-min2") # FIXME: the number of processors should be discovered at runtime using JobParameters.getNumberOfJobProcessors() # here, and later j.setExecutable(self.mpExeFlex, arguments="2") j.setInputSandbox( find_all("mpTest-flexible.py", rootPath, "DIRAC/tests/Utilities")[0]) j.setNumberOfProcessors( minNumberOfProcessors=2) # This requires at least 2 processors j.setLogLevel("DEBUG") try: # This is the standard location in Jenkins j.setInputSandbox( find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") res = j.runLocal(self.d) self.assertTrue(res["OK"])
def test_execute( self ): job = Job() job.setName( "helloWorld-test" ) job.setExecutable( find_all( "helloWorld.py", '.', 'Integration' )[0], 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' ) res = job.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_min2max4(self): """ this tests executes a job that requires 2 to 4 processors """ j = Job() j.setName("MP-test-min2max4") j.setExecutable(self.mpExeFlex, arguments='2') j.setInputSandbox( find_all('mpTest-flexible.py', rootPath, 'DIRAC/tests/Utilities')[0]) j.setNumberOfProcessors( minNumberOfProcessors=2, maxNumberOfProcessors=4) # This requires 2 to 4 processors j.setLogLevel('DEBUG') try: # This is the standard location in Jenkins j.setInputSandbox( find_all('pilot.cfg', os.environ['WORKSPACE'] + '/PilotInstallDIR')[0]) except (IndexError, KeyError): j.setInputSandbox(find_all('pilot.cfg', rootPath)[0]) j.setConfigArgs('pilot.cfg') res = j.runLocal(self.d) self.assertTrue(res['OK'])
def test_execute(self): job = Job() job.setName("helloWorld-test") job.setExecutable(find_all("helloWorld.py", '.', 'Integration')[0], 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') res = job.runLocal(self.d) self.assertTrue(res['OK'])
def test_fixed(self): """this tests executes a job that requires exactly 4 processors""" j = Job() j.setName("MP-test") j.setExecutable(self.mpExe) j.setInputSandbox( find_all("mpTest.py", rootPath, "DIRAC/tests/Utilities")[0]) j.setNumberOfProcessors( 4) # This requires a fixed number of processors j.setLogLevel("DEBUG") try: # This is the standard location in Jenkins j.setInputSandbox( find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") res = j.runLocal(self.d) if multiprocessing.cpu_count() > 1: self.assertTrue(res["OK"]) else: self.assertFalse(res["OK"])
def test_execute( self ): j = Job() j.setName( "helloWorld-test" ) j.setExecutable( self.exeScriptLocation ) res = j.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_execute(self): j = Job() j.setName("helloWorld-test") j.setExecutable(self.exeScriptLocation) res = j.runLocal(self.d) self.assertTrue(res['OK'])
def test_execute( self ): """ just testing unix "ls" """ job = Job() job.setName( "ls-test" ) job.setExecutable( "/bin/ls", '-l' ) res = job.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_execute(self): """ just testing unix "ls" """ job = Job() job.setName("ls-test") job.setExecutable("/bin/ls", '-l') res = job.runLocal(self.d) self.assertTrue(res['OK'])
def test_execute( self ): """ this one tests that I can execute a job that requires multi-processing """ j = Job() j.setName( "MP-test" ) j.setExecutable( self.mpExe ) j.setInputSandbox( find_all( 'mpTest.py', '.', 'Utilities' )[0] ) j.setTag( 'MultiProcessor' ) res = j.runLocal( self.d ) self.assertTrue( res['OK'] )
def test_execute( self ): """ this one tests that I can execute a job that requires multi-processing """ j = Job() j.setName( "MP-test" ) j.setExecutable( self.mpExe ) j.setInputSandbox( find_all( 'mpTest.py', '.', 'Utilities' )[0] ) j.setTag( 'MultiProcessor' ) res = j.runLocal( self.d ) if multiprocessing.cpu_count() > 1: self.assertTrue( res['OK'] ) else: self.assertFalse( res['OK'] )
def test_execute(self): """ this one tests that I can execute a job that requires multi-processing """ j = Job() j.setName("MP-test") j.setExecutable(self.mpExe) j.setInputSandbox(find_all('mpTest.py', rootPath, 'DIRAC/tests/Utilities')[0]) j.setTag('MultiProcessor') j.setLogLevel('DEBUG') res = j.runLocal(self.d) if multiprocessing.cpu_count() > 1: self.assertTrue(res['OK']) else: self.assertFalse(res['OK'])
def test_execute(self): """ this one tests that I can execute a job that requires multi-processing """ j = Job() j.setName("MP-test") j.setExecutable(self.mpExe) j.setInputSandbox( find_all('mpTest.py', rootPath, 'DIRAC/tests/Utilities')[0]) j.setNumberOfProcessors(4) j.setLogLevel('DEBUG') res = j.runLocal(self.d) if multiprocessing.cpu_count() > 1: self.assertTrue(res['OK']) else: self.assertFalse(res['OK'])
def test_execute(self): j = Job() j.setName("helloWorld-test") j.setExecutable(self.exeScriptLocation) j.setLogLevel("DEBUG") try: # This is the standard location in Jenkins j.setInputSandbox( find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") res = j.runLocal(self.d) self.assertTrue(res["OK"])
def test_execute(self): j = Job() j.setName("helloWorld-test") j.setExecutable(self.exeScriptLocation) j.setLogLevel('DEBUG') try: # This is the standard location in Jenkins j.setInputSandbox( find_all('pilot.cfg', os.environ['WORKSPACE'] + '/PilotInstallDIR')[0]) except (IndexError, KeyError): j.setInputSandbox(find_all('pilot.cfg', rootPath)[0]) j.setConfigArgs('pilot.cfg') res = j.runLocal(self.d) self.assertTrue(res['OK'])
def test_execute(self): """just testing unix "ls" """ job = Job() job.setName("ls-test") job.setExecutable("/bin/ls", "-l") 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"])
def test_execute(self): """ just testing unix "ls" """ job = Job() job.setName("ls-test") job.setExecutable("/bin/ls", '-l') 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'])
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"])
def test_min1(self): """this tests executes a job that requires at least 1 processor""" j = Job() j.setName("MP-test-min1") j.setExecutable(self.mpExeFlex, arguments="2") j.setInputSandbox( find_all("mpTest-flexible.py", rootPath, "DIRAC/tests/Utilities")[0]) j.setNumberOfProcessors( minNumberOfProcessors=1) # This requires 1 to infinite processors j.setLogLevel("DEBUG") try: # This is the standard location in Jenkins j.setInputSandbox( find_all("pilot.cfg", os.environ["WORKSPACE"] + "/PilotInstallDIR")[0]) except (IndexError, KeyError): j.setInputSandbox(find_all("pilot.cfg", rootPath)[0]) j.setConfigArgs("pilot.cfg") res = j.runLocal(self.d) self.assertTrue(res["OK"])
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'])