aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuhiro Inaba <kinaba@google.com>2022-05-24 23:39:58 +0900
committerKazuhiro Inaba <kinaba@chromium.org>2022-05-26 23:08:52 +0000
commitd0706497d5283b961dca62cf37f8c50ad9812463 (patch)
tree2a14a1a138bbcb8665cf88e94870b8c38d22a983
parent9eb70ed4ee956c5eabcb816b081b412b24bc88e3 (diff)
downloadautotest-d0706497d5283b961dca62cf37f8c50ad9812463.tar.gz
cheets_[CG]TS_*: Replicate the tree under android-cts/testcases
Newer CTS versions rely on the `find` command over the testcases directory without an option to follow symlinks. Hence this new CL copies the directory structure yet still symlinking each files for keeping the faster copying. BUG=b:230692027 TEST=cheets_CTS_T.internal.arm.CtsBackup Change-Id: I151e7dccc980903de2081058d08b45a1d3030cd9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/3663585 Auto-Submit: Kazuhiro Inaba <kinaba@chromium.org> Reviewed-by: Shao-Chuan Lee <shaochuan@chromium.org> Tested-by: Kazuhiro Inaba <kinaba@chromium.org>
-rw-r--r--server/cros/tradefed/tradefed_test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/server/cros/tradefed/tradefed_test.py b/server/cros/tradefed/tradefed_test.py
index c12fc91edf..66d518c001 100644
--- a/server/cros/tradefed/tradefed_test.py
+++ b/server/cros/tradefed/tradefed_test.py
@@ -720,6 +720,17 @@ class TradefedTest(test.test):
if entry == 'tools':
shutil.copytree(os.path.join(special_src, entry),
os.path.join(special_dest, entry))
+ elif entry == 'testcases':
+ # Directory structure in testcases/ needs to be
+ # instantiated, because CTS tries `find` command
+ # in the directory without following symlinks
+ for subdir, _, files in os.walk(
+ os.path.join(special_src, entry)):
+ rel = os.path.relpath(subdir, special_src)
+ os.mkdir(os.path.join(special_dest, rel))
+ for file in files:
+ os.symlink(os.path.join(special_src, rel, file),
+ os.path.join(special_dest, rel, file))
else:
os.symlink(os.path.join(special_src, entry),
os.path.join(special_dest, entry))