[autotest] Update autoserv to support server-side packaging.

Code change is made so autoserv will honer the --require-ssp arg. When the
argument is specified, autoserv will:
1. Try to locate server-side package based on --image, host attribute
   job_repo_url and host's cros-version label.
2. If no server-side package can be staged, the job will be run without ssp.
3. If package can be staged, autoserv will start a container to run the test.
   a) parent autoserv process's log will be stored in [results]/wrapper folder.
   b) A container will be created from base container, with proper setup.
   c) The same autoserv command line (with update on result path and control
      etc.), will be executed inside the container.
   d) Parent autoserv process will wait for above command to finish and destroy
      the container afterwards. If the test job was aborted, container should
      also be destroyed.

BUG=chromium:453624
TEST=local setup and run test command:
/usr/local/autotest/server/autoserv -p -r /usr/local/autotest/results/16-debug_\
user/$result_dir  -m 172.27.215.232 -u udebug_user -l dummy_PassServer -s -P \
16-debug_user/$result_dir -n /usr/local/autotest/results/drone_tmp/attach.2  \
--verify_job_repo_url --require-ssp
create job from afe:
http://dshi.mtv.corp.google.com/afe/#tab_id=view_job&object_id=19

Change-Id: Ida36374dd500cd1fd0b67a86ab8c0198ade4cc36
Reviewed-on: https://chromium-review.googlesource.com/259834
Reviewed-by: Dan Shi <dshi@chromium.org>
Commit-Queue: Dan Shi <dshi@chromium.org>
Trybot-Ready: Dan Shi <dshi@chromium.org>
Tested-by: Dan Shi <dshi@chromium.org>
diff --git a/server/server_job.py b/server/server_job.py
index 2488587..38b2d0c 100644
--- a/server/server_job.py
+++ b/server/server_job.py
@@ -153,8 +153,7 @@
                  ssh_options=host_factory.DEFAULT_SSH_OPTIONS,
                  test_retry=0, group_name='',
                  tag='', disable_sysinfo=False,
-                 control_filename=SERVER_CONTROL_FILENAME,
-                 require_ssp=False):
+                 control_filename=SERVER_CONTROL_FILENAME):
         """
         Create a server side job object.
 
@@ -182,7 +181,6 @@
                 tests for a modest shortening of test time.  [optional]
         @param control_filename: The filename where the server control file
                 should be written in the results directory.
-        @param require_ssp: Require to use server-side packaging to run the test.
         """
         super(base_server_job, self).__init__(resultdir=resultdir,
                                               test_retry=test_retry)
@@ -218,7 +216,6 @@
         self.drop_caches_between_iterations = False
         self._control_filename = control_filename
         self._disable_sysinfo = disable_sysinfo
-        self._require_ssp = require_ssp
 
         self.logging = logging_manager.get_logging_manager(
                 manage_stdout_and_stderr=True, redirect_fds=True)
@@ -513,12 +510,6 @@
         return wrapper
 
 
-    def _run_with_ssp(self):
-        """Run the server job with server-side packaging.
-        """
-        raise NotImplementedError('Server-side packaging is not supported yet.')
-
-
     def parallel_simple(self, function, machines, log=True, timeout=None,
                         return_results=False):
         """
@@ -623,7 +614,7 @@
                 # package, this job will fail.
                 if verify_job_repo_url:
                     self._execute_code(VERIFY_JOB_REPO_URL_CONTROL_FILE,
-                        namespace)
+                                       namespace)
                 else:
                     logging.warning('Not checking if job_repo_url contains '
                                     'autotest packages on %s', machines)
@@ -648,11 +639,9 @@
                                     server_control_file)
                 else:
                     utils.open_write_close(server_control_file, control)
+
                 logging.info("Processing control file")
-                if self._require_ssp:
-                    self._run_with_ssp()
-                else:
-                    self._execute_code(server_control_file, namespace)
+                self._execute_code(server_control_file, namespace)
                 logging.info("Finished processing control file")
 
                 # If no device error occured, no need to collect crashinfo.