Add framework for Test Planner execution engine, and the supporting RPC
interfaces

Signed-off-by: James Ren <jamesren@google.com>


git-svn-id: http://test.kernel.org/svn/autotest/trunk@4260 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/planner/planner_test_utils.py b/frontend/planner/planner_test_utils.py
new file mode 100644
index 0000000..6aa2d3b
--- /dev/null
+++ b/frontend/planner/planner_test_utils.py
@@ -0,0 +1,26 @@
+import common
+from autotest_lib.frontend.afe import frontend_test_utils
+from autotest_lib.frontend.afe import models as afe_models
+from autotest_lib.frontend.planner import models
+from autotest_lib.client.common_lib import utils
+
+class PlannerTestMixin(frontend_test_utils.FrontendTestMixin):
+    _PLAN_NAME = 'plan'
+
+    def _planner_common_setup(self):
+        self._frontend_common_setup()
+
+        plan = models.Plan.objects.create(name=self._PLAN_NAME)
+        models.Host.objects.create(
+                plan=plan, host=afe_models.Host.objects.get(hostname='host1'))
+        models.Host.objects.create(
+                plan=plan, host=afe_models.Host.objects.get(hostname='host2'))
+        plan.host_labels.add(afe_models.Label.objects.get(name='label1'))
+        plan.save()
+
+        self._plan = plan
+
+
+    def _planner_common_teardown(self):
+        self._plan.delete()
+        self._frontend_common_teardown()