Index: testing/chromoting/browser_tests_launcher.py |
diff --git a/testing/chromoting/browser_tests_launcher.py b/testing/chromoting/browser_tests_launcher.py |
index d39d2910e3e70ae330e210206d3c250147603c27..c5a6c4cc0731d95d8bba2d4244d44f7f31b6c633 100644 |
--- a/testing/chromoting/browser_tests_launcher.py |
+++ b/testing/chromoting/browser_tests_launcher.py |
@@ -21,7 +21,7 @@ HOST_HASH_VALUE = hashlib.md5(socket.gethostname()).hexdigest() |
SUCCESS_INDICATOR = 'SUCCESS: all tests passed.' |
NATIVE_MESSAGING_DIR = 'NativeMessagingHosts' |
CRD_ID = 'chrome-remote-desktop' # Used in a few file/folder names |
-CHROMOTING_HOST_PATH = '/opt/google/chrome-remote-desktop/chrome-remote-desktop' |
+CHROMOTING_HOST_PATH = './remoting/host/linux/linux_me2me_host.py' |
TEST_FAILURE = False |
FAILING_TESTS = '' |
HOST_READY_INDICATOR = 'Host ready to receive connections.' |
@@ -29,6 +29,7 @@ BROWSER_NOT_STARTED_ERROR = ( |
'Still waiting for the following processes to finish') |
TIME_OUT_INDICATOR = '(TIMED OUT)' |
MAX_RETRIES = 1 |
+ISOLATE_TEMP_FOLDER = '' |
joedow
2015/08/07 22:16:19
Can you init this variable up here instead of usin
anandc
2015/08/07 22:26:41
Done.
|
def LaunchBTCommand(args, command): |
@@ -156,10 +157,19 @@ def RestartMe2MeHost(): |
False: if HOST_READY_INDICATOR not found in stdout. |
""" |
+ # To start the host, we want to be in the temp-folder for this test execution. |
+ # Store the current folder to return back to it later. |
+ cwd = os.getcwd() |
joedow
2015/08/07 22:16:19
can you use previous_directory here? It is no lon
anandc
2015/08/07 22:26:41
Done.
|
+ os.chdir(ISOLATE_TEMP_FOLDER) |
+ |
# Stop chromoting host. |
RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --stop') |
# Start chromoting host. |
results = RunCommandInSubProcess(CHROMOTING_HOST_PATH + ' --start') |
+ |
+ # Go back to starting folder. |
joedow
2015/08/07 22:16:19
nit: remove comment, I think it will be obvious if
anandc
2015/08/07 22:26:41
Done.
|
+ os.chdir(cwd) |
+ print 'Now in %s: ' % os.getcwd() |
# Confirm that the start process completed, and we got: |
# "Host ready to receive connections." in the log. |
if HOST_READY_INDICATOR not in results: |
@@ -220,6 +230,14 @@ def TestCaseSetup(args): |
def main(args): |
+ global ISOLATE_TEMP_FOLDER |
+ # On a Swarming bot where these tests are executed, a temp folder is created |
+ # under which the files specified in an .isolate are copied. This temp folder |
+ # has a random name, which we'll store here for use late. |
+ # Note that the test-execution always start from the testing/chromoting folder |
+ # under the temp folder. |
+ ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..')) |
+ |
InitialiseTestMachineForLinux(args.cfg_file) |
with open(args.commands_file) as f: |
@@ -232,15 +250,12 @@ def main(args): |
# All tests completed. Include host-logs in the test results. |
host_log_contents = '' |
- # There should be only 1 log file, as we delete logs on test completion. |
- # Loop through matching files, just in case there are more. |
for log_file in glob.glob('/tmp/chrome_remote_desktop_*'): |
with open(log_file, 'r') as log: |
host_log_contents += '\nHOST LOG %s\n CONTENTS:\n%s' % ( |
log_file, log.read()) |
print host_log_contents |
- # Was there any test failure? |
if TEST_FAILURE: |
print '++++++++++AT LEAST 1 TEST FAILED++++++++++' |
print FAILING_TESTS.rstrip('\n') |