OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Utility script to run tests on the Chromoting bot.""" | 5 """Utility script to run tests on the Chromoting bot.""" |
6 | 6 |
7 import hashlib | 7 import hashlib |
8 import os | 8 import os |
9 from os.path import expanduser | 9 from os.path import expanduser |
10 import re | 10 import re |
(...skipping 11 matching lines...) Expand all Loading... |
22 NATIVE_MESSAGING_DIR = 'NativeMessagingHosts' | 22 NATIVE_MESSAGING_DIR = 'NativeMessagingHosts' |
23 # On a Swarming bot where these tests are executed, a temp folder is created | 23 # On a Swarming bot where these tests are executed, a temp folder is created |
24 # under which the files specified in an .isolate are copied. This temp folder | 24 # under which the files specified in an .isolate are copied. This temp folder |
25 # has a random name, which we'll store here for use later. | 25 # has a random name, which we'll store here for use later. |
26 # Note that the test-execution always starts from the testing/chromoting folder | 26 # Note that the test-execution always starts from the testing/chromoting folder |
27 # under the temp folder. | 27 # under the temp folder. |
28 ISOLATE_CHROMOTING_HOST_PATH = 'remoting/host/linux/linux_me2me_host.py' | 28 ISOLATE_CHROMOTING_HOST_PATH = 'remoting/host/linux/linux_me2me_host.py' |
29 ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..')) | 29 ISOLATE_TEMP_FOLDER = os.path.abspath(os.path.join(os.getcwd(), '../..')) |
30 CHROMOTING_HOST_PATH = os.path.join(ISOLATE_TEMP_FOLDER, | 30 CHROMOTING_HOST_PATH = os.path.join(ISOLATE_TEMP_FOLDER, |
31 ISOLATE_CHROMOTING_HOST_PATH) | 31 ISOLATE_CHROMOTING_HOST_PATH) |
| 32 MAX_RETRIES = 1 |
32 | 33 |
33 | 34 |
34 class HostOperationFailedException(Exception): | 35 class HostOperationFailedException(Exception): |
35 pass | 36 pass |
36 | 37 |
37 | 38 |
38 def RunCommandInSubProcess(command): | 39 def RunCommandInSubProcess(command): |
39 """Creates a subprocess with command-line that is passed in. | 40 """Creates a subprocess with command-line that is passed in. |
40 | 41 |
41 Args: | 42 Args: |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 with open(host_log_file, 'r') as log_file: | 252 with open(host_log_file, 'r') as log_file: |
252 for line in log_file: | 253 for line in log_file: |
253 # The host JID will be recorded in a line saying 'Signaling | 254 # The host JID will be recorded in a line saying 'Signaling |
254 # connected'. | 255 # connected'. |
255 if 'Signaling connected. ' in line: | 256 if 'Signaling connected. ' in line: |
256 components = line.split(':') | 257 components = line.split(':') |
257 host_jid = components[-1].lstrip() | 258 host_jid = components[-1].lstrip() |
258 break | 259 break |
259 | 260 |
260 return host_jid | 261 return host_jid |
OLD | NEW |