def testLoading3(self): """ loading of a single job in the N jobs task """ # log information logging.info("Test Loading 3: load of a single job in a %s jobs task" \ % self.N) start = time() # create a session and db access session = SafeSession(dbInstance=self.dbInstance) db = TrackingDB(session) # create template for task task = Task() task['name'] = 'task2' # create template for jobs with particular logFile job = Job() job['name'] = 'job1' # add to task template task.addJob(job) # load partial task (jobs with logFile 'output.log') try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg))
def testLoading3(self): """ loading of a single job in the N jobs task """ # log information logging.info("Test Loading 3: load of a single job in a %s jobs task" \ % self.N) start = time() # create a session and db access session = SafeSession(dbInstance = self.dbInstance) db = TrackingDB(session) # create template for task task = Task() task['name'] = 'task2' # create template for jobs with particular logFile job = Job() job['name'] = 'job1' # add to task template task.addJob(job) # load partial task (jobs with logFile 'output.log') try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg))
def testCreation3(self): """ creating a running instance """ # log information logging.info("Test Updating 1: updating task object") start = time() # create a session and db access session = SafeSession(dbInstance=self.dbInstance) db = TrackingDB(session) # create template for job task = Task({'name': 'task1'}) job = Job({'name': 'job1'}) task.addJob(job) # load information try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg))
def testCreation3(self): """ creating a running instance """ # log information logging.info("Test Updating 1: updating task object") start = time() # create a session and db access session = SafeSession(dbInstance = self.dbInstance) db = TrackingDB(session) # create template for job task = Task({'name' : 'task1'}) job = Job({'name' : 'job1'}) task.addJob(job) # load information try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg))
# close session session.close() ##################################### # verify operation ##################################### # create a session and db access session = SafeSession(dbInstance=self.dbInstance) db = TrackingDB(session) # create template for job task = Task({'name': 'task1'}) job = Job({'name': 'job1'}) task.addJob(job) # load task try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg)) # get runnig job information runJob = task.jobs[0].runningJob if runJob['executionHost'] != 'ce100.cnaf.infn.it': self.fail("Wrong creation of running job") logging.info(" took " + str(time() - start) + " seconds")
# close session session.close() ##################################### # verify operation ##################################### # create a session and db access session = SafeSession(dbInstance = self.dbInstance) db = TrackingDB(session) # create template for job task = Task({'name' : 'task1'}) job = Job({'name' : 'job1'}) task.addJob(job) # load task try: task.load(db) except TaskError, msg: self.fail("Cannot load task: " + str(msg)) # get runnig job information runJob = task.jobs[0].runningJob if runJob['executionHost'] != 'ce100.cnaf.infn.it': self.fail("Wrong creation of running job") logging.info(" took " + str(time() - start) + " seconds")