예제 #1
0
파일: Tests.py 프로젝트: dmwm/ProdCommon
    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))
예제 #2
0
파일: Tests.py 프로젝트: giffels/PRODCOMMON
    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))
예제 #3
0
파일: Tests.py 프로젝트: dmwm/ProdCommon
    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))
예제 #4
0
파일: Tests.py 프로젝트: giffels/PRODCOMMON
    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))
예제 #5
0
파일: Tests.py 프로젝트: dmwm/ProdCommon
        # 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")

예제 #6
0
파일: Tests.py 프로젝트: giffels/PRODCOMMON
        # 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")