[Autotest][PY3] Add a sys.executable to the autoserv cmd

This will allow autoserv to be called with the version of python that is
being used on test_that. The basic idea is: we will set test_that into
the proper version of python, then all downstream scripts/args will be
called with a sys.executable in the cmd, so they are kicked off using
the same python runner as the launcher.

BUG=chromium:990593
TEST=dummy_Pass (python2 and 3), server and client

Change-Id: I54d6a13155ba1de42c0d9a96d28c58e66849fabc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2589563
Tested-by: Derek Beckett <dbeckett@chromium.org>
Commit-Queue: Navil Perez <navil@google.com>
Reviewed-by: Gregory Nisbet <gregorynisbet@google.com>
diff --git a/server/autoserv_utils.py b/server/autoserv_utils.py
index 76e8601..9fefc43 100644
--- a/server/autoserv_utils.py
+++ b/server/autoserv_utils.py
@@ -4,8 +4,10 @@
 # found in the LICENSE file.
 
 import os
+import sys
 
 import common
+
 from autotest_lib.client.common_lib import control_data
 from autotest_lib.client.common_lib import global_config
 
@@ -71,7 +73,16 @@
 
     """
     script_name = 'virtualenv_autoserv' if use_virtualenv else 'autoserv'
-    command = [os.path.join(autoserv_directory, script_name)]
+
+    full_script_path = os.path.join(autoserv_directory, script_name)
+
+    # virtualenv_autoserv is a `POSIX shell script, ASCII text executable`.
+    # Calling with `sys.executable` would fail because python doesn't 
+    # interpret shebangs itself.
+    if use_virtualenv:
+        command = [full_script_path]
+    else:
+        command = [sys.executable, full_script_path]
 
     if write_pidfile:
         command.append('-p')