summaryrefslogtreecommitdiff
path: root/automated
diff options
context:
space:
mode:
authorChase Qi <chase.qi@linaro.org>2017-03-22 19:39:39 +0800
committerChase Qi <chase.qi@linaro.org>2017-03-23 09:51:49 +0800
commitcf7a1b1230e947d5a07e7b52c5c2b0b1d4240a55 (patch)
treee21d7a6b45a1b2066f1972a212d3d3422b0895c2 /automated
parent7c42868d583d7b7464162a189c0cabc4051960cb (diff)
downloadtest-definitions-pipe-cf7a1b1230e947d5a07e7b52c5c2b0b1d4240a55.tar.gz
automated: android: only set permission on the folder/file pushed
'chmod -R 755 ${remote}' will change other files located under the same ${remote} folder, not just the folder/file pushed by test script. The current patch get the exact path to the folder/file and set permission on it only. Change-Id: Iaaba46e64b320101eedb4f4a9d8db7f64a63b744 Signed-off-by: Chase Qi <chase.qi@linaro.org>
Diffstat (limited to 'automated')
-rwxr-xr-xautomated/lib/android-test-lib8
1 files changed, 7 insertions, 1 deletions
diff --git a/automated/lib/android-test-lib b/automated/lib/android-test-lib
index 8a11279..a4fd136 100755
--- a/automated/lib/android-test-lib
+++ b/automated/lib/android-test-lib
@@ -130,7 +130,13 @@ adb_push() {
adb shell mkdir -p "${remote}"
info_msg "Pushing ${local} to devcie ${ANDROID_SERIAL}"
adb push "${local}" "${remote}"
- adb shell chmod -R 755 "${remote}"
+
+ # Set 755 permission on the folder/file pushed to device.
+ if [ -d "${local}" ]; then
+ adb shell chmod -R 755 "${remote}"
+ elif [ -f "${local}" ]; then
+ adb shell chmod -R 755 "$(echo "${remote}" | sed 's|/$||')/$(basename "${local}")"
+ fi
}
adb_pull() {