backend support for hostless jobs
* support in rpc_interface.create_job() and models for creating a hostless job -- a job with one queue entry with no host, meta_host or atomic_group
* support in scheduler for recognizing and executing such a job. the bulk of the work was in extracting an AbstractQueueTask class from QueueTask, containing all the logic not pertaining to hosts. I then added a simple HostlessQueueTask class also inheriting from it.
Also got rid of HostQueueEntry.get_host() and added an extra log line when AgentTasks finish (used to be for QueueTasks only).
Signed-off-by: Steve Howard <[email protected]>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4018 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/afe/rpc_interface_unittest.py b/frontend/afe/rpc_interface_unittest.py
index 9c284b6..3ef345c 100755
--- a/frontend/afe/rpc_interface_unittest.py
+++ b/frontend/afe/rpc_interface_unittest.py
@@ -168,6 +168,16 @@
hosts=[1, 1])
+ def test_create_hostless_job(self):
+ job_id = self._create_job_helper(hostless=True)
+ job = models.Job.objects.get(pk=job_id)
+ queue_entries = job.hostqueueentry_set.all()
+ self.assertEquals(len(queue_entries), 1)
+ self.assertEquals(queue_entries[0].host, None)
+ self.assertEquals(queue_entries[0].meta_host, None)
+ self.assertEquals(queue_entries[0].atomic_group, None)
+
+
def _setup_special_tasks(self):
host = self.hosts[0]