Allow additional parameters to be specified with test plans. Also wrap
the control file for each test in the test plan, so that the Test
Planner can prefix each intended test with a verify_test, along with
any site-specific prefixes that may be required.

Allowing additional parameters gives the users the option to directly
specify the parameters for the verify_test, along with what
site-specific prefixes, if any, to attach.

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



git-svn-id: http://test.kernel.org/svn/autotest/trunk@4469 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/planner/rpc_interface_unittest.py b/frontend/planner/rpc_interface_unittest.py
index dfca205..42f682d 100644
--- a/frontend/planner/rpc_interface_unittest.py
+++ b/frontend/planner/rpc_interface_unittest.py
@@ -7,8 +7,8 @@
 from autotest_lib.frontend.planner import planner_test_utils, model_attributes
 from autotest_lib.frontend.planner import rpc_interface, models, rpc_utils
 from autotest_lib.frontend.planner import failure_actions
-from autotest_lib.frontend.afe import model_logic
-from autotest_lib.frontend.afe import models as afe_models
+from autotest_lib.frontend.afe import model_logic, models as afe_models
+from autotest_lib.frontend.afe import rpc_interface as afe_rpc_interface
 from autotest_lib.frontend.tko import models as tko_models
 
 
@@ -164,5 +164,27 @@
         self.god.check_playback()
 
 
+    def test_generate_test_config(self):
+        control = {'control_file': object(),
+                   'is_server': object()}
+        test = 'test'
+        alias = 'test alias'
+        estimated_runtime = object()
+
+        self.god.stub_function(afe_rpc_interface, 'generate_control_file')
+        afe_rpc_interface.generate_control_file.expect_call(
+                tests=[test]).and_return(control)
+
+        result = rpc_interface.generate_test_config(
+                alias=alias, afe_test_name=test,
+                estimated_runtime=estimated_runtime)
+
+        self.assertEqual(result['alias'], 'test_alias')
+        self.assertEqual(result['control_file'], control['control_file'])
+        self.assertEqual(result['is_server'], control['is_server'])
+        self.assertEqual(result['estimated_runtime'], estimated_runtime)
+        self.god.check_playback()
+
+
 if __name__ == '__main__':
     unittest.main()