Exemple #1
0
 def test_job_request_abort(self):
     django_job = self._create_job(hosts=[5, 6], atomic_group=1)
     job = scheduler_models.Job(django_job.id)
     job.request_abort()
     django_hqes = list(models.HostQueueEntry.objects.filter(job=job.id))
     for hqe in django_hqes:
         self.assertTrue(hqe.aborted)
Exemple #2
0
    def test_next_group_name(self):
        django_job = self._create_job(metahosts=[1])
        job = scheduler_models.Job(id=django_job.id)
        self.assertEqual('group0', job._next_group_name())

        for hqe in django_job.hostqueueentry_set.filter():
            hqe.execution_subdir = 'my_rack.group0'
            hqe.save()
        self.assertEqual('my_rack.group1', job._next_group_name('my/rack'))