From cf7a1b1230e947d5a07e7b52c5c2b0b1d4240a55 Mon Sep 17 00:00:00 2001 From: Chase Qi Date: Wed, 22 Mar 2017 19:39:39 +0800 Subject: 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 --- automated/lib/android-test-lib | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'automated') 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() { -- cgit v1.2.3