Add support to autoserv for a --control-filename parameter, to allow users to
control where in the results directory autoserv will store the server control
file.
This also changes the archving stage in the scheduler to make use of this
argument, so that the control file from the archving stage is written to
control.archive and does not overwrite the control.srv from the job itself.
Signed-off-by: John Admanski <jadmanski@google.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4294 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/server/server_job.py b/server/server_job.py
index 55a527c..d4c01e7 100644
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -66,7 +66,8 @@
def __init__(self, control, args, resultdir, label, user, machines,
client=False, parse_job='',
ssh_user='root', ssh_port=22, ssh_pass='',
- group_name='', tag=''):
+ group_name='', tag='',
+ control_filename=SERVER_CONTROL_FILENAME):
"""
Create a server side job object.
@@ -84,6 +85,8 @@
@param group_name: If supplied, this will be written out as
host_group_name in the keyvals file for the parser.
@param tag: The job execution tag from the scheduler. [optional]
+ @param control_filename: The filename where the server control file
+ should be written in the results directory.
"""
super(base_server_job, self).__init__(resultdir=resultdir)
@@ -114,6 +117,7 @@
self.hosts = set()
self.drop_caches = False
self.drop_caches_between_iterations = False
+ self._control_filename = control_filename
self.logging = logging_manager.get_logging_manager(
manage_stdout_and_stderr=True, redirect_fds=True)
@@ -433,7 +437,7 @@
suffix='temp_control_file_dir')
control_file_dir = temp_control_file_dir
server_control_file = os.path.join(control_file_dir,
- SERVER_CONTROL_FILENAME)
+ self._control_filename)
client_control_file = os.path.join(control_file_dir,
CLIENT_CONTROL_FILENAME)
if self._client: