[android] Push test binaries w/o modifying executable name. (#19960)

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)
This commit is contained in:
Daniel Rodríguez Troitiño
2018-11-02 11:03:08 -07:00
committed by Jordan Rose
parent 42772922e0
commit d3e5af6f18
2 changed files with 8 additions and 4 deletions

View File

@@ -90,9 +90,12 @@ def execute_on_device(executable_path, executable_arguments):
uuid_dir = '{}/{}'.format(DEVICE_TEMP_DIR, str(uuid.uuid4())[:10])
shell(['mkdir', '-p', uuid_dir])
# `adb` can only handle commands under a certain length. No matter what the
# original executable's name, on device we call it `__executable`.
executable = '{}/__executable'.format(uuid_dir)
# `adb` can only handle commands under a certain length. That's why we
# hide the arguments and piping/status in executable files. However, at
# least one resilience test relies on checking the executable name, so we
# need to use the same name as the one provided.
executable_name = os.path.basename(executable_path)
executable = '{}/{}'.format(uuid_dir, executable_name)
push(executable_path, executable)
child_environment = ['{}="{}"'.format(k.replace(ENV_PREFIX, '', 1), v)