Skip to content

Commit c59e762

Browse files
committed
[android] Push test binaries w/o modifying executable name.
At least test_rth.swift is checking the name of the executable during the test, so renaming every executable to __executable in Android will never work. Also, during the rth tool execution, all the results from before and after are pushed for every test. Since Android copies the passed files without relative paths, the library files will overwrite each other, making the test fail. Depends on #19949 (more or less)
1 parent 248d04b commit c59e762

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

utils/android/adb/commands.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
from __future__ import print_function
1919

20+
import os
2021
import subprocess
2122
import tempfile
2223
import uuid
@@ -88,9 +89,12 @@ def execute_on_device(executable_path, executable_arguments):
8889
uuid_dir = '{}/{}'.format(DEVICE_TEMP_DIR, str(uuid.uuid4())[:10])
8990
shell(['mkdir', '-p', uuid_dir])
9091

91-
# `adb` can only handle commands under a certain length. No matter what the
92-
# original executable's name, on device we call it `__executable`.
93-
executable = '{}/__executable'.format(uuid_dir)
92+
# `adb` can only handle commands under a certain length. That's why we
93+
# hide the arguments and piping/status in executable files. However, at
94+
# least one resilience test relies on checking the executable name, so we
95+
# need to use the same name as the one provided.
96+
executable_name = os.path.basename(executable_path)
97+
executable = '{}/{}'.format(uuid_dir, executable_name)
9498
push(executable_path, executable)
9599

96100
# When running the executable on the device, we need to pass it the same

utils/rth

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ class ResilienceTest(object):
165165
config2_lower = config2.lower()
166166
output_obj = os.path.join(self.tmp_dir,
167167
config1_lower + '_' + config2_lower)
168-
tmp_dir_contents = glob.glob(os.path.join(self.tmp_dir, '*', '*'))
168+
tmp_dir_contents = glob.glob(
169+
os.path.join(self.tmp_dir, self.config_dir_map[config1], '*'))
169170
command = self.target_run + [output_obj] + tmp_dir_contents
170171
verbose_print_command(command)
171172
returncode = subprocess.call(command)

0 commit comments

Comments
 (0)